Compare commits
2
Commits
v10
..
lua-no-zzone
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72288e2bae | ||
|
|
0e7460009e |
No files matched your search
+1
-1
@@ -142,7 +142,7 @@ extern char logfilename[1024];
|
|||||||
#define VERSIONSTRING CLIENTNAME " v10"
|
#define VERSIONSTRING CLIENTNAME " v10"
|
||||||
#define VERSIONSTRINGW CLIENTNAMEW L" v10"
|
#define VERSIONSTRINGW CLIENTNAMEW L" v10"
|
||||||
|
|
||||||
//#define SATURN_TESTING // comment out for saturn release builds!
|
#define SATURN_TESTING // comment out for saturn release builds!
|
||||||
|
|
||||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||||
|
|||||||
+1
-19
@@ -624,26 +624,13 @@ static void HWR_PrecacheLevelFlats(void)
|
|||||||
{
|
{
|
||||||
// lookup for flats that may´ve been already loaded
|
// lookup for flats that may´ve been already loaded
|
||||||
flatcheck flatpresent;
|
flatcheck flatpresent;
|
||||||
size_t i;
|
size_t i, j;
|
||||||
#if 0
|
|
||||||
size_t j;
|
|
||||||
#endif
|
|
||||||
INT32 k;
|
INT32 k;
|
||||||
|
|
||||||
// this kinda messes up encore remapping behavior at times
|
|
||||||
// so just disable it for now ig
|
|
||||||
#ifdef GLENCORE
|
|
||||||
if (encoremap)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
flatcheck_init(&flatpresent);
|
flatcheck_init(&flatpresent);
|
||||||
flatcheck_reserve(&flatpresent, numlevelflats);
|
flatcheck_reserve(&flatpresent, numlevelflats);
|
||||||
|
|
||||||
// special case for encore
|
// special case for encore
|
||||||
#if 0
|
|
||||||
#ifdef GLENCORE
|
#ifdef GLENCORE
|
||||||
if (encoremap)
|
if (encoremap)
|
||||||
{
|
{
|
||||||
@@ -683,7 +670,6 @@ static void HWR_PrecacheLevelFlats(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
// on non encore we have it simple
|
// on non encore we have it simple
|
||||||
@@ -1329,7 +1315,6 @@ void HWR_SetPalette(RGBA_t *palette)
|
|||||||
crushed_palette[i].s.blue = (UINT8)(fblue / 31.0f * 255.0f);
|
crushed_palette[i].s.blue = (UINT8)(fblue / 31.0f * 255.0f);
|
||||||
crushed_palette[i].s.alpha = 255;
|
crushed_palette[i].s.alpha = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
GL_SetScreenPalette(crushed_palette);
|
GL_SetScreenPalette(crushed_palette);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1407,7 +1392,6 @@ void HWR_SetMapPalette(void)
|
|||||||
I_Error("HWR_SetMapPalette: A programmer assumed palette lumps are at least 768 bytes long, but apparently this was a wrong assumption!\n");
|
I_Error("HWR_SetMapPalette: A programmer assumed palette lumps are at least 768 bytes long, but apparently this was a wrong assumption!\n");
|
||||||
|
|
||||||
RGB_data = (UINT8 *)(W_CacheLumpNum(lumpnum, PU_CACHE));
|
RGB_data = (UINT8 *)(W_CacheLumpNum(lumpnum, PU_CACHE));
|
||||||
|
|
||||||
// we got the RGB palette now, but we need it in RGBA format.
|
// we got the RGB palette now, but we need it in RGBA format.
|
||||||
for (i = 0; i < 256; i++)
|
for (i = 0; i < 256; i++)
|
||||||
{
|
{
|
||||||
@@ -1416,7 +1400,6 @@ void HWR_SetMapPalette(void)
|
|||||||
RGBA_converted[i].s.blue = *(RGB_data++);
|
RGBA_converted[i].s.blue = *(RGB_data++);
|
||||||
RGBA_converted[i].s.alpha = 255;
|
RGBA_converted[i].s.alpha = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
palette = RGBA_converted;
|
palette = RGBA_converted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1424,7 +1407,6 @@ void HWR_SetMapPalette(void)
|
|||||||
if (memcmp(mapPalette, palette, sizeof(mapPalette)))
|
if (memcmp(mapPalette, palette, sizeof(mapPalette)))
|
||||||
{
|
{
|
||||||
memcpy(mapPalette, palette, sizeof(mapPalette));
|
memcpy(mapPalette, palette, sizeof(mapPalette));
|
||||||
|
|
||||||
// in palette rendering mode, this means that all rgba textures now have wrong colors
|
// in palette rendering mode, this means that all rgba textures now have wrong colors
|
||||||
// and the lookup table is outdated
|
// and the lookup table is outdated
|
||||||
HWR_SetPaletteLookup(mapPalette);
|
HWR_SetPaletteLookup(mapPalette);
|
||||||
|
|||||||
+15
-10
@@ -62,14 +62,6 @@ static lua_CFunction liblist[] = {
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
// Lua asks for memory using this.
|
|
||||||
static void *LUA_Alloc(void *ud, void *ptr, size_t osize, size_t nsize)
|
|
||||||
{
|
|
||||||
(void)ud;
|
|
||||||
(void)osize;
|
|
||||||
return Z_Realloc(ptr, nsize, PU_LUA, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Panic function Lua calls when there's an unprotected error.
|
// Panic function Lua calls when there's an unprotected error.
|
||||||
// This function cannot return. Lua would kill the application anyway if it did.
|
// This function cannot return. Lua would kill the application anyway if it did.
|
||||||
FUNCNORETURN static int LUA_Panic(lua_State *L)
|
FUNCNORETURN static int LUA_Panic(lua_State *L)
|
||||||
@@ -197,7 +189,7 @@ void LUA_ClearState(void)
|
|||||||
CONS_Printf(M_GetText("Pardon me while I initialize the Lua scripting interface...\n"));
|
CONS_Printf(M_GetText("Pardon me while I initialize the Lua scripting interface...\n"));
|
||||||
|
|
||||||
// allocate state
|
// allocate state
|
||||||
L = lua_newstate(LUA_Alloc, NULL);
|
L = luaL_newstate();
|
||||||
lua_atpanic(L, LUA_Panic);
|
lua_atpanic(L, LUA_Panic);
|
||||||
|
|
||||||
// open base libraries
|
// open base libraries
|
||||||
@@ -373,7 +365,7 @@ void LUA_DumpFile(const char *filename)
|
|||||||
|
|
||||||
static void createMathLibState(void)
|
static void createMathLibState(void)
|
||||||
{
|
{
|
||||||
mL = lua_newstate(LUA_Alloc, NULL);
|
mL = luaL_newstate();
|
||||||
lua_atpanic(mL, LUA_Panic);
|
lua_atpanic(mL, LUA_Panic);
|
||||||
|
|
||||||
// open only enum lib
|
// open only enum lib
|
||||||
@@ -1465,3 +1457,16 @@ int Lua_CreateFieldTable(lua_State *L, const char *const lst[])
|
|||||||
|
|
||||||
return luaL_ref(L, LUA_REGISTRYINDEX);
|
return luaL_ref(L, LUA_REGISTRYINDEX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t LUA_MemoryUsage(void)
|
||||||
|
{
|
||||||
|
size_t usage = 0;
|
||||||
|
|
||||||
|
if (gL)
|
||||||
|
usage += lua_gc(gL, LUA_GCCOUNT, 0);
|
||||||
|
|
||||||
|
if (mL)
|
||||||
|
usage += lua_gc(mL, LUA_GCCOUNT, 0);
|
||||||
|
|
||||||
|
return usage;
|
||||||
|
}
|
||||||
@@ -82,6 +82,9 @@ int Lua_optoption(lua_State *L, int narg, int def, int list_ref);
|
|||||||
int Lua_CreateFieldTable(lua_State *L, const char *const lst[]);
|
int Lua_CreateFieldTable(lua_State *L, const char *const lst[]);
|
||||||
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save);
|
void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save);
|
||||||
|
|
||||||
|
// Returns lua memory usage in kbytes
|
||||||
|
size_t LUA_MemoryUsage(void);
|
||||||
|
|
||||||
// Console wrapper
|
// Console wrapper
|
||||||
void COM_Lua_f(void);
|
void COM_Lua_f(void);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -663,8 +663,8 @@ static void Command_Memfree_f(void)
|
|||||||
|
|
||||||
Z_CheckHeap(-1);
|
Z_CheckHeap(-1);
|
||||||
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
|
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
|
||||||
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TotalUsage()>>10));
|
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1((Z_TotalUsage()>>10) + LUA_MemoryUsage()));
|
||||||
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10));
|
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(LUA_MemoryUsage())); // No longer uses z_zone memory but for consistency keep it here
|
||||||
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
|
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
|
||||||
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
|
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
|
||||||
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
|
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
|
||||||
|
|||||||
Reference in new issue
Block a user