(20140723)
This commit is contained in:
1248
DIST/web/game.html
1248
DIST/web/game.html
File diff suppressed because one or more lines are too long
9018
DIST/web/game.js
9018
DIST/web/game.js
File diff suppressed because one or more lines are too long
@@ -22,6 +22,7 @@
|
||||
#include <emscripten.h>
|
||||
#define USE_OpenGL 0
|
||||
#define USE_OpenGLES 1
|
||||
#define SDL_GetKeyState SDL_GetKeyboardState
|
||||
#else
|
||||
// UNIX
|
||||
#include <GL/gl.h>
|
||||
|
||||
@@ -2,11 +2,15 @@
|
||||
|
||||
#include <math.h>
|
||||
#include <SDL/SDL.h>
|
||||
#ifdef EMSCRIPTEN
|
||||
#define SDL_GetKeyState SDL_GetKeyboardState
|
||||
#endif
|
||||
|
||||
#include "Util.h"
|
||||
#include "Input.h"
|
||||
|
||||
|
||||
|
||||
// Globals
|
||||
InputKeyStatus _keys[InputKey_Max];
|
||||
int _pointerDown=0;
|
||||
|
||||
@@ -3,7 +3,7 @@ LAUNCHER= start
|
||||
RM=rm -rf
|
||||
|
||||
LIBS=
|
||||
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O1
|
||||
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O1 -Wno-implicit-function-declaration
|
||||
#LDFLAGS= --embed-file data
|
||||
LDFLAGS= --preload-file data
|
||||
|
||||
@@ -12,7 +12,7 @@ RESULT=game.html
|
||||
BUILDDIR=build-emscripten
|
||||
|
||||
ifeq ($(target),release)
|
||||
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O2 --llvm-lto 1
|
||||
CFLAGS= -s FULL_ES2=1 -s ASM_JS=1 -O2 --llvm-lto 1 -Wno-implicit-function-declaration
|
||||
BUILDDIR=build-emscripten-release
|
||||
endif
|
||||
|
||||
|
||||
14
main.c
14
main.c
@@ -5,9 +5,11 @@
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#include <time.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <emscripten.h>
|
||||
#define time stime
|
||||
#endif
|
||||
|
||||
|
||||
@@ -28,6 +30,14 @@ DrawImg img_end;
|
||||
|
||||
DrawFnt font;
|
||||
|
||||
void GameLib_MkDir(char *dir){
|
||||
#ifdef WIN32
|
||||
mkdir(dir);
|
||||
#else
|
||||
mkdir(dir,0777);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
void ProcGame();
|
||||
void PostProcGame();
|
||||
@@ -162,7 +172,7 @@ void DrawGame(float f){
|
||||
void LoadGame(){
|
||||
FILE *f;
|
||||
|
||||
mkdir("saves");
|
||||
GameLib_MkDir("saves");
|
||||
|
||||
f=fopen(saveFilename,"rb");
|
||||
if(!f)
|
||||
@@ -185,7 +195,7 @@ void LoadGame(){
|
||||
void SaveGame(){
|
||||
FILE *f;
|
||||
|
||||
mkdir("saves");
|
||||
GameLib_MkDir("saves");
|
||||
|
||||
f=fopen(saveFilename,"wb");
|
||||
if(!f)
|
||||
|
||||
Reference in New Issue
Block a user