From 34cc1d1cc4a8c27c86b71ee7c94d0c1fc177f187 Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Wed, 23 Nov 2022 17:09:54 +0000 Subject: [PATCH 1/8] Exposed floor/ceiling pic x/y offsets to Lua. --- src/lua_maplib.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index b4565121d..4b90bc013 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -33,7 +33,13 @@ enum sector_e { sector_floorheight, sector_ceilingheight, sector_floorpic, + sector_floorxoffs, + sector_flooryoffs, + sector_floorpicangle, sector_ceilingpic, + sector_ceilingxoffs, + sector_ceilingyoffs, + sector_ceilingpicangle, sector_lightlevel, sector_floorlightlevel, sector_floorlightabsolute, @@ -63,7 +69,13 @@ static const char *const sector_opt[] = { "floorheight", "ceilingheight", "floorpic", + "floorxoffs", + "flooryoffs", + "floorpicangle", "ceilingpic", + "ceilingxoffs", + "ceilingyoffs", + "ceilingpicangle", "lightlevel", "floorlightlevel", "floorlightabsolute", @@ -607,6 +619,21 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } + case sector_floorxoffs: + { + lua_pushfixed(L, sector->floor_xoffs); + return 1; + } + case sector_flooryoffs: + { + lua_pushfixed(L, sector->floor_yoffs); + return 1; + } + case sector_floorpicangle: + { + lua_pushangle(L, sector->floorpic_angle); + return 1; + } case sector_ceilingpic: // ceilingpic { levelflat_t *levelflat = &levelflats[sector->ceilingpic]; @@ -616,6 +643,21 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } + case sector_ceilingxoffs: + { + lua_pushfixed(L, sector->ceiling_xoffs); + return 1; + } + case sector_ceilingyoffs: + { + lua_pushfixed(L, sector->ceiling_yoffs); + return 1; + } + case sector_ceilingpicangle: + { + lua_pushangle(L, sector->ceilingpic_angle); + return 1; + } case sector_lightlevel: lua_pushinteger(L, sector->lightlevel); return 1; @@ -751,9 +793,27 @@ static int sector_set(lua_State *L) case sector_floorpic: sector->floorpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; + case sector_floorxoffs: + sector->floor_xoffs = luaL_checkfixed(L, 3); + break; + case sector_flooryoffs: + sector->floor_yoffs = luaL_checkfixed(L, 3); + break; + case sector_floorpicangle: + sector->floorpic_angle = luaL_checkangle(L, 3); + break; case sector_ceilingpic: sector->ceilingpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; + case sector_ceilingxoffs: + sector->ceiling_xoffs = luaL_checkfixed(L, 3); + break; + case sector_ceilingyoffs: + sector->ceiling_yoffs = luaL_checkfixed(L, 3); + break; + case sector_ceilingpicangle: + sector->ceilingpic_angle = luaL_checkangle(L, 3); + break; case sector_lightlevel: sector->lightlevel = (INT16)luaL_checkinteger(L, 3); break; From e789bf1fb241148d6dbd54c2e0efc7059b032b44 Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Wed, 23 Nov 2022 17:29:44 +0000 Subject: [PATCH 2/8] Fix for consistency just *angle for *_angle --- src/lua_maplib.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 4b90bc013..ff732af29 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -35,11 +35,11 @@ enum sector_e { sector_floorpic, sector_floorxoffs, sector_flooryoffs, - sector_floorpicangle, + sector_floorpic_angle, sector_ceilingpic, sector_ceilingxoffs, sector_ceilingyoffs, - sector_ceilingpicangle, + sector_ceilingpic_angle, sector_lightlevel, sector_floorlightlevel, sector_floorlightabsolute, @@ -71,11 +71,11 @@ static const char *const sector_opt[] = { "floorpic", "floorxoffs", "flooryoffs", - "floorpicangle", + "floorpic_angle", "ceilingpic", "ceilingxoffs", "ceilingyoffs", - "ceilingpicangle", + "ceilingpic_angle", "lightlevel", "floorlightlevel", "floorlightabsolute", @@ -629,7 +629,7 @@ static int sector_get(lua_State *L) lua_pushfixed(L, sector->floor_yoffs); return 1; } - case sector_floorpicangle: + case sector_floorpic_angle: { lua_pushangle(L, sector->floorpic_angle); return 1; @@ -653,7 +653,7 @@ static int sector_get(lua_State *L) lua_pushfixed(L, sector->ceiling_yoffs); return 1; } - case sector_ceilingpicangle: + case sector_ceilingpic_angle: { lua_pushangle(L, sector->ceilingpic_angle); return 1; @@ -799,7 +799,7 @@ static int sector_set(lua_State *L) case sector_flooryoffs: sector->floor_yoffs = luaL_checkfixed(L, 3); break; - case sector_floorpicangle: + case sector_floorpic_angle: sector->floorpic_angle = luaL_checkangle(L, 3); break; case sector_ceilingpic: @@ -811,7 +811,7 @@ static int sector_set(lua_State *L) case sector_ceilingyoffs: sector->ceiling_yoffs = luaL_checkfixed(L, 3); break; - case sector_ceilingpicangle: + case sector_ceilingpic_angle: sector->ceilingpic_angle = luaL_checkangle(L, 3); break; case sector_lightlevel: From 27c6afb80b2a67ec1197dca5d9a96e9fec6de512 Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Thu, 24 Nov 2022 18:51:53 +0000 Subject: [PATCH 3/8] Yikes. how did I miss "_" on every single variable --- src/lua_maplib.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index ff732af29..0def825e1 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -33,12 +33,12 @@ enum sector_e { sector_floorheight, sector_ceilingheight, sector_floorpic, - sector_floorxoffs, - sector_flooryoffs, + sector_floor_xoffs, + sector_floor_yoffs, sector_floorpic_angle, sector_ceilingpic, - sector_ceilingxoffs, - sector_ceilingyoffs, + sector_ceiling_xoffs, + sector_ceiling_yoffs, sector_ceilingpic_angle, sector_lightlevel, sector_floorlightlevel, @@ -69,12 +69,12 @@ static const char *const sector_opt[] = { "floorheight", "ceilingheight", "floorpic", - "floorxoffs", - "flooryoffs", + "floor_xoffs", + "floor_yoffs", "floorpic_angle", "ceilingpic", - "ceilingxoffs", - "ceilingyoffs", + "ceiling_xoffs", + "ceiling_yoffs", "ceilingpic_angle", "lightlevel", "floorlightlevel", @@ -619,12 +619,12 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } - case sector_floorxoffs: + case sector_floor_xoffs: { lua_pushfixed(L, sector->floor_xoffs); return 1; } - case sector_flooryoffs: + case sector_floor_yoffs: { lua_pushfixed(L, sector->floor_yoffs); return 1; @@ -643,12 +643,12 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } - case sector_ceilingxoffs: + case sector_ceiling_xoffs: { lua_pushfixed(L, sector->ceiling_xoffs); return 1; } - case sector_ceilingyoffs: + case sector_ceiling_yoffs: { lua_pushfixed(L, sector->ceiling_yoffs); return 1; @@ -793,10 +793,10 @@ static int sector_set(lua_State *L) case sector_floorpic: sector->floorpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case sector_floorxoffs: + case sector_floor_xoffs: sector->floor_xoffs = luaL_checkfixed(L, 3); break; - case sector_flooryoffs: + case sector_floor_yoffs: sector->floor_yoffs = luaL_checkfixed(L, 3); break; case sector_floorpic_angle: @@ -805,10 +805,10 @@ static int sector_set(lua_State *L) case sector_ceilingpic: sector->ceilingpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case sector_ceilingxoffs: + case sector_ceiling_xoffs: sector->ceiling_xoffs = luaL_checkfixed(L, 3); break; - case sector_ceilingyoffs: + case sector_ceiling_yoffs: sector->ceiling_yoffs = luaL_checkfixed(L, 3); break; case sector_ceilingpic_angle: From 9d4a3b91c3c33d8e8945d90a61584336c41e461f Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Fri, 25 Nov 2022 22:27:41 +0000 Subject: [PATCH 4/8] change names of Lua variables for last time. --- src/lua_maplib.c | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 0def825e1..7908a1d72 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -33,13 +33,13 @@ enum sector_e { sector_floorheight, sector_ceilingheight, sector_floorpic, - sector_floor_xoffs, - sector_floor_yoffs, - sector_floorpic_angle, + sector_floorxoffset, + sector_flooryoffset, + sector_floorangle, sector_ceilingpic, - sector_ceiling_xoffs, - sector_ceiling_yoffs, - sector_ceilingpic_angle, + sector_ceilingxoffset, + sector_ceilingyoffset, + sector_ceilingangle, sector_lightlevel, sector_floorlightlevel, sector_floorlightabsolute, @@ -69,13 +69,13 @@ static const char *const sector_opt[] = { "floorheight", "ceilingheight", "floorpic", - "floor_xoffs", - "floor_yoffs", - "floorpic_angle", + "floorxoffset", + "flooryoffset", + "floorangle", "ceilingpic", - "ceiling_xoffs", - "ceiling_yoffs", - "ceilingpic_angle", + "ceilingxoffset", + "ceilingyoffset", + "ceilingangle", "lightlevel", "floorlightlevel", "floorlightabsolute", @@ -619,17 +619,17 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } - case sector_floor_xoffs: + case sector_floorxoffset: { lua_pushfixed(L, sector->floor_xoffs); return 1; } - case sector_floor_yoffs: + case sector_flooryoffset: { lua_pushfixed(L, sector->floor_yoffs); return 1; } - case sector_floorpic_angle: + case sector_floorangle: { lua_pushangle(L, sector->floorpic_angle); return 1; @@ -643,17 +643,17 @@ static int sector_get(lua_State *L) lua_pushlstring(L, levelflat->name, i); return 1; } - case sector_ceiling_xoffs: + case sector_ceilingxoffset: { lua_pushfixed(L, sector->ceiling_xoffs); return 1; } - case sector_ceiling_yoffs: + case sector_ceilingyoffset: { lua_pushfixed(L, sector->ceiling_yoffs); return 1; } - case sector_ceilingpic_angle: + case sector_ceilingangle: { lua_pushangle(L, sector->ceilingpic_angle); return 1; @@ -793,25 +793,25 @@ static int sector_set(lua_State *L) case sector_floorpic: sector->floorpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case sector_floor_xoffs: + case sector_floorxoffset: sector->floor_xoffs = luaL_checkfixed(L, 3); break; - case sector_floor_yoffs: + case sector_flooryoffset: sector->floor_yoffs = luaL_checkfixed(L, 3); break; - case sector_floorpic_angle: + case sector_floorangle: sector->floorpic_angle = luaL_checkangle(L, 3); break; case sector_ceilingpic: sector->ceilingpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case sector_ceiling_xoffs: + case sector_ceilingxoffset: sector->ceiling_xoffs = luaL_checkfixed(L, 3); break; - case sector_ceiling_yoffs: + case sector_ceilingyoffset: sector->ceiling_yoffs = luaL_checkfixed(L, 3); break; - case sector_ceilingpic_angle: + case sector_ceilingangle: sector->ceilingpic_angle = luaL_checkangle(L, 3); break; case sector_lightlevel: From 3217984f55720b30a5f43df32cacdb6f89466ccf Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Fri, 25 Nov 2022 23:01:27 +0000 Subject: [PATCH 5/8] c-side offset/angle variable renamed --- src/hardware/hw_main.c | 32 ++++++------- src/lua_maplib.c | 24 +++++----- src/p_saveg.c | 36 +++++++------- src/p_setup.c | 106 ++++++++++++++++++++--------------------- src/p_spec.c | 32 ++++++------- src/r_bsp.c | 58 +++++++++++----------- src/r_defs.h | 8 ++-- src/r_fps.c | 16 +++---- src/r_segs.c | 12 ++--- 9 files changed, 162 insertions(+), 162 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 3cb7275a0..2b376544a 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -459,30 +459,30 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool { if (!isceiling) // it's a floor { - scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatheight; - angle = FOFsector->floorpic_angle; + scrollx = FIXED_TO_FLOAT(FOFsector->floorxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(FOFsector->flooryoffset)/fflatheight; + angle = FOFsector->floorangle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatwidth; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatheight; - angle = FOFsector->ceilingpic_angle; + angle = FOFsector->ceilingangle; } } else if (gl_frontsector) { if (!isceiling) // it's a floor { - scrollx = FIXED_TO_FLOAT(gl_frontsector->floor_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(gl_frontsector->floor_yoffs)/fflatheight; - angle = gl_frontsector->floorpic_angle; + scrollx = FIXED_TO_FLOAT(gl_frontsector->floorxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(gl_frontsector->flooryoffset)/fflatheight; + angle = gl_frontsector->floorangle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(gl_frontsector->ceiling_xoffs)/fflatwidth; scrolly = FIXED_TO_FLOAT(gl_frontsector->ceiling_yoffs)/fflatheight; - angle = gl_frontsector->ceilingpic_angle; + angle = gl_frontsector->ceilingangle; } } @@ -2719,30 +2719,30 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, { if (!isceiling) // it's a floor { - scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatheight; - angle = FOFsector->floorpic_angle; + scrollx = FIXED_TO_FLOAT(FOFsector->floorxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(FOFsector->flooryoffset)/fflatheight; + angle = FOFsector->floorangle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatwidth; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatheight; - angle = FOFsector->ceilingpic_angle; + angle = FOFsector->ceilingangle; } } else if (gl_frontsector) { if (!isceiling) // it's a floor { - scrollx = FIXED_TO_FLOAT(gl_frontsector->floor_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(gl_frontsector->floor_yoffs)/fflatheight; - angle = gl_frontsector->floorpic_angle; + scrollx = FIXED_TO_FLOAT(gl_frontsector->floorxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(gl_frontsector->flooryoffset)/fflatheight; + angle = gl_frontsector->floorangle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(gl_frontsector->ceiling_xoffs)/fflatwidth; scrolly = FIXED_TO_FLOAT(gl_frontsector->ceiling_yoffs)/fflatheight; - angle = gl_frontsector->ceilingpic_angle; + angle = gl_frontsector->ceilingangle; } } diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 7908a1d72..79909a6be 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -621,17 +621,17 @@ static int sector_get(lua_State *L) } case sector_floorxoffset: { - lua_pushfixed(L, sector->floor_xoffs); + lua_pushfixed(L, sector->floorxoffset); return 1; } case sector_flooryoffset: { - lua_pushfixed(L, sector->floor_yoffs); + lua_pushfixed(L, sector->flooryoffset); return 1; } case sector_floorangle: { - lua_pushangle(L, sector->floorpic_angle); + lua_pushangle(L, sector->floorangle); return 1; } case sector_ceilingpic: // ceilingpic @@ -645,17 +645,17 @@ static int sector_get(lua_State *L) } case sector_ceilingxoffset: { - lua_pushfixed(L, sector->ceiling_xoffs); + lua_pushfixed(L, sector->ceilingxoffset); return 1; } case sector_ceilingyoffset: { - lua_pushfixed(L, sector->ceiling_yoffs); + lua_pushfixed(L, sector->ceilingyoffset); return 1; } case sector_ceilingangle: { - lua_pushangle(L, sector->ceilingpic_angle); + lua_pushangle(L, sector->ceilingangle); return 1; } case sector_lightlevel: @@ -794,25 +794,25 @@ static int sector_set(lua_State *L) sector->floorpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; case sector_floorxoffset: - sector->floor_xoffs = luaL_checkfixed(L, 3); + sector->floorxoffset = luaL_checkfixed(L, 3); break; case sector_flooryoffset: - sector->floor_yoffs = luaL_checkfixed(L, 3); + sector->flooryoffset = luaL_checkfixed(L, 3); break; case sector_floorangle: - sector->floorpic_angle = luaL_checkangle(L, 3); + sector->floorangle = luaL_checkangle(L, 3); break; case sector_ceilingpic: sector->ceilingpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; case sector_ceilingxoffset: - sector->ceiling_xoffs = luaL_checkfixed(L, 3); + sector->ceilingxoffset = luaL_checkfixed(L, 3); break; case sector_ceilingyoffset: - sector->ceiling_yoffs = luaL_checkfixed(L, 3); + sector->ceilingyoffset = luaL_checkfixed(L, 3); break; case sector_ceilingangle: - sector->ceilingpic_angle = luaL_checkangle(L, 3); + sector->ceilingangle = luaL_checkangle(L, 3); break; case sector_lightlevel: sector->lightlevel = (INT16)luaL_checkinteger(L, 3); diff --git a/src/p_saveg.c b/src/p_saveg.c index ce7353b95..464372d68 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1022,17 +1022,17 @@ static void ArchiveSectors(void) if (ss->special != spawnss->special) diff |= SD_SPECIAL; - if (ss->floor_xoffs != spawnss->floor_xoffs) + if (ss->floorxoffset != spawnss->floorxoffset) diff2 |= SD_FXOFFS; - if (ss->floor_yoffs != spawnss->floor_yoffs) + if (ss->flooryoffset != spawnss->flooryoffset) diff2 |= SD_FYOFFS; - if (ss->ceiling_xoffs != spawnss->ceiling_xoffs) + if (ss->ceilingxoffset != spawnss->ceilingxoffset) diff2 |= SD_CXOFFS; - if (ss->ceiling_yoffs != spawnss->ceiling_yoffs) + if (ss->ceilingyoffset != spawnss->ceilingyoffset) diff2 |= SD_CYOFFS; - if (ss->floorpic_angle != spawnss->floorpic_angle) + if (ss->floorangle != spawnss->floorangle) diff2 |= SD_FLOORANG; - if (ss->ceilingpic_angle != spawnss->ceilingpic_angle) + if (ss->ceilingangle != spawnss->ceilingangle) diff2 |= SD_CEILANG; if (!Tag_Compare(&ss->tags, &spawnss->tags)) @@ -1095,17 +1095,17 @@ static void ArchiveSectors(void) if (diff & SD_SPECIAL) WRITEINT16(save_p, ss->special); if (diff2 & SD_FXOFFS) - WRITEFIXED(save_p, ss->floor_xoffs); + WRITEFIXED(save_p, ss->floorxoffset); if (diff2 & SD_FYOFFS) - WRITEFIXED(save_p, ss->floor_yoffs); + WRITEFIXED(save_p, ss->flooryoffset); if (diff2 & SD_CXOFFS) - WRITEFIXED(save_p, ss->ceiling_xoffs); + WRITEFIXED(save_p, ss->ceilingxoffset); if (diff2 & SD_CYOFFS) - WRITEFIXED(save_p, ss->ceiling_yoffs); + WRITEFIXED(save_p, ss->ceilingyoffset); if (diff2 & SD_FLOORANG) - WRITEANGLE(save_p, ss->floorpic_angle); + WRITEANGLE(save_p, ss->floorangle); if (diff2 & SD_CEILANG) - WRITEANGLE(save_p, ss->ceilingpic_angle); + WRITEANGLE(save_p, ss->ceilingangle); if (diff2 & SD_TAG) { WRITEUINT32(save_p, ss->tags.count); @@ -1196,17 +1196,17 @@ static void UnArchiveSectors(void) sectors[i].special = READINT16(save_p); if (diff2 & SD_FXOFFS) - sectors[i].floor_xoffs = READFIXED(save_p); + sectors[i].floorxoffset = READFIXED(save_p); if (diff2 & SD_FYOFFS) - sectors[i].floor_yoffs = READFIXED(save_p); + sectors[i].flooryoffset = READFIXED(save_p); if (diff2 & SD_CXOFFS) - sectors[i].ceiling_xoffs = READFIXED(save_p); + sectors[i].ceilingxoffset = READFIXED(save_p); if (diff2 & SD_CYOFFS) - sectors[i].ceiling_yoffs = READFIXED(save_p); + sectors[i].ceilingyoffset = READFIXED(save_p); if (diff2 & SD_FLOORANG) - sectors[i].floorpic_angle = READANGLE(save_p); + sectors[i].floorangle = READANGLE(save_p); if (diff2 & SD_CEILANG) - sectors[i].ceilingpic_angle = READANGLE(save_p); + sectors[i].ceilingangle = READANGLE(save_p); if (diff2 & SD_TAG) { size_t ncount = READUINT32(save_p); diff --git a/src/p_setup.c b/src/p_setup.c index deb308da2..20790a48b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1049,10 +1049,10 @@ static void P_LoadSectors(UINT8 *data) ss->special = SHORT(ms->special); Tag_FSet(&ss->tags, SHORT(ms->tag)); - ss->floor_xoffs = ss->floor_yoffs = 0; - ss->ceiling_xoffs = ss->ceiling_yoffs = 0; + ss->floorxoffset = ss->flooryoffset = 0; + ss->ceilingxoffset = ss->ceilingyoffset = 0; - ss->floorpic_angle = ss->ceilingpic_angle = 0; + ss->floorangle = ss->ceilingangle = 0; ss->floorlightlevel = ss->ceilinglightlevel = 0; ss->floorlightabsolute = ss->ceilinglightabsolute = false; @@ -1578,19 +1578,19 @@ static void ParseTextmapSectorParameter(UINT32 i, const char *param, const char if ((id = strchr(id, ' '))) id++; } - } + } else if (fastcmp(param, "xpanningfloor")) - sectors[i].floor_xoffs = FLOAT_TO_FIXED(atof(val)); + sectors[i].floorxoffset = FLOAT_TO_FIXED(atof(val)); else if (fastcmp(param, "ypanningfloor")) - sectors[i].floor_yoffs = FLOAT_TO_FIXED(atof(val)); + sectors[i].flooryoffset = FLOAT_TO_FIXED(atof(val)); else if (fastcmp(param, "xpanningceiling")) - sectors[i].ceiling_xoffs = FLOAT_TO_FIXED(atof(val)); + sectors[i].ceilingxoffset = FLOAT_TO_FIXED(atof(val)); else if (fastcmp(param, "ypanningceiling")) - sectors[i].ceiling_yoffs = FLOAT_TO_FIXED(atof(val)); + sectors[i].ceilingyoffset = FLOAT_TO_FIXED(atof(val)); else if (fastcmp(param, "rotationfloor")) - sectors[i].floorpic_angle = FixedAngle(FLOAT_TO_FIXED(atof(val))); + sectors[i].floorangle = FixedAngle(FLOAT_TO_FIXED(atof(val))); else if (fastcmp(param, "rotationceiling")) - sectors[i].ceilingpic_angle = FixedAngle(FLOAT_TO_FIXED(atof(val))); + sectors[i].ceilingangle = FixedAngle(FLOAT_TO_FIXED(atof(val))); else if (fastcmp(param, "floorplane_a")) { textmap_planefloor.defined |= PD_A; @@ -1959,47 +1959,47 @@ static void TextmapParse(UINT32 dataPos, size_t num, void (*parser)(UINT32, cons */ static void TextmapFixFlatOffsets(sector_t *sec) { - if (sec->floorpic_angle) + if (sec->floorangle) { - fixed_t pc = FINECOSINE(sec->floorpic_angle>>ANGLETOFINESHIFT); - fixed_t ps = FINESINE (sec->floorpic_angle>>ANGLETOFINESHIFT); - fixed_t xoffs = sec->floor_xoffs; - fixed_t yoffs = sec->floor_yoffs; - sec->floor_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); - sec->floor_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); + fixed_t pc = FINECOSINE(sec->floorangle>>ANGLETOFINESHIFT); + fixed_t ps = FINESINE (sec->floorangle>>ANGLETOFINESHIFT); + fixed_t xoffs = sec->floorxoffset; + fixed_t yoffs = sec->flooryoffset; + sec->floorxoffset = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); + sec->flooryoffset = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); } - if (sec->ceilingpic_angle) + if (sec->ceilingangle) { - fixed_t pc = FINECOSINE(sec->ceilingpic_angle>>ANGLETOFINESHIFT); - fixed_t ps = FINESINE (sec->ceilingpic_angle>>ANGLETOFINESHIFT); - fixed_t xoffs = sec->ceiling_xoffs; - fixed_t yoffs = sec->ceiling_yoffs; - sec->ceiling_xoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); - sec->ceiling_yoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); + fixed_t pc = FINECOSINE(sec->ceilingangle>>ANGLETOFINESHIFT); + fixed_t ps = FINESINE (sec->ceilingangle>>ANGLETOFINESHIFT); + fixed_t xoffs = sec->ceilingxoffset; + fixed_t yoffs = sec->ceilingyoffset; + sec->ceilingxoffset = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); + sec->ceilingyoffset = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); } } static void TextmapUnfixFlatOffsets(sector_t *sec) { - if (sec->floorpic_angle) + if (sec->floorangle) { - fixed_t pc = FINECOSINE(sec->floorpic_angle >> ANGLETOFINESHIFT); - fixed_t ps = FINESINE(sec->floorpic_angle >> ANGLETOFINESHIFT); - fixed_t xoffs = sec->floor_xoffs; - fixed_t yoffs = sec->floor_yoffs; - sec->floor_xoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); - sec->floor_yoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); + fixed_t pc = FINECOSINE(sec->floorangle >> ANGLETOFINESHIFT); + fixed_t ps = FINESINE(sec->floorangle >> ANGLETOFINESHIFT); + fixed_t xoffs = sec->floorxoffset; + fixed_t yoffs = sec->flooryoffset; + sec->floorxoffset = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); + sec->flooryoffset = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); } - if (sec->ceilingpic_angle) + if (sec->ceilingangle) { - fixed_t pc = FINECOSINE(sec->ceilingpic_angle >> ANGLETOFINESHIFT); - fixed_t ps = FINESINE(sec->ceilingpic_angle >> ANGLETOFINESHIFT); - fixed_t xoffs = sec->ceiling_xoffs; - fixed_t yoffs = sec->ceiling_yoffs; - sec->ceiling_xoffs = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); - sec->ceiling_yoffs = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); + fixed_t pc = FINECOSINE(sec->ceilingangle >> ANGLETOFINESHIFT); + fixed_t ps = FINESINE(sec->ceilingangle >> ANGLETOFINESHIFT); + fixed_t xoffs = sec->ceilingxoffset; + fixed_t yoffs = sec->ceilingyoffset; + sec->ceilingxoffset = (FixedMul(xoffs, ps) % MAXFLATSIZE) + (FixedMul(yoffs, pc) % MAXFLATSIZE); + sec->ceilingyoffset = (FixedMul(xoffs, pc) % MAXFLATSIZE) - (FixedMul(yoffs, ps) % MAXFLATSIZE); } } @@ -2492,18 +2492,18 @@ static void P_WriteTextmap(void) } sector_t tempsec = wsectors[i]; TextmapUnfixFlatOffsets(&tempsec); - if (tempsec.floor_xoffs != 0) - fprintf(f, "xpanningfloor = %f;\n", FIXED_TO_FLOAT(tempsec.floor_xoffs)); - if (tempsec.floor_yoffs != 0) - fprintf(f, "ypanningfloor = %f;\n", FIXED_TO_FLOAT(tempsec.floor_yoffs)); - if (tempsec.ceiling_xoffs != 0) - fprintf(f, "xpanningceiling = %f;\n", FIXED_TO_FLOAT(tempsec.ceiling_xoffs)); - if (tempsec.ceiling_yoffs != 0) - fprintf(f, "ypanningceiling = %f;\n", FIXED_TO_FLOAT(tempsec.ceiling_yoffs)); - if (wsectors[i].floorpic_angle != 0) - fprintf(f, "rotationfloor = %f;\n", FIXED_TO_FLOAT(AngleFixed(wsectors[i].floorpic_angle))); - if (wsectors[i].ceilingpic_angle != 0) - fprintf(f, "rotationceiling = %f;\n", FIXED_TO_FLOAT(AngleFixed(wsectors[i].ceilingpic_angle))); + if (tempsec.floorxoffset != 0) + fprintf(f, "xpanningfloor = %f;\n", FIXED_TO_FLOAT(tempsec.floorxoffset)); + if (tempsec.flooryoffset != 0) + fprintf(f, "ypanningfloor = %f;\n", FIXED_TO_FLOAT(tempsec.flooryoffset)); + if (tempsec.ceilingxoffset != 0) + fprintf(f, "xpanningceiling = %f;\n", FIXED_TO_FLOAT(tempsec.ceilingxoffset)); + if (tempsec.ceilingyoffset != 0) + fprintf(f, "ypanningceiling = %f;\n", FIXED_TO_FLOAT(tempsec.ceilingyoffset)); + if (wsectors[i].floorangle != 0) + fprintf(f, "rotationfloor = %f;\n", FIXED_TO_FLOAT(AngleFixed(wsectors[i].floorangle))); + if (wsectors[i].ceilingangle != 0) + fprintf(f, "rotationceiling = %f;\n", FIXED_TO_FLOAT(AngleFixed(wsectors[i].ceilingangle))); if (wsectors[i].extra_colormap) { INT32 lightcolor = P_RGBAToColor(wsectors[i].extra_colormap->rgba); @@ -2708,10 +2708,10 @@ static void P_LoadTextmap(void) sc->special = 0; Tag_FSet(&sc->tags, 0); - sc->floor_xoffs = sc->floor_yoffs = 0; - sc->ceiling_xoffs = sc->ceiling_yoffs = 0; + sc->floorxoffset = sc->flooryoffset = 0; + sc->ceilingxoffset = sc->ceilingyoffset = 0; - sc->floorpic_angle = sc->ceilingpic_angle = 0; + sc->floorangle = sc->ceilingangle = 0; sc->floorlightlevel = sc->ceilinglightlevel = 0; sc->floorlightabsolute = sc->ceilinglightabsolute = false; diff --git a/src/p_spec.c b/src/p_spec.c index 82337d2f6..d781ea7d7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5570,17 +5570,17 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, I fflr->target = sec; fflr->bottomheight = &sec2->floorheight; fflr->bottompic = &sec2->floorpic; - fflr->bottomxoffs = &sec2->floor_xoffs; - fflr->bottomyoffs = &sec2->floor_yoffs; - fflr->bottomangle = &sec2->floorpic_angle; + fflr->bottomxoffs = &sec2->floorxoffset; + fflr->bottomyoffs = &sec2->flooryoffset; + fflr->bottomangle = &sec2->floorangle; // Add the ceiling fflr->topheight = &sec2->ceilingheight; fflr->toppic = &sec2->ceilingpic; fflr->toplightlevel = &sec2->lightlevel; - fflr->topxoffs = &sec2->ceiling_xoffs; - fflr->topyoffs = &sec2->ceiling_yoffs; - fflr->topangle = &sec2->ceilingpic_angle; + fflr->topxoffs = &sec2->ceilingxoffset; + fflr->topyoffs = &sec2->ceilingyoffset; + fflr->topangle = &sec2->ceilingangle; // Add slopes fflr->t_slope = &sec2->c_slope; @@ -6098,16 +6098,16 @@ void P_ApplyFlatAlignment(sector_t *sector, angle_t flatangle, fixed_t xoffs, fi { if (floor) { - sector->floorpic_angle = flatangle; - sector->floor_xoffs += xoffs; - sector->floor_yoffs += yoffs; + sector->floorangle = flatangle; + sector->floorxoffset += xoffs; + sector->flooryoffset += yoffs; } if (ceiling) { - sector->ceilingpic_angle = flatangle; - sector->ceiling_xoffs += xoffs; - sector->ceiling_yoffs += yoffs; + sector->ceilingangle = flatangle; + sector->ceilingxoffset += xoffs; + sector->ceilingyoffset += yoffs; } } @@ -7349,14 +7349,14 @@ void T_Scroll(scroll_t *s) case sc_floor: // scroll floor texture sec = sectors + s->affectee; - sec->floor_xoffs += dx; - sec->floor_yoffs += dy; + sec->floorxoffset += dx; + sec->flooryoffset += dy; break; case sc_ceiling: // scroll ceiling texture sec = sectors + s->affectee; - sec->ceiling_xoffs += dx; - sec->ceiling_yoffs += dy; + sec->ceilingxoffset += dx; + sec->ceilingyoffset += dy; break; case sc_carry: diff --git a/src/r_bsp.c b/src/r_bsp.c index bf238a435..129c6ba00 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -275,9 +275,9 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel, tempsec->ceilingheight = s->floorheight - 1, !back)) || viewz <= s->floorheight) { // head-below-floor hack tempsec->floorpic = s->floorpic; - tempsec->floor_xoffs = s->floor_xoffs; - tempsec->floor_yoffs = s->floor_yoffs; - tempsec->floorpic_angle = s->floorpic_angle; + tempsec->floorxoffset = s->floorxoffset; + tempsec->flooryoffset = s->flooryoffset; + tempsec->floorangle = s->floorangle; if (underwater) { @@ -285,16 +285,16 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel, { tempsec->floorheight = tempsec->ceilingheight+1; tempsec->ceilingpic = tempsec->floorpic; - tempsec->ceiling_xoffs = tempsec->floor_xoffs; - tempsec->ceiling_yoffs = tempsec->floor_yoffs; - tempsec->ceilingpic_angle = tempsec->floorpic_angle; + tempsec->ceilingxoffset = tempsec->floorxoffset; + tempsec->ceilingyoffset = tempsec->flooryoffset; + tempsec->ceilingangle = tempsec->floorangle; } else { tempsec->ceilingpic = s->ceilingpic; - tempsec->ceiling_xoffs = s->ceiling_xoffs; - tempsec->ceiling_yoffs = s->ceiling_yoffs; - tempsec->ceilingpic_angle = s->ceilingpic_angle; + tempsec->ceilingxoffset = s->ceilingxoffset; + tempsec->ceilingyoffset = s->ceilingyoffset; + tempsec->ceilingangle = s->ceilingangle; } } @@ -315,25 +315,25 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel, tempsec->floorheight = s->ceilingheight + 1; tempsec->floorpic = tempsec->ceilingpic = s->ceilingpic; - tempsec->floor_xoffs = tempsec->ceiling_xoffs = s->ceiling_xoffs; - tempsec->floor_yoffs = tempsec->ceiling_yoffs = s->ceiling_yoffs; - tempsec->floorpic_angle = tempsec->ceilingpic_angle = s->ceilingpic_angle; + tempsec->floorxoffset = tempsec->ceilingxoffset = s->ceilingxoffset; + tempsec->flooryoffset = tempsec->ceilingyoffset = s->ceilingyoffset; + tempsec->floorangle = tempsec->ceilingangle = s->ceilingangle; if (s->floorpic == skyflatnum) // SKYFIX? { tempsec->ceilingheight = tempsec->floorheight-1; tempsec->floorpic = tempsec->ceilingpic; - tempsec->floor_xoffs = tempsec->ceiling_xoffs; - tempsec->floor_yoffs = tempsec->ceiling_yoffs; - tempsec->floorpic_angle = tempsec->ceilingpic_angle; + tempsec->floorxoffset = tempsec->ceilingxoffset; + tempsec->flooryoffset = tempsec->ceilingyoffset; + tempsec->floorangle = tempsec->ceilingangle; } else { tempsec->ceilingheight = sec->ceilingheight; tempsec->floorpic = s->floorpic; - tempsec->floor_xoffs = s->floor_xoffs; - tempsec->floor_yoffs = s->floor_yoffs; - tempsec->floorpic_angle = s->floorpic_angle; + tempsec->floorxoffset = s->floorxoffset; + tempsec->flooryoffset = s->flooryoffset; + tempsec->floorangle = s->floorangle; } tempsec->lightlevel = s->lightlevel; @@ -363,12 +363,12 @@ boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back) && back->lightlevel == front->lightlevel && !line->sidedef->midtexture // Check offsets too! - && back->floor_xoffs == front->floor_xoffs - && back->floor_yoffs == front->floor_yoffs - && back->floorpic_angle == front->floorpic_angle - && back->ceiling_xoffs == front->ceiling_xoffs - && back->ceiling_yoffs == front->ceiling_yoffs - && back->ceilingpic_angle == front->ceilingpic_angle + && back->floorxoffset == front->floorxoffset + && back->flooryoffset == front->flooryoffset + && back->floorangle == front->floorangle + && back->ceilingxoffset == front->ceilingxoffset + && back->ceilingyoffset == front->ceilingyoffset + && back->ceilingangle == front->ceilingangle // Consider altered lighting. && back->floorlightlevel == front->floorlightlevel && back->floorlightabsolute == front->floorlightabsolute @@ -909,7 +909,7 @@ static void R_Subsector(size_t num) || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum)) { floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel, - frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL, NULL, frontsector->f_slope); + frontsector->floorxoffset, frontsector->flooryoffset, frontsector->floorangle, floorcolormap, NULL, NULL, frontsector->f_slope); } else floorplane = NULL; @@ -919,7 +919,7 @@ static void R_Subsector(size_t num) || (frontsector->heightsec != -1 && sectors[frontsector->heightsec].floorpic == skyflatnum)) { ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic, - ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle, + ceilinglightlevel, frontsector->ceilingxoffset, frontsector->ceilingyoffset, frontsector->ceilingangle, ceilingcolormap, NULL, NULL, frontsector->c_slope); } else @@ -1033,8 +1033,8 @@ static void R_Subsector(size_t num) { light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, - (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floor_xoffs, polysec->floor_yoffs, - polysec->floorpic_angle-po->angle, + (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->floorxoffset, polysec->flooryoffset, + polysec->floorangle-po->angle, (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, NULL); // will ffloors be slopable eventually? @@ -1057,7 +1057,7 @@ static void R_Subsector(size_t num) { light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, - (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceiling_xoffs, polysec->ceiling_yoffs, polysec->ceilingpic_angle-po->angle, + (light == -1 ? frontsector->lightlevel : *frontsector->lightlist[light].lightlevel), polysec->ceilingxoffset, polysec->ceilingyoffset, polysec->ceilingangle-po->angle, (light == -1 ? frontsector->extra_colormap : *frontsector->lightlist[light].extra_colormap), NULL, po, NULL); // will ffloors be slopable eventually? diff --git a/src/r_defs.h b/src/r_defs.h index dbede806e..7da162de7 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -423,12 +423,12 @@ typedef struct sector_s void *fadecolormapdata; // fade colormap thinker // floor and ceiling texture offsets - fixed_t floor_xoffs, floor_yoffs; - fixed_t ceiling_xoffs, ceiling_yoffs; + fixed_t floorxoffset, flooryoffset; + fixed_t ceilingxoffset, ceilingyoffset; // flat angle - angle_t floorpic_angle; - angle_t ceilingpic_angle; + angle_t floorangle; + angle_t ceilingangle; INT32 heightsec; // other sector, or -1 if no other sector INT32 camsec; // used for camera clipping diff --git a/src/r_fps.c b/src/r_fps.c index 2d30c9f01..3d7d3f7ae 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -426,8 +426,8 @@ void R_CreateInterpolator_SectorScroll(thinker_t *thinker, sector_t *sector, boo } else { - interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs = sector->floor_xoffs; - interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs = sector->floor_yoffs; + interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs = sector->floorxoffset; + interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs = sector->flooryoffset; } } @@ -490,9 +490,9 @@ static void UpdateLevelInterpolatorState(levelinterpolator_t *interp) break; case LVLINTERP_SectorScroll: interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs; - interp->sectorscroll.bakxoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_xoffs : interp->sectorscroll.sector->floor_xoffs; + interp->sectorscroll.bakxoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_xoffs : interp->sectorscroll.sector->floorxoffset; interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs; - interp->sectorscroll.bakyoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_yoffs : interp->sectorscroll.sector->floor_yoffs; + interp->sectorscroll.bakyoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_yoffs : interp->sectorscroll.sector->flooryoffset; break; case LVLINTERP_SideScroll: interp->sidescroll.oldtextureoffset = interp->sidescroll.baktextureoffset; @@ -583,8 +583,8 @@ void R_ApplyLevelInterpolators(fixed_t frac) } else { - interp->sectorscroll.sector->floor_xoffs = R_LerpFixed(interp->sectorscroll.oldxoffs, interp->sectorscroll.bakxoffs, frac); - interp->sectorscroll.sector->floor_yoffs = R_LerpFixed(interp->sectorscroll.oldyoffs, interp->sectorscroll.bakyoffs, frac); + interp->sectorscroll.sector->floorxoffset = R_LerpFixed(interp->sectorscroll.oldxoffs, interp->sectorscroll.bakxoffs, frac); + interp->sectorscroll.sector->flooryoffset = R_LerpFixed(interp->sectorscroll.oldyoffs, interp->sectorscroll.bakyoffs, frac); } break; case LVLINTERP_SideScroll: @@ -638,8 +638,8 @@ void R_RestoreLevelInterpolators(void) } else { - interp->sectorscroll.sector->floor_xoffs = interp->sectorscroll.bakxoffs; - interp->sectorscroll.sector->floor_yoffs = interp->sectorscroll.bakyoffs; + interp->sectorscroll.sector->floorxoffset = interp->sectorscroll.bakxoffs; + interp->sectorscroll.sector->flooryoffset = interp->sectorscroll.bakyoffs; } break; case LVLINTERP_SideScroll: diff --git a/src/r_segs.c b/src/r_segs.c index 43a7f945f..681524054 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1906,9 +1906,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) || backsector->floorpic != frontsector->floorpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. - || backsector->floor_xoffs != frontsector->floor_xoffs - || backsector->floor_yoffs != frontsector->floor_yoffs - || backsector->floorpic_angle != frontsector->floorpic_angle + || backsector->floorxoffset != frontsector->floorxoffset + || backsector->flooryoffset != frontsector->flooryoffset + || backsector->floorangle != frontsector->floorangle //SoM: 3/22/2000: Prevents bleeding. || (frontsector->heightsec != -1 && frontsector->floorpic != skyflatnum) || backsector->floorlightlevel != frontsector->floorlightlevel @@ -1939,9 +1939,9 @@ void R_StoreWallRange(INT32 start, INT32 stop) || backsector->ceilingpic != frontsector->ceilingpic || backsector->lightlevel != frontsector->lightlevel //SoM: 3/22/2000: Check floor x and y offsets. - || backsector->ceiling_xoffs != frontsector->ceiling_xoffs - || backsector->ceiling_yoffs != frontsector->ceiling_yoffs - || backsector->ceilingpic_angle != frontsector->ceilingpic_angle + || backsector->ceilingxoffset != frontsector->ceilingxoffset + || backsector->ceilingyoffset != frontsector->ceilingyoffset + || backsector->ceilingangle != frontsector->ceilingangle //SoM: 3/22/2000: Prevents bleeding. || (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum) || backsector->ceilinglightlevel != frontsector->ceilinglightlevel From c5daa248d16f803cf16b0836980cadf973e758e9 Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Fri, 25 Nov 2022 23:06:07 +0000 Subject: [PATCH 6/8] r_fps.c ceiling_y/xoffs renamed --- src/r_fps.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/r_fps.c b/src/r_fps.c index 3d7d3f7ae..661da8ba2 100644 --- a/src/r_fps.c +++ b/src/r_fps.c @@ -421,8 +421,8 @@ void R_CreateInterpolator_SectorScroll(thinker_t *thinker, sector_t *sector, boo interp->sectorscroll.ceiling = ceiling; if (ceiling) { - interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs = sector->ceiling_xoffs; - interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs = sector->ceiling_yoffs; + interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs = sector->ceilingxoffset; + interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs = sector->ceilingyoffset; } else { @@ -490,9 +490,9 @@ static void UpdateLevelInterpolatorState(levelinterpolator_t *interp) break; case LVLINTERP_SectorScroll: interp->sectorscroll.oldxoffs = interp->sectorscroll.bakxoffs; - interp->sectorscroll.bakxoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_xoffs : interp->sectorscroll.sector->floorxoffset; + interp->sectorscroll.bakxoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceilingxoffset : interp->sectorscroll.sector->floorxoffset; interp->sectorscroll.oldyoffs = interp->sectorscroll.bakyoffs; - interp->sectorscroll.bakyoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceiling_yoffs : interp->sectorscroll.sector->flooryoffset; + interp->sectorscroll.bakyoffs = interp->sectorscroll.ceiling ? interp->sectorscroll.sector->ceilingyoffset : interp->sectorscroll.sector->flooryoffset; break; case LVLINTERP_SideScroll: interp->sidescroll.oldtextureoffset = interp->sidescroll.baktextureoffset; @@ -578,8 +578,8 @@ void R_ApplyLevelInterpolators(fixed_t frac) case LVLINTERP_SectorScroll: if (interp->sectorscroll.ceiling) { - interp->sectorscroll.sector->ceiling_xoffs = R_LerpFixed(interp->sectorscroll.oldxoffs, interp->sectorscroll.bakxoffs, frac); - interp->sectorscroll.sector->ceiling_yoffs = R_LerpFixed(interp->sectorscroll.oldyoffs, interp->sectorscroll.bakyoffs, frac); + interp->sectorscroll.sector->ceilingxoffset = R_LerpFixed(interp->sectorscroll.oldxoffs, interp->sectorscroll.bakxoffs, frac); + interp->sectorscroll.sector->ceilingyoffset = R_LerpFixed(interp->sectorscroll.oldyoffs, interp->sectorscroll.bakyoffs, frac); } else { @@ -633,8 +633,8 @@ void R_RestoreLevelInterpolators(void) case LVLINTERP_SectorScroll: if (interp->sectorscroll.ceiling) { - interp->sectorscroll.sector->ceiling_xoffs = interp->sectorscroll.bakxoffs; - interp->sectorscroll.sector->ceiling_yoffs = interp->sectorscroll.bakyoffs; + interp->sectorscroll.sector->ceilingxoffset = interp->sectorscroll.bakxoffs; + interp->sectorscroll.sector->ceilingyoffset = interp->sectorscroll.bakyoffs; } else { From 656f7f94acf7390a17aff9b4a4fd92771ea5953b Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Fri, 25 Nov 2022 23:06:22 +0000 Subject: [PATCH 7/8] hw_main.c ceiling_y/xoffs renamed --- src/hardware/hw_main.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 2b376544a..c1043f8bb 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -465,8 +465,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool } else // it's a ceiling { - scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatheight; + scrollx = FIXED_TO_FLOAT(FOFsector->ceilingxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(FOFsector->ceilingyoffset)/fflatheight; angle = FOFsector->ceilingangle; } } @@ -480,8 +480,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool } else // it's a ceiling { - scrollx = FIXED_TO_FLOAT(gl_frontsector->ceiling_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(gl_frontsector->ceiling_yoffs)/fflatheight; + scrollx = FIXED_TO_FLOAT(gl_frontsector->ceilingxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(gl_frontsector->ceilingyoffset)/fflatheight; angle = gl_frontsector->ceilingangle; } } @@ -2725,8 +2725,8 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, } else // it's a ceiling { - scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatheight; + scrollx = FIXED_TO_FLOAT(FOFsector->ceilingxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(FOFsector->ceilingyoffset)/fflatheight; angle = FOFsector->ceilingangle; } } @@ -2740,8 +2740,8 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, } else // it's a ceiling { - scrollx = FIXED_TO_FLOAT(gl_frontsector->ceiling_xoffs)/fflatwidth; - scrolly = FIXED_TO_FLOAT(gl_frontsector->ceiling_yoffs)/fflatheight; + scrollx = FIXED_TO_FLOAT(gl_frontsector->ceilingxoffset)/fflatwidth; + scrolly = FIXED_TO_FLOAT(gl_frontsector->ceilingyoffset)/fflatheight; angle = gl_frontsector->ceilingangle; } } From da9786b593040200fe56f6771e58ed6a16a01ed2 Mon Sep 17 00:00:00 2001 From: Ace Lite Date: Fri, 25 Nov 2022 23:16:11 +0000 Subject: [PATCH 8/8] exposed floorlightsec, ceilinglightsec variables. --- src/lua_maplib.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 79909a6be..d3a00782b 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -43,8 +43,10 @@ enum sector_e { sector_lightlevel, sector_floorlightlevel, sector_floorlightabsolute, + sector_floorlightsec, sector_ceilinglightlevel, sector_ceilinglightabsolute, + sector_ceilinglightsec, sector_special, sector_tag, sector_taglist, @@ -79,8 +81,10 @@ static const char *const sector_opt[] = { "lightlevel", "floorlightlevel", "floorlightabsolute", + "floorlightsec", "ceilinglightlevel", "ceilinglightabsolute", + "ceilinglightsec", "special", "tag", "taglist", @@ -667,12 +671,18 @@ static int sector_get(lua_State *L) case sector_floorlightabsolute: lua_pushboolean(L, sector->floorlightabsolute); return 1; + case sector_floorlightsec: + lua_pushinteger(L, sector->floorlightsec); + return 1; case sector_ceilinglightlevel: lua_pushinteger(L, sector->ceilinglightlevel); return 1; case sector_ceilinglightabsolute: lua_pushboolean(L, sector->ceilinglightabsolute); return 1; + case sector_ceilinglightsec: + lua_pushinteger(L, sector->ceilinglightsec); + return 1; case sector_special: lua_pushinteger(L, sector->special); return 1; @@ -801,7 +811,7 @@ static int sector_set(lua_State *L) break; case sector_floorangle: sector->floorangle = luaL_checkangle(L, 3); - break; + break; case sector_ceilingpic: sector->ceilingpic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; @@ -823,12 +833,18 @@ static int sector_set(lua_State *L) case sector_floorlightabsolute: sector->floorlightabsolute = luaL_checkboolean(L, 3); break; + case sector_floorlightsec: + sector->floorlightsec = (INT32)luaL_checkinteger(L, 3); + break; case sector_ceilinglightlevel: sector->ceilinglightlevel = (INT16)luaL_checkinteger(L, 3); break; case sector_ceilinglightabsolute: sector->ceilinglightabsolute = luaL_checkboolean(L, 3); break; + case sector_ceilinglightsec: + sector->ceilinglightsec = (INT32)luaL_checkinteger(L, 3); + break; case sector_special: sector->special = (INT16)luaL_checkinteger(L, 3); break;