Skip to content

A modified version of the Syndicate Wars port created by vexillium

License

Notifications You must be signed in to change notification settings

leonsodhi/swars

Repository files navigation

swars

This is a continuation of the project created by Unavowed and Gynvael Coldwind. It also incorporates one of the fixes discovered by mefistotelis related to structure packing. See http://swars.vexillium.org for details.

Usage

Usage: swars.exe [OPTIONS]

Available options:
  --windowed=WxH Run in windowed mode at specified resolution. Default is 640x480
  --fullwindow   Run in fullscreen borderless window mode
  --monitor=X    Display on monitor X
  --help         Display the help message

Building on Windows 7 (64-bit) from the original source

  • Download mingw-get-setup.exe and install it to C:\MinGW
  • In the MinGW Installation Manager, install the mingw-developer-toolkit package from Basic Setup
  • Run C:\MinGW\msys\1.0\msys.bat
  • mingw-get install 'gcc=4.8.1.*' (It's likely that a newer release would be fine but this was the version I used)
  • mingw-get install 'libz=1.2.8.*'
  • Close the MINGW32 command prompt window
  • Download and extract http://swars.vexillium.org/files/swars-0.3.tar.bz2 to C:\projects\swars-0.3
  • Download python-2.7.13.msi from https://www.python.org/ and install it, ensuring that "Add python.exe to Path" is selected

Installing dependencies

  • Download and extract the following:
  • Build and install libogg as described below
  • Build and install libvorbis as described below
  • Copy the contents of C:\projects\lib\libpng-1.2.37-bin to C:\mingw
  • Copy the contents of C:\projects\libs\libpng-1.2.37-lib to C:\mingw
  • Edit C:\projects\libs\SDL-1.2.14\bin\sdl-config and change prefix=/usr/local to prefix=C:/mingw
  • Copy the directories bin, include, lib, man, and share from C:\projects\libs\SDL-1.2.14 to C:\mingw
  • Copy bin\Win32\soft_oal.dll from C:\projects\libs\openal-soft-1.17.2-bin to C:\mingw\bin
  • Copy the directory C:\projects\libs\openal-soft-1.17.2-bin\include to C:\mingw
  • Copy the contents of C:\projects\libs\openal-soft-1.17.2-bin\libs\Win32 to C:\mingw\lib

Building & installing libogg

  • Run C:\MinGW\msys\1.0\msys.bat
  • cd C:/projects/libs/libogg-1.3.2
  • LDFLAGS='-mwindows' ./configure --prefix=c:/mingw --host=i686-w64-mingw32
  • make && make install

Building & installing libvorbis

  • Run C:\MinGW\msys\1.0\msys.bat
  • cd C:/projects/libs/libvorbis-1.3.5
  • LDFLAGS='-mwindows' ./configure --prefix=c:/mingw --host=i686-w64-mingw32
  • make && make install

Updating the Makefile

  • Edit C:\projects\swars-0.3\src\Makefile.windows
  • Change the LIBS variable at the top to the following:
LIBS	 = -lmsvcrt $(shell sdl-config --libs) -lOpenAL32 -lvorbisfile -lvorbis -logg -lpng -lz
  • Add -mno-ms-bitfields to the beginning of CFLAGS and CPPFLAGS. This is required due to this bug related to structure packing
  • Delete $(RES) from the OBJ list

Fixing up the source

  • Edit C:\projects\swars-0.3\src\windows.config.h and uncomment HAVE_GETTIMEOFDAY
  • Edit C:\projects\swars-0.3\src\util.h and add #include <sys/stat.h> under #include <stdbool.h>
  • Download the game speed patch to C:\projects\swars-0.3
  • Run C:\MinGW\msys\1.0\msys.bat
  • cd c:/projects/swars-0.3
  • patch -p1 < 0001-Lower-max_fps-and-fix-overly-long-sleep-times.patch

Compiling and installing

  • Run C:\MinGW\msys\1.0\msys.bat
  • cd c:/projects/swars-0.3/src
  • make -f Makefile.windows
  • Copy swars.exe from C:\projects\swars-0.3\src to the root of your Syndicate Wars install directory
  • Copy C:\MinGW\bin\soft_oal.dll to the root of your Syndicate Wars install directory and rename it to OpenAL32.dll
  • Copy the following files from C:\MinGW\bin to the root of your Syndicate Wars install directory
libpng3.dll
zlib1.dll
libgcc_s_dw2-1.dll
SDL.dll
libvorbisfile-3.dll
libvorbis-0.dll
libogg-0.dll

Building on Windows 7 (64-bit) using this repo

  • Follow the first section above to setup mingw & Python. Use the source code from this repository instead
  • Install all dependencies with the exception of SDL
  • Install the SDL2 development library:
    • Download and extract SDL2-2.0.5 to C:\projects\libs\SDL2-2.0.5
    • Edit C:\projects\libs\SDL2-2.0.5\i686-w64-mingw32\bin\sdl2-config and change the prefix to prefix=C:/mingw
    • Copy the contents of C:\projects\libs\SDL2-2.0.5\i686-w64-mingw32 to C:\mingw
  • Skip the makefile changes
  • Skip fixing up the source
  • Compile and install but copy SDL2.dll instead of SDL.dll