Open main menu

Difference between revisions of "Compiling ScummVM/Visual Studio/Compiling Libraries"

→‎libmpeg2: Remove all the code changes - they aren't needed
(→‎libmpeg2: Remove a define instead of changing the libmpeg2 code)
(→‎libmpeg2: Remove all the code changes - they aren't needed)
Line 232: Line 232:
* Copy inttypes.h and config.h from the vc++ directory into the libmpeg2 directory
* Copy inttypes.h and config.h from the vc++ directory into the libmpeg2 directory
* Copy attributes.h and mpeg2.h from the include directory into the libmpeg2 directory
* Copy attributes.h and mpeg2.h from the include directory into the libmpeg2 directory
* Make sure that your project includes these files, and remove the included project files:
* Make sure that your project includes these files, and remove the included object (.obj) files:
** alloc.c
** alloc.c
** config.h
** config.h
** cpu_accel.c
** cpu_state.c
** decode.c
** decode.c
** header.c
** header.c
Line 252: Line 254:
</source>
</source>
* Open config.h and comment out these lines:
* Open config.h and comment out these lines:
<source lang="C">
#define ACCEL_DETECT
</source>
<source lang="C">
<source lang="C">
#define ARCH_X86
#define ARCH_X86
Line 262: Line 267:
** Configuration Properties->General, "Configuration type" should be "Static library(.lib)"
** Configuration Properties->General, "Configuration type" should be "Static library(.lib)"
** Configuration Properties->C/C++->Code Generation, "Runtime Library" should be "Multi-threaded (/MT)"
** Configuration Properties->C/C++->Code Generation, "Runtime Library" should be "Multi-threaded (/MT)"
Now, we'll remove all the MMX optimization references from the files that have been added to the project. Perform the following:
* Open slice.c, replace these lines:
<source lang="C">
extern void (* mpeg2_cpu_state_save) (cpu_state_t * state);
extern void (* mpeg2_cpu_state_restore) (cpu_state_t * state);
</source>
with:
<source lang="C">
void (* mpeg2_cpu_state_save) (cpu_state_t * state) = 0;
void (* mpeg2_cpu_state_restore) (cpu_state_t * state) = 0;
uint32_t mpeg2_detect_accel (uint32_t accel) { return 0; }
void mpeg2_cpu_state_init (uint32_t accel) {}
</source>


After you compile the library, go to its include directory, create a folder "mpeg2dec" in there and copy all files from the include folder in this subfolder. You will end up with 2 directories, "include" and "include\mpeg2dec" with the same files. This is needed, as ScummVM includes files from the "mpeg2dec" directory
After you compile the library, go to its include directory, create a folder "mpeg2dec" in there and copy all files from the include folder in this subfolder. You will end up with 2 directories, "include" and "include\mpeg2dec" with the same files. This is needed, as ScummVM includes files from the "mpeg2dec" directory
1,489

edits