misc/wrapper.c
author nemo
Mon, 27 Dec 2010 12:47:51 -0500
branch0.9.15
changeset 4721 5e50d8162a96
parent 3697 d5b30d6373fc
child 4926 f9a13dd16f01
permissions -rw-r--r--
Merge trunk into 0.9.15, excluding CMakeLists.txt and ChangeLog.txt - this should fix snowball again, pick up some more translation changes, hide the seed button by default and fix a couple of frontend desyncs

/*
 This is an experimental main to use with hwLibary
 - create the library with `cmake . -DBUILD_ENGINE_LIBRARY=1' and `make hwengine'
 - compile this file with `gcc libhwLibrary.dylib libSDLmain.a wrapper.c -o wrapper -framework Cocoa -framework SDL'
   (in Mac OS X, but this command line shouldn't be much different in other OSes; make sure to set the correct files/paths)
 - this executable expect a save file "Save.hws" and the data folder "Data" to be in the same launching directory
 */

#import <stdio.h>
#import <stdlib.h>

extern void Game (const char **);

int SDL_main (int argc, const char **argv) {

    const char **gameArgs = (const char**) malloc(sizeof(char *) * 9);

    gameArgs[0] = "wrapper";    //UserNick
	gameArgs[1] = "0";          //ipcPort
	gameArgs[2] = "0";          //isSoundEnabled
	gameArgs[3] = "0";          //isMusicEnabled
	gameArgs[4] = "en.txt";     //cLocaleFName
	gameArgs[5] = "0";          //cAltDamage
	gameArgs[6] = "768";        //cScreenHeight
    gameArgs[7] = "1024";       //cScreenHeight
    gameArgs[8] = "Save.hws";   //recordFileName

    Game(gameArgs);
    free(gameArgs);

    return 0;
}