Giter VIP home page Giter VIP logo

swars's Introduction

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

swars's People

Stargazers

Zeck avatar  avatar Andy avatar Jim Balcomb avatar  avatar Mitsuhama avatar  avatar  avatar ailmanki avatar  avatar guts avatar  avatar

Watchers

James Cloos avatar Florian Betz avatar  avatar  avatar

swars's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.