Provide entry point customization (#352)
This commit is contained in:
@@ -4,6 +4,8 @@ DIR=.
|
||||
DIST=../../dist
|
||||
OSX_CFLAGS=-I/Library/Frameworks/SDL2.framework/Headers
|
||||
OSX_LINKER_ARGS="-F /Library/Frameworks -framework SDL2"
|
||||
#OSX_CFLAGS=-I/opt/local/include/SDL2
|
||||
#OSX_LINKER_ARGS="-L/opt/local/lib -lSDL2"
|
||||
LINUX_CFLAGS=-I/usr/include/SDL2
|
||||
LINUX_LINKER_ARGS="-L/usr/lib/x86_64-linux-gnu -lSDL2"
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ headers = SDL.h stdio.h string.h unistd.h stdlib.h time.h
|
||||
excludedFunctions = _IO_flockfile _IO_funlockfile _IO_ftrylockfile \
|
||||
_IO_cleanup_region_start _IO_cleanup_region_end \
|
||||
mkstemp_dprotected_np
|
||||
entryPoint = SDL_main
|
||||
|
||||
compilerOpts.osx = -D_POSIX_SOURCE -mxsave -mavx -mf16c
|
||||
compilerOpts.linux = -D_REENTRANT
|
||||
|
||||
@@ -491,10 +491,6 @@ class Game(width: Int, height: Int, val visualizer: GameFieldVisualizer, val use
|
||||
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
SDL_main(args)
|
||||
}
|
||||
|
||||
fun get_SDL_Error() = SDL_GetError()!!.asCString().toString()
|
||||
|
||||
class SDL_Visualizer(val width: Int, val height: Int): GameFieldVisualizer, UserInput {
|
||||
@@ -806,8 +802,7 @@ class SDL_Visualizer(val width: Int, val height: Int): GameFieldVisualizer, User
|
||||
}
|
||||
}
|
||||
|
||||
@ExportForCppRuntime("SDL_main")
|
||||
fun SDL_main(args: Array<String>) {
|
||||
fun main(args: Array<String>) {
|
||||
var startLevel = 0
|
||||
var width = 10
|
||||
var height = 20
|
||||
@@ -828,4 +823,4 @@ fun SDL_main(args: Array<String>) {
|
||||
game.startNewGame(startLevel)
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user