add sprite flipping, cleanup some lua things
This commit is contained in:
parent
15041984f1
commit
b659523d69
8 changed files with 48 additions and 27 deletions
|
|
@ -677,7 +677,7 @@ void pxl8_script_set_gfx(pxl8_script* script, pxl8_gfx* gfx) {
|
|||
script->gfx = gfx;
|
||||
if (script->L && gfx) {
|
||||
lua_pushlightuserdata(script->L, gfx);
|
||||
lua_setglobal(script->L, "_pxl8_gfx");
|
||||
lua_setglobal(script->L, "pxl8_gfx");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -686,7 +686,7 @@ void pxl8_script_set_input(pxl8_script* script, pxl8_input_state* input) {
|
|||
script->input = input;
|
||||
if (script->L && input) {
|
||||
lua_pushlightuserdata(script->L, input);
|
||||
lua_setglobal(script->L, "_pxl8_input");
|
||||
lua_setglobal(script->L, "pxl8_input");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -694,7 +694,7 @@ void pxl8_script_set_rng(pxl8_script* script, void* rng) {
|
|||
if (!script) return;
|
||||
if (script->L && rng) {
|
||||
lua_pushlightuserdata(script->L, rng);
|
||||
lua_setglobal(script->L, "_pxl8_rng");
|
||||
lua_setglobal(script->L, "pxl8_rng");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -703,7 +703,7 @@ void pxl8_script_set_sfx(pxl8_script* script, pxl8_sfx_mixer* mixer) {
|
|||
script->mixer = mixer;
|
||||
if (script->L && mixer) {
|
||||
lua_pushlightuserdata(script->L, mixer);
|
||||
lua_setglobal(script->L, "_pxl8_sfx_mixer");
|
||||
lua_setglobal(script->L, "pxl8_sfx");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ void pxl8_script_set_sys(pxl8_script* script, void* sys) {
|
|||
if (!script) return;
|
||||
if (script->L && sys) {
|
||||
lua_pushlightuserdata(script->L, sys);
|
||||
lua_setglobal(script->L, "_pxl8_sys");
|
||||
lua_setglobal(script->L, "pxl8_sys");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1049,7 +1049,7 @@ static bool pxl8_script_is_builtin_global(const char* name) {
|
|||
"print", "pxl8", "rawequal", "rawget", "rawset", "require",
|
||||
"select", "setfenv", "setmetatable", "string", "table",
|
||||
"tonumber", "tostring", "type", "unpack", "update", "frame",
|
||||
"xpcall", "_pxl8_gfx", "_pxl8_input", "_pxl8_rng", "_pxl8_sfx_mixer", "_pxl8_sys",
|
||||
"xpcall", "pxl8_gfx", "pxl8_input", "pxl8_rng", "pxl8_sfx", "pxl8_sys",
|
||||
NULL
|
||||
};
|
||||
for (int i = 0; builtins[i]; i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue