misc/wrapper.c
author unc0rr
Fri, 25 Jun 2010 17:02:30 +0400
changeset 3561 7f8e07e4a4e3
parent 3495 a6b4f351d400
child 3697 d5b30d6373fc
permissions -rw-r--r--
Reimplement REMOVE_TEAM
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3495
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     1
/*
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     2
 This is an experimental main to use with hwLibary
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     3
 - create the library with `cmake . -DBUILD_ENGINE_LIBRARY=1' and `make hwengine'
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     4
 - compile this file with `gcc libhwLibrary.dylib libSDLmain.a wrapper.c -o wrapper -framework Cocoa -framework SDL'
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     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)
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     6
 - this executable expect a save file "Save.hws" and the data folder "Data" to be in the same launching directory
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     7
 */
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     8
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
     9
#import <stdio.h>
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    10
#import <stdlib.h>
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    11
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    12
extern void Game (const char **);
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    13
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    14
int SDL_main (int argc, const char **argv) {
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    15
    
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    16
    const char **gameArgs = (const char**) malloc(sizeof(char *) * 9);
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    17
    
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    18
    gameArgs[0] = "wrapper";    //UserNick
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    19
	gameArgs[1] = "0";          //ipcPort
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    20
	gameArgs[2] = "0";          //isSoundEnabled
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    21
	gameArgs[3] = "0";          //isMusicEnabled
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    22
	gameArgs[4] = "en.txt";     //cLocaleFName
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    23
	gameArgs[5] = "0";          //cAltDamage
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    24
	gameArgs[6] = "768";        //cScreenHeight
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    25
    gameArgs[7] = "1024";       //cScreenHeight
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    26
    gameArgs[8] = "Save.hws";   //recordFileName
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    27
    
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    28
    Game(gameArgs);
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    29
    free(gameArgs);
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    30
    
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    31
    return 0;
a6b4f351d400 now engine can be optionally built as library, there's an example wrapper of how to use it
koda
parents:
diff changeset
    32
}