misc/wrapper.c
changeset 3495 a6b4f351d400
child 3697 d5b30d6373fc
equal deleted inserted replaced
3494:208c5671b202 3495:a6b4f351d400
       
     1 /*
       
     2  This is an experimental main to use with hwLibary
       
     3  - create the library with `cmake . -DBUILD_ENGINE_LIBRARY=1' and `make hwengine'
       
     4  - compile this file with `gcc libhwLibrary.dylib libSDLmain.a wrapper.c -o wrapper -framework Cocoa -framework SDL'
       
     5    (in Mac OS X, but this command line shouldn't be much different in other OSes; make sure to set the correct files/paths)
       
     6  - this executable expect a save file "Save.hws" and the data folder "Data" to be in the same launching directory
       
     7  */
       
     8 
       
     9 #import <stdio.h>
       
    10 #import <stdlib.h>
       
    11 
       
    12 extern void Game (const char **);
       
    13 
       
    14 int SDL_main (int argc, const char **argv) {
       
    15     
       
    16     const char **gameArgs = (const char**) malloc(sizeof(char *) * 9);
       
    17     
       
    18     gameArgs[0] = "wrapper";    //UserNick
       
    19 	gameArgs[1] = "0";          //ipcPort
       
    20 	gameArgs[2] = "0";          //isSoundEnabled
       
    21 	gameArgs[3] = "0";          //isMusicEnabled
       
    22 	gameArgs[4] = "en.txt";     //cLocaleFName
       
    23 	gameArgs[5] = "0";          //cAltDamage
       
    24 	gameArgs[6] = "768";        //cScreenHeight
       
    25     gameArgs[7] = "1024";       //cScreenHeight
       
    26     gameArgs[8] = "Save.hws";   //recordFileName
       
    27     
       
    28     Game(gameArgs);
       
    29     free(gameArgs);
       
    30     
       
    31     return 0;
       
    32 }