- v0.9.01
- [NEW] version numbers - debug() is now an alias of printf
This commit is contained in:
8
lua.cpp
8
lua.cpp
@@ -915,14 +915,14 @@ void lua_init(char* filenames) {
|
|||||||
char* buffer = file_getfilebuffer(file_start, size);
|
char* buffer = file_getfilebuffer(file_start, size);
|
||||||
if (luaL_loadbuffer(L, buffer, size, file_start)) {
|
if (luaL_loadbuffer(L, buffer, size, file_start)) {
|
||||||
debug("LOADING ERROR: ");
|
debug("LOADING ERROR: ");
|
||||||
debug(lua_tostring(L, -1));
|
debug("%s\n",lua_tostring(L, -1));
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
free(buffer);
|
free(buffer);
|
||||||
if (lua_pcall(L,0, LUA_MULTRET, 0)) {
|
if (lua_pcall(L,0, LUA_MULTRET, 0)) {
|
||||||
debug("RUNTIME ERROR: ");
|
debug("RUNTIME ERROR: ");
|
||||||
debug(lua_tostring(L, -1));
|
debug("%s\n",lua_tostring(L, -1));
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -946,7 +946,7 @@ void lua_call_init() {
|
|||||||
lua_getglobal(L, "_init");
|
lua_getglobal(L, "_init");
|
||||||
if (lua_pcall(L, 0, 0, 0)) {
|
if (lua_pcall(L, 0, 0, 0)) {
|
||||||
debug("RUNTIME ERROR: ");
|
debug("RUNTIME ERROR: ");
|
||||||
debug(lua_tostring(L, -1));
|
debug("%s\n",lua_tostring(L, -1));
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
}
|
}
|
||||||
@@ -957,7 +957,7 @@ void lua_call_update() {
|
|||||||
lua_getglobal(L, "_update");
|
lua_getglobal(L, "_update");
|
||||||
if (lua_pcall(L, 0, 0, 0)) {
|
if (lua_pcall(L, 0, 0, 0)) {
|
||||||
debug("RUNTIME ERROR: ");
|
debug("RUNTIME ERROR: ");
|
||||||
debug(lua_tostring(L, -1));
|
debug("%s\n",lua_tostring(L, -1));
|
||||||
lua_pop(L,1);
|
lua_pop(L,1);
|
||||||
is_playing = false;
|
is_playing = false;
|
||||||
}
|
}
|
||||||
|
|||||||
6
mini.cpp
6
mini.cpp
@@ -211,7 +211,7 @@ int main(int argc,char*argv[]){
|
|||||||
|
|
||||||
reinit();
|
reinit();
|
||||||
initaudio();
|
initaudio();
|
||||||
debug("MINI SYSTEM BOOTING...");
|
debug("MINI v%s\n",MINI_VERSION);
|
||||||
lua_init(lua_files);
|
lua_init(lua_files);
|
||||||
lua_call_init();
|
lua_call_init();
|
||||||
|
|
||||||
@@ -904,9 +904,9 @@ const char* tostr(int val) {
|
|||||||
return SDL_itoa(val, tostr_tmp, 10);
|
return SDL_itoa(val, tostr_tmp, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug(const char *str) {
|
/*void debug(const char *str) {
|
||||||
printf("%s\n",str);
|
printf("%s\n",str);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
uint8_t ascii(const char *str, uint8_t index) {
|
uint8_t ascii(const char *str, uint8_t index) {
|
||||||
return str[index];
|
return str[index];
|
||||||
|
|||||||
5
mini.h
5
mini.h
@@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include <SDL2/SDL.h>
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
|
#define MINI_VERSION "0.9.01d"
|
||||||
|
|
||||||
#define KEY_UNKNOWN 0
|
#define KEY_UNKNOWN 0
|
||||||
#define KEY_A 4
|
#define KEY_A 4
|
||||||
#define KEY_B 5
|
#define KEY_B 5
|
||||||
@@ -232,7 +234,8 @@ int rnd(int x);
|
|||||||
|
|
||||||
const char* tostr(int val);
|
const char* tostr(int val);
|
||||||
|
|
||||||
void debug(const char *str);
|
//void debug(const char *str);
|
||||||
|
#define debug printf
|
||||||
|
|
||||||
uint8_t ascii(const char *str, uint8_t index);
|
uint8_t ascii(const char *str, uint8_t index);
|
||||||
|
|
||||||
|
|||||||
2
opti.bat
2
opti.bat
@@ -1,2 +1,2 @@
|
|||||||
g++ *.cpp ./lua/*.c -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lmingw32 -lSDL2main -lSDL2 -mwindows -o mini.exe
|
g++ *.cpp ./lua/*.c -Os -ffunction-sections -fdata-sections -Wl,--gc-sections -lmingw32 -lSDL2main -lSDL2 -o mini.exe
|
||||||
strip -s -R .comment -R .gnu.version --strip-unneeded mini.exe
|
strip -s -R .comment -R .gnu.version --strip-unneeded mini.exe
|
||||||
|
|||||||
Reference in New Issue
Block a user