Wargus/stargus

CMake from Wargus

Closed this issue · 5 comments

The attached patch duplicates the CMake build system found in Wargus. The patch also removes the duplicate code between stargus.c and stratagus-game-launcher.h I've only tested it on Linux, but everything seems to build correctly. This doesn't outright remove the old Makefile in case there are any bugs.


Imported from Launchpad using lp2gh.

(by losinggeneration)

(by pali)
Nice patch. But Stargus extractor (startool) has one problem: It works only on 32bit system. I'm trying to port mpq part for 64bit systems too and after that I will release new version of Stargus too (of cource with CMake build system + using stratagus*.h files in stargus.c) So I will include your patch after adding 64bit support.

(by losinggeneration)
Oh yes, I can see the issue with 64bit support just from the following:
#define UInt8 unsigned char
#define UInt16 unsigned short
#define SInt16 short
#define UInt32 unsigned long
#define SInt32 int

Switching that to use stdint.h and using the int typedefs makes it pretty clear there's lots of unsafe casting going on.

(by pali)
Not only this problem. All pointers are defined as UInt32. I have fixed all expect Wave Huffman decoding in mpq.cpp

(by pali)
Your attached commit was merged.