mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Lunatic: v7 engine support, event updates
git-svn-id: https://svn.eduke32.com/eduke32@2668 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
2963e2874d
commit
165c569cbe
4 changed files with 45 additions and 18 deletions
|
@ -54,6 +54,12 @@ const int32_t engine_main_arrays_are_static = 0; // for Lunatic
|
||||||
const int32_t engine_main_arrays_are_static = 1;
|
const int32_t engine_main_arrays_are_static = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if MAXSECTORS==MAXSECTORSV8
|
||||||
|
const int32_t engine_v8 = 1;
|
||||||
|
#else
|
||||||
|
const int32_t engine_v8 = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
float debug1, debug2;
|
float debug1, debug2;
|
||||||
|
|
||||||
static void drawpixel_safe(void *s, char a)
|
static void drawpixel_safe(void *s, char a)
|
||||||
|
|
|
@ -64,19 +64,6 @@ typedef struct {
|
||||||
int32_t x, y, z;
|
int32_t x, y, z;
|
||||||
} vec3_t;
|
} vec3_t;
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
enum
|
|
||||||
{
|
|
||||||
MAXSECTORS = 4096,
|
|
||||||
MAXWALLS = 16384,
|
|
||||||
MAXSPRITES = 16384,
|
|
||||||
|
|
||||||
MAXSTATUS = 1024,
|
|
||||||
|
|
||||||
MAXBUNCHES = 256,
|
|
||||||
CEILING = 0,
|
|
||||||
FLOOR = 1,
|
|
||||||
};
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
assert(ffi.sizeof('sectortype')==40)
|
assert(ffi.sizeof('sectortype')==40)
|
||||||
|
@ -85,7 +72,7 @@ assert(ffi.sizeof('spritetype')==44)
|
||||||
|
|
||||||
---- engine data and functions ----
|
---- engine data and functions ----
|
||||||
|
|
||||||
ffi.cdef[[int32_t engine_main_arrays_are_static;]]
|
ffi.cdef[[int32_t engine_main_arrays_are_static, engine_v8;]]
|
||||||
|
|
||||||
-- NOTE TO SELF: This is not C, never EVER write
|
-- NOTE TO SELF: This is not C, never EVER write
|
||||||
-- if (x)
|
-- if (x)
|
||||||
|
@ -108,6 +95,38 @@ spriteext_t *spriteext;
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if (ffi.C.engine_v8 == 0) then
|
||||||
|
-- V7
|
||||||
|
ffi.cdef[[
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MAXSECTORS = 1024,
|
||||||
|
MAXWALLS = 8192,
|
||||||
|
MAXSPRITES = 4096,
|
||||||
|
}
|
||||||
|
]]
|
||||||
|
else
|
||||||
|
-- V8
|
||||||
|
ffi.cdef[[
|
||||||
|
enum
|
||||||
|
{
|
||||||
|
MAXSECTORS = 4096,
|
||||||
|
MAXWALLS = 16384,
|
||||||
|
MAXSPRITES = 16384,
|
||||||
|
}
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
ffi.cdef[[
|
||||||
|
enum {
|
||||||
|
MAXSTATUS = 1024,
|
||||||
|
|
||||||
|
MAXBUNCHES = 256,
|
||||||
|
CEILING = 0,
|
||||||
|
FLOOR = 1,
|
||||||
|
};
|
||||||
|
]]
|
||||||
|
|
||||||
ffi.cdef[[
|
ffi.cdef[[
|
||||||
const int16_t numsectors, numwalls;
|
const int16_t numsectors, numwalls;
|
||||||
const int32_t numyaxbunches;
|
const int32_t numyaxbunches;
|
||||||
|
@ -126,7 +145,7 @@ int16_t yax_getbunch(int16_t i, int16_t cf);
|
||||||
---- game structs ----
|
---- game structs ----
|
||||||
ffi.cdef[[
|
ffi.cdef[[
|
||||||
#pragma pack(push,1)
|
#pragma pack(push,1)
|
||||||
// ACTOR_T, might still need to make some fields read-only
|
// XXX: might still need to make some fields read-only
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
const int32_t t_data[10]; // 40b sometimes used to hold offsets to con code
|
const int32_t t_data[10]; // 40b sometimes used to hold offsets to con code
|
||||||
|
@ -342,6 +361,9 @@ enum GameEvent_t {
|
||||||
EVENT_DISPLAYLOADINGSCREEN,
|
EVENT_DISPLAYLOADINGSCREEN,
|
||||||
EVENT_ANIMATESPRITES,
|
EVENT_ANIMATESPRITES,
|
||||||
EVENT_NEWGAME,
|
EVENT_NEWGAME,
|
||||||
|
EVENT_SOUND,
|
||||||
|
EVENT_CHECKTOUCHDAMAGE,
|
||||||
|
EVENT_CHECKFLOORDAMAGE,
|
||||||
MAXEVENTS
|
MAXEVENTS
|
||||||
};
|
};
|
||||||
]]
|
]]
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
{
|
{
|
||||||
engine_main_arrays_are_static;
|
engine_main_arrays_are_static;
|
||||||
|
engine_v8;
|
||||||
|
|
||||||
sector;
|
sector;
|
||||||
wall;
|
wall;
|
||||||
|
@ -25,6 +26,5 @@ nextsectbunch;
|
||||||
actor;
|
actor;
|
||||||
ud;
|
ud;
|
||||||
|
|
||||||
luaJIT_BC_con_lang;
|
luaJIT_BC_*;
|
||||||
luaJIT_BC_lunacon;
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -95,7 +95,6 @@ local function cmd(...)
|
||||||
local pat = Pat(true)
|
local pat = Pat(true)
|
||||||
local vartypes = {...}
|
local vartypes = {...}
|
||||||
|
|
||||||
local spat = ""
|
|
||||||
for i=1,#vartypes do
|
for i=1,#vartypes do
|
||||||
assert(vartypes[i] < 0)
|
assert(vartypes[i] < 0)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue