From b564a169d80a0ff6db33de6e03f505803d8f05cf Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 17 Jun 2015 21:00:10 +0100 Subject: [PATCH 001/109] Starting work for getting sector.lines in Lua: it WORKS at the least, but I have no way to determine the size of the array itself as of yet --- src/lua_libs.h | 1 + src/lua_maplib.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/src/lua_libs.h b/src/lua_libs.h index d19ad885..25552eac 100644 --- a/src/lua_libs.h +++ b/src/lua_libs.h @@ -42,6 +42,7 @@ extern lua_State *gL; #define META_CVAR "CONSVAR_T*" +#define META_SECTORLINES "SECTOR_T*LINES" #define META_SIDENUM "LINE_T*SIDENUM" #define META_HUDINFO "HUDINFO_T*" diff --git a/src/lua_maplib.c b/src/lua_maplib.c index e5cc30c1..40acc6df 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -37,6 +37,7 @@ enum sector_e { sector_thinglist, sector_heightsec, sector_camsec, + sector_lines, sector_ffloors }; @@ -52,6 +53,7 @@ static const char *const sector_opt[] = { "thinglist", "heightsec", "camsec", + "lines", "ffloors", NULL}; @@ -260,6 +262,49 @@ static int sector_iterate(lua_State *L) return 3; } +// sector.lines, i -> sector.lines[i] +// sector.lines.valid, for validity checking +static int sectorlines_get(lua_State *L) +{ + line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); + size_t i; + //size_t numoflines; + lua_settop(L, 2); + if (!lua_isnumber(L, 2)) + { + int field = luaL_checkoption(L, 2, NULL, valid_opt); + if (!seclines) + { + if (field == 0) { + lua_pushboolean(L, 0); + return 1; + } + return luaL_error(L, "accessed sector_t doesn't exist anymore."); + } else if (field == 0) { + lua_pushboolean(L, 1); + return 1; + } + } + + /* \TODO: figure out how to find size of seclines array, rather than the size of a pointer! + Testing for sectors[0].lines in GFZ1 with a test Lua script: + sizeof(seclines) returns 4 + sizeof(*seclines) returns 4 + sizeof(**seclines) returns 84, presumably the size of line_t + You can probably see why I haven't been successful yet, hopefully + //CONS_Printf("sizeof(seclines): %d\n", sizeof(seclines)); + //CONS_Printf("sizeof(seclines[0]): %d\n", sizeof(seclines[0]));*/ + + /*numoflines = sizeof(seclines) / sizeof(seclines[0]); + if (!numoflines) + return luaL_error(L, "no lines found!");*/ + i = (size_t)lua_tointeger(L, 2); + /*if (i > numoflines) + return 0;*/ + LUA_PushUserdata(L, seclines[i], META_LINE); + return 1; +} + static int sector_get(lua_State *L) { sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); @@ -325,6 +370,9 @@ static int sector_get(lua_State *L) return 0; LUA_PushUserdata(L, §ors[sector->camsec], META_SECTOR); return 1; + case sector_lines: // lines + LUA_PushUserdata(L, sector->lines, META_SECTORLINES); + return 1; case sector_ffloors: // ffloors lua_pushcfunction(L, lib_iterateSectorFFloors); LUA_PushUserdata(L, sector->ffloors, META_FFLOOR); @@ -1178,6 +1226,11 @@ static int mapheaderinfo_get(lua_State *L) int LUA_MapLib(lua_State *L) { + luaL_newmetatable(L, META_SECTORLINES); + lua_pushcfunction(L, sectorlines_get); + lua_setfield(L, -2, "__index"); + lua_pop(L, 1); + luaL_newmetatable(L, META_SECTOR); lua_pushcfunction(L, sector_get); lua_setfield(L, -2, "__index"); From af3c4755dc1c26c003d595474799560eba83b964 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 17 Jan 2016 19:43:26 +0000 Subject: [PATCH 002/109] All lumps with the "SOC_" prefix in their names are now read as SOCs. --- src/w_wad.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/w_wad.c b/src/w_wad.c index 9d6a11fb..39bde4bb 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -147,6 +147,16 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum) } #endif + { + lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; + for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) + if (memcmp(lump_p->name,"SOC_",4)==0) + { + CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } + } + // Check for MAINCFG for (lump = 0;lump != INT16_MAX;lump++) { From 79e3e2351d17f4f223d75295635122257219242d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jan 2016 14:56:52 +0000 Subject: [PATCH 003/109] Finally bothered to add in a method to obtain sector.lines' size internally to prevent going out of bounds. Admittedly I knew of this particular method from the start but wanted to avoid it in favour of a less-hacky looking method of getting sector.lines' size ...but there was none to be found at all. --- src/lua_maplib.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 1307540f..77651b20 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -268,7 +268,7 @@ static int sectorlines_get(lua_State *L) { line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); size_t i; - //size_t numoflines; + size_t numoflines = 0; lua_settop(L, 2); if (!lua_isnumber(L, 2)) { @@ -286,21 +286,22 @@ static int sectorlines_get(lua_State *L) } } - /* \TODO: figure out how to find size of seclines array, rather than the size of a pointer! - Testing for sectors[0].lines in GFZ1 with a test Lua script: - sizeof(seclines) returns 4 - sizeof(*seclines) returns 4 - sizeof(**seclines) returns 84, presumably the size of line_t - You can probably see why I haven't been successful yet, hopefully - //CONS_Printf("sizeof(seclines): %d\n", sizeof(seclines)); - //CONS_Printf("sizeof(seclines[0]): %d\n", sizeof(seclines[0]));*/ + // check first linedef to figure which of its sectors owns this sector->lines pointer + // then check that sector's linecount to get a maximum index + //if (!seclines[0]) + //return luaL_error(L, "no lines found!"); // no first linedef????? + if (seclines[0]->frontsector->lines == seclines) + numoflines = seclines[0]->frontsector->linecount; + else if (seclines[0]->backsector && seclines[0]->backsector->lines == seclines) // check backsector exists first + numoflines = seclines[0]->backsector->linecount; + //if neither sector has it then ??? - /*numoflines = sizeof(seclines) / sizeof(seclines[0]); if (!numoflines) - return luaL_error(L, "no lines found!");*/ + return luaL_error(L, "no lines found!"); + i = (size_t)lua_tointeger(L, 2); - /*if (i > numoflines) - return 0;*/ + if (i >= numoflines) + return 0; LUA_PushUserdata(L, seclines[i], META_LINE); return 1; } From 5abdb08a25da14e1378adb937a4418e92dfcc609 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 20 Jan 2016 16:03:17 +0000 Subject: [PATCH 004/109] #sector.lines now returns the number of linedefs in the sector --- src/lua_maplib.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 77651b20..d585c479 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -306,6 +306,23 @@ static int sectorlines_get(lua_State *L) return 1; } +static int sectorlines_num(lua_State *L) +{ + line_t **seclines = *((line_t ***)luaL_checkudata(L, 1, META_SECTORLINES)); + size_t numoflines = 0; + // check first linedef to figure which of its sectors owns this sector->lines pointer + // then check that sector's linecount to get a maximum index + //if (!seclines[0]) + //return luaL_error(L, "no lines found!"); // no first linedef????? + if (seclines[0]->frontsector->lines == seclines) + numoflines = seclines[0]->frontsector->linecount; + else if (seclines[0]->backsector && seclines[0]->backsector->lines == seclines) // check backsector exists first + numoflines = seclines[0]->backsector->linecount; + //if neither sector has it then ??? + lua_pushinteger(L, numoflines); + return 1; +} + static int sector_get(lua_State *L) { sector_t *sector = *((sector_t **)luaL_checkudata(L, 1, META_SECTOR)); @@ -1282,6 +1299,9 @@ int LUA_MapLib(lua_State *L) luaL_newmetatable(L, META_SECTORLINES); lua_pushcfunction(L, sectorlines_get); lua_setfield(L, -2, "__index"); + + lua_pushcfunction(L, sectorlines_num); + lua_setfield(L, -2, "__len"); lua_pop(L, 1); luaL_newmetatable(L, META_SECTOR); From cd198d6809d171ac242b0bfe7db768a04e135003 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 30 Jan 2016 17:19:05 +0000 Subject: [PATCH 005/109] merge SOC_****, MAINCFG and OBJCTCFG searches into one big search for any of them This makes it so that it doesn't matter what order you place SOC lumps within a WAD... relative to other SOC lumps at least, anyway --- src/w_wad.c | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 39bde4bb..dc994e84 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -150,31 +150,21 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum) { lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) - if (memcmp(lump_p->name,"SOC_",4)==0) + if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump { CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfiles[wadnum]->filename); DEH_LoadDehackedLumpPwad(wadnum, lump); } - } - - // Check for MAINCFG - for (lump = 0;lump != INT16_MAX;lump++) - { - lump = W_CheckNumForNamePwad("MAINCFG", wadnum, lump); - if (lump == INT16_MAX) - break; - CONS_Printf(M_GetText("Loading main config from %s\n"), wadfiles[wadnum]->filename); - DEH_LoadDehackedLumpPwad(wadnum, lump); - } - - // Check for OBJCTCFG - for (lump = 0;lump < INT16_MAX;lump++) - { - lump = W_CheckNumForNamePwad("OBJCTCFG", wadnum, lump); - if (lump == INT16_MAX) - break; - CONS_Printf(M_GetText("Loading object config from %s\n"), wadfiles[wadnum]->filename); - DEH_LoadDehackedLumpPwad(wadnum, lump); + else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG + { + CONS_Printf(M_GetText("Loading main config from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } + else if (memcmp(lump_p->name,"OBJCTCFG",8)==0) // Check for OBJCTCFG + { + CONS_Printf(M_GetText("Loading object config from %s\n"), wadfiles[wadnum]->filename); + DEH_LoadDehackedLumpPwad(wadnum, lump); + } } #ifdef SCANTHINGS From dafe0ccd11b321546dbf5728d510c98f51db2ce0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 21:53:14 +0000 Subject: [PATCH 006/109] Added v.width(), v.height() and v.renderer() to Lua's drawer/video library --- src/lua_hudlib.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 5a83d95b..fa15b9be 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -16,7 +16,9 @@ #include "r_local.h" #include "st_stuff.h" // hudinfo[] #include "g_game.h" +#include "i_video.h" // rendermode #include "p_local.h" // camera_t +#include "screen.h" // screen width/height #include "v_video.h" #include "w_wad.h" #include "z_zone.h" @@ -510,6 +512,30 @@ static int libd_getColormap(lua_State *L) return 1; } +static int libd_width(lua_State *L) +{ + HUDONLY + lua_pushinteger(L, vid.width); // push screen width + return 1; +} + +static int libd_height(lua_State *L) +{ + HUDONLY + lua_pushinteger(L, vid.height); // push screen height + return 1; +} + +static int libd_renderer(lua_State *L) +{ + HUDONLY + if (rendermode == render_opengl) // OpenGL renderer + lua_pushliteral(L, "opengl"); + else // Software renderer + lua_pushliteral(L, "software"); + return 1; +} + static luaL_Reg lib_draw[] = { {"patchExists", libd_patchExists}, {"cachePatch", libd_cachePatch}, @@ -521,6 +547,9 @@ static luaL_Reg lib_draw[] = { {"drawString", libd_drawString}, {"stringWidth", libd_stringWidth}, {"getColormap", libd_getColormap}, + {"width", libd_width}, + {"height", libd_height}, + {"renderer", libd_renderer}, {NULL, NULL} }; From 04528eb3e64e931588e33c48d58a2c3201875e00 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 22:15:17 +0000 Subject: [PATCH 007/109] MonsterIestyn: what about render_none? --- src/lua_hudlib.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index fa15b9be..0ba7b3d2 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -529,10 +529,11 @@ static int libd_height(lua_State *L) static int libd_renderer(lua_State *L) { HUDONLY - if (rendermode == render_opengl) // OpenGL renderer - lua_pushliteral(L, "opengl"); - else // Software renderer - lua_pushliteral(L, "software"); + switch (rendermode) { + case render_opengl: lua_pushliteral(L, "opengl"); break; // OpenGL renderer + case render_soft: lua_pushliteral(L, "software"); break; // Software renderer + default: lua_pushliteral(L, "none"); break; // render_none (for dedicated), in case there's any reason this should be run + } return 1; } From d1b89c9320f98cfe2bf514fe7dbd1890c4f21403 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 31 Jan 2016 22:52:02 +0000 Subject: [PATCH 008/109] Quick fix for another drawer lib function while I'm here, cough --- src/lua_hudlib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 0ba7b3d2..325f00b0 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -488,7 +488,7 @@ static int libd_getColormap(lua_State *L) INT32 skinnum = TC_DEFAULT; skincolors_t color = luaL_optinteger(L, 2, 0); UINT8* colormap = NULL; - //HUDSAFE + HUDONLY if (lua_isnoneornil(L, 1)) ; // defaults to TC_DEFAULT else if (lua_type(L, 1) == LUA_TNUMBER) // skin number From 9973bedd5f3711773b5b5f2e276e400893398b99 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 5 Feb 2016 16:38:33 +0000 Subject: [PATCH 009/109] Free the memory of all clipping arrays for each portal properly Not the actual fix I'm intending to make with this branch, but it's needed anyway --- src/r_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r_main.c b/src/r_main.c index a4e72cba..ccaa14b8 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1360,6 +1360,9 @@ void R_RenderPlayerView(player_t *player) // okay done. free it. portalcullsector = NULL; // Just in case... portal_base = portal->next; + Z_Free(portal->ceilingclip); + Z_Free(portal->floorclip); + Z_Free(portal->frontscale); Z_Free(portal); } // END PORTAL RENDERING From 166fafd71708553539c753783b924496387ba4d0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 6 Feb 2016 18:57:26 +0000 Subject: [PATCH 010/109] Fixed div-by-zero crash relating to portals, drawsegs and midtextures Had to remove Red's scale hack in order to do so, because it utterly fails when the drawseg doesn't actually belong to the portal in the first place. --- src/r_bsp.c | 4 +++- src/r_bsp.h | 1 + src/r_defs.h | 2 ++ src/r_main.c | 11 +---------- src/r_segs.c | 5 +++++ src/r_things.c | 3 +++ 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index c87d8baa..52be9a0e 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -26,6 +26,7 @@ side_t *sidedef; line_t *linedef; sector_t *frontsector; sector_t *backsector; +boolean portalline; // is curline a portal seg? // very ugly realloc() of drawsegs at run-time, I upped it to 512 // instead of 256.. and someone managed to send me a level with @@ -378,6 +379,7 @@ static void R_AddLine(seg_t *line) return; curline = line; + portalline = false; // OPTIMIZE: quickly reject orthogonal back sides. angle1 = R_PointToAngle(line->v1->x, line->v1->y); @@ -431,7 +433,7 @@ static void R_AddLine(seg_t *line) backsector = line->backsector; // Portal line - if (line->linedef->special == 40 && P_PointOnLineSide(viewx, viewy, line->linedef) == 0) + if (line->linedef->special == 40 && line->side == 0) { if (portalrender < cv_maxportals.value) { diff --git a/src/r_bsp.h b/src/r_bsp.h index 14b11ea7..3d0429fe 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -23,6 +23,7 @@ extern side_t *sidedef; extern line_t *linedef; extern sector_t *frontsector; extern sector_t *backsector; +extern boolean portalline; // is curline a portal seg? // drawsegs are allocated on the fly... see r_segs.c diff --git a/src/r_defs.h b/src/r_defs.h index f18410fe..a982a598 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -675,6 +675,8 @@ typedef struct drawseg_s INT32 numthicksides; fixed_t frontscale[MAXVIDWIDTH]; + UINT8 portalpass; // if > 0 and == portalrender, do not clip sprites + #ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures diff --git a/src/r_main.c b/src/r_main.c index ccaa14b8..a6b13302 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -91,7 +91,6 @@ typedef struct portal_pair INT16 *ceilingclip; INT16 *floorclip; fixed_t *frontscale; - size_t seg; } portal_pair; portal_pair *portal_base, *portal_cap; line_t *portalclipline; @@ -1230,7 +1229,7 @@ void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2) portal->start = x1; portal->end = x2; - portal->seg = ds_p-drawsegs; + portalline = true; // this tells R_StoreWallRange that curline is a portal seg portal->viewx = viewx; portal->viewy = viewy; @@ -1344,14 +1343,6 @@ void R_RenderPlayerView(player_t *player) validcount++; - if (portal->seg) - { - // Push the portal's old drawseg out of the way so it isn't interfering with sprite clipping. -Red - drawseg_t *seg = drawsegs+portal->seg; - seg->scale1 = 0; - seg->scale2 = 0; - } - R_RenderBSPNode((INT32)numnodes - 1); R_ClipSprites(); //R_DrawPlanes(); diff --git a/src/r_segs.c b/src/r_segs.c index 04873b29..0106a1ba 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2887,6 +2887,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) R_RenderSegLoop(); colfunc = wallcolfunc; + if (portalline) // if curline is a portal, set portalrender for drawseg + ds_p->portalpass = portalrender+1; + else + ds_p->portalpass = 0; + // save sprite clipping info if (((ds_p->silhouette & SIL_TOP) || maskedtexture) && !ds_p->sprtopclip) { diff --git a/src/r_things.c b/src/r_things.c index 2a3f8e77..667a26e0 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2058,6 +2058,9 @@ void R_ClipSprites(void) continue; } + if (ds->portalpass > 0 && ds->portalpass == portalrender) + continue; // is a portal + r1 = ds->x1 < spr->x1 ? spr->x1 : ds->x1; r2 = ds->x2 > spr->x2 ? spr->x2 : ds->x2; From ae2b1e8ea1ba860107d036e316011f0427ec329d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 6 Feb 2016 21:06:52 +0000 Subject: [PATCH 011/109] Use <= instead of ==, so that sprites for second-tier portals and beyond still display thx Red for spotting this --- src/r_defs.h | 2 +- src/r_things.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_defs.h b/src/r_defs.h index a982a598..107b8a83 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -675,7 +675,7 @@ typedef struct drawseg_s INT32 numthicksides; fixed_t frontscale[MAXVIDWIDTH]; - UINT8 portalpass; // if > 0 and == portalrender, do not clip sprites + UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping #ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures diff --git a/src/r_things.c b/src/r_things.c index 667a26e0..3767b02b 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2058,7 +2058,7 @@ void R_ClipSprites(void) continue; } - if (ds->portalpass > 0 && ds->portalpass == portalrender) + if (ds->portalpass > 0 && ds->portalpass <= portalrender) continue; // is a portal r1 = ds->x1 < spr->x1 ? spr->x1 : ds->x1; From 1bdd4cf641a1116097c7081f365962c80b8bf3a3 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Tue, 9 Feb 2016 02:39:16 -0800 Subject: [PATCH 012/109] backport state-animations from internal master to public next most other code in the branch did not come along for the ride. --- src/dehacked.c | 614 +++-------------------------------- src/info.c | 802 ++++++++-------------------------------------- src/info.h | 613 +++-------------------------------- src/lua_mobjlib.c | 8 + src/p_local.h | 1 + src/p_mobj.c | 159 +++++---- src/p_mobj.h | 4 +- src/p_pspr.h | 6 +- src/p_saveg.c | 11 + src/p_tick.c | 2 + 10 files changed, 341 insertions(+), 1879 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 44ef998a..a29f3875 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -4588,30 +4588,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_MSSHIELD_F12", // Ring - "S_RING1", - "S_RING2", - "S_RING3", - "S_RING4", - "S_RING5", - "S_RING6", - "S_RING7", - "S_RING8", - "S_RING9", - "S_RING10", - "S_RING11", - "S_RING12", - "S_RING13", - "S_RING14", - "S_RING15", - "S_RING16", - "S_RING17", - "S_RING18", - "S_RING19", - "S_RING20", - "S_RING21", - "S_RING22", - "S_RING23", - "S_RING24", + "S_RING", // Blue Sphere for special stages "S_BLUEBALL", @@ -4627,39 +4604,10 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_GRAVWELLRED3", // Individual Team Rings - "S_TEAMRING1", - "S_TEAMRING2", - "S_TEAMRING3", - "S_TEAMRING4", - "S_TEAMRING5", - "S_TEAMRING6", - "S_TEAMRING7", - "S_TEAMRING8", - "S_TEAMRING9", - "S_TEAMRING10", - "S_TEAMRING11", - "S_TEAMRING12", - "S_TEAMRING13", - "S_TEAMRING14", - "S_TEAMRING15", - "S_TEAMRING16", - "S_TEAMRING17", - "S_TEAMRING18", - "S_TEAMRING19", - "S_TEAMRING20", - "S_TEAMRING21", - "S_TEAMRING22", - "S_TEAMRING23", - "S_TEAMRING24", + "S_TEAMRING", // Special Stage Token - "S_EMMY1", - "S_EMMY2", - "S_EMMY3", - "S_EMMY4", - "S_EMMY5", - "S_EMMY6", - "S_EMMY7", + "S_EMMY", // Special Stage Token "S_TOKEN", @@ -4813,40 +4761,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SPIKED2", // Starpost - "S_STARPOST1", - "S_STARPOST2", - "S_STARPOST3", - "S_STARPOST4", - "S_STARPOST5", - "S_STARPOST6", - "S_STARPOST7", - "S_STARPOST8", - "S_STARPOST9", - "S_STARPOST10", - "S_STARPOST11", - "S_STARPOST12", - "S_STARPOST13", - "S_STARPOST14", - "S_STARPOST15", - "S_STARPOST16", - "S_STARPOST17", - "S_STARPOST18", - "S_STARPOST19", - "S_STARPOST20", - "S_STARPOST21", - "S_STARPOST22", - "S_STARPOST23", - "S_STARPOST24", - "S_STARPOST25", - "S_STARPOST26", - "S_STARPOST27", - "S_STARPOST28", - "S_STARPOST29", - "S_STARPOST30", - "S_STARPOST31", - "S_STARPOST32", - "S_STARPOST33", - "S_STARPOST34", + "S_STARPOST_IDLE", + "S_STARPOST_FLASH", + "S_STARPOST_SPIN", // Big floating mine "S_BIGMINE1", @@ -5454,38 +5371,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_PITY10", // Invincibility Sparkles - "S_IVSP1", - "S_IVSP2", - "S_IVSP3", - "S_IVSP4", - "S_IVSP5", - "S_IVSP6", - "S_IVSP7", - "S_IVSP8", - "S_IVSP9", - "S_IVSP10", - "S_IVSP11", - "S_IVSP12", - "S_IVSP13", - "S_IVSP14", - "S_IVSP15", - "S_IVSP16", - "S_IVSP17", - "S_IVSP18", - "S_IVSP19", - "S_IVSP20", - "S_IVSP21", - "S_IVSP22", - "S_IVSP23", - "S_IVSP24", - "S_IVSP25", - "S_IVSP26", - "S_IVSP27", - "S_IVSP28", - "S_IVSP29", - "S_IVSP30", - "S_IVSP31", - "S_IVSP32", + "S_IVSP", // Super Sonic Spark "S_SSPK1", @@ -5672,283 +5558,17 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RRNG6", "S_RRNG7", - // Bounce Ring - "S_BOUNCERING1", - "S_BOUNCERING2", - "S_BOUNCERING3", - "S_BOUNCERING4", - "S_BOUNCERING5", - "S_BOUNCERING6", - "S_BOUNCERING7", - "S_BOUNCERING8", - "S_BOUNCERING9", - "S_BOUNCERING10", - "S_BOUNCERING11", - "S_BOUNCERING12", - "S_BOUNCERING13", - "S_BOUNCERING14", - "S_BOUNCERING15", - "S_BOUNCERING16", - "S_BOUNCERING17", - "S_BOUNCERING18", - "S_BOUNCERING19", - "S_BOUNCERING20", - "S_BOUNCERING21", - "S_BOUNCERING22", - "S_BOUNCERING23", - "S_BOUNCERING24", - "S_BOUNCERING25", - "S_BOUNCERING26", - "S_BOUNCERING27", - "S_BOUNCERING28", - "S_BOUNCERING29", - "S_BOUNCERING30", - "S_BOUNCERING31", - "S_BOUNCERING32", - "S_BOUNCERING33", - "S_BOUNCERING34", - "S_BOUNCERING35", - - // Rail Ring - "S_RAILRING1", - "S_RAILRING2", - "S_RAILRING3", - "S_RAILRING4", - "S_RAILRING5", - "S_RAILRING6", - "S_RAILRING7", - "S_RAILRING8", - "S_RAILRING9", - "S_RAILRING10", - "S_RAILRING11", - "S_RAILRING12", - "S_RAILRING13", - "S_RAILRING14", - "S_RAILRING15", - "S_RAILRING16", - "S_RAILRING17", - "S_RAILRING18", - "S_RAILRING19", - "S_RAILRING20", - "S_RAILRING21", - "S_RAILRING22", - "S_RAILRING23", - "S_RAILRING24", - "S_RAILRING25", - "S_RAILRING26", - "S_RAILRING27", - "S_RAILRING28", - "S_RAILRING29", - "S_RAILRING30", - "S_RAILRING31", - "S_RAILRING32", - "S_RAILRING33", - "S_RAILRING34", - "S_RAILRING35", - - // Infinity ring - "S_INFINITYRING1", - "S_INFINITYRING2", - "S_INFINITYRING3", - "S_INFINITYRING4", - "S_INFINITYRING5", - "S_INFINITYRING6", - "S_INFINITYRING7", - "S_INFINITYRING8", - "S_INFINITYRING9", - "S_INFINITYRING10", - "S_INFINITYRING11", - "S_INFINITYRING12", - "S_INFINITYRING13", - "S_INFINITYRING14", - "S_INFINITYRING15", - "S_INFINITYRING16", - "S_INFINITYRING17", - "S_INFINITYRING18", - "S_INFINITYRING19", - "S_INFINITYRING20", - "S_INFINITYRING21", - "S_INFINITYRING22", - "S_INFINITYRING23", - "S_INFINITYRING24", - "S_INFINITYRING25", - "S_INFINITYRING26", - "S_INFINITYRING27", - "S_INFINITYRING28", - "S_INFINITYRING29", - "S_INFINITYRING30", - "S_INFINITYRING31", - "S_INFINITYRING32", - "S_INFINITYRING33", - "S_INFINITYRING34", - "S_INFINITYRING35", - - // Automatic Ring - "S_AUTOMATICRING1", - "S_AUTOMATICRING2", - "S_AUTOMATICRING3", - "S_AUTOMATICRING4", - "S_AUTOMATICRING5", - "S_AUTOMATICRING6", - "S_AUTOMATICRING7", - "S_AUTOMATICRING8", - "S_AUTOMATICRING9", - "S_AUTOMATICRING10", - "S_AUTOMATICRING11", - "S_AUTOMATICRING12", - "S_AUTOMATICRING13", - "S_AUTOMATICRING14", - "S_AUTOMATICRING15", - "S_AUTOMATICRING16", - "S_AUTOMATICRING17", - "S_AUTOMATICRING18", - "S_AUTOMATICRING19", - "S_AUTOMATICRING20", - "S_AUTOMATICRING21", - "S_AUTOMATICRING22", - "S_AUTOMATICRING23", - "S_AUTOMATICRING24", - "S_AUTOMATICRING25", - "S_AUTOMATICRING26", - "S_AUTOMATICRING27", - "S_AUTOMATICRING28", - "S_AUTOMATICRING29", - "S_AUTOMATICRING30", - "S_AUTOMATICRING31", - "S_AUTOMATICRING32", - "S_AUTOMATICRING33", - "S_AUTOMATICRING34", - "S_AUTOMATICRING35", - - // Explosion Ring - "S_EXPLOSIONRING1", - "S_EXPLOSIONRING2", - "S_EXPLOSIONRING3", - "S_EXPLOSIONRING4", - "S_EXPLOSIONRING5", - "S_EXPLOSIONRING6", - "S_EXPLOSIONRING7", - "S_EXPLOSIONRING8", - "S_EXPLOSIONRING9", - "S_EXPLOSIONRING10", - "S_EXPLOSIONRING11", - "S_EXPLOSIONRING12", - "S_EXPLOSIONRING13", - "S_EXPLOSIONRING14", - "S_EXPLOSIONRING15", - "S_EXPLOSIONRING16", - "S_EXPLOSIONRING17", - "S_EXPLOSIONRING18", - "S_EXPLOSIONRING19", - "S_EXPLOSIONRING20", - "S_EXPLOSIONRING21", - "S_EXPLOSIONRING22", - "S_EXPLOSIONRING23", - "S_EXPLOSIONRING24", - "S_EXPLOSIONRING25", - "S_EXPLOSIONRING26", - "S_EXPLOSIONRING27", - "S_EXPLOSIONRING28", - "S_EXPLOSIONRING29", - "S_EXPLOSIONRING30", - "S_EXPLOSIONRING31", - "S_EXPLOSIONRING32", - "S_EXPLOSIONRING33", - "S_EXPLOSIONRING34", - "S_EXPLOSIONRING35", - - // Scatter Ring - "S_SCATTERRING1", - "S_SCATTERRING2", - "S_SCATTERRING3", - "S_SCATTERRING4", - "S_SCATTERRING5", - "S_SCATTERRING6", - "S_SCATTERRING7", - "S_SCATTERRING8", - "S_SCATTERRING9", - "S_SCATTERRING10", - "S_SCATTERRING11", - "S_SCATTERRING12", - "S_SCATTERRING13", - "S_SCATTERRING14", - "S_SCATTERRING15", - "S_SCATTERRING16", - "S_SCATTERRING17", - "S_SCATTERRING18", - "S_SCATTERRING19", - "S_SCATTERRING20", - "S_SCATTERRING21", - "S_SCATTERRING22", - "S_SCATTERRING23", - "S_SCATTERRING24", - "S_SCATTERRING25", - "S_SCATTERRING26", - "S_SCATTERRING27", - "S_SCATTERRING28", - "S_SCATTERRING29", - "S_SCATTERRING30", - "S_SCATTERRING31", - "S_SCATTERRING32", - "S_SCATTERRING33", - "S_SCATTERRING34", - "S_SCATTERRING35", - - // Grenade Ring - "S_GRENADERING1", - "S_GRENADERING2", - "S_GRENADERING3", - "S_GRENADERING4", - "S_GRENADERING5", - "S_GRENADERING6", - "S_GRENADERING7", - "S_GRENADERING8", - "S_GRENADERING9", - "S_GRENADERING10", - "S_GRENADERING11", - "S_GRENADERING12", - "S_GRENADERING13", - "S_GRENADERING14", - "S_GRENADERING15", - "S_GRENADERING16", - "S_GRENADERING17", - "S_GRENADERING18", - "S_GRENADERING19", - "S_GRENADERING20", - "S_GRENADERING21", - "S_GRENADERING22", - "S_GRENADERING23", - "S_GRENADERING24", - "S_GRENADERING25", - "S_GRENADERING26", - "S_GRENADERING27", - "S_GRENADERING28", - "S_GRENADERING29", - "S_GRENADERING30", - "S_GRENADERING31", - "S_GRENADERING32", - "S_GRENADERING33", - "S_GRENADERING34", - "S_GRENADERING35", + // Weapon Ring Ammo + "S_BOUNCERINGAMMO", + "S_RAILRINGAMMO", + "S_INFINITYRINGAMMO", + "S_AUTOMATICRINGAMMO", + "S_EXPLOSIONRINGAMMO", + "S_SCATTERRINGAMMO", + "S_GRENADERINGAMMO", // Weapon pickup - "S_BOUNCEPICKUP1", - "S_BOUNCEPICKUP2", - "S_BOUNCEPICKUP3", - "S_BOUNCEPICKUP4", - "S_BOUNCEPICKUP5", - "S_BOUNCEPICKUP6", - "S_BOUNCEPICKUP7", - "S_BOUNCEPICKUP8", - "S_BOUNCEPICKUP9", - "S_BOUNCEPICKUP10", - "S_BOUNCEPICKUP11", - "S_BOUNCEPICKUP12", - "S_BOUNCEPICKUP13", - "S_BOUNCEPICKUP14", - "S_BOUNCEPICKUP15", - "S_BOUNCEPICKUP16", - + "S_BOUNCEPICKUP", "S_BOUNCEPICKUPFADE1", "S_BOUNCEPICKUPFADE2", "S_BOUNCEPICKUPFADE3", @@ -5958,23 +5578,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_BOUNCEPICKUPFADE7", "S_BOUNCEPICKUPFADE8", - "S_RAILPICKUP1", - "S_RAILPICKUP2", - "S_RAILPICKUP3", - "S_RAILPICKUP4", - "S_RAILPICKUP5", - "S_RAILPICKUP6", - "S_RAILPICKUP7", - "S_RAILPICKUP8", - "S_RAILPICKUP9", - "S_RAILPICKUP10", - "S_RAILPICKUP11", - "S_RAILPICKUP12", - "S_RAILPICKUP13", - "S_RAILPICKUP14", - "S_RAILPICKUP15", - "S_RAILPICKUP16", - + "S_RAILPICKUP", "S_RAILPICKUPFADE1", "S_RAILPICKUPFADE2", "S_RAILPICKUPFADE3", @@ -5984,23 +5588,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RAILPICKUPFADE7", "S_RAILPICKUPFADE8", - "S_AUTOPICKUP1", - "S_AUTOPICKUP2", - "S_AUTOPICKUP3", - "S_AUTOPICKUP4", - "S_AUTOPICKUP5", - "S_AUTOPICKUP6", - "S_AUTOPICKUP7", - "S_AUTOPICKUP8", - "S_AUTOPICKUP9", - "S_AUTOPICKUP10", - "S_AUTOPICKUP11", - "S_AUTOPICKUP12", - "S_AUTOPICKUP13", - "S_AUTOPICKUP14", - "S_AUTOPICKUP15", - "S_AUTOPICKUP16", - + "S_AUTOPICKUP", "S_AUTOPICKUPFADE1", "S_AUTOPICKUPFADE2", "S_AUTOPICKUPFADE3", @@ -6010,23 +5598,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_AUTOPICKUPFADE7", "S_AUTOPICKUPFADE8", - "S_EXPLODEPICKUP1", - "S_EXPLODEPICKUP2", - "S_EXPLODEPICKUP3", - "S_EXPLODEPICKUP4", - "S_EXPLODEPICKUP5", - "S_EXPLODEPICKUP6", - "S_EXPLODEPICKUP7", - "S_EXPLODEPICKUP8", - "S_EXPLODEPICKUP9", - "S_EXPLODEPICKUP10", - "S_EXPLODEPICKUP11", - "S_EXPLODEPICKUP12", - "S_EXPLODEPICKUP13", - "S_EXPLODEPICKUP14", - "S_EXPLODEPICKUP15", - "S_EXPLODEPICKUP16", - + "S_EXPLODEPICKUP", "S_EXPLODEPICKUPFADE1", "S_EXPLODEPICKUPFADE2", "S_EXPLODEPICKUPFADE3", @@ -6036,23 +5608,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_EXPLODEPICKUPFADE7", "S_EXPLODEPICKUPFADE8", - "S_SCATTERPICKUP1", - "S_SCATTERPICKUP2", - "S_SCATTERPICKUP3", - "S_SCATTERPICKUP4", - "S_SCATTERPICKUP5", - "S_SCATTERPICKUP6", - "S_SCATTERPICKUP7", - "S_SCATTERPICKUP8", - "S_SCATTERPICKUP9", - "S_SCATTERPICKUP10", - "S_SCATTERPICKUP11", - "S_SCATTERPICKUP12", - "S_SCATTERPICKUP13", - "S_SCATTERPICKUP14", - "S_SCATTERPICKUP15", - "S_SCATTERPICKUP16", - + "S_SCATTERPICKUP", "S_SCATTERPICKUPFADE1", "S_SCATTERPICKUPFADE2", "S_SCATTERPICKUPFADE3", @@ -6062,23 +5618,7 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_SCATTERPICKUPFADE7", "S_SCATTERPICKUPFADE8", - "S_GRENADEPICKUP1", - "S_GRENADEPICKUP2", - "S_GRENADEPICKUP3", - "S_GRENADEPICKUP4", - "S_GRENADEPICKUP5", - "S_GRENADEPICKUP6", - "S_GRENADEPICKUP7", - "S_GRENADEPICKUP8", - "S_GRENADEPICKUP9", - "S_GRENADEPICKUP10", - "S_GRENADEPICKUP11", - "S_GRENADEPICKUP12", - "S_GRENADEPICKUP13", - "S_GRENADEPICKUP14", - "S_GRENADEPICKUP15", - "S_GRENADEPICKUP16", - + "S_GRENADEPICKUP", "S_GRENADEPICKUPFADE1", "S_GRENADEPICKUPFADE2", "S_GRENADEPICKUPFADE3", @@ -6459,101 +5999,22 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_ROCKSPAWN", - "S_ROCKCRUMBLEA1", - "S_ROCKCRUMBLEA2", - "S_ROCKCRUMBLEA3", - "S_ROCKCRUMBLEA4", - "S_ROCKCRUMBLEA5", - - "S_ROCKCRUMBLEB1", - "S_ROCKCRUMBLEB2", - "S_ROCKCRUMBLEB3", - "S_ROCKCRUMBLEB4", - "S_ROCKCRUMBLEB5", - - "S_ROCKCRUMBLEC1", - "S_ROCKCRUMBLEC2", - "S_ROCKCRUMBLEC3", - "S_ROCKCRUMBLEC4", - "S_ROCKCRUMBLEC5", - - "S_ROCKCRUMBLED1", - "S_ROCKCRUMBLED2", - "S_ROCKCRUMBLED3", - "S_ROCKCRUMBLED4", - "S_ROCKCRUMBLED5", - - "S_ROCKCRUMBLEE1", - "S_ROCKCRUMBLEE2", - "S_ROCKCRUMBLEE3", - "S_ROCKCRUMBLEE4", - "S_ROCKCRUMBLEE5", - - "S_ROCKCRUMBLEF1", - "S_ROCKCRUMBLEF2", - "S_ROCKCRUMBLEF3", - "S_ROCKCRUMBLEF4", - "S_ROCKCRUMBLEF5", - - "S_ROCKCRUMBLEG1", - "S_ROCKCRUMBLEG2", - "S_ROCKCRUMBLEG3", - "S_ROCKCRUMBLEG4", - "S_ROCKCRUMBLEG5", - - "S_ROCKCRUMBLEH1", - "S_ROCKCRUMBLEH2", - "S_ROCKCRUMBLEH3", - "S_ROCKCRUMBLEH4", - "S_ROCKCRUMBLEH5", - - "S_ROCKCRUMBLEI1", - "S_ROCKCRUMBLEI2", - "S_ROCKCRUMBLEI3", - "S_ROCKCRUMBLEI4", - "S_ROCKCRUMBLEI5", - - "S_ROCKCRUMBLEJ1", - "S_ROCKCRUMBLEJ2", - "S_ROCKCRUMBLEJ3", - "S_ROCKCRUMBLEJ4", - "S_ROCKCRUMBLEJ5", - - "S_ROCKCRUMBLEK1", - "S_ROCKCRUMBLEK2", - "S_ROCKCRUMBLEK3", - "S_ROCKCRUMBLEK4", - "S_ROCKCRUMBLEK5", - - "S_ROCKCRUMBLEL1", - "S_ROCKCRUMBLEL2", - "S_ROCKCRUMBLEL3", - "S_ROCKCRUMBLEL4", - "S_ROCKCRUMBLEL5", - - "S_ROCKCRUMBLEM1", - "S_ROCKCRUMBLEM2", - "S_ROCKCRUMBLEM3", - "S_ROCKCRUMBLEM4", - "S_ROCKCRUMBLEM5", - - "S_ROCKCRUMBLEN1", - "S_ROCKCRUMBLEN2", - "S_ROCKCRUMBLEN3", - "S_ROCKCRUMBLEN4", - "S_ROCKCRUMBLEN5", - - "S_ROCKCRUMBLEO1", - "S_ROCKCRUMBLEO2", - "S_ROCKCRUMBLEO3", - "S_ROCKCRUMBLEO4", - "S_ROCKCRUMBLEO5", - - "S_ROCKCRUMBLEP1", - "S_ROCKCRUMBLEP2", - "S_ROCKCRUMBLEP3", - "S_ROCKCRUMBLEP4", - "S_ROCKCRUMBLEP5", + "S_ROCKCRUMBLEA", + "S_ROCKCRUMBLEB", + "S_ROCKCRUMBLEC", + "S_ROCKCRUMBLED", + "S_ROCKCRUMBLEE", + "S_ROCKCRUMBLEF", + "S_ROCKCRUMBLEG", + "S_ROCKCRUMBLEH", + "S_ROCKCRUMBLEI", + "S_ROCKCRUMBLEJ", + "S_ROCKCRUMBLEK", + "S_ROCKCRUMBLEL", + "S_ROCKCRUMBLEM", + "S_ROCKCRUMBLEN", + "S_ROCKCRUMBLEO", + "S_ROCKCRUMBLEP", "S_SRB1_CRAWLA1", "S_SRB1_CRAWLA2", @@ -7484,6 +6945,7 @@ struct { // Frame settings {"FF_FRAMEMASK",FF_FRAMEMASK}, + {"FF_ANIMATE",FF_ANIMATE}, {"FF_FULLBRIGHT",FF_FULLBRIGHT}, {"FF_TRANSMASK",FF_TRANSMASK}, {"FF_TRANSSHIFT",FF_TRANSSHIFT}, diff --git a/src/info.c b/src/info.c index 9e04b4e3..9f75f188 100644 --- a/src/info.c +++ b/src/info.c @@ -60,6 +60,7 @@ char sprnames[NUMSPRITES + 1][5] = state_t states[NUMSTATES] = { // frame is masked through FF_FRAMEMASK + // FF_ANIMATE (0x4000) makes simple state animations (var1 #frames, var2 tic delay) // FF_FULLBRIGHT (0x8000) activates the fullbright colormap // use FF_TRANS10 - FF_TRANS90 for easy translucency // (or tr_trans10<frame); break; + case mobj_anim_duration: + lua_pushinteger(L, mo->anim_duration); + break; case mobj_touching_sectorlist: return UNIMPLEMENTED; case mobj_subsector: @@ -406,6 +411,9 @@ static int mobj_set(lua_State *L) case mobj_frame: mo->frame = (UINT32)luaL_checkinteger(L, 3); break; + case mobj_anim_duration: + mo->anim_duration = (UINT16)luaL_checkinteger(L, 3); + break; case mobj_touching_sectorlist: return UNIMPLEMENTED; case mobj_subsector: diff --git a/src/p_local.h b/src/p_local.h index 97b8865d..d035925c 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -212,6 +212,7 @@ void P_RemoveSavegameMobj(mobj_t *th); boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state); void P_RunShields(void); +void P_RunOverlays(void); void P_MobjThinker(mobj_t *mobj); boolean P_RailThinker(mobj_t *mobj); void P_PushableThinker(mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index 25ae8815..323e5ce9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -79,11 +79,33 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum) actioncachehead.prev = newaction; } +// +// P_CycleStateAnimation +// +FUNCINLINE static ATTRINLINE void P_CycleStateAnimation(mobj_t *mobj) +{ + // var2 determines delay between animation frames + if (!(mobj->frame & FF_ANIMATE) || --mobj->anim_duration != 0) + return; + mobj->anim_duration = (UINT16)mobj->state->var2; + + // compare the current sprite frame to the one we started from + // if more than var1 away from it, swap back to the original + // else just advance by one + if ((mobj->frame & FF_FRAMEMASK) - (mobj->state->frame & FF_FRAMEMASK) < (UINT32)mobj->state->var1) + ++mobj->frame; + else + mobj->frame = (mobj->state->frame & FF_FRAMEMASK) | (mobj->frame & ~FF_FRAMEMASK); +} + // // P_CycleMobjState // static void P_CycleMobjState(mobj_t *mobj) { + // state animations + P_CycleStateAnimation(mobj); + // cycle through states, // calling action functions at transitions if (mobj->tics != -1) @@ -102,6 +124,9 @@ static void P_CycleMobjState(mobj_t *mobj) // static void P_CyclePlayerMobjState(mobj_t *mobj) { + // state animations + P_CycleStateAnimation(mobj); + // cycle through states, // calling action functions at transitions if (mobj->tics != -1) @@ -279,6 +304,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state) mobj->sprite = st->sprite; mobj->frame = st->frame; + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set // Modified handling. // Call action functions when the state is set @@ -346,6 +372,7 @@ boolean P_SetMobjState(mobj_t *mobj, statenum_t state) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set // Modified handling. // Call action functions when the state is set @@ -399,6 +426,8 @@ boolean P_SetMobjStateNF(mobj_t *mobj, statenum_t state) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + return true; } @@ -416,6 +445,8 @@ static boolean P_SetPrecipMobjState(precipmobj_t *mobj, statenum_t state) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + return true; } @@ -3716,6 +3747,8 @@ void P_NullPrecipThinker(precipmobj_t *mobj) void P_SnowThinker(precipmobj_t *mobj) { + P_CycleStateAnimation((mobj_t *)mobj); + // adjust height if ((mobj->z += mobj->momz) <= mobj->floorz) mobj->z = mobj->ceilingz; @@ -3723,6 +3756,8 @@ void P_SnowThinker(precipmobj_t *mobj) void P_RainThinker(precipmobj_t *mobj) { + P_CycleStateAnimation((mobj_t *)mobj); + if (mobj->state != &states[S_RAIN1]) { // cycle through states, @@ -5833,8 +5868,6 @@ INT32 numshields = 0; void P_RunShields(void) { INT32 i; - mobj_t *mo, *next; - fixed_t destx,desty,zoffs; // run shields for (i = 0; i < numshields; i++) @@ -5843,60 +5876,6 @@ void P_RunShields(void) P_SetTarget(&shields[i], NULL); } numshields = 0; - - // run overlays - next = NULL; - for (mo = overlaycap; mo; mo = next) - { - I_Assert(!P_MobjWasRemoved(mo)); - - // grab next in chain, then unset the chain target - next = mo->hnext; - P_SetTarget(&mo->hnext, NULL); - - if (!mo->target) - continue; - if (!splitscreen /*&& rendermode != render_soft*/) - { - angle_t viewingangle; - - if (players[displayplayer].awayviewtics) - viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].awayviewmobj->x, players[displayplayer].awayviewmobj->y); - else if (!camera.chase && players[displayplayer].mo) - viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].mo->x, players[displayplayer].mo->y); - else - viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, camera.x, camera.y); - - if (mo->state->var1) - viewingangle += ANGLE_180; - destx = mo->target->x + P_ReturnThrustX(mo->target, viewingangle, FixedMul(FRACUNIT/4, mo->scale)); - desty = mo->target->y + P_ReturnThrustY(mo->target, viewingangle, FixedMul(FRACUNIT/4, mo->scale)); - } - else - { - destx = mo->target->x; - desty = mo->target->y; - } - - mo->eflags = (mo->eflags & ~MFE_VERTICALFLIP) | (mo->target->eflags & MFE_VERTICALFLIP); - mo->scale = mo->destscale = mo->target->scale; - zoffs = FixedMul(((signed)mo->state->var2)*FRACUNIT, mo->scale); - mo->angle = mo->target->angle; - - P_UnsetThingPosition(mo); - mo->x = destx; - mo->y = desty; - if (mo->eflags & MFE_VERTICALFLIP) - mo->z = (mo->target->z + mo->target->height - mo->height) - zoffs; - else - mo->z = mo->target->z + zoffs; - if (mo->state->var1) - P_SetUnderlayPosition(mo); - else - P_SetThingPosition(mo); - P_CheckPosition(mo, mo->x, mo->y); - } - P_SetTarget(&overlaycap, NULL); } static boolean P_AddShield(mobj_t *thing) @@ -5933,6 +5912,71 @@ static boolean P_AddShield(mobj_t *thing) return true; } +void P_RunOverlays(void) +{ + // run overlays + mobj_t *mo, *next = NULL; + fixed_t destx,desty,zoffs; + + for (mo = overlaycap; mo; mo = next) + { + I_Assert(!P_MobjWasRemoved(mo)); + + // grab next in chain, then unset the chain target + next = mo->hnext; + P_SetTarget(&mo->hnext, NULL); + + if (!mo->target) + continue; + if (!splitscreen /*&& rendermode != render_soft*/) + { + angle_t viewingangle; + + if (players[displayplayer].awayviewtics) + viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].awayviewmobj->x, players[displayplayer].awayviewmobj->y); + else if (!camera.chase && players[displayplayer].mo) + viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayer].mo->x, players[displayplayer].mo->y); + else + viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, camera.x, camera.y); + + if (!(mo->state->frame & FF_ANIMATE) && mo->state->var1) + viewingangle += ANGLE_180; + destx = mo->target->x + P_ReturnThrustX(mo->target, viewingangle, FixedMul(FRACUNIT/4, mo->scale)); + desty = mo->target->y + P_ReturnThrustY(mo->target, viewingangle, FixedMul(FRACUNIT/4, mo->scale)); + } + else + { + destx = mo->target->x; + desty = mo->target->y; + } + + mo->eflags = (mo->eflags & ~MFE_VERTICALFLIP) | (mo->target->eflags & MFE_VERTICALFLIP); + mo->scale = mo->destscale = mo->target->scale; + mo->angle = mo->target->angle; + + if (!(mo->state->frame & FF_ANIMATE)) + zoffs = FixedMul(((signed)mo->state->var2)*FRACUNIT, mo->scale); + // if you're using FF_ANIMATE on an overlay, + // then you're on your own. + else + zoffs = 0; + + P_UnsetThingPosition(mo); + mo->x = destx; + mo->y = desty; + if (mo->eflags & MFE_VERTICALFLIP) + mo->z = (mo->target->z + mo->target->height - mo->height) - zoffs; + else + mo->z = mo->target->z + zoffs; + if (mo->state->var1) + P_SetUnderlayPosition(mo); + else + P_SetThingPosition(mo); + P_CheckPosition(mo, mo->x, mo->y); + } + P_SetTarget(&overlaycap, NULL); +} + // Called only when MT_OVERLAY thinks. static void P_AddOverlay(mobj_t *thing) { @@ -7502,6 +7546,8 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits.. + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set + mobj->friction = ORIG_FRICTION; mobj->movefactor = ORIG_FRICTION_FACTOR; @@ -7727,6 +7773,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype mobj->tics = st->tics; mobj->sprite = st->sprite; mobj->frame = st->frame; // FF_FRAMEMASK for frame, and other bits.. + mobj->anim_duration = (UINT16)st->var2; // only used if FF_ANIMATE is set // set subsector and/or block links P_SetPrecipitationThingPosition(mobj); diff --git a/src/p_mobj.h b/src/p_mobj.h index 224a8ca5..6198f5be 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -270,6 +270,7 @@ typedef struct mobj_s angle_t angle; // orientation spritenum_t sprite; // used to find patch_t and flip value UINT32 frame; // frame number, plus bits see p_pspr.h + UINT16 anim_duration; // for FF_ANIMATE states struct msecnode_s *touching_sectorlist; // a linked list of sectors where this object appears @@ -383,7 +384,8 @@ typedef struct precipmobj_s // More drawing info: to determine current sprite. angle_t angle; // orientation spritenum_t sprite; // used to find patch_t and flip value - INT32 frame; // frame number, plus bits see p_pspr.h + UINT32 frame; // frame number, plus bits see p_pspr.h + UINT16 anim_duration; // for FF_ANIMATE states struct mprecipsecnode_s *touching_sectorlist; // a linked list of sectors where this object appears diff --git a/src/p_pspr.h b/src/p_pspr.h index e0b57675..53ad30ab 100644 --- a/src/p_pspr.h +++ b/src/p_pspr.h @@ -36,9 +36,11 @@ #endif /// \brief Frame flags: only the frame number -#define FF_FRAMEMASK 0x7fff +#define FF_FRAMEMASK 0x3fff +/// \brief Frame flags: Simple stateless animation +#define FF_ANIMATE 0x4000 /// \brief Frame flags: frame always appears full bright -#define FF_FULLBRIGHT 0x8000 // +#define FF_FULLBRIGHT 0x8000 /// \brief Frame flags: 0 = no trans(opaque), 1-15 = transl. table #define FF_TRANSMASK 0xf0000 /// \brief shift for FF_TRANSMASK diff --git a/src/p_saveg.c b/src/p_saveg.c index 61f51e49..565ff0bd 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -1058,6 +1058,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) diff |= MD_SPRITE; if (mobj->frame != mobj->state->frame) diff |= MD_FRAME; + if (mobj->anim_duration != (UINT16)mobj->state->var2) + diff |= MD_FRAME; if (mobj->eflags) diff |= MD_EFLAGS; if (mobj->player) @@ -1178,7 +1180,10 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type) if (diff & MD_SPRITE) WRITEUINT16(save_p, mobj->sprite); if (diff & MD_FRAME) + { WRITEUINT32(save_p, mobj->frame); + WRITEUINT16(save_p, mobj->anim_duration); + } if (diff & MD_EFLAGS) WRITEUINT16(save_p, mobj->eflags); if (diff & MD_PLAYER) @@ -2004,9 +2009,15 @@ static void LoadMobjThinker(actionf_p1 thinker) else mobj->sprite = mobj->state->sprite; if (diff & MD_FRAME) + { mobj->frame = READUINT32(save_p); + mobj->anim_duration = READUINT16(save_p); + } else + { mobj->frame = mobj->state->frame; + mobj->anim_duration = (UINT16)mobj->state->var2; + } if (diff & MD_EFLAGS) mobj->eflags = READUINT16(save_p); if (diff & MD_PLAYER) diff --git a/src/p_tick.c b/src/p_tick.c index 2973505f..c72ab5b6 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -631,6 +631,7 @@ void P_Ticker(boolean run) // Run shield positioning P_RunShields(); + P_RunOverlays(); P_UpdateSpecials(); P_RespawnSpecials(); @@ -742,6 +743,7 @@ void P_PreTicker(INT32 frames) // Run shield positioning P_RunShields(); + P_RunOverlays(); P_UpdateSpecials(); P_RespawnSpecials(); From 58e685353a3575e71869f691de6a2e793cb1ec1e Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Tue, 5 Jan 2016 05:03:00 -0800 Subject: [PATCH 013/109] Attempt 2 at special stage fades. More basic in execution. --- src/dehacked.c | 12 ++++++++++-- src/f_finale.h | 3 ++- src/f_wipe.c | 1 + src/p_setup.c | 51 +++++++++++++++++++++++++++++++++++++------------- 4 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 44ef998a..f7ec8ed5 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3187,6 +3187,12 @@ static void readwipes(MYFILE *f) else if (fastcmp(pword, "FINAL")) wipeoffset = wipe_gameend_final; } + else if (fastncmp(word, "SPECLEVEL_", 10)) + { + pword = word + 10; + if (fastcmp(pword, "TOWHITE")) + wipeoffset = wipe_speclevel_towhite; + } if (wipeoffset < 0) { @@ -3194,9 +3200,11 @@ static void readwipes(MYFILE *f) continue; } - if (value == UINT8_MAX // Cannot disable non-toblack wipes (or the level toblack wipe) - && (wipeoffset <= wipe_level_toblack || wipeoffset >= wipe_level_final)) + if (value == UINT8_MAX + && (wipeoffset <= wipe_level_toblack || wipeoffset >= wipe_speclevel_towhite)) { + // Cannot disable non-toblack wipes + // (or the level toblack wipe, or the special towhite wipe) deh_warning("Wipes: can't disable wipe of type '%s'", word); continue; } diff --git a/src/f_finale.h b/src/f_finale.h index 97a26f4c..e263a379 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -90,6 +90,7 @@ enum // custom intermissions wipe_specinter_toblack, wipe_multinter_toblack, + wipe_speclevel_towhite, wipe_level_final, wipe_intermission_final, @@ -108,7 +109,7 @@ enum NUMWIPEDEFS }; -#define WIPEFINALSHIFT 12 +#define WIPEFINALSHIFT 13 extern UINT8 wipedefs[NUMWIPEDEFS]; #endif diff --git a/src/f_wipe.c b/src/f_wipe.c index 6f14e577..e0578949 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -58,6 +58,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { 0, // wipe_specinter_toblack 0, // wipe_multinter_toblack + 0, // wipe_speclevel_towhite 0, // wipe_level_final 0, // wipe_intermission_final diff --git a/src/p_setup.c b/src/p_setup.c index 3491669c..dc0e4ffd 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2369,7 +2369,7 @@ boolean P_SetupLevel(boolean skipprecip) // use gamemap to get map number. // 99% of the things already did, so. // Map header should always be in place at this point - INT32 i, loadprecip = 1; + INT32 i, loadprecip = 1, ranspecialwipe = 0; INT32 loademblems = 1; INT32 fromnetsave = 0; boolean loadedbm = false; @@ -2442,6 +2442,28 @@ boolean P_SetupLevel(boolean skipprecip) // will be set by player think. players[consoleplayer].viewz = 1; + // Special stage fade to white + // This is handled BEFORE sounds are stopped. + if (rendermode != render_none && G_IsSpecialStage(gamemap)) + { + tic_t starttime = I_GetTime(); + tic_t endtime = starttime + (3*TICRATE)/2; + + S_StartSound(NULL, sfx_s3kaf); + + F_WipeStartScreen(); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0); + + F_WipeEndScreen(); + F_RunWipe(wipedefs[wipe_speclevel_towhite], false); + + // Hold on white for extra effect. + while (I_GetTime() < endtime) + I_Sleep(); + + ranspecialwipe = 1; + } + // Make sure all sounds are stopped before Z_FreeTags. S_StopSounds(); S_ClearSfx(); @@ -2451,25 +2473,28 @@ boolean P_SetupLevel(boolean skipprecip) S_Start(); // Let's fade to black here - if (rendermode != render_none) + // But only if we didn't do the special stage wipe + if (rendermode != render_none && !ranspecialwipe) { F_WipeStartScreen(); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); F_WipeEndScreen(); F_RunWipe(wipedefs[wipe_level_toblack], false); + } + // Print "SPEEDING OFF TO [ZONE] [ACT 1]..." + if (rendermode != render_none) + { // Don't include these in the fade! - { - char tx[64]; - V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to...")); - snprintf(tx, 63, "%s%s%s", - mapheaderinfo[gamemap-1]->lvlttl, - (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE", - (mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : ""); - V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx); - I_UpdateNoVsync(); - } + char tx[64]; + V_DrawSmallString(1, 191, V_ALLOWLOWERCASE, M_GetText("Speeding off to...")); + snprintf(tx, 63, "%s%s%s", + mapheaderinfo[gamemap-1]->lvlttl, + (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE) ? "" : " ZONE", + (mapheaderinfo[gamemap-1]->actnum > 0) ? va(", Act %d",mapheaderinfo[gamemap-1]->actnum) : ""); + V_DrawSmallString(1, 195, V_ALLOWLOWERCASE, tx); + I_UpdateNoVsync(); } #ifdef HAVE_BLUA @@ -2767,7 +2792,7 @@ boolean P_SetupLevel(boolean skipprecip) // Remove the loading shit from the screen if (rendermode != render_none) - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, (ranspecialwipe) ? 0 : 31); if (precache || dedicated) R_PrecacheLevel(); From 8c17dac589215ad71d501a52aaff96b57f26021f Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 19:48:20 -0800 Subject: [PATCH 014/109] The concept of "music slots" doesn't exist anymore. Use whatever names you want for your music. So long as you prefix the lumps with O_ or D_, it doesn't matter anymore. DISCLAIMER: Linedef type 413 (change music) and Lua scripting is not tested. (cherry picked from commit 025ca413a2a01a8ec7c104748c2f510e350aa457) # Conflicts: # src/p_user.c --- src/d_netcmd.c | 47 +- src/dehacked.c | 97 ++-- src/doomstat.h | 22 +- src/f_finale.c | 22 +- src/g_game.c | 17 +- src/lua_baselib.c | 7 +- src/lua_maplib.c | 8 +- src/m_menu.c | 16 +- src/p_enemy.c | 8 +- src/p_inter.c | 4 +- src/p_saveg.c | 2 +- src/p_setup.c | 31 +- src/p_spec.c | 17 +- src/p_user.c | 26 +- src/s_sound.c | 562 ++++++++++----------- src/s_sound.h | 16 +- src/sdl/mixer_sound.c | 1 + src/sounds.c | 1061 ---------------------------------------- src/sounds.h | 1086 ----------------------------------------- src/y_inter.c | 8 +- 20 files changed, 431 insertions(+), 2627 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 02bc464e..9916e524 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1854,10 +1854,10 @@ static void Got_Pause(UINT8 **cp, INT32 playernum) if (paused) { if (!menuactive || netgame) - S_PauseSound(); + S_PauseAudio(); } else - S_ResumeSound(); + S_ResumeAudio(); } } @@ -3761,46 +3761,53 @@ static void Command_Displayplayer_f(void) static void Command_Tunes_f(void) { const char *tunearg; - UINT16 tune, track = 0; + UINT16 tunenum, track = 0; const size_t argc = COM_Argc(); if (argc < 2) //tunes slot ... { - CONS_Printf("tunes :\n"); + CONS_Printf("tunes :\n"); CONS_Printf(M_GetText("Play a music slot at a set speed (\"1\" being normal speed).\n")); CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n")); - CONS_Printf(M_GetText("The current tune is: %d\nThe current track is: %d\n"), - (mapmusic & MUSIC_SONGMASK), ((mapmusic & MUSIC_TRACKMASK) >> MUSIC_TRACKSHIFT)); + CONS_Printf(M_GetText("The current tune is: %s\nThe current track is: %d\n"), + mapmusname, (mapmusflags & MUSIC_TRACKMASK)); return; } tunearg = COM_Argv(1); - tune = (UINT16)atoi(tunearg); + tunenum = (UINT16)atoi(tunearg); track = 0; - if (!strcasecmp(tunearg, "default")) + if (!strcasecmp(tunearg, "none")) { - tune = mapheaderinfo[gamemap-1]->musicslot; - track = mapheaderinfo[gamemap-1]->musicslottrack; + S_StopMusic(); + return; } - else if (toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') - tune = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); - - if (tune >= NUMMUSIC) + else if (!strcasecmp(tunearg, "default")) { - CONS_Alert(CONS_NOTICE, M_GetText("Valid slots are 1 to %d, or 0 to stop music\n"), NUMMUSIC - 1); + tunearg = mapheaderinfo[gamemap-1]->musname; + track = mapheaderinfo[gamemap-1]->mustrack; + } + else if (tunearg[3] == 0 && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') + tunenum = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); + + if (tunenum && tunenum >= 1036) + { + CONS_Alert(CONS_NOTICE, M_GetText("Valid music slots are 1 to 1035.\n")); return; } if (argc > 3) track = (UINT16)atoi(COM_Argv(3))-1; - mapmusic = tune | (track << MUSIC_TRACKSHIFT); - - if (tune == mus_None) - S_StopMusic(); + if (tunenum) + snprintf(mapmusname, 7, "%sM", G_BuildMapName(tunenum)); else - S_ChangeMusic(mapmusic, true); + strncpy(mapmusname, tunearg, 7); + mapmusname[6] = 0; + mapmusflags = (track & MUSIC_TRACKMASK); + + S_ChangeMusic(mapmusname, mapmusflags, true); if (argc > 2) { diff --git a/src/dehacked.c b/src/dehacked.c index 44ef998a..6f07ce8e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -65,7 +65,6 @@ static mobjtype_t get_mobjtype(const char *word); static statenum_t get_state(const char *word); static spritenum_t get_sprite(const char *word); static sfxenum_t get_sfx(const char *word); -static UINT16 get_mus(const char *word); static hudnum_t get_huditem(const char *word); #ifndef HAVE_BLUA static powertype_t get_power(const char *word); @@ -1164,19 +1163,34 @@ static void readlevelheader(MYFILE *f, INT32 num) mapheaderinfo[num-1]->typeoflevel = tol; } } - else if (fastcmp(word, "MUSICSLOT")) + else if (fastcmp(word, "MUSIC")) { + if (fastcmp(word2, "NONE")) + mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string + else + { + deh_strlcpy(mapheaderinfo[num-1]->musname, word2, + sizeof(mapheaderinfo[num-1]->musname), va("Level header %d: music", num)); + } + } + else if (fastcmp(word, "MUSICSLOT")) + { // Backwards compatibility? // Convert to map number if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0') i = M_MapNumber(word2[0], word2[1]); - if (i) // it's just a number - mapheaderinfo[num-1]->musicslot = (UINT16)i; - else // No? Okay, now we'll get technical. - mapheaderinfo[num-1]->musicslot = get_mus(word2); // accepts all of O_CHRSEL, mus_chrsel, or just plain ChrSel + if (!i) + mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string + else if (i > 1035) + deh_warning("Level header %d: musicslot out of range (0 - 1035)\n", num); + else // it's just a number + { + snprintf(mapheaderinfo[num-1]->musname, 7, va("%sM", G_BuildMapName(i))); + mapheaderinfo[num-1]->musname[6] = 0; + } } - else if (fastcmp(word, "MUSICSLOTTRACK")) - mapheaderinfo[num-1]->musicslottrack = ((UINT16)i - 1); + else if (fastcmp(word, "MUSICTRACK")) + mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); else if (fastcmp(word, "FORCECHARACTER")) { strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1); @@ -1443,10 +1457,16 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum) else deh_warning("CutSceneScene %d: unknown word '%s'", num, word); } - else if (fastcmp(word, "MUSICSLOT")) + else if (fastcmp(word, "MUSIC")) { - DEH_WriteUndoline(word, va("%u", cutscenes[num]->scene[scenenum].musicslot), UNDO_NONE); - cutscenes[num]->scene[scenenum].musicslot = get_mus(word2); // accepts all of O_MAP01M, mus_map01m, or just plain MAP01M + DEH_WriteUndoline(word, cutscenes[num]->scene[scenenum].musswitch, UNDO_NONE); + strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7); + cutscenes[num]->scene[scenenum].musswitch[6] = 0; + } + else if (fastcmp(word, "MUSICTRACK")) + { + DEH_WriteUndoline(word, va("%u", cutscenes[num]->scene[scenenum].musswitchflags), UNDO_NONE); + cutscenes[num]->scene[scenenum].musswitchflags = ((UINT16)i) & MUSIC_TRACKMASK; } else if (fastcmp(word, "MUSICLOOP")) { @@ -7958,22 +7978,6 @@ static sfxenum_t get_sfx(const char *word) return sfx_None; } -static UINT16 get_mus(const char *word) -{ // Returns the value of SFX_ enumerations - UINT16 i; - if (*word >= '0' && *word <= '9') - return atoi(word); - if (fastncmp("MUS_",word,4)) - word += 4; // take off the MUS_ - else if (fastncmp("O_",word,2) || fastncmp("D_",word,2)) - word += 2; // take off the O_ or D_ - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(word, S_music[i].name)) - return i; - deh_warning("Couldn't find music named 'MUS_%s'",word); - return mus_None; -} - static hudnum_t get_huditem(const char *word) { // Returns the value of HUD_ enumerations hudnum_t i; @@ -8172,11 +8176,6 @@ static fixed_t find_const(const char **rword) free(word); return r; } - else if (fastncmp("MUS_",word,4) || fastncmp("O_",word,2)) { - r = get_mus(word); - free(word); - return r; - } else if (fastncmp("PW_",word,3)) { r = get_power(word); free(word); @@ -8546,33 +8545,6 @@ static inline int lib_getenum(lua_State *L) if (mathlib) return luaL_error(L, "sfx '%s' could not be found.\n", word); return 0; } - else if (!mathlib && fastncmp("mus_",word,4)) { - p = word+4; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fastcmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return 0; - } - else if (mathlib && fastncmp("MUS_",word,4)) { // SOCs are ALL CAPS! - p = word+4; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return luaL_error(L, "music '%s' could not be found.\n", word); - } - else if (mathlib && (fastncmp("O_",word,2) || fastncmp("D_",word,2))) { - p = word+2; - for (i = 0; i < NUMMUSIC; i++) - if (S_music[i].name && fasticmp(p, S_music[i].name)) { - lua_pushinteger(L, i); - return 1; - } - return luaL_error(L, "music '%s' could not be found.\n", word); - } else if (!mathlib && fastncmp("pw_",word,3)) { p = word+3; for (i = 0; i < NUMPOWERS; i++) @@ -8724,8 +8696,11 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"globallevelskynum")) { lua_pushinteger(L, globallevelskynum); return 1; - } else if (fastcmp(word,"mapmusic")) { - lua_pushinteger(L, mapmusic); + } else if (fastcmp(word,"mapmusname")) { + lua_pushstring(L, mapmusname); + return 1; + } else if (fastcmp(word,"mapmusflags")) { + lua_pushinteger(L, mapmusflags); return 1; } else if (fastcmp(word,"server")) { if ((!multiplayer || !netgame) && !playeringame[serverplayer]) diff --git a/src/doomstat.h b/src/doomstat.h index 44cf6fea..ffdbcaec 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -31,15 +31,11 @@ // Selected by user. extern INT16 gamemap; - -// ----------------xxxxxxxxxxxxxxxx = music slot -// -xxxxxxxxxxxxxxx---------------- = track slot -// x------------------------------- = reset music bit -extern UINT32 mapmusic; -#define MUSIC_TRACKSHIFT 16 -#define MUSIC_SONGMASK 0x0000FFFF -#define MUSIC_TRACKMASK 0x7FFF0000 -#define MUSIC_RELOADRESET 0x80000000 +extern char mapmusname[7]; +extern UINT16 mapmusflags; +#define MUSIC_TRACKMASK 0x0FFF // ----************ +#define MUSIC_RELOADRESET 0x8000 // *--------------- +// Use other bits if necessary. extern INT16 maptol; extern UINT8 globalweather; @@ -146,11 +142,13 @@ typedef struct UINT16 xcoord[8]; UINT16 ycoord[8]; UINT16 picduration[8]; - UINT16 musicslot; UINT8 musicloop; UINT16 textxpos; UINT16 textypos; + char musswitch[7]; + UINT16 musswitchflags; + UINT8 fadecolor; // Color number for fade, 0 means don't do the first fade UINT8 fadeinid; // ID of the first fade, to a color -- ignored if fadecolor is 0 UINT8 fadeoutid; // ID of the second fade, to the new screen @@ -218,8 +216,8 @@ typedef struct UINT8 actnum; ///< Act number or 0 for none. UINT16 typeoflevel; ///< Combination of typeoflevel flags. INT16 nextlevel; ///< Map number of next level, or 1100-1102 to end. - UINT16 musicslot; ///< Music slot number to play. 0 for no music. - UINT16 musicslottrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. + char musname[7]; ///< Music track to play. "" for no music. + UINT16 mustrack; ///< Subsong to play. Only really relevant for music modules and specific formats supported by GME. 0 to ignore. char forcecharacter[17]; ///< (SKINNAMESIZE+1) Skin to switch to or "" to disable. UINT8 weather; ///< 0 = sunny day, 1 = storm, 2 = snow, 3 = rain, 4 = blank, 5 = thunder w/o rain, 6 = rain w/o lightning, 7 = heat wave. INT16 skynum; ///< Sky number to use. diff --git a/src/f_finale.c b/src/f_finale.c index a85fd11c..efe39f29 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -559,7 +559,7 @@ static void F_IntroDrawScene(void) if (finalecount < 4) S_StopMusic(); if (finalecount == 4) - S_ChangeMusic(mus_stjr, false); + S_ChangeMusicInternal("stjr", false); x = (BASEVIDWIDTH<scene[scenenum].xcoord[picnum]; picypos = cutscenes[cutnum]->scene[scenenum].ycoord[picnum]; - if (cutscenes[cutnum]->scene[scenenum].musicslot != 0) - S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musicslot, cutscenes[cutnum]->scene[scenenum].musicloop); + if (cutscenes[cutnum]->scene[scenenum].musswitch[0]) + S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musswitch, + cutscenes[cutnum]->scene[scenenum].musswitchflags, + cutscenes[cutnum]->scene[scenenum].musicloop); // Fade to the next dofadenow = true; @@ -1774,8 +1776,10 @@ void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean reset animtimer = cutscenes[cutnum]->scene[0].picduration[0]; // Picture duration stoptimer = 0; - if (cutscenes[cutnum]->scene[scenenum].musicslot != 0) - S_ChangeMusic(cutscenes[cutnum]->scene[scenenum].musicslot, cutscenes[cutnum]->scene[scenenum].musicloop); + if (cutscenes[cutnum]->scene[0].musswitch[0]) + S_ChangeMusic(cutscenes[cutnum]->scene[0].musswitch, + cutscenes[cutnum]->scene[0].musswitchflags, + cutscenes[cutnum]->scene[0].musicloop); else S_StopMusic(); } diff --git a/src/g_game.c b/src/g_game.c index 72cfe4a5..08853643 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -69,8 +69,10 @@ static void G_DoStartContinue(void); static void G_DoContinued(void); static void G_DoWorldDone(void); +char mapmusname[7]; // Music name +UINT16 mapmusflags; // Track and reset bit + INT16 gamemap = 1; -UINT32 mapmusic; // music, track, and reset bit INT16 maptol; UINT8 globalweather = 0; INT32 curWeather = PRECIP_NONE; @@ -2182,12 +2184,13 @@ void G_PlayerReborn(INT32 player) if (p-players == consoleplayer) { - if (mapmusic & MUSIC_RELOADRESET) // TODO: Might not need this here + if (mapmusflags & MUSIC_RELOADRESET) { - mapmusic = mapheaderinfo[gamemap-1]->musicslot - | (mapheaderinfo[gamemap-1]->musicslottrack << MUSIC_TRACKSHIFT); + strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); + mapmusname[6] = 0; + mapmusflags = mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK; } - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } if (gametype == GT_COOP) @@ -3521,7 +3524,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean if (paused) { paused = false; - S_ResumeSound(); + S_ResumeAudio(); } if (netgame || multiplayer) // Nice try, haxor. @@ -3595,7 +3598,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean globalweather = mapheaderinfo[gamemap-1]->weather; // Don't carry over custom music change to another map. - mapmusic |= MUSIC_RELOADRESET; + mapmusflags |= MUSIC_RELOADRESET; ultimatemode = pultmode; playerdeadview = false; diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 5e2d31b1..38627095 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1636,9 +1636,10 @@ static int lib_sStopSound(lua_State *L) static int lib_sChangeMusic(lua_State *L) { - UINT32 music_num = (UINT32)luaL_checkinteger(L, 1); + const char *music_name = luaL_checkstring(L, 1); boolean looping = (boolean)lua_opttrueboolean(L, 2); player_t *player = NULL; + UINT16 music_flags = 0; NOHUD if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) { @@ -1646,8 +1647,10 @@ static int lib_sChangeMusic(lua_State *L) if (!player) return LUA_ErrInvalid(L, "player_t"); } + music_flags = (UINT16)luaL_optinteger(L, 4, 0); + if (!player || P_IsLocalPlayer(player)) - S_ChangeMusic(music_num, looping); + S_ChangeMusic(music_name, music_flags, looping); return 0; } diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 38920c22..5f77b2b5 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1168,10 +1168,10 @@ static int mapheaderinfo_get(lua_State *L) lua_pushinteger(L, header->typeoflevel); else if (fastcmp(field,"nextlevel")) lua_pushinteger(L, header->nextlevel); - else if (fastcmp(field,"musicslot")) - lua_pushinteger(L, header->musicslot); - else if (fastcmp(field,"musicslottrack")) - lua_pushinteger(L, header->musicslottrack); + else if (fastcmp(field,"musname")) + lua_pushlstring(L, header->musname, 6); + else if (fastcmp(field,"mustrack")) + lua_pushinteger(L, header->mustrack); else if (fastcmp(field,"forcecharacter")) lua_pushstring(L, header->forcecharacter); else if (fastcmp(field,"weather")) diff --git a/src/m_menu.c b/src/m_menu.c index 65ea1cfe..e53b3258 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4751,7 +4751,7 @@ static void M_SetupChoosePlayer(INT32 choice) if (Playing() == false) { S_StopMusic(); - S_ChangeMusic(mus_chrsel, true); + S_ChangeMusicInternal("chrsel", true); } SP_PlayerDef.prevMenu = currentMenu; @@ -5202,7 +5202,7 @@ void M_DrawTimeAttackMenu(void) lumpnum_t lumpnum; char beststr[40]; - S_ChangeMusic(mus_racent, true); // Eww, but needed for when user hits escape during demo playback + S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); @@ -5365,7 +5365,7 @@ static void M_TimeAttack(INT32 choice) itemOn = tastart; // "Start" is selected. G_SetGamestate(GS_TIMEATTACK); - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); } // Drawing function for Nights Attack @@ -5375,7 +5375,7 @@ void M_DrawNightsAttackMenu(void) lumpnum_t lumpnum; char beststr[40]; - S_ChangeMusic(mus_racent, true); // Eww, but needed for when user hits escape during demo playback + S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); @@ -5498,7 +5498,7 @@ static void M_NightsAttack(INT32 choice) itemOn = nastart; // "Start" is selected. G_SetGamestate(GS_TIMEATTACK); - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); } // Player has selected the "START" from the nights attack screen @@ -5732,7 +5732,7 @@ static void M_ModeAttackEndGame(INT32 choice) itemOn = currentMenu->lastOn; G_SetGamestate(GS_TIMEATTACK); modeattacking = ATTACKING_NONE; - S_ChangeMusic(mus_racent, true); + S_ChangeMusicInternal("racent", true); // Update replay availability. CV_AddValue(&cv_nextmap, 1); CV_AddValue(&cv_nextmap, -1); @@ -6944,7 +6944,7 @@ static void M_ToggleDigital(void) if (nodigimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); S_StopMusic(); - S_ChangeMusic(mus_lclear, false); + S_ChangeMusicInternal("lclear", false); M_StartMessage(M_GetText("Digital Music Enabled\n"), NULL, MM_NOTHING); } else @@ -6971,7 +6971,7 @@ static void M_ToggleMIDI(void) I_InitMIDIMusic(); if (nomidimusic) return; S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); - S_ChangeMusic(mus_lclear, false); + S_ChangeMusicInternal("lclear", false); M_StartMessage(M_GetText("MIDI Music Enabled\n"), NULL, MM_NOTHING); } else diff --git a/src/p_enemy.c b/src/p_enemy.c index df529727..10176064 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3063,12 +3063,8 @@ void A_Invincibility(mobj_t *actor) { S_StopMusic(); if (mariomode) - { - S_ChangeMusic(mus_minvnc, false); G_GhostAddColor(GHC_INVINCIBLE); - } - else - S_ChangeMusic(mus_invinc, false); + S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); } } @@ -3104,7 +3100,7 @@ void A_SuperSneakers(mobj_t *actor) else { S_StopMusic(); - S_ChangeMusic(mus_shoes, false); + S_ChangeMusicInternal("shoes", false); } } } diff --git a/src/p_inter.c b/src/p_inter.c index 709e0e2b..61d397d6 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2073,7 +2073,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) if (P_IsLocalPlayer(target->player) && target->player == &players[consoleplayer]) { S_StopMusic(); // Stop the Music! Tails 03-14-2000 - S_ChangeMusic(mus_gmover, false); // Yousa dead now, Okieday? Tails 03-14-2000 + S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000 } } } @@ -2461,7 +2461,7 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source) && player->nightstime < 10*TICRATE) { //S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusic(mus_drown,false); + S_ChangeMusicInternal("drown",false); } } } diff --git a/src/p_saveg.c b/src/p_saveg.c index 61f51e49..67c66cb6 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -3192,7 +3192,7 @@ static inline boolean P_NetUnArchiveMisc(void) // tell the sound code to reset the music since we're skipping what // normally sets this flag - mapmusic |= MUSIC_RELOADRESET; + mapmusflags |= MUSIC_RELOADRESET; G_SetGamestate(READINT16(save_p)); diff --git a/src/p_setup.c b/src/p_setup.c index 3491669c..3a51d90b 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -180,10 +180,11 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) mapheaderinfo[num]->typeoflevel = 0; DEH_WriteUndoline("NEXTLEVEL", va("%d", mapheaderinfo[num]->nextlevel), UNDO_NONE); mapheaderinfo[num]->nextlevel = (INT16)(i + 1); - DEH_WriteUndoline("MUSICSLOT", va("%d", mapheaderinfo[num]->musicslot), UNDO_NONE); - mapheaderinfo[num]->musicslot = mus_map01m + num; - DEH_WriteUndoline("MUSICSLOTTRACK", va("%d", mapheaderinfo[num]->musicslottrack), UNDO_NONE); - mapheaderinfo[num]->musicslottrack = 0; + DEH_WriteUndoline("MUSIC", mapheaderinfo[num]->musname, UNDO_NONE); + snprintf(mapheaderinfo[num]->musname, 7, va("%sM", G_BuildMapName(i))); + mapheaderinfo[num]->musname[6] = 0; + DEH_WriteUndoline("MUSICTRACK", va("%d", mapheaderinfo[num]->mustrack), UNDO_NONE); + mapheaderinfo[num]->mustrack = 0; DEH_WriteUndoline("FORCECHARACTER", va("%d", mapheaderinfo[num]->forcecharacter), UNDO_NONE); mapheaderinfo[num]->forcecharacter[0] = '\0'; DEH_WriteUndoline("WEATHER", va("%d", mapheaderinfo[num]->weather), UNDO_NONE); @@ -1439,6 +1440,21 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) #endif case 413: // Change music + { + char process[8+1]; + + sd->toptexture = sd->midtexture = sd->bottomtexture = 0; + if (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0') + { + M_Memcpy(process,msd->bottomtexture,8); + process[8] = '\0'; + sd->bottomtexture = get_number(process)-1; + } + M_Memcpy(process,msd->toptexture,8); + sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL); + M_Memcpy(sd->text, process, strlen(process)+1); + break; + } case 414: // Play SFX { sd->toptexture = sd->midtexture = sd->bottomtexture = 0; @@ -1449,13 +1465,6 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) process[8] = '\0'; sd->toptexture = get_number(process); } - if (sd->special == 413 && (msd->bottomtexture[0] != '-' || msd->bottomtexture[1] != '\0')) - { - char process[8+1]; - M_Memcpy(process,msd->bottomtexture,8); - process[8] = '\0'; - sd->bottomtexture = get_number(process)-1; - } break; } diff --git a/src/p_spec.c b/src/p_spec.c index 81994d46..ef3425e0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2390,20 +2390,19 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) // console player only unless NOCLIMB is set if ((line->flags & ML_NOCLIMB) || (mo && mo->player && P_IsLocalPlayer(mo->player))) { - UINT16 musicnum = (UINT16)sides[line->sidenum[0]].toptexture; //P_AproxDistance(line->dx, line->dy)>>FRACBITS; UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture; - mapmusic = musicnum | (tracknum << MUSIC_TRACKSHIFT); - if (!(line->flags & ML_BLOCKMONSTERS)) - mapmusic |= MUSIC_RELOADRESET; + strncpy(mapmusname, line->text, 7); + mapmusname[6] = 0; - if (musicnum >= NUMMUSIC || musicnum == mus_None) - S_StopMusic(); - else - S_ChangeMusic(mapmusic, !(line->flags & ML_EFFECT4)); + mapmusflags = tracknum & MUSIC_TRACKMASK; + if (!(line->flags & ML_BLOCKMONSTERS)) + mapmusflags |= MUSIC_RELOADRESET; + + S_ChangeMusic(mapmusname, mapmusflags, !(line->flags & ML_EFFECT4)); // Except, you can use the ML_BLOCKMONSTERS flag to change this behavior. - // if (mapmusic & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. + // if (mapmusflags & MUSIC_RELOADRESET) then it will reset the music in G_PlayerReborn. } break; diff --git a/src/p_user.c b/src/p_user.c index f015c17f..ef281406 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -962,7 +962,7 @@ void P_DoSuperTransformation(player_t *player, boolean giverings) if (!(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC) && P_IsLocalPlayer(player)) { S_StopMusic(); - S_ChangeMusic(mus_supers, true); + S_ChangeMusicInternal("supers", true); } S_StartSound(NULL, sfx_supert); //let all players hear it -mattw_cfi @@ -1098,7 +1098,7 @@ void P_PlayLivesJingle(player_t *player) if (player) player->powers[pw_extralife] = extralifetics + 1; S_StopMusic(); // otherwise it won't restart if this is done twice in a row - S_ChangeMusic(mus_xtlife, false); + S_ChangeMusicInternal("xtlife", false); } } @@ -1116,21 +1116,21 @@ void P_RestoreMusic(player_t *player) return; S_SpeedMusic(1.0f); if (player->powers[pw_super] && !(mapheaderinfo[gamemap-1]->levelflags & LF_NOSSMUSIC)) - S_ChangeMusic(mus_supers, true); + S_ChangeMusicInternal("supers", true); else if (player->powers[pw_invulnerability] > 1) - S_ChangeMusic((mariomode) ? mus_minvnc : mus_invinc, false); + S_ChangeMusicInternal((mariomode) ? "minvnc" : "invinc", false); else if (player->powers[pw_sneakers] > 1 && !player->powers[pw_super]) { if (mapheaderinfo[gamemap-1]->levelflags & LF_SPEEDMUSIC) { S_SpeedMusic(1.4f); - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } else - S_ChangeMusic(mus_shoes, true); + S_ChangeMusicInternal("shoes", true); } else - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } // @@ -2039,7 +2039,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) mobj_t *killer; if ((netgame || multiplayer) && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); killer = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_NULL); killer->threshold = 42; // Special flag that it was drowning which killed you. @@ -2048,7 +2048,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) else if (player->powers[pw_spacetime] == 1) { if ((netgame || multiplayer) && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); P_DamageMobj(player->mo, NULL, NULL, 10000); } @@ -2083,7 +2083,7 @@ static void P_CheckUnderwaterAndSpaceTimer(player_t *player) && player == &players[consoleplayer]) { S_StopMusic(); - S_ChangeMusic(mus_drown, false); + S_ChangeMusicInternal("drown", false); } if (player->powers[pw_underwater] == 25*TICRATE + 1) @@ -5592,7 +5592,7 @@ static void P_NiGHTSMovement(player_t *player) } else if (P_IsLocalPlayer(player) && player->nightstime == 10*TICRATE) // S_StartSound(NULL, sfx_timeup); // that creepy "out of time" music from NiGHTS. Dummied out, as some on the dev team thought it wasn't Sonic-y enough (Mystic, notably). Uncomment to restore. -SH - S_ChangeMusic(mus_drown,false); + S_ChangeMusicInternal("drown",false); if (player->mo->z < player->mo->floorz) @@ -7731,7 +7731,7 @@ static void P_DeathThink(player_t *player) // Return to level music if (netgame && player->deadtimer == gameovertics && P_IsLocalPlayer(player)) - S_ChangeMusic(mapmusic, true); + S_ChangeMusic(mapmusname, mapmusflags, true); } if (!player->mo) @@ -8717,7 +8717,7 @@ void P_PlayerThink(player_t *player) if (countdown == 11*TICRATE - 1) { if (P_IsLocalPlayer(player)) - S_ChangeMusic(mus_drown, false); + S_ChangeMusicInternal("drown", false); } // If you've hit the countdown and you haven't made diff --git a/src/s_sound.c b/src/s_sound.c index 14a8cc42..1e5f79aa 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -141,14 +141,6 @@ typedef struct static channel_t *channels = NULL; static INT32 numofchannels = 0; -// whether songs are mus_paused -static boolean mus_paused = 0; - -// music currently being played -musicinfo_t *mus_playing = 0; - -static INT32 nextcleanup; - // // Internals. // @@ -307,47 +299,6 @@ static void SetChannelsNum(void) channels[i].sfxinfo = 0; } -// -// Initializes sound stuff, including volume -// Sets channels, SFX and music volume, -// allocates channel buffer, sets S_sfx lookup. -// -void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume) -{ - INT32 i; - - if (dedicated) - return; - - S_SetSfxVolume(sfxVolume); - S_SetDigMusicVolume(digMusicVolume); - S_SetMIDIMusicVolume(midiMusicVolume); - - SetChannelsNum(); - - // no sounds are playing, and they are not mus_paused - mus_paused = 0; - - // Note that sounds have not been cached (yet). - for (i = 1; i < NUMSFX; i++) - { - S_sfx[i].usefulness = -1; // for I_GetSfx() - S_sfx[i].lumpnum = LUMPERROR; - } - - // precache sounds if requested by cmdline, or precachesound var true - if (!nosound && (M_CheckParm("-precachesound") || precachesound.value)) - { - // Initialize external data (all sounds) at start, keep static. - CONS_Printf(M_GetText("Loading sounds... ")); - - for (i = 1; i < NUMSFX; i++) - if (S_sfx[i].name) - S_sfx[i].data = I_GetSfx(&S_sfx[i]); - - CONS_Printf(M_GetText(" pre-cached all sound data\n")); - } -} // Retrieve the lump number of sfx // @@ -371,12 +322,6 @@ lumpnum_t S_GetSfxLumpNum(sfxinfo_t *sfx) return W_GetNumForName("dsthok"); } -// -// Per level startup code. -// Kills playing sounds at start of level, -// determines music if any, changes music. -// - // Stop all sounds, load level info, THEN start sounds. void S_StopSounds(void) { @@ -442,22 +387,6 @@ void S_StopSoundByNum(sfxenum_t sfxnum) } } -void S_Start(void) -{ - if (mapmusic & MUSIC_RELOADRESET) - { - mapmusic = mapheaderinfo[gamemap-1]->musicslot - | (mapheaderinfo[gamemap-1]->musicslottrack << MUSIC_TRACKSHIFT); - } - - mus_paused = 0; - - if (cv_resetmusic.value) - S_StopMusic(); - S_ChangeMusic(mapmusic, true); - nextcleanup = 15; -} - void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume) { INT32 sep, pitch, priority, cnum; @@ -745,43 +674,6 @@ void S_StopSound(void *origin) } } -// -// Stop and resume music, during game PAUSE. -// -void S_PauseSound(void) -{ - if (!nodigimusic) - I_PauseSong(0); - - if (mus_playing && !mus_paused) - { - I_PauseSong(mus_playing->handle); - mus_paused = true; - } - - // pause cd music -#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) - I_PauseCD(); -#else - I_StopCD(); -#endif -} - -void S_ResumeSound(void) -{ - if (!nodigimusic) - I_ResumeSong(0); - else - if (mus_playing && mus_paused) - { - I_ResumeSong(mus_playing->handle); - mus_paused = false; - } - - // resume cd music - I_ResumeCD(); -} - // // Updates music & sounds // @@ -883,38 +775,6 @@ void S_UpdateSounds(void) } } - // Clean up unused data. -#if 0 - { - static tic_t nextcleanup = 0; - size_t i; - sfxinfo_t *sfx; - - if (!gametic) nextcleanup = 0; - if (gametic > nextcleanup) - { - for (i = 1; i < NUMSFX; i++) - { - if (S_sfx[i].usefulness == 0) - { - S_sfx[i].usefulness--; - - // don't forget to unlock it !!! - // __dmpi_unlock_.... - //Z_ChangeTag(S_sfx[i].data, PU_CACHE); - I_FreeSfx(S_sfx+i); - //S_sfx[i].data = 0; - - CONS_Debug(DBG_GAMELOGIC, "flushed sfx %.6s\n", S_sfx[i].name); - } - } - nextcleanup = gametic + 15; - } - } -#endif - - // FIXTHIS: nextcleanup is probably unused - for (cnum = 0; cnum < numofchannels; cnum++) { c = &channels[cnum]; @@ -984,37 +844,6 @@ void S_UpdateSounds(void) I_UpdateSound(); } -void S_SetDigMusicVolume(INT32 volume) -{ - if (volume < 0 || volume > 31) - CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); - - CV_SetValue(&cv_digmusicvolume, volume&31); - actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var - -#ifdef DJGPPDOS - I_SetDigMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. -#endif - - if (!nodigimusic) - I_SetDigMusicVolume(volume&31); -} - -void S_SetMIDIMusicVolume(INT32 volume) -{ - if (volume < 0 || volume > 31) - CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); - - CV_SetValue(&cv_midimusicvolume, volume&0x1f); - actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var - -#ifdef DJGPPDOS - I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. -#endif - - I_SetMIDIMusicVolume(volume&0x1f); -} - void S_SetSfxVolume(INT32 volume) { if (volume < 0 || volume > 31) @@ -1031,137 +860,6 @@ void S_SetSfxVolume(INT32 volume) #endif } -static boolean S_MIDIMusic(musicinfo_t *music, boolean looping) -{ - if (nomidimusic) - return true; // no error - - if (music_disabled) - return true; // no error - - // get lumpnum if neccessary - if (!music->lumpnum) - { - if (W_CheckNumForName(va("d_%s", music->name)) == LUMPERROR) - return false; - music->lumpnum = W_GetNumForName(va("d_%s", music->name)); - } - - // load & register it - music->data = W_CacheLumpNum(music->lumpnum, PU_MUSIC); -#if defined (macintosh) && !defined (HAVE_SDL) - music->handle = I_RegisterSong(music_num); -#else - music->handle = I_RegisterSong(music->data, W_LumpLength(music->lumpnum)); -#endif - -#ifdef MUSSERV - if (msg_id != -1) - { - struct musmsg msg_buffer; - - msg_buffer.msg_type = 6; - memset(msg_buffer.msg_text, 0, sizeof (msg_buffer.msg_text)); - sprintf(msg_buffer.msg_text, "d_%s", music->name); - msgsnd(msg_id, (struct msgbuf*)&msg_buffer, sizeof (msg_buffer.msg_text), IPC_NOWAIT); - } -#endif - - // play it - if (!I_PlaySong(music->handle, looping)) - return false; - - mus_playing = music; - return true; -} - -static boolean S_DigMusic(musicinfo_t *music, boolean looping) -{ - if (nodigimusic) - return false; // try midi - - if (digital_disabled) - return false; // try midi - - if (!I_StartDigSong(music->name, looping)) - return false; - - mus_playing = music; - return true; -} - -void S_ChangeMusic(UINT32 mslotnum, boolean looping) -{ - musicinfo_t *music; - musicenum_t music_num = (signed)(mslotnum & MUSIC_SONGMASK); - INT32 track_num = (mslotnum & MUSIC_TRACKMASK) >> MUSIC_TRACKSHIFT; - -#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) - S_ClearSfx(); -#endif - - if (nomidimusic && nodigimusic) - return; - - if (music_disabled && digital_disabled) - return; - - // No Music - if (music_num == mus_None) - { - S_StopMusic(); - return; - } - - if (music_num >= NUMMUSIC) - { - CONS_Alert(CONS_ERROR, "Bad music number %d\n", music_num); - return; - } - else - music = &S_music[music_num]; - - if (mus_playing != music) - { - S_StopMusic(); // shutdown old music - if (!S_DigMusic(music, looping) && !S_MIDIMusic(music, looping)) - { - CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), music->name); - return; - } - } - I_SetSongTrack(track_num); -} - -boolean S_SpeedMusic(float speed) -{ - return I_SetSongSpeed(speed); -} - -void S_StopMusic(void) -{ - if (!mus_playing) - return; - - if (mus_paused) - I_ResumeSong(mus_playing->handle); - - if (!nodigimusic) - I_StopDigSong(); - - S_SpeedMusic(1.0f); - I_StopSong(mus_playing->handle); - I_UnRegisterSong(mus_playing->handle); - -#ifndef HAVE_SDL //SDL uses RWOPS - Z_ChangeTag(mus_playing->data, PU_CACHE); -#endif - - mus_playing->data = NULL; - mus_playing = NULL; - -} - void S_ClearSfx(void) { #ifndef DJGPPDOS @@ -1452,3 +1150,263 @@ void S_StartSoundName(void *mo, const char *soundname) S_StartSound(mo, soundnum); } + +/// ------------------------ +/// Music +/// ------------------------ + +#define music_playing (music_name[0]) // String is empty if no music is playing + +static char music_name[7]; // up to 6-character name +static lumpnum_t music_lumpnum; // lump number of music (used??) +static void *music_data; // music raw data +static INT32 music_handle; // once registered, the handle for the music + +static boolean mus_paused = 0; // whether songs are mus_paused + +static boolean S_MIDIMusic(const char *mname, boolean looping) +{ + lumpnum_t mlumpnum; + void *mdata; + INT32 mhandle; + + if (nomidimusic || music_disabled) + return false; // didn't search. + + if (W_CheckNumForName(va("d_%s", mname)) == LUMPERROR) + return false; + mlumpnum = W_GetNumForName(va("d_%s", mname)); + + // load & register it + mdata = W_CacheLumpNum(mlumpnum, PU_MUSIC); + mhandle = I_RegisterSong(mdata, W_LumpLength(mlumpnum)); + +#ifdef MUSSERV + if (msg_id != -1) + { + struct musmsg msg_buffer; + + msg_buffer.msg_type = 6; + memset(msg_buffer.msg_text, 0, sizeof (msg_buffer.msg_text)); + sprintf(msg_buffer.msg_text, "d_%s", mname); + msgsnd(msg_id, (struct msgbuf*)&msg_buffer, sizeof (msg_buffer.msg_text), IPC_NOWAIT); + } +#endif + + // play it + if (!I_PlaySong(mhandle, looping)) + return false; + + strncpy(music_name, mname, 7); + music_name[6] = 0; + music_lumpnum = mlumpnum; + music_data = mdata; + music_handle = mhandle; + return true; +} + +static boolean S_DigMusic(const char *mname, boolean looping) +{ + if (nodigimusic || digital_disabled) + return false; // try midi + + if (!I_StartDigSong(mname, looping)) + return false; + + strncpy(music_name, mname, 7); + music_name[6] = 0; + music_lumpnum = LUMPERROR; + music_data = NULL; + music_handle = 0; + return true; +} + +void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping) +{ +#if defined (DC) || defined (_WIN32_WCE) || defined (PSP) || defined(GP2X) + S_ClearSfx(); +#endif + + if ((nomidimusic || music_disabled) && (nodigimusic || digital_disabled)) + return; + + // No Music (empty string) + if (mmusic[0] == 0) + { + S_StopMusic(); + return; + } + + if (strncmp(music_name, mmusic, 6)) + { + S_StopMusic(); // shutdown old music + if (!S_DigMusic(mmusic, looping) && !S_MIDIMusic(mmusic, looping)) + { + CONS_Alert(CONS_ERROR, M_GetText("Music lump %.6s not found!\n"), mmusic); + return; + } + } + I_SetSongTrack(mflags & MUSIC_TRACKMASK); +} + +boolean S_SpeedMusic(float speed) +{ + return I_SetSongSpeed(speed); +} + +void S_StopMusic(void) +{ + if (!music_playing) + return; + + if (mus_paused) + I_ResumeSong(music_handle); + + if (!nodigimusic) + I_StopDigSong(); + + S_SpeedMusic(1.0f); + I_StopSong(music_handle); + I_UnRegisterSong(music_handle); + +#ifndef HAVE_SDL //SDL uses RWOPS + Z_ChangeTag(music_data, PU_CACHE); +#endif + + music_data = NULL; + music_name[0] = 0; +} + +void S_SetDigMusicVolume(INT32 volume) +{ + if (volume < 0 || volume > 31) + CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); + + CV_SetValue(&cv_digmusicvolume, volume&31); + actualdigmusicvolume = cv_digmusicvolume.value; //check for change of var + +#ifdef DJGPPDOS + I_SetDigMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. +#endif + if (!nodigimusic) + I_SetDigMusicVolume(volume&31); +} + +void S_SetMIDIMusicVolume(INT32 volume) +{ + if (volume < 0 || volume > 31) + CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n"); + + CV_SetValue(&cv_midimusicvolume, volume&0x1f); + actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var + +#ifdef DJGPPDOS + I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this. +#endif + I_SetMIDIMusicVolume(volume&0x1f); +} + +/// ------------------------ +/// Init & Others +/// ------------------------ + +// +// Initializes sound stuff, including volume +// Sets channels, SFX and music volume, +// allocates channel buffer, sets S_sfx lookup. +// +void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume) +{ + INT32 i; + + if (dedicated) + return; + + S_SetSfxVolume(sfxVolume); + S_SetDigMusicVolume(digMusicVolume); + S_SetMIDIMusicVolume(midiMusicVolume); + + SetChannelsNum(); + + // no sounds are playing, and they are not mus_paused + mus_paused = 0; + + // Note that sounds have not been cached (yet). + for (i = 1; i < NUMSFX; i++) + { + S_sfx[i].usefulness = -1; // for I_GetSfx() + S_sfx[i].lumpnum = LUMPERROR; + } + + // precache sounds if requested by cmdline, or precachesound var true + if (!nosound && (M_CheckParm("-precachesound") || precachesound.value)) + { + // Initialize external data (all sounds) at start, keep static. + CONS_Printf(M_GetText("Loading sounds... ")); + + for (i = 1; i < NUMSFX; i++) + if (S_sfx[i].name) + S_sfx[i].data = I_GetSfx(&S_sfx[i]); + + CONS_Printf(M_GetText(" pre-cached all sound data\n")); + } +} + + +// +// Per level startup code. +// Kills playing sounds at start of level, +// determines music if any, changes music. +// +void S_Start(void) +{ + if (mapmusflags & MUSIC_RELOADRESET) + { + strncpy(mapmusname, mapheaderinfo[gamemap-1]->musname, 7); + mapmusname[6] = 0; + mapmusflags = (mapheaderinfo[gamemap-1]->mustrack & MUSIC_TRACKMASK); + } + + mus_paused = 0; + + if (cv_resetmusic.value) + S_StopMusic(); + S_ChangeMusic(mapmusname, mapmusflags, true); +} + +// +// Stop and resume music, during game PAUSE. +// +void S_PauseAudio(void) +{ + if (!nodigimusic) + I_PauseSong(0); + + if (music_playing && !mus_paused) + { + I_PauseSong(music_handle); + mus_paused = true; + } + + // pause cd music +#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL) + I_PauseCD(); +#else + I_StopCD(); +#endif +} + +void S_ResumeAudio(void) +{ + if (!nodigimusic) + I_ResumeSong(0); + else + if (music_playing && mus_paused) + { + I_ResumeSong(music_handle); + mus_paused = false; + } + + // resume cd music + I_ResumeCD(); +} diff --git a/src/s_sound.h b/src/s_sound.h index 6589ca59..12787536 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -48,9 +48,6 @@ typedef enum extern consvar_t play_mode; #endif -//in case you're wondering why: I need to define this as extern so P_RestoreMusic can get to it so we don't do stupid song/speed changes -extern musicinfo_t *mus_playing; - typedef enum { SF_TOTALLYSINGLE = 1, // Only play one of these sounds at a time...GLOBALLY @@ -100,11 +97,12 @@ void S_StartSoundAtVolume(const void *origin, sfxenum_t sound_id, INT32 volume); // Stop sound for thing at void S_StopSound(void *origin); -// Start music using from sounds.h, and set whether looping -// note: music slot is first 16 bits for songnum, -// next 15 bits for tracknum (gme, other formats with more than one track) +// Start music track, arbitrary, given its name, and set whether looping +// note: music flags 12 bits for tracknum (gme, other formats with more than one track) +// 13-15 aren't used yet // and the last bit we ignore (internal game flag for resetting music on reload) -void S_ChangeMusic(UINT32 mslotnum, boolean looping); +#define S_ChangeMusicInternal(a,b) S_ChangeMusic(a,0,b) +void S_ChangeMusic(const char *mmusic, UINT16 mflags, boolean looping); // Set Speed of Music boolean S_SpeedMusic(float speed); @@ -113,8 +111,8 @@ boolean S_SpeedMusic(float speed); void S_StopMusic(void); // Stop and resume music, during game PAUSE. -void S_PauseSound(void); -void S_ResumeSound(void); +void S_PauseAudio(void); +void S_ResumeAudio(void); // // Updates music & sounds diff --git a/src/sdl/mixer_sound.c b/src/sdl/mixer_sound.c index 71969209..2ce54615 100644 --- a/src/sdl/mixer_sound.c +++ b/src/sdl/mixer_sound.c @@ -374,6 +374,7 @@ void I_FreeSfx(sfxinfo_t *sfx) if (sfx->data) Mix_FreeChunk(sfx->data); sfx->data = NULL; + sfx->lumpnum = LUMPERROR; } INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority) diff --git a/src/sounds.c b/src/sounds.c index 1ec86e7b..97bdf23e 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -20,1067 +20,6 @@ #include "w_wad.h" #include "lua_script.h" -// -// Information about all the music -// - -musicinfo_t S_music[NUMMUSIC] = -{ - {NULL, 0, NULL, -1}, - {"map01m", 0, NULL, -1}, - {"map02m", 0, NULL, -1}, - {"map03m", 0, NULL, -1}, - {"map04m", 0, NULL, -1}, - {"map05m", 0, NULL, -1}, - {"map06m", 0, NULL, -1}, - {"map07m", 0, NULL, -1}, - {"map08m", 0, NULL, -1}, - {"map09m", 0, NULL, -1}, - {"map10m", 0, NULL, -1}, - {"map11m", 0, NULL, -1}, - {"map12m", 0, NULL, -1}, - {"map13m", 0, NULL, -1}, - {"map14m", 0, NULL, -1}, - {"map15m", 0, NULL, -1}, - {"map16m", 0, NULL, -1}, - {"map17m", 0, NULL, -1}, - {"map18m", 0, NULL, -1}, - {"map19m", 0, NULL, -1}, - {"map20m", 0, NULL, -1}, - {"map21m", 0, NULL, -1}, - {"map22m", 0, NULL, -1}, - {"map23m", 0, NULL, -1}, - {"map24m", 0, NULL, -1}, - {"map25m", 0, NULL, -1}, - {"map26m", 0, NULL, -1}, - {"map27m", 0, NULL, -1}, - {"map28m", 0, NULL, -1}, - {"map29m", 0, NULL, -1}, - {"map30m", 0, NULL, -1}, - {"map31m", 0, NULL, -1}, - {"map32m", 0, NULL, -1}, - {"map33m", 0, NULL, -1}, - {"map34m", 0, NULL, -1}, - {"map35m", 0, NULL, -1}, - {"map36m", 0, NULL, -1}, - {"map37m", 0, NULL, -1}, - {"map38m", 0, NULL, -1}, - {"map39m", 0, NULL, -1}, - {"map40m", 0, NULL, -1}, - {"map41m", 0, NULL, -1}, - {"map42m", 0, NULL, -1}, - {"map43m", 0, NULL, -1}, - {"map44m", 0, NULL, -1}, - {"map45m", 0, NULL, -1}, - {"map46m", 0, NULL, -1}, - {"map47m", 0, NULL, -1}, - {"map48m", 0, NULL, -1}, - {"map49m", 0, NULL, -1}, - {"map50m", 0, NULL, -1}, - {"map51m", 0, NULL, -1}, - {"map52m", 0, NULL, -1}, - {"map53m", 0, NULL, -1}, - {"map54m", 0, NULL, -1}, - {"map55m", 0, NULL, -1}, - {"map56m", 0, NULL, -1}, - {"map57m", 0, NULL, -1}, - {"map58m", 0, NULL, -1}, - {"map59m", 0, NULL, -1}, - {"map60m", 0, NULL, -1}, - {"map61m", 0, NULL, -1}, - {"map62m", 0, NULL, -1}, - {"map63m", 0, NULL, -1}, - {"map64m", 0, NULL, -1}, - {"map65m", 0, NULL, -1}, - {"map66m", 0, NULL, -1}, - {"map67m", 0, NULL, -1}, - {"map68m", 0, NULL, -1}, - {"map69m", 0, NULL, -1}, - {"map70m", 0, NULL, -1}, - {"map71m", 0, NULL, -1}, - {"map72m", 0, NULL, -1}, - {"map73m", 0, NULL, -1}, - {"map74m", 0, NULL, -1}, - {"map75m", 0, NULL, -1}, - {"map76m", 0, NULL, -1}, - {"map77m", 0, NULL, -1}, - {"map78m", 0, NULL, -1}, - {"map79m", 0, NULL, -1}, - {"map80m", 0, NULL, -1}, - {"map81m", 0, NULL, -1}, - {"map82m", 0, NULL, -1}, - {"map83m", 0, NULL, -1}, - {"map84m", 0, NULL, -1}, - {"map85m", 0, NULL, -1}, - {"map86m", 0, NULL, -1}, - {"map87m", 0, NULL, -1}, - {"map88m", 0, NULL, -1}, - {"map89m", 0, NULL, -1}, - {"map90m", 0, NULL, -1}, - {"map91m", 0, NULL, -1}, - {"map92m", 0, NULL, -1}, - {"map93m", 0, NULL, -1}, - {"map94m", 0, NULL, -1}, - {"map95m", 0, NULL, -1}, - {"map96m", 0, NULL, -1}, - {"map97m", 0, NULL, -1}, - {"map98m", 0, NULL, -1}, - {"map99m", 0, NULL, -1}, - {"mapa0m", 0, NULL, -1}, - {"mapa1m", 0, NULL, -1}, - {"mapa2m", 0, NULL, -1}, - {"mapa3m", 0, NULL, -1}, - {"mapa4m", 0, NULL, -1}, - {"mapa5m", 0, NULL, -1}, - {"mapa6m", 0, NULL, -1}, - {"mapa7m", 0, NULL, -1}, - {"mapa8m", 0, NULL, -1}, - {"mapa9m", 0, NULL, -1}, - {"mapaam", 0, NULL, -1}, - {"mapabm", 0, NULL, -1}, - {"mapacm", 0, NULL, -1}, - {"mapadm", 0, NULL, -1}, - {"mapaem", 0, NULL, -1}, - {"mapafm", 0, NULL, -1}, - {"mapagm", 0, NULL, -1}, - {"mapahm", 0, NULL, -1}, - {"mapaim", 0, NULL, -1}, - {"mapajm", 0, NULL, -1}, - {"mapakm", 0, NULL, -1}, - {"mapalm", 0, NULL, -1}, - {"mapamm", 0, NULL, -1}, - {"mapanm", 0, NULL, -1}, - {"mapaom", 0, NULL, -1}, - {"mapapm", 0, NULL, -1}, - {"mapaqm", 0, NULL, -1}, - {"maparm", 0, NULL, -1}, - {"mapasm", 0, NULL, -1}, - {"mapatm", 0, NULL, -1}, - {"mapaum", 0, NULL, -1}, - {"mapavm", 0, NULL, -1}, - {"mapawm", 0, NULL, -1}, - {"mapaxm", 0, NULL, -1}, - {"mapaym", 0, NULL, -1}, - {"mapazm", 0, NULL, -1}, - {"mapb0m", 0, NULL, -1}, - {"mapb1m", 0, NULL, -1}, - {"mapb2m", 0, NULL, -1}, - {"mapb3m", 0, NULL, -1}, - {"mapb4m", 0, NULL, -1}, - {"mapb5m", 0, NULL, -1}, - {"mapb6m", 0, NULL, -1}, - {"mapb7m", 0, NULL, -1}, - {"mapb8m", 0, NULL, -1}, - {"mapb9m", 0, NULL, -1}, - {"mapbam", 0, NULL, -1}, - {"mapbbm", 0, NULL, -1}, - {"mapbcm", 0, NULL, -1}, - {"mapbdm", 0, NULL, -1}, - {"mapbem", 0, NULL, -1}, - {"mapbfm", 0, NULL, -1}, - {"mapbgm", 0, NULL, -1}, - {"mapbhm", 0, NULL, -1}, - {"mapbim", 0, NULL, -1}, - {"mapbjm", 0, NULL, -1}, - {"mapbkm", 0, NULL, -1}, - {"mapblm", 0, NULL, -1}, - {"mapbmm", 0, NULL, -1}, - {"mapbnm", 0, NULL, -1}, - {"mapbom", 0, NULL, -1}, - {"mapbpm", 0, NULL, -1}, - {"mapbqm", 0, NULL, -1}, - {"mapbrm", 0, NULL, -1}, - {"mapbsm", 0, NULL, -1}, - {"mapbtm", 0, NULL, -1}, - {"mapbum", 0, NULL, -1}, - {"mapbvm", 0, NULL, -1}, - {"mapbwm", 0, NULL, -1}, - {"mapbxm", 0, NULL, -1}, - {"mapbym", 0, NULL, -1}, - {"mapbzm", 0, NULL, -1}, - {"mapc0m", 0, NULL, -1}, - {"mapc1m", 0, NULL, -1}, - {"mapc2m", 0, NULL, -1}, - {"mapc3m", 0, NULL, -1}, - {"mapc4m", 0, NULL, -1}, - {"mapc5m", 0, NULL, -1}, - {"mapc6m", 0, NULL, -1}, - {"mapc7m", 0, NULL, -1}, - {"mapc8m", 0, NULL, -1}, - {"mapc9m", 0, NULL, -1}, - {"mapcam", 0, NULL, -1}, - {"mapcbm", 0, NULL, -1}, - {"mapccm", 0, NULL, -1}, - {"mapcdm", 0, NULL, -1}, - {"mapcem", 0, NULL, -1}, - {"mapcfm", 0, NULL, -1}, - {"mapcgm", 0, NULL, -1}, - {"mapchm", 0, NULL, -1}, - {"mapcim", 0, NULL, -1}, - {"mapcjm", 0, NULL, -1}, - {"mapckm", 0, NULL, -1}, - {"mapclm", 0, NULL, -1}, - {"mapcmm", 0, NULL, -1}, - {"mapcnm", 0, NULL, -1}, - {"mapcom", 0, NULL, -1}, - {"mapcpm", 0, NULL, -1}, - {"mapcqm", 0, NULL, -1}, - {"mapcrm", 0, NULL, -1}, - {"mapcsm", 0, NULL, -1}, - {"mapctm", 0, NULL, -1}, - {"mapcum", 0, NULL, -1}, - {"mapcvm", 0, NULL, -1}, - {"mapcwm", 0, NULL, -1}, - {"mapcxm", 0, NULL, -1}, - {"mapcym", 0, NULL, -1}, - {"mapczm", 0, NULL, -1}, - {"mapd0m", 0, NULL, -1}, - {"mapd1m", 0, NULL, -1}, - {"mapd2m", 0, NULL, -1}, - {"mapd3m", 0, NULL, -1}, - {"mapd4m", 0, NULL, -1}, - {"mapd5m", 0, NULL, -1}, - {"mapd6m", 0, NULL, -1}, - {"mapd7m", 0, NULL, -1}, - {"mapd8m", 0, NULL, -1}, - {"mapd9m", 0, NULL, -1}, - {"mapdam", 0, NULL, -1}, - {"mapdbm", 0, NULL, -1}, - {"mapdcm", 0, NULL, -1}, - {"mapddm", 0, NULL, -1}, - {"mapdem", 0, NULL, -1}, - {"mapdfm", 0, NULL, -1}, - {"mapdgm", 0, NULL, -1}, - {"mapdhm", 0, NULL, -1}, - {"mapdim", 0, NULL, -1}, - {"mapdjm", 0, NULL, -1}, - {"mapdkm", 0, NULL, -1}, - {"mapdlm", 0, NULL, -1}, - {"mapdmm", 0, NULL, -1}, - {"mapdnm", 0, NULL, -1}, - {"mapdom", 0, NULL, -1}, - {"mapdpm", 0, NULL, -1}, - {"mapdqm", 0, NULL, -1}, - {"mapdrm", 0, NULL, -1}, - {"mapdsm", 0, NULL, -1}, - {"mapdtm", 0, NULL, -1}, - {"mapdum", 0, NULL, -1}, - {"mapdvm", 0, NULL, -1}, - {"mapdwm", 0, NULL, -1}, - {"mapdxm", 0, NULL, -1}, - {"mapdym", 0, NULL, -1}, - {"mapdzm", 0, NULL, -1}, - {"mape0m", 0, NULL, -1}, - {"mape1m", 0, NULL, -1}, - {"mape2m", 0, NULL, -1}, - {"mape3m", 0, NULL, -1}, - {"mape4m", 0, NULL, -1}, - {"mape5m", 0, NULL, -1}, - {"mape6m", 0, NULL, -1}, - {"mape7m", 0, NULL, -1}, - {"mape8m", 0, NULL, -1}, - {"mape9m", 0, NULL, -1}, - {"mapeam", 0, NULL, -1}, - {"mapebm", 0, NULL, -1}, - {"mapecm", 0, NULL, -1}, - {"mapedm", 0, NULL, -1}, - {"mapeem", 0, NULL, -1}, - {"mapefm", 0, NULL, -1}, - {"mapegm", 0, NULL, -1}, - {"mapehm", 0, NULL, -1}, - {"mapeim", 0, NULL, -1}, - {"mapejm", 0, NULL, -1}, - {"mapekm", 0, NULL, -1}, - {"mapelm", 0, NULL, -1}, - {"mapemm", 0, NULL, -1}, - {"mapenm", 0, NULL, -1}, - {"mapeom", 0, NULL, -1}, - {"mapepm", 0, NULL, -1}, - {"mapeqm", 0, NULL, -1}, - {"maperm", 0, NULL, -1}, - {"mapesm", 0, NULL, -1}, - {"mapetm", 0, NULL, -1}, - {"mapeum", 0, NULL, -1}, - {"mapevm", 0, NULL, -1}, - {"mapewm", 0, NULL, -1}, - {"mapexm", 0, NULL, -1}, - {"mapeym", 0, NULL, -1}, - {"mapezm", 0, NULL, -1}, - {"mapf0m", 0, NULL, -1}, - {"mapf1m", 0, NULL, -1}, - {"mapf2m", 0, NULL, -1}, - {"mapf3m", 0, NULL, -1}, - {"mapf4m", 0, NULL, -1}, - {"mapf5m", 0, NULL, -1}, - {"mapf6m", 0, NULL, -1}, - {"mapf7m", 0, NULL, -1}, - {"mapf8m", 0, NULL, -1}, - {"mapf9m", 0, NULL, -1}, - {"mapfam", 0, NULL, -1}, - {"mapfbm", 0, NULL, -1}, - {"mapfcm", 0, NULL, -1}, - {"mapfdm", 0, NULL, -1}, - {"mapfem", 0, NULL, -1}, - {"mapffm", 0, NULL, -1}, - {"mapfgm", 0, NULL, -1}, - {"mapfhm", 0, NULL, -1}, - {"mapfim", 0, NULL, -1}, - {"mapfjm", 0, NULL, -1}, - {"mapfkm", 0, NULL, -1}, - {"mapflm", 0, NULL, -1}, - {"mapfmm", 0, NULL, -1}, - {"mapfnm", 0, NULL, -1}, - {"mapfom", 0, NULL, -1}, - {"mapfpm", 0, NULL, -1}, - {"mapfqm", 0, NULL, -1}, - {"mapfrm", 0, NULL, -1}, - {"mapfsm", 0, NULL, -1}, - {"mapftm", 0, NULL, -1}, - {"mapfum", 0, NULL, -1}, - {"mapfvm", 0, NULL, -1}, - {"mapfwm", 0, NULL, -1}, - {"mapfxm", 0, NULL, -1}, - {"mapfym", 0, NULL, -1}, - {"mapfzm", 0, NULL, -1}, - {"mapg0m", 0, NULL, -1}, - {"mapg1m", 0, NULL, -1}, - {"mapg2m", 0, NULL, -1}, - {"mapg3m", 0, NULL, -1}, - {"mapg4m", 0, NULL, -1}, - {"mapg5m", 0, NULL, -1}, - {"mapg6m", 0, NULL, -1}, - {"mapg7m", 0, NULL, -1}, - {"mapg8m", 0, NULL, -1}, - {"mapg9m", 0, NULL, -1}, - {"mapgam", 0, NULL, -1}, - {"mapgbm", 0, NULL, -1}, - {"mapgcm", 0, NULL, -1}, - {"mapgdm", 0, NULL, -1}, - {"mapgem", 0, NULL, -1}, - {"mapgfm", 0, NULL, -1}, - {"mapggm", 0, NULL, -1}, - {"mapghm", 0, NULL, -1}, - {"mapgim", 0, NULL, -1}, - {"mapgjm", 0, NULL, -1}, - {"mapgkm", 0, NULL, -1}, - {"mapglm", 0, NULL, -1}, - {"mapgmm", 0, NULL, -1}, - {"mapgnm", 0, NULL, -1}, - {"mapgom", 0, NULL, -1}, - {"mapgpm", 0, NULL, -1}, - {"mapgqm", 0, NULL, -1}, - {"mapgrm", 0, NULL, -1}, - {"mapgsm", 0, NULL, -1}, - {"mapgtm", 0, NULL, -1}, - {"mapgum", 0, NULL, -1}, - {"mapgvm", 0, NULL, -1}, - {"mapgwm", 0, NULL, -1}, - {"mapgxm", 0, NULL, -1}, - {"mapgym", 0, NULL, -1}, - {"mapgzm", 0, NULL, -1}, - {"maph0m", 0, NULL, -1}, - {"maph1m", 0, NULL, -1}, - {"maph2m", 0, NULL, -1}, - {"maph3m", 0, NULL, -1}, - {"maph4m", 0, NULL, -1}, - {"maph5m", 0, NULL, -1}, - {"maph6m", 0, NULL, -1}, - {"maph7m", 0, NULL, -1}, - {"maph8m", 0, NULL, -1}, - {"maph9m", 0, NULL, -1}, - {"mapham", 0, NULL, -1}, - {"maphbm", 0, NULL, -1}, - {"maphcm", 0, NULL, -1}, - {"maphdm", 0, NULL, -1}, - {"maphem", 0, NULL, -1}, - {"maphfm", 0, NULL, -1}, - {"maphgm", 0, NULL, -1}, - {"maphhm", 0, NULL, -1}, - {"maphim", 0, NULL, -1}, - {"maphjm", 0, NULL, -1}, - {"maphkm", 0, NULL, -1}, - {"maphlm", 0, NULL, -1}, - {"maphmm", 0, NULL, -1}, - {"maphnm", 0, NULL, -1}, - {"maphom", 0, NULL, -1}, - {"maphpm", 0, NULL, -1}, - {"maphqm", 0, NULL, -1}, - {"maphrm", 0, NULL, -1}, - {"maphsm", 0, NULL, -1}, - {"maphtm", 0, NULL, -1}, - {"maphum", 0, NULL, -1}, - {"maphvm", 0, NULL, -1}, - {"maphwm", 0, NULL, -1}, - {"maphxm", 0, NULL, -1}, - {"maphym", 0, NULL, -1}, - {"maphzm", 0, NULL, -1}, - {"mapi0m", 0, NULL, -1}, - {"mapi1m", 0, NULL, -1}, - {"mapi2m", 0, NULL, -1}, - {"mapi3m", 0, NULL, -1}, - {"mapi4m", 0, NULL, -1}, - {"mapi5m", 0, NULL, -1}, - {"mapi6m", 0, NULL, -1}, - {"mapi7m", 0, NULL, -1}, - {"mapi8m", 0, NULL, -1}, - {"mapi9m", 0, NULL, -1}, - {"mapiam", 0, NULL, -1}, - {"mapibm", 0, NULL, -1}, - {"mapicm", 0, NULL, -1}, - {"mapidm", 0, NULL, -1}, - {"mapiem", 0, NULL, -1}, - {"mapifm", 0, NULL, -1}, - {"mapigm", 0, NULL, -1}, - {"mapihm", 0, NULL, -1}, - {"mapiim", 0, NULL, -1}, - {"mapijm", 0, NULL, -1}, - {"mapikm", 0, NULL, -1}, - {"mapilm", 0, NULL, -1}, - {"mapimm", 0, NULL, -1}, - {"mapinm", 0, NULL, -1}, - {"mapiom", 0, NULL, -1}, - {"mapipm", 0, NULL, -1}, - {"mapiqm", 0, NULL, -1}, - {"mapirm", 0, NULL, -1}, - {"mapism", 0, NULL, -1}, - {"mapitm", 0, NULL, -1}, - {"mapium", 0, NULL, -1}, - {"mapivm", 0, NULL, -1}, - {"mapiwm", 0, NULL, -1}, - {"mapixm", 0, NULL, -1}, - {"mapiym", 0, NULL, -1}, - {"mapizm", 0, NULL, -1}, - {"mapj0m", 0, NULL, -1}, - {"mapj1m", 0, NULL, -1}, - {"mapj2m", 0, NULL, -1}, - {"mapj3m", 0, NULL, -1}, - {"mapj4m", 0, NULL, -1}, - {"mapj5m", 0, NULL, -1}, - {"mapj6m", 0, NULL, -1}, - {"mapj7m", 0, NULL, -1}, - {"mapj8m", 0, NULL, -1}, - {"mapj9m", 0, NULL, -1}, - {"mapjam", 0, NULL, -1}, - {"mapjbm", 0, NULL, -1}, - {"mapjcm", 0, NULL, -1}, - {"mapjdm", 0, NULL, -1}, - {"mapjem", 0, NULL, -1}, - {"mapjfm", 0, NULL, -1}, - {"mapjgm", 0, NULL, -1}, - {"mapjhm", 0, NULL, -1}, - {"mapjim", 0, NULL, -1}, - {"mapjjm", 0, NULL, -1}, - {"mapjkm", 0, NULL, -1}, - {"mapjlm", 0, NULL, -1}, - {"mapjmm", 0, NULL, -1}, - {"mapjnm", 0, NULL, -1}, - {"mapjom", 0, NULL, -1}, - {"mapjpm", 0, NULL, -1}, - {"mapjqm", 0, NULL, -1}, - {"mapjrm", 0, NULL, -1}, - {"mapjsm", 0, NULL, -1}, - {"mapjtm", 0, NULL, -1}, - {"mapjum", 0, NULL, -1}, - {"mapjvm", 0, NULL, -1}, - {"mapjwm", 0, NULL, -1}, - {"mapjxm", 0, NULL, -1}, - {"mapjym", 0, NULL, -1}, - {"mapjzm", 0, NULL, -1}, - {"mapk0m", 0, NULL, -1}, - {"mapk1m", 0, NULL, -1}, - {"mapk2m", 0, NULL, -1}, - {"mapk3m", 0, NULL, -1}, - {"mapk4m", 0, NULL, -1}, - {"mapk5m", 0, NULL, -1}, - {"mapk6m", 0, NULL, -1}, - {"mapk7m", 0, NULL, -1}, - {"mapk8m", 0, NULL, -1}, - {"mapk9m", 0, NULL, -1}, - {"mapkam", 0, NULL, -1}, - {"mapkbm", 0, NULL, -1}, - {"mapkcm", 0, NULL, -1}, - {"mapkdm", 0, NULL, -1}, - {"mapkem", 0, NULL, -1}, - {"mapkfm", 0, NULL, -1}, - {"mapkgm", 0, NULL, -1}, - {"mapkhm", 0, NULL, -1}, - {"mapkim", 0, NULL, -1}, - {"mapkjm", 0, NULL, -1}, - {"mapkkm", 0, NULL, -1}, - {"mapklm", 0, NULL, -1}, - {"mapkmm", 0, NULL, -1}, - {"mapknm", 0, NULL, -1}, - {"mapkom", 0, NULL, -1}, - {"mapkpm", 0, NULL, -1}, - {"mapkqm", 0, NULL, -1}, - {"mapkrm", 0, NULL, -1}, - {"mapksm", 0, NULL, -1}, - {"mapktm", 0, NULL, -1}, - {"mapkum", 0, NULL, -1}, - {"mapkvm", 0, NULL, -1}, - {"mapkwm", 0, NULL, -1}, - {"mapkxm", 0, NULL, -1}, - {"mapkym", 0, NULL, -1}, - {"mapkzm", 0, NULL, -1}, - {"mapl0m", 0, NULL, -1}, - {"mapl1m", 0, NULL, -1}, - {"mapl2m", 0, NULL, -1}, - {"mapl3m", 0, NULL, -1}, - {"mapl4m", 0, NULL, -1}, - {"mapl5m", 0, NULL, -1}, - {"mapl6m", 0, NULL, -1}, - {"mapl7m", 0, NULL, -1}, - {"mapl8m", 0, NULL, -1}, - {"mapl9m", 0, NULL, -1}, - {"maplam", 0, NULL, -1}, - {"maplbm", 0, NULL, -1}, - {"maplcm", 0, NULL, -1}, - {"mapldm", 0, NULL, -1}, - {"maplem", 0, NULL, -1}, - {"maplfm", 0, NULL, -1}, - {"maplgm", 0, NULL, -1}, - {"maplhm", 0, NULL, -1}, - {"maplim", 0, NULL, -1}, - {"mapljm", 0, NULL, -1}, - {"maplkm", 0, NULL, -1}, - {"mapllm", 0, NULL, -1}, - {"maplmm", 0, NULL, -1}, - {"maplnm", 0, NULL, -1}, - {"maplom", 0, NULL, -1}, - {"maplpm", 0, NULL, -1}, - {"maplqm", 0, NULL, -1}, - {"maplrm", 0, NULL, -1}, - {"maplsm", 0, NULL, -1}, - {"mapltm", 0, NULL, -1}, - {"maplum", 0, NULL, -1}, - {"maplvm", 0, NULL, -1}, - {"maplwm", 0, NULL, -1}, - {"maplxm", 0, NULL, -1}, - {"maplym", 0, NULL, -1}, - {"maplzm", 0, NULL, -1}, - {"mapm0m", 0, NULL, -1}, - {"mapm1m", 0, NULL, -1}, - {"mapm2m", 0, NULL, -1}, - {"mapm3m", 0, NULL, -1}, - {"mapm4m", 0, NULL, -1}, - {"mapm5m", 0, NULL, -1}, - {"mapm6m", 0, NULL, -1}, - {"mapm7m", 0, NULL, -1}, - {"mapm8m", 0, NULL, -1}, - {"mapm9m", 0, NULL, -1}, - {"mapmam", 0, NULL, -1}, - {"mapmbm", 0, NULL, -1}, - {"mapmcm", 0, NULL, -1}, - {"mapmdm", 0, NULL, -1}, - {"mapmem", 0, NULL, -1}, - {"mapmfm", 0, NULL, -1}, - {"mapmgm", 0, NULL, -1}, - {"mapmhm", 0, NULL, -1}, - {"mapmim", 0, NULL, -1}, - {"mapmjm", 0, NULL, -1}, - {"mapmkm", 0, NULL, -1}, - {"mapmlm", 0, NULL, -1}, - {"mapmmm", 0, NULL, -1}, - {"mapmnm", 0, NULL, -1}, - {"mapmom", 0, NULL, -1}, - {"mapmpm", 0, NULL, -1}, - {"mapmqm", 0, NULL, -1}, - {"mapmrm", 0, NULL, -1}, - {"mapmsm", 0, NULL, -1}, - {"mapmtm", 0, NULL, -1}, - {"mapmum", 0, NULL, -1}, - {"mapmvm", 0, NULL, -1}, - {"mapmwm", 0, NULL, -1}, - {"mapmxm", 0, NULL, -1}, - {"mapmym", 0, NULL, -1}, - {"mapmzm", 0, NULL, -1}, - {"mapn0m", 0, NULL, -1}, - {"mapn1m", 0, NULL, -1}, - {"mapn2m", 0, NULL, -1}, - {"mapn3m", 0, NULL, -1}, - {"mapn4m", 0, NULL, -1}, - {"mapn5m", 0, NULL, -1}, - {"mapn6m", 0, NULL, -1}, - {"mapn7m", 0, NULL, -1}, - {"mapn8m", 0, NULL, -1}, - {"mapn9m", 0, NULL, -1}, - {"mapnam", 0, NULL, -1}, - {"mapnbm", 0, NULL, -1}, - {"mapncm", 0, NULL, -1}, - {"mapndm", 0, NULL, -1}, - {"mapnem", 0, NULL, -1}, - {"mapnfm", 0, NULL, -1}, - {"mapngm", 0, NULL, -1}, - {"mapnhm", 0, NULL, -1}, - {"mapnim", 0, NULL, -1}, - {"mapnjm", 0, NULL, -1}, - {"mapnkm", 0, NULL, -1}, - {"mapnlm", 0, NULL, -1}, - {"mapnmm", 0, NULL, -1}, - {"mapnnm", 0, NULL, -1}, - {"mapnom", 0, NULL, -1}, - {"mapnpm", 0, NULL, -1}, - {"mapnqm", 0, NULL, -1}, - {"mapnrm", 0, NULL, -1}, - {"mapnsm", 0, NULL, -1}, - {"mapntm", 0, NULL, -1}, - {"mapnum", 0, NULL, -1}, - {"mapnvm", 0, NULL, -1}, - {"mapnwm", 0, NULL, -1}, - {"mapnxm", 0, NULL, -1}, - {"mapnym", 0, NULL, -1}, - {"mapnzm", 0, NULL, -1}, - {"mapo0m", 0, NULL, -1}, - {"mapo1m", 0, NULL, -1}, - {"mapo2m", 0, NULL, -1}, - {"mapo3m", 0, NULL, -1}, - {"mapo4m", 0, NULL, -1}, - {"mapo5m", 0, NULL, -1}, - {"mapo6m", 0, NULL, -1}, - {"mapo7m", 0, NULL, -1}, - {"mapo8m", 0, NULL, -1}, - {"mapo9m", 0, NULL, -1}, - {"mapoam", 0, NULL, -1}, - {"mapobm", 0, NULL, -1}, - {"mapocm", 0, NULL, -1}, - {"mapodm", 0, NULL, -1}, - {"mapoem", 0, NULL, -1}, - {"mapofm", 0, NULL, -1}, - {"mapogm", 0, NULL, -1}, - {"mapohm", 0, NULL, -1}, - {"mapoim", 0, NULL, -1}, - {"mapojm", 0, NULL, -1}, - {"mapokm", 0, NULL, -1}, - {"mapolm", 0, NULL, -1}, - {"mapomm", 0, NULL, -1}, - {"maponm", 0, NULL, -1}, - {"mapoom", 0, NULL, -1}, - {"mapopm", 0, NULL, -1}, - {"mapoqm", 0, NULL, -1}, - {"maporm", 0, NULL, -1}, - {"maposm", 0, NULL, -1}, - {"mapotm", 0, NULL, -1}, - {"mapoum", 0, NULL, -1}, - {"mapovm", 0, NULL, -1}, - {"mapowm", 0, NULL, -1}, - {"mapoxm", 0, NULL, -1}, - {"mapoym", 0, NULL, -1}, - {"mapozm", 0, NULL, -1}, - {"mapp0m", 0, NULL, -1}, - {"mapp1m", 0, NULL, -1}, - {"mapp2m", 0, NULL, -1}, - {"mapp3m", 0, NULL, -1}, - {"mapp4m", 0, NULL, -1}, - {"mapp5m", 0, NULL, -1}, - {"mapp6m", 0, NULL, -1}, - {"mapp7m", 0, NULL, -1}, - {"mapp8m", 0, NULL, -1}, - {"mapp9m", 0, NULL, -1}, - {"mappam", 0, NULL, -1}, - {"mappbm", 0, NULL, -1}, - {"mappcm", 0, NULL, -1}, - {"mappdm", 0, NULL, -1}, - {"mappem", 0, NULL, -1}, - {"mappfm", 0, NULL, -1}, - {"mappgm", 0, NULL, -1}, - {"mapphm", 0, NULL, -1}, - {"mappim", 0, NULL, -1}, - {"mappjm", 0, NULL, -1}, - {"mappkm", 0, NULL, -1}, - {"mapplm", 0, NULL, -1}, - {"mappmm", 0, NULL, -1}, - {"mappnm", 0, NULL, -1}, - {"mappom", 0, NULL, -1}, - {"mapppm", 0, NULL, -1}, - {"mappqm", 0, NULL, -1}, - {"mapprm", 0, NULL, -1}, - {"mappsm", 0, NULL, -1}, - {"mapptm", 0, NULL, -1}, - {"mappum", 0, NULL, -1}, - {"mappvm", 0, NULL, -1}, - {"mappwm", 0, NULL, -1}, - {"mappxm", 0, NULL, -1}, - {"mappym", 0, NULL, -1}, - {"mappzm", 0, NULL, -1}, - {"mapq0m", 0, NULL, -1}, - {"mapq1m", 0, NULL, -1}, - {"mapq2m", 0, NULL, -1}, - {"mapq3m", 0, NULL, -1}, - {"mapq4m", 0, NULL, -1}, - {"mapq5m", 0, NULL, -1}, - {"mapq6m", 0, NULL, -1}, - {"mapq7m", 0, NULL, -1}, - {"mapq8m", 0, NULL, -1}, - {"mapq9m", 0, NULL, -1}, - {"mapqam", 0, NULL, -1}, - {"mapqbm", 0, NULL, -1}, - {"mapqcm", 0, NULL, -1}, - {"mapqdm", 0, NULL, -1}, - {"mapqem", 0, NULL, -1}, - {"mapqfm", 0, NULL, -1}, - {"mapqgm", 0, NULL, -1}, - {"mapqhm", 0, NULL, -1}, - {"mapqim", 0, NULL, -1}, - {"mapqjm", 0, NULL, -1}, - {"mapqkm", 0, NULL, -1}, - {"mapqlm", 0, NULL, -1}, - {"mapqmm", 0, NULL, -1}, - {"mapqnm", 0, NULL, -1}, - {"mapqom", 0, NULL, -1}, - {"mapqpm", 0, NULL, -1}, - {"mapqqm", 0, NULL, -1}, - {"mapqrm", 0, NULL, -1}, - {"mapqsm", 0, NULL, -1}, - {"mapqtm", 0, NULL, -1}, - {"mapqum", 0, NULL, -1}, - {"mapqvm", 0, NULL, -1}, - {"mapqwm", 0, NULL, -1}, - {"mapqxm", 0, NULL, -1}, - {"mapqym", 0, NULL, -1}, - {"mapqzm", 0, NULL, -1}, - {"mapr0m", 0, NULL, -1}, - {"mapr1m", 0, NULL, -1}, - {"mapr2m", 0, NULL, -1}, - {"mapr3m", 0, NULL, -1}, - {"mapr4m", 0, NULL, -1}, - {"mapr5m", 0, NULL, -1}, - {"mapr6m", 0, NULL, -1}, - {"mapr7m", 0, NULL, -1}, - {"mapr8m", 0, NULL, -1}, - {"mapr9m", 0, NULL, -1}, - {"mapram", 0, NULL, -1}, - {"maprbm", 0, NULL, -1}, - {"maprcm", 0, NULL, -1}, - {"maprdm", 0, NULL, -1}, - {"maprem", 0, NULL, -1}, - {"maprfm", 0, NULL, -1}, - {"maprgm", 0, NULL, -1}, - {"maprhm", 0, NULL, -1}, - {"maprim", 0, NULL, -1}, - {"maprjm", 0, NULL, -1}, - {"maprkm", 0, NULL, -1}, - {"maprlm", 0, NULL, -1}, - {"maprmm", 0, NULL, -1}, - {"maprnm", 0, NULL, -1}, - {"maprom", 0, NULL, -1}, - {"maprpm", 0, NULL, -1}, - {"maprqm", 0, NULL, -1}, - {"maprrm", 0, NULL, -1}, - {"maprsm", 0, NULL, -1}, - {"maprtm", 0, NULL, -1}, - {"maprum", 0, NULL, -1}, - {"maprvm", 0, NULL, -1}, - {"maprwm", 0, NULL, -1}, - {"maprxm", 0, NULL, -1}, - {"maprym", 0, NULL, -1}, - {"maprzm", 0, NULL, -1}, - {"maps0m", 0, NULL, -1}, - {"maps1m", 0, NULL, -1}, - {"maps2m", 0, NULL, -1}, - {"maps3m", 0, NULL, -1}, - {"maps4m", 0, NULL, -1}, - {"maps5m", 0, NULL, -1}, - {"maps6m", 0, NULL, -1}, - {"maps7m", 0, NULL, -1}, - {"maps8m", 0, NULL, -1}, - {"maps9m", 0, NULL, -1}, - {"mapsam", 0, NULL, -1}, - {"mapsbm", 0, NULL, -1}, - {"mapscm", 0, NULL, -1}, - {"mapsdm", 0, NULL, -1}, - {"mapsem", 0, NULL, -1}, - {"mapsfm", 0, NULL, -1}, - {"mapsgm", 0, NULL, -1}, - {"mapshm", 0, NULL, -1}, - {"mapsim", 0, NULL, -1}, - {"mapsjm", 0, NULL, -1}, - {"mapskm", 0, NULL, -1}, - {"mapslm", 0, NULL, -1}, - {"mapsmm", 0, NULL, -1}, - {"mapsnm", 0, NULL, -1}, - {"mapsom", 0, NULL, -1}, - {"mapspm", 0, NULL, -1}, - {"mapsqm", 0, NULL, -1}, - {"mapsrm", 0, NULL, -1}, - {"mapssm", 0, NULL, -1}, - {"mapstm", 0, NULL, -1}, - {"mapsum", 0, NULL, -1}, - {"mapsvm", 0, NULL, -1}, - {"mapswm", 0, NULL, -1}, - {"mapsxm", 0, NULL, -1}, - {"mapsym", 0, NULL, -1}, - {"mapszm", 0, NULL, -1}, - {"mapt0m", 0, NULL, -1}, - {"mapt1m", 0, NULL, -1}, - {"mapt2m", 0, NULL, -1}, - {"mapt3m", 0, NULL, -1}, - {"mapt4m", 0, NULL, -1}, - {"mapt5m", 0, NULL, -1}, - {"mapt6m", 0, NULL, -1}, - {"mapt7m", 0, NULL, -1}, - {"mapt8m", 0, NULL, -1}, - {"mapt9m", 0, NULL, -1}, - {"maptam", 0, NULL, -1}, - {"maptbm", 0, NULL, -1}, - {"maptcm", 0, NULL, -1}, - {"maptdm", 0, NULL, -1}, - {"maptem", 0, NULL, -1}, - {"maptfm", 0, NULL, -1}, - {"maptgm", 0, NULL, -1}, - {"mapthm", 0, NULL, -1}, - {"maptim", 0, NULL, -1}, - {"maptjm", 0, NULL, -1}, - {"maptkm", 0, NULL, -1}, - {"maptlm", 0, NULL, -1}, - {"maptmm", 0, NULL, -1}, - {"maptnm", 0, NULL, -1}, - {"maptom", 0, NULL, -1}, - {"maptpm", 0, NULL, -1}, - {"maptqm", 0, NULL, -1}, - {"maptrm", 0, NULL, -1}, - {"maptsm", 0, NULL, -1}, - {"mapttm", 0, NULL, -1}, - {"maptum", 0, NULL, -1}, - {"maptvm", 0, NULL, -1}, - {"maptwm", 0, NULL, -1}, - {"maptxm", 0, NULL, -1}, - {"maptym", 0, NULL, -1}, - {"maptzm", 0, NULL, -1}, - {"mapu0m", 0, NULL, -1}, - {"mapu1m", 0, NULL, -1}, - {"mapu2m", 0, NULL, -1}, - {"mapu3m", 0, NULL, -1}, - {"mapu4m", 0, NULL, -1}, - {"mapu5m", 0, NULL, -1}, - {"mapu6m", 0, NULL, -1}, - {"mapu7m", 0, NULL, -1}, - {"mapu8m", 0, NULL, -1}, - {"mapu9m", 0, NULL, -1}, - {"mapuam", 0, NULL, -1}, - {"mapubm", 0, NULL, -1}, - {"mapucm", 0, NULL, -1}, - {"mapudm", 0, NULL, -1}, - {"mapuem", 0, NULL, -1}, - {"mapufm", 0, NULL, -1}, - {"mapugm", 0, NULL, -1}, - {"mapuhm", 0, NULL, -1}, - {"mapuim", 0, NULL, -1}, - {"mapujm", 0, NULL, -1}, - {"mapukm", 0, NULL, -1}, - {"mapulm", 0, NULL, -1}, - {"mapumm", 0, NULL, -1}, - {"mapunm", 0, NULL, -1}, - {"mapuom", 0, NULL, -1}, - {"mapupm", 0, NULL, -1}, - {"mapuqm", 0, NULL, -1}, - {"mapurm", 0, NULL, -1}, - {"mapusm", 0, NULL, -1}, - {"maputm", 0, NULL, -1}, - {"mapuum", 0, NULL, -1}, - {"mapuvm", 0, NULL, -1}, - {"mapuwm", 0, NULL, -1}, - {"mapuxm", 0, NULL, -1}, - {"mapuym", 0, NULL, -1}, - {"mapuzm", 0, NULL, -1}, - {"mapv0m", 0, NULL, -1}, - {"mapv1m", 0, NULL, -1}, - {"mapv2m", 0, NULL, -1}, - {"mapv3m", 0, NULL, -1}, - {"mapv4m", 0, NULL, -1}, - {"mapv5m", 0, NULL, -1}, - {"mapv6m", 0, NULL, -1}, - {"mapv7m", 0, NULL, -1}, - {"mapv8m", 0, NULL, -1}, - {"mapv9m", 0, NULL, -1}, - {"mapvam", 0, NULL, -1}, - {"mapvbm", 0, NULL, -1}, - {"mapvcm", 0, NULL, -1}, - {"mapvdm", 0, NULL, -1}, - {"mapvem", 0, NULL, -1}, - {"mapvfm", 0, NULL, -1}, - {"mapvgm", 0, NULL, -1}, - {"mapvhm", 0, NULL, -1}, - {"mapvim", 0, NULL, -1}, - {"mapvjm", 0, NULL, -1}, - {"mapvkm", 0, NULL, -1}, - {"mapvlm", 0, NULL, -1}, - {"mapvmm", 0, NULL, -1}, - {"mapvnm", 0, NULL, -1}, - {"mapvom", 0, NULL, -1}, - {"mapvpm", 0, NULL, -1}, - {"mapvqm", 0, NULL, -1}, - {"mapvrm", 0, NULL, -1}, - {"mapvsm", 0, NULL, -1}, - {"mapvtm", 0, NULL, -1}, - {"mapvum", 0, NULL, -1}, - {"mapvvm", 0, NULL, -1}, - {"mapvwm", 0, NULL, -1}, - {"mapvxm", 0, NULL, -1}, - {"mapvym", 0, NULL, -1}, - {"mapvzm", 0, NULL, -1}, - {"mapw0m", 0, NULL, -1}, - {"mapw1m", 0, NULL, -1}, - {"mapw2m", 0, NULL, -1}, - {"mapw3m", 0, NULL, -1}, - {"mapw4m", 0, NULL, -1}, - {"mapw5m", 0, NULL, -1}, - {"mapw6m", 0, NULL, -1}, - {"mapw7m", 0, NULL, -1}, - {"mapw8m", 0, NULL, -1}, - {"mapw9m", 0, NULL, -1}, - {"mapwam", 0, NULL, -1}, - {"mapwbm", 0, NULL, -1}, - {"mapwcm", 0, NULL, -1}, - {"mapwdm", 0, NULL, -1}, - {"mapwem", 0, NULL, -1}, - {"mapwfm", 0, NULL, -1}, - {"mapwgm", 0, NULL, -1}, - {"mapwhm", 0, NULL, -1}, - {"mapwim", 0, NULL, -1}, - {"mapwjm", 0, NULL, -1}, - {"mapwkm", 0, NULL, -1}, - {"mapwlm", 0, NULL, -1}, - {"mapwmm", 0, NULL, -1}, - {"mapwnm", 0, NULL, -1}, - {"mapwom", 0, NULL, -1}, - {"mapwpm", 0, NULL, -1}, - {"mapwqm", 0, NULL, -1}, - {"mapwrm", 0, NULL, -1}, - {"mapwsm", 0, NULL, -1}, - {"mapwtm", 0, NULL, -1}, - {"mapwum", 0, NULL, -1}, - {"mapwvm", 0, NULL, -1}, - {"mapwwm", 0, NULL, -1}, - {"mapwxm", 0, NULL, -1}, - {"mapwym", 0, NULL, -1}, - {"mapwzm", 0, NULL, -1}, - {"mapx0m", 0, NULL, -1}, - {"mapx1m", 0, NULL, -1}, - {"mapx2m", 0, NULL, -1}, - {"mapx3m", 0, NULL, -1}, - {"mapx4m", 0, NULL, -1}, - {"mapx5m", 0, NULL, -1}, - {"mapx6m", 0, NULL, -1}, - {"mapx7m", 0, NULL, -1}, - {"mapx8m", 0, NULL, -1}, - {"mapx9m", 0, NULL, -1}, - {"mapxam", 0, NULL, -1}, - {"mapxbm", 0, NULL, -1}, - {"mapxcm", 0, NULL, -1}, - {"mapxdm", 0, NULL, -1}, - {"mapxem", 0, NULL, -1}, - {"mapxfm", 0, NULL, -1}, - {"mapxgm", 0, NULL, -1}, - {"mapxhm", 0, NULL, -1}, - {"mapxim", 0, NULL, -1}, - {"mapxjm", 0, NULL, -1}, - {"mapxkm", 0, NULL, -1}, - {"mapxlm", 0, NULL, -1}, - {"mapxmm", 0, NULL, -1}, - {"mapxnm", 0, NULL, -1}, - {"mapxom", 0, NULL, -1}, - {"mapxpm", 0, NULL, -1}, - {"mapxqm", 0, NULL, -1}, - {"mapxrm", 0, NULL, -1}, - {"mapxsm", 0, NULL, -1}, - {"mapxtm", 0, NULL, -1}, - {"mapxum", 0, NULL, -1}, - {"mapxvm", 0, NULL, -1}, - {"mapxwm", 0, NULL, -1}, - {"mapxxm", 0, NULL, -1}, - {"mapxym", 0, NULL, -1}, - {"mapxzm", 0, NULL, -1}, - {"mapy0m", 0, NULL, -1}, - {"mapy1m", 0, NULL, -1}, - {"mapy2m", 0, NULL, -1}, - {"mapy3m", 0, NULL, -1}, - {"mapy4m", 0, NULL, -1}, - {"mapy5m", 0, NULL, -1}, - {"mapy6m", 0, NULL, -1}, - {"mapy7m", 0, NULL, -1}, - {"mapy8m", 0, NULL, -1}, - {"mapy9m", 0, NULL, -1}, - {"mapyam", 0, NULL, -1}, - {"mapybm", 0, NULL, -1}, - {"mapycm", 0, NULL, -1}, - {"mapydm", 0, NULL, -1}, - {"mapyem", 0, NULL, -1}, - {"mapyfm", 0, NULL, -1}, - {"mapygm", 0, NULL, -1}, - {"mapyhm", 0, NULL, -1}, - {"mapyim", 0, NULL, -1}, - {"mapyjm", 0, NULL, -1}, - {"mapykm", 0, NULL, -1}, - {"mapylm", 0, NULL, -1}, - {"mapymm", 0, NULL, -1}, - {"mapynm", 0, NULL, -1}, - {"mapyom", 0, NULL, -1}, - {"mapypm", 0, NULL, -1}, - {"mapyqm", 0, NULL, -1}, - {"mapyrm", 0, NULL, -1}, - {"mapysm", 0, NULL, -1}, - {"mapytm", 0, NULL, -1}, - {"mapyum", 0, NULL, -1}, - {"mapyvm", 0, NULL, -1}, - {"mapywm", 0, NULL, -1}, - {"mapyxm", 0, NULL, -1}, - {"mapyym", 0, NULL, -1}, - {"mapyzm", 0, NULL, -1}, - {"mapz0m", 0, NULL, -1}, - {"mapz1m", 0, NULL, -1}, - {"mapz2m", 0, NULL, -1}, - {"mapz3m", 0, NULL, -1}, - {"mapz4m", 0, NULL, -1}, - {"mapz5m", 0, NULL, -1}, - {"mapz6m", 0, NULL, -1}, - {"mapz7m", 0, NULL, -1}, - {"mapz8m", 0, NULL, -1}, - {"mapz9m", 0, NULL, -1}, - {"mapzam", 0, NULL, -1}, - {"mapzbm", 0, NULL, -1}, - {"mapzcm", 0, NULL, -1}, - {"mapzdm", 0, NULL, -1}, - {"mapzem", 0, NULL, -1}, - {"mapzfm", 0, NULL, -1}, - {"mapzgm", 0, NULL, -1}, - {"mapzhm", 0, NULL, -1}, - {"mapzim", 0, NULL, -1}, - {"mapzjm", 0, NULL, -1}, - {"mapzkm", 0, NULL, -1}, - {"mapzlm", 0, NULL, -1}, - {"mapzmm", 0, NULL, -1}, - {"mapznm", 0, NULL, -1}, - {"mapzom", 0, NULL, -1}, - {"mapzpm", 0, NULL, -1}, - {"mapzqm", 0, NULL, -1}, - {"mapzrm", 0, NULL, -1}, - {"mapzsm", 0, NULL, -1}, - {"mapztm", 0, NULL, -1}, - {"mapzum", 0, NULL, -1}, - {"mapzvm", 0, NULL, -1}, - {"mapzwm", 0, NULL, -1}, - {"mapzxm", 0, NULL, -1}, - {"mapzym", 0, NULL, -1}, - {"mapzzm", 0, NULL, -1}, - - {"titles", 0, NULL, -1}, // Title screen - {"read_m", 0, NULL, -1}, // Intro - {"lclear", 0, NULL, -1}, // Level clear - {"invinc", 0, NULL, -1}, // Invincibility - {"shoes", 0, NULL, -1}, // Super sneakers - {"minvnc", 0, NULL, -1}, // Mario invincibility - {"drown", 0, NULL, -1}, // Drowning - {"gmover", 0, NULL, -1}, // Game over - {"xtlife", 0, NULL, -1}, // Extra life - {"contsc", 0, NULL, -1}, // Continue screen - {"supers", 0, NULL, -1}, // Super Sonic - {"chrsel", 0, NULL, -1}, // Character select - {"credit", 0, NULL, -1}, // Credits - {"racent", 0, NULL, -1}, // Race Results - {"stjr", 0, NULL, -1}, // Sonic Team Jr. Presents -}; - - // // Information about all the sfx // diff --git a/src/sounds.h b/src/sounds.h index c5851a34..4388d02c 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -86,1095 +86,9 @@ struct sfxinfo_struct lumpnum_t lumpnum; }; -// -// MusicInfo struct. -// -typedef struct -{ - // up to 6-character name - const char *name; - - // lump number of music - lumpnum_t lumpnum; - - // music data - void *data; - - // music handle once registered - INT32 handle; -} musicinfo_t; - // the complete set of sound effects extern sfxinfo_t S_sfx[]; -// the complete set of music -extern musicinfo_t S_music[]; - -// -// Identifiers for all music in game. -// - -// Music list (don't edit this comment!) -typedef enum -{ - mus_None, - mus_map01m, - mus_map02m, - mus_map03m, - mus_map04m, - mus_map05m, - mus_map06m, - mus_map07m, - mus_map08m, - mus_map09m, - mus_map10m, - mus_map11m, - mus_map12m, - mus_map13m, - mus_map14m, - mus_map15m, - mus_map16m, - mus_map17m, - mus_map18m, - mus_map19m, - mus_map20m, - mus_map21m, - mus_map22m, - mus_map23m, - mus_map24m, - mus_map25m, - mus_map26m, - mus_map27m, - mus_map28m, - mus_map29m, - mus_map30m, - mus_map31m, - mus_map32m, - mus_map33m, - mus_map34m, - mus_map35m, - mus_map36m, - mus_map37m, - mus_map38m, - mus_map39m, - mus_map40m, - mus_map41m, - mus_map42m, - mus_map43m, - mus_map44m, - mus_map45m, - mus_map46m, - mus_map47m, - mus_map48m, - mus_map49m, - mus_map50m, - mus_map51m, - mus_map52m, - mus_map53m, - mus_map54m, - mus_map55m, - mus_map56m, - mus_map57m, - mus_map58m, - mus_map59m, - mus_map60m, - mus_map61m, - mus_map62m, - mus_map63m, - mus_map64m, - mus_map65m, - mus_map66m, - mus_map67m, - mus_map68m, - mus_map69m, - mus_map70m, - mus_map71m, - mus_map72m, - mus_map73m, - mus_map74m, - mus_map75m, - mus_map76m, - mus_map77m, - mus_map78m, - mus_map79m, - mus_map80m, - mus_map81m, - mus_map82m, - mus_map83m, - mus_map84m, - mus_map85m, - mus_map86m, - mus_map87m, - mus_map88m, - mus_map89m, - mus_map90m, - mus_map91m, - mus_map92m, - mus_map93m, - mus_map94m, - mus_map95m, - mus_map96m, - mus_map97m, - mus_map98m, - mus_map99m, - mus_mapa0m, - mus_mapa1m, - mus_mapa2m, - mus_mapa3m, - mus_mapa4m, - mus_mapa5m, - mus_mapa6m, - mus_mapa7m, - mus_mapa8m, - mus_mapa9m, - mus_mapaam, - mus_mapabm, - mus_mapacm, - mus_mapadm, - mus_mapaem, - mus_mapafm, - mus_mapagm, - mus_mapahm, - mus_mapaim, - mus_mapajm, - mus_mapakm, - mus_mapalm, - mus_mapamm, - mus_mapanm, - mus_mapaom, - mus_mapapm, - mus_mapaqm, - mus_maparm, - mus_mapasm, - mus_mapatm, - mus_mapaum, - mus_mapavm, - mus_mapawm, - mus_mapaxm, - mus_mapaym, - mus_mapazm, - mus_mapb0m, - mus_mapb1m, - mus_mapb2m, - mus_mapb3m, - mus_mapb4m, - mus_mapb5m, - mus_mapb6m, - mus_mapb7m, - mus_mapb8m, - mus_mapb9m, - mus_mapbam, - mus_mapbbm, - mus_mapbcm, - mus_mapbdm, - mus_mapbem, - mus_mapbfm, - mus_mapbgm, - mus_mapbhm, - mus_mapbim, - mus_mapbjm, - mus_mapbkm, - mus_mapblm, - mus_mapbmm, - mus_mapbnm, - mus_mapbom, - mus_mapbpm, - mus_mapbqm, - mus_mapbrm, - mus_mapbsm, - mus_mapbtm, - mus_mapbum, - mus_mapbvm, - mus_mapbwm, - mus_mapbxm, - mus_mapbym, - mus_mapbzm, - mus_mapc0m, - mus_mapc1m, - mus_mapc2m, - mus_mapc3m, - mus_mapc4m, - mus_mapc5m, - mus_mapc6m, - mus_mapc7m, - mus_mapc8m, - mus_mapc9m, - mus_mapcam, - mus_mapcbm, - mus_mapccm, - mus_mapcdm, - mus_mapcem, - mus_mapcfm, - mus_mapcgm, - mus_mapchm, - mus_mapcim, - mus_mapcjm, - mus_mapckm, - mus_mapclm, - mus_mapcmm, - mus_mapcnm, - mus_mapcom, - mus_mapcpm, - mus_mapcqm, - mus_mapcrm, - mus_mapcsm, - mus_mapctm, - mus_mapcum, - mus_mapcvm, - mus_mapcwm, - mus_mapcxm, - mus_mapcym, - mus_mapczm, - mus_mapd0m, - mus_mapd1m, - mus_mapd2m, - mus_mapd3m, - mus_mapd4m, - mus_mapd5m, - mus_mapd6m, - mus_mapd7m, - mus_mapd8m, - mus_mapd9m, - mus_mapdam, - mus_mapdbm, - mus_mapdcm, - mus_mapddm, - mus_mapdem, - mus_mapdfm, - mus_mapdgm, - mus_mapdhm, - mus_mapdim, - mus_mapdjm, - mus_mapdkm, - mus_mapdlm, - mus_mapdmm, - mus_mapdnm, - mus_mapdom, - mus_mapdpm, - mus_mapdqm, - mus_mapdrm, - mus_mapdsm, - mus_mapdtm, - mus_mapdum, - mus_mapdvm, - mus_mapdwm, - mus_mapdxm, - mus_mapdym, - mus_mapdzm, - mus_mape0m, - mus_mape1m, - mus_mape2m, - mus_mape3m, - mus_mape4m, - mus_mape5m, - mus_mape6m, - mus_mape7m, - mus_mape8m, - mus_mape9m, - mus_mapeam, - mus_mapebm, - mus_mapecm, - mus_mapedm, - mus_mapeem, - mus_mapefm, - mus_mapegm, - mus_mapehm, - mus_mapeim, - mus_mapejm, - mus_mapekm, - mus_mapelm, - mus_mapemm, - mus_mapenm, - mus_mapeom, - mus_mapepm, - mus_mapeqm, - mus_maperm, - mus_mapesm, - mus_mapetm, - mus_mapeum, - mus_mapevm, - mus_mapewm, - mus_mapexm, - mus_mapeym, - mus_mapezm, - mus_mapf0m, - mus_mapf1m, - mus_mapf2m, - mus_mapf3m, - mus_mapf4m, - mus_mapf5m, - mus_mapf6m, - mus_mapf7m, - mus_mapf8m, - mus_mapf9m, - mus_mapfam, - mus_mapfbm, - mus_mapfcm, - mus_mapfdm, - mus_mapfem, - mus_mapffm, - mus_mapfgm, - mus_mapfhm, - mus_mapfim, - mus_mapfjm, - mus_mapfkm, - mus_mapflm, - mus_mapfmm, - mus_mapfnm, - mus_mapfom, - mus_mapfpm, - mus_mapfqm, - mus_mapfrm, - mus_mapfsm, - mus_mapftm, - mus_mapfum, - mus_mapfvm, - mus_mapfwm, - mus_mapfxm, - mus_mapfym, - mus_mapfzm, - mus_mapg0m, - mus_mapg1m, - mus_mapg2m, - mus_mapg3m, - mus_mapg4m, - mus_mapg5m, - mus_mapg6m, - mus_mapg7m, - mus_mapg8m, - mus_mapg9m, - mus_mapgam, - mus_mapgbm, - mus_mapgcm, - mus_mapgdm, - mus_mapgem, - mus_mapgfm, - mus_mapggm, - mus_mapghm, - mus_mapgim, - mus_mapgjm, - mus_mapgkm, - mus_mapglm, - mus_mapgmm, - mus_mapgnm, - mus_mapgom, - mus_mapgpm, - mus_mapgqm, - mus_mapgrm, - mus_mapgsm, - mus_mapgtm, - mus_mapgum, - mus_mapgvm, - mus_mapgwm, - mus_mapgxm, - mus_mapgym, - mus_mapgzm, - mus_maph0m, - mus_maph1m, - mus_maph2m, - mus_maph3m, - mus_maph4m, - mus_maph5m, - mus_maph6m, - mus_maph7m, - mus_maph8m, - mus_maph9m, - mus_mapham, - mus_maphbm, - mus_maphcm, - mus_maphdm, - mus_maphem, - mus_maphfm, - mus_maphgm, - mus_maphhm, - mus_maphim, - mus_maphjm, - mus_maphkm, - mus_maphlm, - mus_maphmm, - mus_maphnm, - mus_maphom, - mus_maphpm, - mus_maphqm, - mus_maphrm, - mus_maphsm, - mus_maphtm, - mus_maphum, - mus_maphvm, - mus_maphwm, - mus_maphxm, - mus_maphym, - mus_maphzm, - mus_mapi0m, - mus_mapi1m, - mus_mapi2m, - mus_mapi3m, - mus_mapi4m, - mus_mapi5m, - mus_mapi6m, - mus_mapi7m, - mus_mapi8m, - mus_mapi9m, - mus_mapiam, - mus_mapibm, - mus_mapicm, - mus_mapidm, - mus_mapiem, - mus_mapifm, - mus_mapigm, - mus_mapihm, - mus_mapiim, - mus_mapijm, - mus_mapikm, - mus_mapilm, - mus_mapimm, - mus_mapinm, - mus_mapiom, - mus_mapipm, - mus_mapiqm, - mus_mapirm, - mus_mapism, - mus_mapitm, - mus_mapium, - mus_mapivm, - mus_mapiwm, - mus_mapixm, - mus_mapiym, - mus_mapizm, - mus_mapj0m, - mus_mapj1m, - mus_mapj2m, - mus_mapj3m, - mus_mapj4m, - mus_mapj5m, - mus_mapj6m, - mus_mapj7m, - mus_mapj8m, - mus_mapj9m, - mus_mapjam, - mus_mapjbm, - mus_mapjcm, - mus_mapjdm, - mus_mapjem, - mus_mapjfm, - mus_mapjgm, - mus_mapjhm, - mus_mapjim, - mus_mapjjm, - mus_mapjkm, - mus_mapjlm, - mus_mapjmm, - mus_mapjnm, - mus_mapjom, - mus_mapjpm, - mus_mapjqm, - mus_mapjrm, - mus_mapjsm, - mus_mapjtm, - mus_mapjum, - mus_mapjvm, - mus_mapjwm, - mus_mapjxm, - mus_mapjym, - mus_mapjzm, - mus_mapk0m, - mus_mapk1m, - mus_mapk2m, - mus_mapk3m, - mus_mapk4m, - mus_mapk5m, - mus_mapk6m, - mus_mapk7m, - mus_mapk8m, - mus_mapk9m, - mus_mapkam, - mus_mapkbm, - mus_mapkcm, - mus_mapkdm, - mus_mapkem, - mus_mapkfm, - mus_mapkgm, - mus_mapkhm, - mus_mapkim, - mus_mapkjm, - mus_mapkkm, - mus_mapklm, - mus_mapkmm, - mus_mapknm, - mus_mapkom, - mus_mapkpm, - mus_mapkqm, - mus_mapkrm, - mus_mapksm, - mus_mapktm, - mus_mapkum, - mus_mapkvm, - mus_mapkwm, - mus_mapkxm, - mus_mapkym, - mus_mapkzm, - mus_mapl0m, - mus_mapl1m, - mus_mapl2m, - mus_mapl3m, - mus_mapl4m, - mus_mapl5m, - mus_mapl6m, - mus_mapl7m, - mus_mapl8m, - mus_mapl9m, - mus_maplam, - mus_maplbm, - mus_maplcm, - mus_mapldm, - mus_maplem, - mus_maplfm, - mus_maplgm, - mus_maplhm, - mus_maplim, - mus_mapljm, - mus_maplkm, - mus_mapllm, - mus_maplmm, - mus_maplnm, - mus_maplom, - mus_maplpm, - mus_maplqm, - mus_maplrm, - mus_maplsm, - mus_mapltm, - mus_maplum, - mus_maplvm, - mus_maplwm, - mus_maplxm, - mus_maplym, - mus_maplzm, - mus_mapm0m, - mus_mapm1m, - mus_mapm2m, - mus_mapm3m, - mus_mapm4m, - mus_mapm5m, - mus_mapm6m, - mus_mapm7m, - mus_mapm8m, - mus_mapm9m, - mus_mapmam, - mus_mapmbm, - mus_mapmcm, - mus_mapmdm, - mus_mapmem, - mus_mapmfm, - mus_mapmgm, - mus_mapmhm, - mus_mapmim, - mus_mapmjm, - mus_mapmkm, - mus_mapmlm, - mus_mapmmm, - mus_mapmnm, - mus_mapmom, - mus_mapmpm, - mus_mapmqm, - mus_mapmrm, - mus_mapmsm, - mus_mapmtm, - mus_mapmum, - mus_mapmvm, - mus_mapmwm, - mus_mapmxm, - mus_mapmym, - mus_mapmzm, - mus_mapn0m, - mus_mapn1m, - mus_mapn2m, - mus_mapn3m, - mus_mapn4m, - mus_mapn5m, - mus_mapn6m, - mus_mapn7m, - mus_mapn8m, - mus_mapn9m, - mus_mapnam, - mus_mapnbm, - mus_mapncm, - mus_mapndm, - mus_mapnem, - mus_mapnfm, - mus_mapngm, - mus_mapnhm, - mus_mapnim, - mus_mapnjm, - mus_mapnkm, - mus_mapnlm, - mus_mapnmm, - mus_mapnnm, - mus_mapnom, - mus_mapnpm, - mus_mapnqm, - mus_mapnrm, - mus_mapnsm, - mus_mapntm, - mus_mapnum, - mus_mapnvm, - mus_mapnwm, - mus_mapnxm, - mus_mapnym, - mus_mapnzm, - mus_mapo0m, - mus_mapo1m, - mus_mapo2m, - mus_mapo3m, - mus_mapo4m, - mus_mapo5m, - mus_mapo6m, - mus_mapo7m, - mus_mapo8m, - mus_mapo9m, - mus_mapoam, - mus_mapobm, - mus_mapocm, - mus_mapodm, - mus_mapoem, - mus_mapofm, - mus_mapogm, - mus_mapohm, - mus_mapoim, - mus_mapojm, - mus_mapokm, - mus_mapolm, - mus_mapomm, - mus_maponm, - mus_mapoom, - mus_mapopm, - mus_mapoqm, - mus_maporm, - mus_maposm, - mus_mapotm, - mus_mapoum, - mus_mapovm, - mus_mapowm, - mus_mapoxm, - mus_mapoym, - mus_mapozm, - mus_mapp0m, - mus_mapp1m, - mus_mapp2m, - mus_mapp3m, - mus_mapp4m, - mus_mapp5m, - mus_mapp6m, - mus_mapp7m, - mus_mapp8m, - mus_mapp9m, - mus_mappam, - mus_mappbm, - mus_mappcm, - mus_mappdm, - mus_mappem, - mus_mappfm, - mus_mappgm, - mus_mapphm, - mus_mappim, - mus_mappjm, - mus_mappkm, - mus_mapplm, - mus_mappmm, - mus_mappnm, - mus_mappom, - mus_mapppm, - mus_mappqm, - mus_mapprm, - mus_mappsm, - mus_mapptm, - mus_mappum, - mus_mappvm, - mus_mappwm, - mus_mappxm, - mus_mappym, - mus_mappzm, - mus_mapq0m, - mus_mapq1m, - mus_mapq2m, - mus_mapq3m, - mus_mapq4m, - mus_mapq5m, - mus_mapq6m, - mus_mapq7m, - mus_mapq8m, - mus_mapq9m, - mus_mapqam, - mus_mapqbm, - mus_mapqcm, - mus_mapqdm, - mus_mapqem, - mus_mapqfm, - mus_mapqgm, - mus_mapqhm, - mus_mapqim, - mus_mapqjm, - mus_mapqkm, - mus_mapqlm, - mus_mapqmm, - mus_mapqnm, - mus_mapqom, - mus_mapqpm, - mus_mapqqm, - mus_mapqrm, - mus_mapqsm, - mus_mapqtm, - mus_mapqum, - mus_mapqvm, - mus_mapqwm, - mus_mapqxm, - mus_mapqym, - mus_mapqzm, - mus_mapr0m, - mus_mapr1m, - mus_mapr2m, - mus_mapr3m, - mus_mapr4m, - mus_mapr5m, - mus_mapr6m, - mus_mapr7m, - mus_mapr8m, - mus_mapr9m, - mus_mapram, - mus_maprbm, - mus_maprcm, - mus_maprdm, - mus_maprem, - mus_maprfm, - mus_maprgm, - mus_maprhm, - mus_maprim, - mus_maprjm, - mus_maprkm, - mus_maprlm, - mus_maprmm, - mus_maprnm, - mus_maprom, - mus_maprpm, - mus_maprqm, - mus_maprrm, - mus_maprsm, - mus_maprtm, - mus_maprum, - mus_maprvm, - mus_maprwm, - mus_maprxm, - mus_maprym, - mus_maprzm, - mus_maps0m, - mus_maps1m, - mus_maps2m, - mus_maps3m, - mus_maps4m, - mus_maps5m, - mus_maps6m, - mus_maps7m, - mus_maps8m, - mus_maps9m, - mus_mapsam, - mus_mapsbm, - mus_mapscm, - mus_mapsdm, - mus_mapsem, - mus_mapsfm, - mus_mapsgm, - mus_mapshm, - mus_mapsim, - mus_mapsjm, - mus_mapskm, - mus_mapslm, - mus_mapsmm, - mus_mapsnm, - mus_mapsom, - mus_mapspm, - mus_mapsqm, - mus_mapsrm, - mus_mapssm, - mus_mapstm, - mus_mapsum, - mus_mapsvm, - mus_mapswm, - mus_mapsxm, - mus_mapsym, - mus_mapszm, - mus_mapt0m, - mus_mapt1m, - mus_mapt2m, - mus_mapt3m, - mus_mapt4m, - mus_mapt5m, - mus_mapt6m, - mus_mapt7m, - mus_mapt8m, - mus_mapt9m, - mus_maptam, - mus_maptbm, - mus_maptcm, - mus_maptdm, - mus_maptem, - mus_maptfm, - mus_maptgm, - mus_mapthm, - mus_maptim, - mus_maptjm, - mus_maptkm, - mus_maptlm, - mus_maptmm, - mus_maptnm, - mus_maptom, - mus_maptpm, - mus_maptqm, - mus_maptrm, - mus_maptsm, - mus_mapttm, - mus_maptum, - mus_maptvm, - mus_maptwm, - mus_maptxm, - mus_maptym, - mus_maptzm, - mus_mapu0m, - mus_mapu1m, - mus_mapu2m, - mus_mapu3m, - mus_mapu4m, - mus_mapu5m, - mus_mapu6m, - mus_mapu7m, - mus_mapu8m, - mus_mapu9m, - mus_mapuam, - mus_mapubm, - mus_mapucm, - mus_mapudm, - mus_mapuem, - mus_mapufm, - mus_mapugm, - mus_mapuhm, - mus_mapuim, - mus_mapujm, - mus_mapukm, - mus_mapulm, - mus_mapumm, - mus_mapunm, - mus_mapuom, - mus_mapupm, - mus_mapuqm, - mus_mapurm, - mus_mapusm, - mus_maputm, - mus_mapuum, - mus_mapuvm, - mus_mapuwm, - mus_mapuxm, - mus_mapuym, - mus_mapuzm, - mus_mapv0m, - mus_mapv1m, - mus_mapv2m, - mus_mapv3m, - mus_mapv4m, - mus_mapv5m, - mus_mapv6m, - mus_mapv7m, - mus_mapv8m, - mus_mapv9m, - mus_mapvam, - mus_mapvbm, - mus_mapvcm, - mus_mapvdm, - mus_mapvem, - mus_mapvfm, - mus_mapvgm, - mus_mapvhm, - mus_mapvim, - mus_mapvjm, - mus_mapvkm, - mus_mapvlm, - mus_mapvmm, - mus_mapvnm, - mus_mapvom, - mus_mapvpm, - mus_mapvqm, - mus_mapvrm, - mus_mapvsm, - mus_mapvtm, - mus_mapvum, - mus_mapvvm, - mus_mapvwm, - mus_mapvxm, - mus_mapvym, - mus_mapvzm, - mus_mapw0m, - mus_mapw1m, - mus_mapw2m, - mus_mapw3m, - mus_mapw4m, - mus_mapw5m, - mus_mapw6m, - mus_mapw7m, - mus_mapw8m, - mus_mapw9m, - mus_mapwam, - mus_mapwbm, - mus_mapwcm, - mus_mapwdm, - mus_mapwem, - mus_mapwfm, - mus_mapwgm, - mus_mapwhm, - mus_mapwim, - mus_mapwjm, - mus_mapwkm, - mus_mapwlm, - mus_mapwmm, - mus_mapwnm, - mus_mapwom, - mus_mapwpm, - mus_mapwqm, - mus_mapwrm, - mus_mapwsm, - mus_mapwtm, - mus_mapwum, - mus_mapwvm, - mus_mapwwm, - mus_mapwxm, - mus_mapwym, - mus_mapwzm, - mus_mapx0m, - mus_mapx1m, - mus_mapx2m, - mus_mapx3m, - mus_mapx4m, - mus_mapx5m, - mus_mapx6m, - mus_mapx7m, - mus_mapx8m, - mus_mapx9m, - mus_mapxam, - mus_mapxbm, - mus_mapxcm, - mus_mapxdm, - mus_mapxem, - mus_mapxfm, - mus_mapxgm, - mus_mapxhm, - mus_mapxim, - mus_mapxjm, - mus_mapxkm, - mus_mapxlm, - mus_mapxmm, - mus_mapxnm, - mus_mapxom, - mus_mapxpm, - mus_mapxqm, - mus_mapxrm, - mus_mapxsm, - mus_mapxtm, - mus_mapxum, - mus_mapxvm, - mus_mapxwm, - mus_mapxxm, - mus_mapxym, - mus_mapxzm, - mus_mapy0m, - mus_mapy1m, - mus_mapy2m, - mus_mapy3m, - mus_mapy4m, - mus_mapy5m, - mus_mapy6m, - mus_mapy7m, - mus_mapy8m, - mus_mapy9m, - mus_mapyam, - mus_mapybm, - mus_mapycm, - mus_mapydm, - mus_mapyem, - mus_mapyfm, - mus_mapygm, - mus_mapyhm, - mus_mapyim, - mus_mapyjm, - mus_mapykm, - mus_mapylm, - mus_mapymm, - mus_mapynm, - mus_mapyom, - mus_mapypm, - mus_mapyqm, - mus_mapyrm, - mus_mapysm, - mus_mapytm, - mus_mapyum, - mus_mapyvm, - mus_mapywm, - mus_mapyxm, - mus_mapyym, - mus_mapyzm, - mus_mapz0m, - mus_mapz1m, - mus_mapz2m, - mus_mapz3m, - mus_mapz4m, - mus_mapz5m, - mus_mapz6m, - mus_mapz7m, - mus_mapz8m, - mus_mapz9m, - mus_mapzam, - mus_mapzbm, - mus_mapzcm, - mus_mapzdm, - mus_mapzem, - mus_mapzfm, - mus_mapzgm, - mus_mapzhm, - mus_mapzim, - mus_mapzjm, - mus_mapzkm, - mus_mapzlm, - mus_mapzmm, - mus_mapznm, - mus_mapzom, - mus_mapzpm, - mus_mapzqm, - mus_mapzrm, - mus_mapzsm, - mus_mapztm, - mus_mapzum, - mus_mapzvm, - mus_mapzwm, - mus_mapzxm, - mus_mapzym, - mus_mapzzm, - - mus_titles, // title screen - mus_read_m, // intro - mus_lclear, // level clear - mus_invinc, // invincibility - mus_shoes, // super sneakers - mus_minvnc, // Mario invincibility - mus_drown, // drowning - mus_gmover, // game over - mus_xtlife, // extra life - mus_contsc, // continue screen - mus_supers, // Super Sonic - mus_chrsel, // character select - mus_credit, // credits - mus_racent, // Race Results - mus_stjr, // Sonic Team Jr. Presents - - NUMMUSIC -} musicenum_t; -// Note: song number should be a UINT16, as mapmusic only uses 16 bits for music slot number. -// (the rest is track number and an internal reload flag) - // // Identifiers for all sfx in game. // diff --git a/src/y_inter.c b/src/y_inter.c index 2f2edf7c..104c1004 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -632,7 +632,7 @@ void Y_Ticker(void) boolean anybonuses = false; if (!intertic) // first time only - S_ChangeMusic(mus_lclear, false); // don't loop it + S_ChangeMusicInternal("lclear", false); // don't loop it if (intertic < TICRATE) // one second pause before tally begins return; @@ -693,7 +693,7 @@ void Y_Ticker(void) if (!intertic) // first time only { - S_ChangeMusic(mus_lclear, false); // don't loop it + S_ChangeMusicInternal("lclear", false); // don't loop it tallydonetic = 0; } @@ -754,7 +754,7 @@ void Y_Ticker(void) else if (intertype == int_match || intertype == int_ctf || intertype == int_teammatch) // match { if (!intertic) // first time only - S_ChangeMusic(mus_racent, true); // loop it + S_ChangeMusicInternal("racent", true); // loop it // If a player has left or joined, recalculate scores. if (data.match.numplayers != D_NumPlayers()) @@ -763,7 +763,7 @@ void Y_Ticker(void) else if (intertype == int_race || intertype == int_classicrace) // race { if (!intertic) // first time only - S_ChangeMusic(mus_racent, true); // loop it + S_ChangeMusicInternal("racent", true); // loop it // Don't bother recalcing for race. It doesn't make as much sense. } From caab150c9240a37925f38ae4d34f4278ca7c35d2 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 20:41:58 -0800 Subject: [PATCH 015/109] Fixed LD413 (cherry picked from commit 1e4c2f8aad3d2d48eb408f400fde8e259b40fe18) --- src/p_setup.c | 12 ++++++++++-- src/p_spec.c | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/p_setup.c b/src/p_setup.c index 3a51d90b..000a3a65 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -1451,8 +1451,16 @@ static void P_LoadSideDefs2(lumpnum_t lumpnum) sd->bottomtexture = get_number(process)-1; } M_Memcpy(process,msd->toptexture,8); - sd->text = Z_Malloc(strlen(process)+1, PU_LEVEL, NULL); - M_Memcpy(sd->text, process, strlen(process)+1); + process[8] = '\0'; + sd->text = Z_Malloc(7, PU_LEVEL, NULL); + + // If they type in O_ or D_ and their music name, just shrug, + // then copy the rest instead. + if ((process[0] == 'O' || process[0] == 'D') && process[7]) + M_Memcpy(sd->text, process+2, 6); + else // Assume it's a proper music name. + M_Memcpy(sd->text, process, 6); + sd->text[6] = 0; break; } case 414: // Play SFX diff --git a/src/p_spec.c b/src/p_spec.c index ef3425e0..99029d9b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2392,7 +2392,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) { UINT16 tracknum = (UINT16)sides[line->sidenum[0]].bottomtexture; - strncpy(mapmusname, line->text, 7); + strncpy(mapmusname, sides[line->sidenum[0]].text, 7); mapmusname[6] = 0; mapmusflags = tracknum & MUSIC_TRACKMASK; From 1203b0aa73dad58cf411a4349504a3701290c680 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 7 Jan 2016 23:48:19 -0800 Subject: [PATCH 016/109] Fix crash on game clear (No, game, you can't allocate a map header for the credits, why were you doing that before and how did it not break anything??) (cherry picked from commit e1f9a012297d5220dcdd9395265467621a170e32) --- src/g_game.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/g_game.c b/src/g_game.c index 08853643..7941c33d 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2874,7 +2874,8 @@ static void G_DoCompleted(void) // We are committed to this map now. // We may as well allocate its header if it doesn't exist - if(!mapheaderinfo[nextmap]) + // (That is, if it's a real map) + if (nextmap < NUMMAPS && !mapheaderinfo[nextmap]) P_AllocMapHeader(nextmap); if (skipstats) From 04d112276e1ed1b2dd576f829d801e163ffab040 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 8 Jan 2016 03:23:05 -0800 Subject: [PATCH 017/109] Fixed some oddities with TUNES. (cherry picked from commit a4d05350f711db76676e9b48c36d88bd7dbec274) --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 9916e524..7197def7 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3788,7 +3788,7 @@ static void Command_Tunes_f(void) tunearg = mapheaderinfo[gamemap-1]->musname; track = mapheaderinfo[gamemap-1]->mustrack; } - else if (tunearg[3] == 0 && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') + else if (!tunearg[2] && toupper(tunearg[0]) >= 'A' && toupper(tunearg[0]) <= 'Z') tunenum = (UINT16)M_MapNumber(tunearg[0], tunearg[1]); if (tunenum && tunenum >= 1036) From 8fc484cea9360403644a2624656c8431937471e5 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 4 Feb 2016 17:27:55 -0800 Subject: [PATCH 018/109] Just a few more changes to TUNES, nothing special (cherry picked from commit 63a9c66317c263124567234897ed6240b5e34f9e) --- src/d_netcmd.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 7197def7..5eb35283 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3766,11 +3766,12 @@ static void Command_Tunes_f(void) if (argc < 2) //tunes slot ... { - CONS_Printf("tunes :\n"); - CONS_Printf(M_GetText("Play a music slot at a set speed (\"1\" being normal speed).\n")); - CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n")); - CONS_Printf(M_GetText("The current tune is: %s\nThe current track is: %d\n"), - mapmusname, (mapmusflags & MUSIC_TRACKMASK)); + CONS_Printf("tunes [track] [speed] / <-show> / <-default> / <-none>:\n"); + CONS_Printf(M_GetText("Play an arbitrary music lump. If a map number is used, 'MAP##M' is played.\n")); + CONS_Printf(M_GetText("If the format supports multiple songs, you can specify which one to play.\n\n")); + CONS_Printf(M_GetText("* With \"-show\", shows the currently playing tune and track.\n")); + CONS_Printf(M_GetText("* With \"-default\", returns to the default music for the map.\n")); + CONS_Printf(M_GetText("* With \"-none\", any music playing will be stopped.\n")); return; } @@ -3778,12 +3779,18 @@ static void Command_Tunes_f(void) tunenum = (UINT16)atoi(tunearg); track = 0; - if (!strcasecmp(tunearg, "none")) + if (!strcasecmp(tunearg, "-show")) + { + CONS_Printf(M_GetText("The current tune is: %s [track %d]\n"), + mapmusname, (mapmusflags & MUSIC_TRACKMASK)); + return; + } + if (!strcasecmp(tunearg, "-none")) { S_StopMusic(); return; } - else if (!strcasecmp(tunearg, "default")) + else if (!strcasecmp(tunearg, "-default")) { tunearg = mapheaderinfo[gamemap-1]->musname; track = mapheaderinfo[gamemap-1]->mustrack; @@ -3796,9 +3803,11 @@ static void Command_Tunes_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Valid music slots are 1 to 1035.\n")); return; } + if (!tunenum && strlen(tunearg) > 6) // This is automatic -- just show the error just in case + CONS_Alert(CONS_NOTICE, M_GetText("Music name too long - truncated to six characters.\n")); - if (argc > 3) - track = (UINT16)atoi(COM_Argv(3))-1; + if (argc > 2) + track = (UINT16)atoi(COM_Argv(2))-1; if (tunenum) snprintf(mapmusname, 7, "%sM", G_BuildMapName(tunenum)); @@ -3809,9 +3818,9 @@ static void Command_Tunes_f(void) S_ChangeMusic(mapmusname, mapmusflags, true); - if (argc > 2) + if (argc > 3) { - float speed = (float)atof(COM_Argv(2)); + float speed = (float)atof(COM_Argv(3)); if (speed > 0.0f) S_SpeedMusic(speed); } From b7ebb8186d3555ef8f2cbd102d755e7dfba75147 Mon Sep 17 00:00:00 2001 From: Sean Ryder Date: Tue, 9 Feb 2016 16:20:18 +0000 Subject: [PATCH 019/109] Fix MD2 interpolation for FF_ANIMATE states --- src/hardware/hw_md2.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 77795ccc..b092ac32 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1195,16 +1195,37 @@ void HWR_DrawMD2(gr_vissprite_t *spr) HWR_GetMappedPatch(gpatch, spr->colormap); } + if (spr->mobj->frame & FF_ANIMATE) + { + // set duration and tics to be the correct values for FF_ANIMATE states + durs = spr->mobj->state->var2; + tics = spr->mobj->anim_duration; + } + //FIXME: this is not yet correct frame = (spr->mobj->frame & FF_FRAMEMASK) % md2->model->header.numFrames; buff = md2->model->glCommandBuffer; curr = &md2->model->frames[frame]; - if (cv_grmd2.value == 1 - && spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL - && !(spr->mobj->player && (spr->mobj->state->nextstate == S_PLAY_TAP1 || spr->mobj->state->nextstate == S_PLAY_TAP2) && spr->mobj->state == &states[S_PLAY_STND])) + if (cv_grmd2.value == 1) { - const INT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames; - next = &md2->model->frames[nextframe]; + // frames are handled differently for states with FF_ANIMATE, so get the next frame differently for the interpolation + if (spr->mobj->frame & FF_ANIMATE) + { + UINT32 nextframe = (spr->mobj->frame & FF_FRAMEMASK) + 1; + if (nextframe >= (UINT32)spr->mobj->state->var1) + nextframe = (spr->mobj->state->frame & FF_FRAMEMASK); + nextframe %= md2->model->header.numFrames; + next = &md2->model->frames[nextframe]; + } + else + { + if (spr->mobj->state->nextstate != S_NULL && states[spr->mobj->state->nextstate].sprite != SPR_NULL + && !(spr->mobj->player && (spr->mobj->state->nextstate == S_PLAY_TAP1 || spr->mobj->state->nextstate == S_PLAY_TAP2) && spr->mobj->state == &states[S_PLAY_STND])) + { + const UINT32 nextframe = (states[spr->mobj->state->nextstate].frame & FF_FRAMEMASK) % md2->model->header.numFrames; + next = &md2->model->frames[nextframe]; + } + } } //Hurdler: it seems there is still a small problem with mobj angle From dabc4415af553ec8a1bc14e381635e7d9879d279 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 13 Feb 2016 18:11:50 +0000 Subject: [PATCH 020/109] Fix crash caused by drawing scaled, mirrored sprites semi-covered on the left side by portal edge I suspect this crash was possible even outside the context of portals, but whatever --- src/r_things.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 3767b02b..87879a41 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -839,10 +839,10 @@ static void R_DrawVisSprite(vissprite_t *vis) dc_texturemid = FixedDiv(dc_texturemid,this_scale); //Oh lordy, mercy me. Don't freak out if sprites go offscreen! - if (vis->xiscale > 0) + /*if (vis->xiscale > 0) frac = FixedDiv(frac, this_scale); else if (vis->x1 <= 0) - frac = (vis->x1 - vis->x2) * vis->xiscale; + frac = (vis->x1 - vis->x2) * vis->xiscale;*/ sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale); //dc_hires = 1; @@ -1306,7 +1306,7 @@ static void R_ProjectSprite(mobj_t *thing) } if (vis->x1 > x1) - vis->startfrac += vis->xiscale*(vis->x1-x1); + vis->startfrac += FixedDiv(vis->xiscale, this_scale)*(vis->x1-x1); //Fab: lumppat is the lump number of the patch to use, this is different // than lumpid for sprites-in-pwad : the graphics are patched From db3797fd35da9dfde3dcef754b48ac47d9ea602d Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sun, 14 Feb 2016 05:19:40 -0600 Subject: [PATCH 021/109] Add PlayerSpawn hook --- src/lua_hook.h | 2 ++ src/lua_hooklib.c | 1 + src/p_mobj.c | 6 ++++++ 3 files changed, 9 insertions(+) diff --git a/src/lua_hook.h b/src/lua_hook.h index da2dcdc3..f3af7f30 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -42,6 +42,7 @@ enum hook { hook_LinedefExecute, hook_PlayerMsg, hook_HurtMsg, + hook_PlayerSpawn, hook_MAX // last hook }; @@ -75,5 +76,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages +#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for P_SpawnPlayer #endif diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 0415d23e..dfd6d703 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -53,6 +53,7 @@ const char *const hookNames[hook_MAX+1] = { "LinedefExecute", "PlayerMsg", "HurtMsg", + "PlayerSpawn", NULL }; diff --git a/src/p_mobj.c b/src/p_mobj.c index 25ae8815..4916dbfd 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8294,6 +8294,12 @@ void P_SpawnPlayer(INT32 playernum) // Spawn with a pity shield if necessary. P_DoPityCheck(p); + +#ifdef HAVE_BLUA + if (LUAh_PlayerSpawn(p)) // Lua hook for player spawning :) + ; +#endif + } void P_AfterPlayerSpawn(INT32 playernum) From 000ec9ac67c47c1c16489f35987fe2c87caaab81 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sun, 14 Feb 2016 15:22:13 -0600 Subject: [PATCH 022/109] Call LUAh_PlayerSpawn instead of checking for it --- src/p_mobj.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 4916dbfd..367a3a7d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8296,8 +8296,7 @@ void P_SpawnPlayer(INT32 playernum) P_DoPityCheck(p); #ifdef HAVE_BLUA - if (LUAh_PlayerSpawn(p)) // Lua hook for player spawning :) - ; + LUAh_PlayerSpawn(p); // Lua hook for player spawning :) #endif } From f10279d61bf2a79bcd031ab1f625368cd5bf6ebc Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 25 Feb 2016 14:35:05 -0800 Subject: [PATCH 023/109] Very minor performance improvement. --- src/p_mobj.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 323e5ce9..d2454f26 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -92,9 +92,7 @@ FUNCINLINE static ATTRINLINE void P_CycleStateAnimation(mobj_t *mobj) // compare the current sprite frame to the one we started from // if more than var1 away from it, swap back to the original // else just advance by one - if ((mobj->frame & FF_FRAMEMASK) - (mobj->state->frame & FF_FRAMEMASK) < (UINT32)mobj->state->var1) - ++mobj->frame; - else + if (((++mobj->frame) & FF_FRAMEMASK) - (mobj->state->frame & FF_FRAMEMASK) > (UINT32)mobj->state->var1) mobj->frame = (mobj->state->frame & FF_FRAMEMASK) | (mobj->frame & ~FF_FRAMEMASK); } From 5c9aaf2fe4ae3d93dfe50028634e0b70d4ac598f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 25 Feb 2016 22:28:19 -0600 Subject: [PATCH 024/109] Move hook into G_SpawnPlayer --- src/g_game.c | 6 ++++++ src/lua_hook.h | 2 +- src/p_mobj.c | 5 ----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 72cfe4a5..3329e8ef 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2328,6 +2328,12 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) } } P_MovePlayerToSpawn(playernum, spawnpoint); + +#ifdef HAVE_BLUA + player_t *p = &players[playernum]; + LUAh_PlayerSpawn(p); // Lua hook for player spawning :) +#endif + } mapthing_t *G_FindCTFStart(INT32 playernum) diff --git a/src/lua_hook.h b/src/lua_hook.h index f3af7f30..4eb08378 100644 --- a/src/lua_hook.h +++ b/src/lua_hook.h @@ -76,6 +76,6 @@ boolean LUAh_BotAI(mobj_t *sonic, mobj_t *tails, ticcmd_t *cmd); // Hook for B_B boolean LUAh_LinedefExecute(line_t *line, mobj_t *mo, sector_t *sector); // Hook for linedef executors boolean LUAh_PlayerMsg(int source, int target, int flags, char *msg); // Hook for chat messages boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source); // Hook for hurt messages -#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for P_SpawnPlayer +#define LUAh_PlayerSpawn(player) LUAh_PlayerHook(player, hook_PlayerSpawn) // Hook for G_SpawnPlayer #endif diff --git a/src/p_mobj.c b/src/p_mobj.c index 367a3a7d..25ae8815 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8294,11 +8294,6 @@ void P_SpawnPlayer(INT32 playernum) // Spawn with a pity shield if necessary. P_DoPityCheck(p); - -#ifdef HAVE_BLUA - LUAh_PlayerSpawn(p); // Lua hook for player spawning :) -#endif - } void P_AfterPlayerSpawn(INT32 playernum) From 8f0abb267edd493b58e875a08083af9c36ea3870 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 25 Feb 2016 22:47:52 -0600 Subject: [PATCH 025/109] Don't mix declarations and code --- src/g_game.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3329e8ef..219b276e 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2330,8 +2330,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost) P_MovePlayerToSpawn(playernum, spawnpoint); #ifdef HAVE_BLUA - player_t *p = &players[playernum]; - LUAh_PlayerSpawn(p); // Lua hook for player spawning :) + LUAh_PlayerSpawn(&players[playernum]); // Lua hook for player spawning :) #endif } From f5ba192f0b7c3501950e81d3d29958610ad28cf2 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 25 Feb 2016 23:31:48 -0800 Subject: [PATCH 026/109] remove extraneous va() calls --- src/dehacked.c | 2 +- src/p_setup.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 6f07ce8e..b022d51e 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1185,7 +1185,7 @@ static void readlevelheader(MYFILE *f, INT32 num) deh_warning("Level header %d: musicslot out of range (0 - 1035)\n", num); else // it's just a number { - snprintf(mapheaderinfo[num-1]->musname, 7, va("%sM", G_BuildMapName(i))); + snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); mapheaderinfo[num-1]->musname[6] = 0; } } diff --git a/src/p_setup.c b/src/p_setup.c index 000a3a65..00bb4a63 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -181,7 +181,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i) DEH_WriteUndoline("NEXTLEVEL", va("%d", mapheaderinfo[num]->nextlevel), UNDO_NONE); mapheaderinfo[num]->nextlevel = (INT16)(i + 1); DEH_WriteUndoline("MUSIC", mapheaderinfo[num]->musname, UNDO_NONE); - snprintf(mapheaderinfo[num]->musname, 7, va("%sM", G_BuildMapName(i))); + snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i)); mapheaderinfo[num]->musname[6] = 0; DEH_WriteUndoline("MUSICTRACK", va("%d", mapheaderinfo[num]->mustrack), UNDO_NONE); mapheaderinfo[num]->mustrack = 0; From c7ba1d15321531fe2d5ba01e6854760305e98f63 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 26 Feb 2016 18:11:12 +0000 Subject: [PATCH 027/109] Make sure target sector's lightlist is reset whenever FOF flags are changed. This fixes how removing certain flags (such as FF_EXISTS) from FOFs can cause HOMs on walls bordering their target sectors. Also fixes how the force-FOF-to-vanish linedef special can leave behind the FOF's shadow --- src/lua_maplib.c | 6 +++++- src/p_spec.c | 7 +++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 38920c22..16d05dac 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1111,9 +1111,13 @@ static int ffloor_set(lua_State *L) case ffloor_bottompic: *ffloor->bottompic = P_AddLevelFlatRuntime(luaL_checkstring(L, 3)); break; - case ffloor_flags: + case ffloor_flags: { + ffloortype_e oldflags = ffloor->flags; // store FOF's old flags ffloor->flags = luaL_checkinteger(L, 3); + if (ffloor->flags != oldflags) + ffloor->target->moved = true; // reset target sector's lightlist break; + } case ffloor_alpha: ffloor->alpha = (INT32)luaL_checkinteger(L, 3); break; diff --git a/src/p_spec.c b/src/p_spec.c index 81994d46..2c471fa9 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3039,6 +3039,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) INT16 foftag = (INT16)(sides[line->sidenum[0]].rowoffset>>FRACBITS); sector_t *sec; // Sector that the FOF is visible (or not visible) in ffloor_t *rover; // FOF to vanish/un-vanish + ffloortype_e oldflags; // store FOF's old flags for (secnum = -1; (secnum = P_FindSectorFromTag(sectag, secnum)) >= 0 ;) { @@ -3062,11 +3063,17 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) return; } + oldflags = rover->flags; + // Abracadabra! if (line->flags & ML_NOCLIMB) rover->flags |= FF_EXISTS; else rover->flags &= ~FF_EXISTS; + + // if flags changed, reset sector's light list + if (rover->flags != oldflags) + sec->moved = true; } } break; From c3166e40b0010fa9c6748875c8e1bfc9551cbc2f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 27 Feb 2016 14:27:14 -0600 Subject: [PATCH 028/109] Update names in credits Same as the commit in internal, minus toaster's name (by request, of course.) --- src/f_finale.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 507616f3..2a1e5cce 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -977,6 +977,7 @@ static const char *credits[] = { "\"Monster\" Iestyn Jealous", "Ronald \"Furyhunter\" Kinard", // The SDL2 port "John \"JTE\" Muniz", + "Ehab \"Wolfy\" Saeed", "\"SSNTails\"", "Matthew \"Inuyasha\" Walsh", "", @@ -1020,7 +1021,7 @@ static const char *credits[] = { "\"Monster\" Iestyn Jealous", "Jarel \"Arrow\" Jones", "Stefan \"Stuf\" Rimalia", - "Shane Strife", + "Shane Mychal Sexton", "\"Spazzo\"", "David \"Big Wave Dave\" Spencer Sr.", "David \"Instant Sonic\" Spencer Jr.", @@ -1069,7 +1070,7 @@ static const char *credits[] = { "iD Software", "Alex \"MistaED\" Fuller", "FreeDoom Project", // Used some of the mancubus and rocket launcher sprites for Brak - "Randy Heit ()", // For his MSPaint sprite that we nicked + "Randi Heit ()", // For their MSPaint sprite that we nicked "", "\1Produced By", "Sonic Team Junior", From 4b447b3d0db33c92ca1e542cc6a955af3dec45ea Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 28 Feb 2016 18:30:29 +0000 Subject: [PATCH 029/109] Don't add polyobjects to a mobj's sector nodes list. This causes the player to teeter whenever they are above the polyobject's bottom, whether or not it is solid Also, a minor tweak for the teetering code itself, though it looks a right mess and probably should be redone in the future --- src/p_map.c | 6 ++++++ src/p_user.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 61d57dcd..760252c8 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3712,6 +3712,9 @@ static inline boolean PIT_GetSectors(line_t *ld) if (P_BoxOnLineSide(tmbbox, ld) != -1) return true; + if (ld->polyobj) // line belongs to a polyobject, don't add it + return true; + // This line crosses through the object. // Collect the sector(s) from the line and add to the @@ -3744,6 +3747,9 @@ static inline boolean PIT_GetPrecipSectors(line_t *ld) if (P_BoxOnLineSide(preciptmbbox, ld) != -1) return true; + if (ld->polyobj) // line belongs to a polyobject, don't add it + return true; + // This line crosses through the object. // Collect the sector(s) from the line and add to the diff --git a/src/p_user.c b/src/p_user.c index da65b7cb..b3ba5f61 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3087,7 +3087,7 @@ static void P_DoTeeter(player_t *player) } if (polybottom > player->mo->z + player->mo->height + tiptop - || (polybottom < player->mo->z + || (polytop < player->mo->z && player->mo->z + player->mo->height < player->mo->ceilingz - tiptop)) teeter = true; else @@ -3105,7 +3105,7 @@ static void P_DoTeeter(player_t *player) } if (polytop < player->mo->z - tiptop - || (polytop > player->mo->z + player->mo->height + || (polybottom > player->mo->z + player->mo->height && player->mo->z > player->mo->floorz + tiptop)) teeter = true; else From ffa9a4e056a7ad2117eca8155285931f92f13cd4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 2 Oct 2015 13:45:51 +0100 Subject: [PATCH 030/109] Removed the removal of SF_SUPER from skins other than Sonic # Conflicts: # src/r_things.c --- src/r_things.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 2a3f8e77..bdc6c476 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2698,9 +2698,6 @@ next_token: } free(buf2); - // Not in vanilla, you don't. - skin->flags &= ~SF_SUPER; - lump++; // if no sprite defined use spirte just after this one if (skin->sprite[0] == '\0') { From fc35c8557e97e64c17718f5ceee7d8f0190b9246 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sun, 28 Feb 2016 18:19:46 -0800 Subject: [PATCH 031/109] Super color code cleaning, speed 50%, nothing special --- src/g_game.c | 6 ++---- src/p_user.c | 23 +++++------------------ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 72cfe4a5..dda8793b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4326,10 +4326,8 @@ void G_GhostTicker(void) switch(g->color) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) - if (leveltime % 9 < 5) - g->mo->color = SKINCOLOR_SUPER1 + leveltime % 9; - else - g->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9; + g->mo->color = SKINCOLOR_SUPER1; + g->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index da65b7cb..89b530c3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3442,27 +3442,14 @@ static void P_DoSuperStuff(player_t *player) player->mo->health--; } + // future todo: a skin option for this, and possibly more colors switch (player->skin) { - case 1: // Golden orange supertails. - if (leveltime % 9 < 5) - player->mo->color = SKINCOLOR_TSUPER1 + leveltime % 9; - else - player->mo->color = SKINCOLOR_TSUPER1 + 9 - leveltime % 9; - break; - case 2: // Pink superknux. - if (leveltime % 9 < 5) - player->mo->color = SKINCOLOR_KSUPER1 + leveltime % 9; - else - player->mo->color = SKINCOLOR_KSUPER1 + 9 - leveltime % 9; - break; - default: // Yousa yellow now! - if (leveltime % 9 < 5) - player->mo->color = SKINCOLOR_SUPER1 + leveltime % 9; - else - player->mo->color = SKINCOLOR_SUPER1 + 9 - leveltime % 9; - break; + case 1: /* Tails */ player->mo->color = SKINCOLOR_TSUPER1; break; + case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; + default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } + player->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) From ab288a7d1a76f2d79ea7136024902891b7b8c328 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Tue, 1 Mar 2016 17:48:10 -0600 Subject: [PATCH 032/109] Allow Lua to read VERSION, SUBVERSION, and VERSIONSTRING constants --- src/dehacked.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index d6a1881e..95593798 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6941,6 +6941,8 @@ struct { {"PUSHACCEL",PUSHACCEL}, {"MODID",MODID}, // I don't know, I just thought it would be cool for a wad to potentially know what mod it was loaded into. {"CODEBASE",CODEBASE}, // or what release of SRB2 this is. + {"VERSION",VERSION}, // Grab the game's version! + {"SUBVERSION",SUBVERSION}, // more precise version number // Special linedef executor tag numbers! {"LE_PINCHPHASE",LE_PINCHPHASE}, // A boss entered pinch phase (and, in most cases, is preparing their pinch phase attack!) @@ -8213,6 +8215,9 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"gravity")) { lua_pushinteger(L, gravity); return 1; + } else if (fastcmp(word,"VERSIONSTRING")) { + lua_pushstring(L, VERSIONSTRING); + return 1; } return 0; From 668cc85d7b3f828ef723289939ac134b57ce191d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 2 Mar 2016 20:31:04 +0000 Subject: [PATCH 033/109] P_ClosestPointOnLine can now (optionally) take custom coordinates that you want to make up your line --- src/lua_baselib.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 5e2d31b1..be06982f 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -140,14 +140,38 @@ static int lib_pAproxDistance(lua_State *L) static int lib_pClosestPointOnLine(lua_State *L) { + int n = lua_gettop(L); fixed_t x = luaL_checkfixed(L, 1); fixed_t y = luaL_checkfixed(L, 2); - line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); vertex_t result; //HUDSAFE - if (!line) - return LUA_ErrInvalid(L, "line_t"); - P_ClosestPointOnLine(x, y, line, &result); + if (lua_isuserdata(L, 3)) // use a real linedef to get our points + { + line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); + if (!line) + return LUA_ErrInvalid(L, "line_t"); + P_ClosestPointOnLine(x, y, line, &result); + } + else // use custom coordinates of our own! + { + vertex_t v1, v2; // fake vertexes + line_t junk; // fake linedef + + if (n < 6) + return luaL_error(L, "arguments 3 to 6 not all given (expected 4 fixed-point integers)"); + + v1.x = luaL_checkfixed(L, 3); + v1.y = luaL_checkfixed(L, 4); + v2.x = luaL_checkfixed(L, 5); + v2.y = luaL_checkfixed(L, 6); + + junk.v1 = &v1; + junk.v2 = &v2; + junk.dx = v2.x - v1.x; + junk.dy = v2.y - v1.y; + P_ClosestPointOnLine(x, y, &junk, &result); + } + lua_pushfixed(L, result.x); lua_pushfixed(L, result.y); return 2; From 7349cbdbc0c16fe1e6d572de70244bb458633654 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 3 Mar 2016 02:54:07 -0800 Subject: [PATCH 034/109] Backwards compatibility. A test WAD for all possible use cases I can think of can be found here: https://dl.dropboxusercontent.com/u/3518218/21/secret/bc_test.wad --- src/dehacked.c | 110 ++++++++++++++++++++++++++++++++++++++++------ src/doomdef.h | 4 ++ src/lua_baselib.c | 42 ++++++++++++++++++ src/s_sound.c | 22 ++++++++++ src/s_sound.h | 6 +++ 5 files changed, 171 insertions(+), 13 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index b022d51e..3ab37706 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -65,6 +65,9 @@ static mobjtype_t get_mobjtype(const char *word); static statenum_t get_state(const char *word); static spritenum_t get_sprite(const char *word); static sfxenum_t get_sfx(const char *word); +#ifdef MUSICSLOT_COMPATIBILITY +static UINT16 get_mus(const char *word, UINT8 dehacked_mode); +#endif static hudnum_t get_huditem(const char *word); #ifndef HAVE_BLUA static powertype_t get_power(const char *word); @@ -1173,22 +1176,19 @@ static void readlevelheader(MYFILE *f, INT32 num) sizeof(mapheaderinfo[num-1]->musname), va("Level header %d: music", num)); } } +#ifdef MUSICSLOT_COMPATIBILITY else if (fastcmp(word, "MUSICSLOT")) - { // Backwards compatibility? - // Convert to map number - if (word2[0] >= 'A' && word2[0] <= 'Z' && word2[2] == '\0') - i = M_MapNumber(word2[0], word2[1]); - - if (!i) - mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string - else if (i > 1035) - deh_warning("Level header %d: musicslot out of range (0 - 1035)\n", num); - else // it's just a number - { + { + i = get_mus(word2, true); + if (i && i <= 1035) snprintf(mapheaderinfo[num-1]->musname, 7, "%sM", G_BuildMapName(i)); - mapheaderinfo[num-1]->musname[6] = 0; - } + else if (i && i <= 1050) + strncpy(mapheaderinfo[num-1]->musname, compat_special_music_slots[i - 1036], 7); + else + mapheaderinfo[num-1]->musname[0] = 0; // becomes empty string + mapheaderinfo[num-1]->musname[6] = 0; } +#endif else if (fastcmp(word, "MUSICTRACK")) mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1); else if (fastcmp(word, "FORCECHARACTER")) @@ -1463,6 +1463,20 @@ static void readcutscenescene(MYFILE *f, INT32 num, INT32 scenenum) strncpy(cutscenes[num]->scene[scenenum].musswitch, word2, 7); cutscenes[num]->scene[scenenum].musswitch[6] = 0; } +#ifdef MUSICSLOT_COMPATIBILITY + else if (fastcmp(word, "MUSICSLOT")) + { + DEH_WriteUndoline(word, cutscenes[num]->scene[scenenum].musswitch, UNDO_NONE); + i = get_mus(word2, true); + if (i && i <= 1035) + snprintf(cutscenes[num]->scene[scenenum].musswitch, 7, "%sM", G_BuildMapName(i)); + else if (i && i <= 1050) + strncpy(cutscenes[num]->scene[scenenum].musswitch, compat_special_music_slots[i - 1036], 7); + else + cutscenes[num]->scene[scenenum].musswitch[0] = 0; // becomes empty string + cutscenes[num]->scene[scenenum].musswitch[6] = 0; + } +#endif else if (fastcmp(word, "MUSICTRACK")) { DEH_WriteUndoline(word, va("%u", cutscenes[num]->scene[scenenum].musswitchflags), UNDO_NONE); @@ -7978,6 +7992,46 @@ static sfxenum_t get_sfx(const char *word) return sfx_None; } +#ifdef MUSICSLOT_COMPATIBILITY +static UINT16 get_mus(const char *word, UINT8 dehacked_mode) +{ // Returns the value of MUS_ enumerations + UINT16 i; + char lumptmp[4]; + + if (*word >= '0' && *word <= '9') + return atoi(word); + if (!word[2] && toupper(word[0]) >= 'A' && toupper(word[0]) <= 'Z') + return (UINT16)M_MapNumber(word[0], word[1]); + + if (fastncmp("MUS_",word,4)) + word += 4; // take off the MUS_ + else if (fastncmp("O_",word,2) || fastncmp("D_",word,2)) + word += 2; // take off the O_ or D_ + + strncpy(lumptmp, word, 4); + lumptmp[3] = 0; + if (fasticmp("MAP",lumptmp)) + { + word += 3; + if (toupper(word[0]) >= 'A' && toupper(word[0]) <= 'Z') + return (UINT16)M_MapNumber(word[0], word[1]); + else if ((i = atoi(word))) + return i; + + word -= 3; + if (dehacked_mode) + deh_warning("Couldn't find music named 'MUS_%s'",word); + return 0; + } + for (i = 0; compat_special_music_slots[i][0]; ++i) + if (fasticmp(word, compat_special_music_slots[i])) + return i + 1036; + if (dehacked_mode) + deh_warning("Couldn't find music named 'MUS_%s'",word); + return 0; +} +#endif + static hudnum_t get_huditem(const char *word) { // Returns the value of HUD_ enumerations hudnum_t i; @@ -8176,6 +8230,13 @@ static fixed_t find_const(const char **rword) free(word); return r; } +#ifdef MUSICSLOT_COMPATIBILITY + else if (fastncmp("MUS_",word,4) || fastncmp("O_",word,2)) { + r = get_mus(word, true); + free(word); + return r; + } +#endif else if (fastncmp("PW_",word,3)) { r = get_power(word); free(word); @@ -8545,6 +8606,29 @@ static inline int lib_getenum(lua_State *L) if (mathlib) return luaL_error(L, "sfx '%s' could not be found.\n", word); return 0; } +#ifdef MUSICSLOT_COMPATIBILITY + else if (!mathlib && fastncmp("mus_",word,4)) { + p = word+4; + if ((i = get_mus(p, false)) == 0) + return 0; + lua_pushinteger(L, i); + return 1; + } + else if (mathlib && fastncmp("MUS_",word,4)) { // SOCs are ALL CAPS! + p = word+4; + if ((i = get_mus(p, false)) == 0) + return luaL_error(L, "music '%s' could not be found.\n", word); + lua_pushinteger(L, i); + return 1; + } + else if (mathlib && (fastncmp("O_",word,2) || fastncmp("D_",word,2))) { + p = word+2; + if ((i = get_mus(p, false)) == 0) + return luaL_error(L, "music '%s' could not be found.\n", word); + lua_pushinteger(L, i); + return 1; + } +#endif else if (!mathlib && fastncmp("pw_",word,3)) { p = word+3; for (i = 0; i < NUMPOWERS; i++) diff --git a/src/doomdef.h b/src/doomdef.h index 8935eb11..0fc4a1fe 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -490,4 +490,8 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Experimental tweaks to analog mode. (Needs a lot of work before it's ready for primetime.) //#define REDSANALOG +/// Backwards compatibility with musicslots. +/// \note You should leave this enabled unless you're working with a future SRB2 version. +#define MUSICSLOT_COMPATIBILITY + #endif // __DOOMDEF__ diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 38627095..c415eecb 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -1636,17 +1636,59 @@ static int lib_sStopSound(lua_State *L) static int lib_sChangeMusic(lua_State *L) { +#ifdef MUSICSLOT_COMPATIBILITY + const char *music_name; + UINT32 music_num; + char music_compat_name[7]; + + boolean looping; + player_t *player = NULL; + UINT16 music_flags = 0; + NOHUD + + if (lua_isnumber(L, 1)) + { + music_num = (UINT32)luaL_checkinteger(L, 1); + music_flags = (UINT16)(music_num & 0x0000FFFF); + if (music_flags && music_flags <= 1035) + snprintf(music_compat_name, 7, "%sM", G_BuildMapName((INT32)music_flags)); + else if (music_flags && music_flags <= 1050) + strncpy(music_compat_name, compat_special_music_slots[music_flags - 1036], 7); + else + music_compat_name[0] = 0; // becomes empty string + music_compat_name[6] = 0; + music_name = (const char *)&music_compat_name; + music_flags = 0; + } + else + { + music_num = 0; + music_name = luaL_checkstring(L, 1); + } + + + looping = (boolean)lua_opttrueboolean(L, 2); + +#else const char *music_name = luaL_checkstring(L, 1); boolean looping = (boolean)lua_opttrueboolean(L, 2); player_t *player = NULL; UINT16 music_flags = 0; NOHUD + +#endif if (!lua_isnone(L, 3) && lua_isuserdata(L, 3)) { player = *((player_t **)luaL_checkudata(L, 3, META_PLAYER)); if (!player) return LUA_ErrInvalid(L, "player_t"); } + +#ifdef MUSICSLOT_COMPATIBILITY + if (music_num) + music_flags = (UINT16)((music_num & 0x7FFF0000) >> 16); + else +#endif music_flags = (UINT16)luaL_optinteger(L, 4, 0); if (!player || P_IsLocalPlayer(player)) diff --git a/src/s_sound.c b/src/s_sound.c index 1e5f79aa..49373d94 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -1155,6 +1155,28 @@ void S_StartSoundName(void *mo, const char *soundname) /// Music /// ------------------------ +#ifdef MUSICSLOT_COMPATIBILITY +const char *compat_special_music_slots[16] = +{ + "titles", // 1036 title screen + "read_m", // 1037 intro + "lclear", // 1038 level clear + "invinc", // 1039 invincibility + "shoes", // 1040 super sneakers + "minvnc", // 1041 Mario invincibility + "drown", // 1042 drowning + "gmover", // 1043 game over + "xtlife", // 1044 extra life + "contsc", // 1045 continue screen + "supers", // 1046 Super Sonic + "chrsel", // 1047 character select + "credit", // 1048 credits + "racent", // 1049 Race Results + "stjr", // 1050 Sonic Team Jr. Presents + "" +}; +#endif + #define music_playing (music_name[0]) // String is empty if no music is playing static char music_name[7]; // up to 6-character name diff --git a/src/s_sound.h b/src/s_sound.h index 12787536..d5cf3570 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -139,4 +139,10 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #define S_StartScreamSound S_StartSound #endif +#ifdef MUSICSLOT_COMPATIBILITY +// For compatibility with code/scripts relying on older versions +// This is a list of all the "special" slot names and their associated numbers +const char *compat_special_music_slots[16]; +#endif + #endif From 61a0d1bcd162062e43d35a87b8ba539c27187e3c Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 3 Mar 2016 03:09:35 -0800 Subject: [PATCH 035/109] don't use lstring you have space for a null terminator there... --- src/lua_maplib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_maplib.c b/src/lua_maplib.c index 5f77b2b5..e7801d77 100644 --- a/src/lua_maplib.c +++ b/src/lua_maplib.c @@ -1169,7 +1169,7 @@ static int mapheaderinfo_get(lua_State *L) else if (fastcmp(field,"nextlevel")) lua_pushinteger(L, header->nextlevel); else if (fastcmp(field,"musname")) - lua_pushlstring(L, header->musname, 6); + lua_pushstring(L, header->musname); else if (fastcmp(field,"mustrack")) lua_pushinteger(L, header->mustrack); else if (fastcmp(field,"forcecharacter")) From 4f9bb15e4db743221622b421a5ee7828229e9917 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 3 Mar 2016 18:31:17 +0000 Subject: [PATCH 036/109] "Loading SOC from" console message now also displays the name of the SOC_ lump --- src/w_wad.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index dc994e84..132df8fc 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -32,6 +32,7 @@ #include "w_wad.h" #include "z_zone.h" +#include "fastcmp.h" #include "i_video.h" // rendermode #include "d_netfil.h" @@ -151,8 +152,16 @@ static inline void W_LoadDehackedLumps(UINT16 wadnum) lumpinfo_t *lump_p = wadfiles[wadnum]->lumpinfo; for (lump = 0; lump < wadfiles[wadnum]->numlumps; lump++, lump_p++) if (memcmp(lump_p->name,"SOC_",4)==0) // Check for generic SOC lump - { - CONS_Printf(M_GetText("Loading SOC from %s\n"), wadfiles[wadnum]->filename); + { // shameless copy+paste of code from LUA_LoadLump + char *name = malloc(strlen(wadfiles[wadnum]->filename)+10); + strcpy(name, wadfiles[wadnum]->filename); + if (!fasticmp(&name[strlen(name) - 4], ".soc")) { + // If it's not a .soc file, copy the lump name in too. + name[strlen(wadfiles[wadnum]->filename)] = '|'; + M_Memcpy(name+strlen(wadfiles[wadnum]->filename)+1, lump_p->name, 8); + name[strlen(wadfiles[wadnum]->filename)+9] = '\0'; + } + CONS_Printf(M_GetText("Loading SOC from %s\n"), name); DEH_LoadDehackedLumpPwad(wadnum, lump); } else if (memcmp(lump_p->name,"MAINCFG",8)==0) // Check for MAINCFG From 0b704ba6188ee47763ab682c64b0d43138152846 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 3 Mar 2016 17:07:05 -0500 Subject: [PATCH 037/109] Updated NetArchiveHook to lua_hooklib.c Fixes I_Assert failure crash due to hooks working differently now. --- src/lua_hooklib.c | 24 ++++++++++++++++++++++++ src/lua_script.c | 28 +++------------------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 0415d23e..4a3325cf 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -768,4 +768,28 @@ boolean LUAh_HurtMsg(player_t *player, mobj_t *inflictor, mobj_t *source) return hooked; } +void LUAh_NetArchiveHook(lua_CFunction archFunc) +{ + hook_p hookp; + + if (!gL || !(hooksAvailable[hook_NetVars/8] & (1<<(hook_NetVars%8)))) + return; + + // stack: tables + I_Assert(lua_gettop(gL) > 0); + I_Assert(lua_istable(gL, -1)); + + for (hookp = roothook; hookp; hookp = hookp->next) + if (hookp->type == hook_NetVars) + { + lua_pushfstring(gL, FMT_HOOKID, hookp->id); + lua_gettable(gL, LUA_REGISTRYINDEX); + lua_pushvalue(gL, -2); // tables + LUA_Call(gL, 1); + } + + // pop tables + lua_pop(gL, 1); +} + #endif diff --git a/src/lua_script.c b/src/lua_script.c index a7315ad6..2e076b02 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -915,29 +915,7 @@ static void UnArchiveTables(void) } } -static void NetArchiveHook(lua_CFunction archFunc) -{ - int TABLESINDEX; - - if (!gL) - return; - - TABLESINDEX = lua_gettop(gL); - lua_getfield(gL, LUA_REGISTRYINDEX, "hook"); - I_Assert(lua_istable(gL, -1)); - lua_rawgeti(gL, -1, hook_NetVars); - lua_remove(gL, -2); - I_Assert(lua_istable(gL, -1)); - - lua_pushvalue(gL, TABLESINDEX); - lua_pushcclosure(gL, archFunc, 1); - lua_pushnil(gL); - while (lua_next(gL, -3) != 0) { - lua_pushvalue(gL, -3); // function - LUA_Call(gL, 1); - } - lua_pop(gL, 2); -} +void LUAh_NetArchiveHook(lua_CFunction archFunc); void LUA_Step(void) { @@ -972,7 +950,7 @@ void LUA_Archive(void) } WRITEUINT32(save_p, UINT32_MAX); // end of mobjs marker, replaces mobjnum. - NetArchiveHook(NetArchive); // call the NetArchive hook in archive mode + LUAh_NetArchiveHook(NetArchive); // call the NetArchive hook in archive mode ArchiveTables(); if (gL) @@ -1003,7 +981,7 @@ void LUA_UnArchive(void) UnArchiveExtVars(th); // apply variables } while(mobjnum != UINT32_MAX); // repeat until end of mobjs marker. - NetArchiveHook(NetUnArchive); // call the NetArchive hook in unarchive mode + LUAh_NetArchiveHook(NetUnArchive); // call the NetArchive hook in unarchive mode UnArchiveTables(); if (gL) From 7ae871c7f860d2d76294a3c78379a1124d8af0e2 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 3 Mar 2016 17:19:21 -0500 Subject: [PATCH 038/109] Fix errenous stack pop. This function is intended to leave the stack in the same state it recieved it. --- src/lua_hooklib.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 4a3325cf..01d4314c 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -788,8 +788,7 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc) LUA_Call(gL, 1); } - // pop tables - lua_pop(gL, 1); + // stack: tables } #endif From 0bdc976d50038db25386290339eb1c959d43dd04 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 3 Mar 2016 17:19:35 -0500 Subject: [PATCH 039/109] Shut up compiler warning. --- src/lua_hooklib.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 01d4314c..48c6df6d 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -24,6 +24,8 @@ #include "lua_hook.h" #include "lua_hud.h" // hud_running errors +void LUAh_NetArchiveHook(lua_CFunction archFunc); + static UINT8 hooksAvailable[(hook_MAX/8)+1]; const char *const hookNames[hook_MAX+1] = { From 9d6e75ae4f625cb5330b627b1777ef279e0344d9 Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 3 Mar 2016 17:30:10 -0500 Subject: [PATCH 040/109] Cleanup LUAh_NetArchiveHook prototype mess. --- src/lua_hooklib.c | 2 -- src/lua_script.c | 2 -- src/lua_script.h | 1 + 3 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 48c6df6d..01d4314c 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -24,8 +24,6 @@ #include "lua_hook.h" #include "lua_hud.h" // hud_running errors -void LUAh_NetArchiveHook(lua_CFunction archFunc); - static UINT8 hooksAvailable[(hook_MAX/8)+1]; const char *const hookNames[hook_MAX+1] = { diff --git a/src/lua_script.c b/src/lua_script.c index 2e076b02..9925bac0 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -915,8 +915,6 @@ static void UnArchiveTables(void) } } -void LUAh_NetArchiveHook(lua_CFunction archFunc); - void LUA_Step(void) { if (!gL) diff --git a/src/lua_script.h b/src/lua_script.h index 292160a0..ec67703c 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -55,6 +55,7 @@ void Got_Luacmd(UINT8 **cp, INT32 playernum); // lua_consolelib.c void LUA_CVarChanged(const char *name); // lua_consolelib.c int Lua_optoption(lua_State *L, int narg, const char *def, const char *const lst[]); +void LUAh_NetArchiveHook(lua_CFunction archFunc); // Console wrapper void COM_Lua_f(void); From b368936b03b3e65e7cb8c5fdf417660806fc05cc Mon Sep 17 00:00:00 2001 From: Yukita Mayako Date: Thu, 3 Mar 2016 17:30:46 -0500 Subject: [PATCH 041/109] Fix bad logic in LUAh_NetArchiveHook rewrite... Argh, I knew I was forgetting something! archFunc is the argument to be passed to the hooks, not tables! --- src/lua_hooklib.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index 01d4314c..5230886a 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -779,15 +779,21 @@ void LUAh_NetArchiveHook(lua_CFunction archFunc) I_Assert(lua_gettop(gL) > 0); I_Assert(lua_istable(gL, -1)); + // tables becomes an upvalue of archFunc + lua_pushvalue(gL, -1); + lua_pushcclosure(gL, archFunc, 1); + // stack: tables, archFunc + for (hookp = roothook; hookp; hookp = hookp->next) if (hookp->type == hook_NetVars) { lua_pushfstring(gL, FMT_HOOKID, hookp->id); lua_gettable(gL, LUA_REGISTRYINDEX); - lua_pushvalue(gL, -2); // tables + lua_pushvalue(gL, -2); // archFunc LUA_Call(gL, 1); } + lua_pop(gL, 1); // pop archFunc // stack: tables } From 4ab2c336e7e19c73a1a287802dc0e1f0969a55b8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Mar 2016 19:32:07 +0000 Subject: [PATCH 042/109] Possibly fixed the issues with LibGME mentioned in issue #14. Not even the HAVE_LIBGME macro was defined apparently, huh. --- cmake/Modules/FindGME.cmake | 8 ++++---- src/CMakeLists.txt | 1 + src/sdl/CMakeLists.txt | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindGME.cmake b/cmake/Modules/FindGME.cmake index 3b0c68de..ea80af45 100644 --- a/cmake/Modules/FindGME.cmake +++ b/cmake/Modules/FindGME.cmake @@ -6,16 +6,16 @@ find_path(GME_INCLUDE_DIR NAMES gme.h PATHS ${GME_PKGCONF_INCLUDE_DIRS} - /usr/include/gme - /usr/local/include/gme + "/usr/include/gme" + "/usr/local/include/gme" ) find_library(GME_LIBRARY NAMES gme PATHS ${GME_PKGCONF_LIBRARY_DIRS} - /usr/lib - /usr/local/lib + "/usr/lib" + "/usr/local/lib" ) set(GME_PROCESS_INCLUDES GME_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9e25dbb..6ec8f2d7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -314,6 +314,7 @@ if(${SRB2_CONFIG_HAVE_GME}) find_package(GME) if(${GME_FOUND}) set(SRB2_HAVE_GME ON) + add_definitions(-DHAVE_LIBGME) else() message(WARNING "You have specified that GME is available but it was not found.") endif() diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index b3d73452..7190efaa 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -122,6 +122,7 @@ if(${SDL2_FOUND}) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -131,6 +132,7 @@ if(${SDL2_FOUND}) target_link_libraries(SRB2SDL2 PRIVATE ${SDL2_LIBRARIES} ${SDL2_MIXER_LIBRARIES} + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -198,6 +200,7 @@ if(${SDL2_FOUND}) target_include_directories(SRB2SDL2 PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2_MIXER_INCLUDE_DIRS} + ${GME_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} From eab51414f348470edfb7b84e2157db7d9b1af39d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 7 Mar 2016 21:16:02 +0000 Subject: [PATCH 043/109] Fix typo in A_ChangeAngleAbsolute --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 367d5714..ffb69082 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7223,7 +7223,7 @@ void A_ChangeAngleAbsolute(mobj_t *actor) //const angle_t amin = FixedAngle(locvar1*FRACUNIT); //const angle_t amax = FixedAngle(locvar2*FRACUNIT); #ifdef HAVE_BLUA - if (LUA_CallAction("A_ChangeAngelAbsolute", actor)) + if (LUA_CallAction("A_ChangeAngleAbsolute", actor)) return; #endif From 694220155e26e63af242fa9ff457d34261425ca3 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Tue, 8 Mar 2016 21:30:12 -0800 Subject: [PATCH 044/109] Revert "MF2_PUSHED is now MFE_PUSHED, for the simple reason that it makes more sense as an eflags object flag than a flags2 object flag!" This reverts commit c8c7878005f79e87f7c0cfa5e0a2f42a53d68758. # Conflicts: # src/dehacked.c # src/p_mobj.c # src/p_mobj.h --- src/dehacked.c | 2 +- src/p_mobj.c | 3 ++- src/p_mobj.h | 38 +++++++++++++++++++------------------- src/p_spec.c | 18 +++++++++--------- 4 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index c21e8fb9..60f3b059 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6684,6 +6684,7 @@ static const char *const MOBJFLAG2_LIST[] = { "EXPLOSION", // Thrown ring has explosive properties "SCATTER", // Thrown ring has scatter properties "BEYONDTHEGRAVE",// Source of this missile has died and has since respawned. + "PUSHED", // Mobj was already pushed this tic "SLIDEPUSH", // MF_PUSHABLE that pushes continuously. "CLASSICPUSH", // Drops straight down when object has negative Z. "STANDONME", // While not pushable, stand on me anyway. @@ -6712,7 +6713,6 @@ static const char *const MOBJEFLAG_LIST[] = { "JUSTSTEPPEDDOWN", // used for ramp sectors "VERTICALFLIP", // Vertically flip sprite/allow upside-down physics "GOOWATER", // Goo water - "PUSHED", // Mobj was already pushed this tic "SPRUNG", // Mobj was already sprung this tic "APPLYPMOMZ", // Platform movement NULL diff --git a/src/p_mobj.c b/src/p_mobj.c index d2454f26..cb9bc775 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6083,7 +6083,8 @@ void P_MobjThinker(mobj_t *mobj) if (mobj->tracer && P_MobjWasRemoved(mobj->tracer)) P_SetTarget(&mobj->tracer, NULL); - mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG); + mobj->flags2 &= ~MF2_PUSHED; + mobj->eflags &= ~MFE_SPRUNG; tmfloorthing = tmhitthing = NULL; diff --git a/src/p_mobj.h b/src/p_mobj.h index 6198f5be..e24b0965 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -175,23 +175,24 @@ typedef enum MF2_EXPLOSION = 1<<7, // Thrown ring has explosive properties MF2_SCATTER = 1<<8, // Thrown ring has scatter properties MF2_BEYONDTHEGRAVE = 1<<9, // Source of this missile has died and has since respawned. - MF2_SLIDEPUSH = 1<<10, // MF_PUSHABLE that pushes continuously. - MF2_CLASSICPUSH = 1<<11, // Drops straight down when object has negative Z. - MF2_STANDONME = 1<<12, // While not pushable, stand on me anyway. - MF2_INFLOAT = 1<<13, // Floating to a height for a move, don't auto float to target's height. - MF2_DEBRIS = 1<<14, // Splash ring from explosion ring - MF2_NIGHTSPULL = 1<<15, // Attracted from a paraloop - MF2_JUSTATTACKED = 1<<16, // can be pushed by other moving mobjs - MF2_FIRING = 1<<17, // turret fire - MF2_SUPERFIRE = 1<<18, // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. - MF2_SHADOW = 1<<19, // Fuzzy draw, makes targeting harder. - MF2_STRONGBOX = 1<<20, // Flag used for "strong" random monitors. - MF2_OBJECTFLIP = 1<<21, // Flag for objects that always have flipped gravity. - MF2_SKULLFLY = 1<<22, // Special handling: skull in flight. - MF2_FRET = 1<<23, // Flashing from a previous hit - MF2_BOSSNOTRAP = 1<<24, // No Egg Trap after boss - MF2_BOSSFLEE = 1<<25, // Boss is fleeing! - MF2_BOSSDEAD = 1<<26, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) + MF2_PUSHED = 1<<10, // Mobj was already pushed this tic + MF2_SLIDEPUSH = 1<<11, // MF_PUSHABLE that pushes continuously. + MF2_CLASSICPUSH = 1<<12, // Drops straight down when object has negative Z. + MF2_STANDONME = 1<<13, // While not pushable, stand on me anyway. + MF2_INFLOAT = 1<<14, // Floating to a height for a move, don't auto float to target's height. + MF2_DEBRIS = 1<<15, // Splash ring from explosion ring + MF2_NIGHTSPULL = 1<<16, // Attracted from a paraloop + MF2_JUSTATTACKED = 1<<17, // can be pushed by other moving mobjs + MF2_FIRING = 1<<18, // turret fire + MF2_SUPERFIRE = 1<<19, // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it. + MF2_SHADOW = 1<<20, // Fuzzy draw, makes targeting harder. + MF2_STRONGBOX = 1<<21, // Flag used for "strong" random monitors. + MF2_OBJECTFLIP = 1<<22, // Flag for objects that always have flipped gravity. + MF2_SKULLFLY = 1<<23, // Special handling: skull in flight. + MF2_FRET = 1<<24, // Flashing from a previous hit + MF2_BOSSNOTRAP = 1<<25, // No Egg Trap after boss + MF2_BOSSFLEE = 1<<26, // Boss is fleeing! + MF2_BOSSDEAD = 1<<27, // Boss is dead! (Not necessarily fleeing, if a fleeing point doesn't exist.) // free: to and including 1<<31 } mobjflag2_t; @@ -231,8 +232,7 @@ typedef enum MFE_VERTICALFLIP = 1<<5, // Goo water MFE_GOOWATER = 1<<6, - // Mobj was already pushed this tic - MFE_PUSHED = 1<<7, + // free: to and including 1<<7 // Mobj was already sprung this tic MFE_SPRUNG = 1<<8, // Platform movement diff --git a/src/p_spec.c b/src/p_spec.c index f9fa5f1f..34b77906 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6468,7 +6468,7 @@ static void P_DoScrollMove(mobj_t *thing, fixed_t dx, fixed_t dy, INT32 exclusiv thing->momy += dy; if (exclusive) - thing->eflags |= MFE_PUSHED; + thing->flags2 |= MF2_PUSHED; } /** Processes an active scroller. @@ -6572,7 +6572,7 @@ void T_Scroll(scroll_t *s) { thing = node->m_thing; - if (thing->eflags & MFE_PUSHED) // Already pushed this tic by an exclusive pusher. + if (thing->flags2 & MF2_PUSHED) // Already pushed this tic by an exclusive pusher. continue; height = P_GetSpecialBottomZ(thing, sec, psec); @@ -6594,7 +6594,7 @@ void T_Scroll(scroll_t *s) { thing = node->m_thing; - if (thing->eflags & MFE_PUSHED) + if (thing->flags2 & MF2_PUSHED) continue; height = P_GetSpecialBottomZ(thing, sec, sec); @@ -6635,7 +6635,7 @@ void T_Scroll(scroll_t *s) { thing = node->m_thing; - if (thing->eflags & MFE_PUSHED) + if (thing->flags2 & MF2_PUSHED) continue; height = P_GetSpecialTopZ(thing, sec, psec); @@ -6657,7 +6657,7 @@ void T_Scroll(scroll_t *s) { thing = node->m_thing; - if (thing->eflags & MFE_PUSHED) + if (thing->flags2 & MF2_PUSHED) continue; height = P_GetSpecialTopZ(thing, sec, sec); @@ -7140,7 +7140,7 @@ static pusher_t *tmpusher; // pusher structure for blockmap searches */ static inline boolean PIT_PushThing(mobj_t *thing) { - if (thing->eflags & MFE_PUSHED) + if (thing->flags2 & MF2_PUSHED) return false; if (thing->player && thing->player->pflags & PF_ROPEHANG) @@ -7270,7 +7270,7 @@ static inline boolean PIT_PushThing(mobj_t *thing) } if (tmpusher->exclusive) - thing->eflags |= MFE_PUSHED; + thing->flags2 |= MF2_PUSHED; return true; } @@ -7373,7 +7373,7 @@ void T_Pusher(pusher_t *p) || thing->type == MT_BIGTUMBLEWEED)) continue; - if (thing->eflags & MFE_PUSHED) + if (thing->flags2 & MF2_PUSHED) continue; if (thing->player && thing->player->pflags & PF_ROPEHANG) @@ -7540,7 +7540,7 @@ void T_Pusher(pusher_t *p) } if (p->exclusive) - thing->eflags |= MFE_PUSHED; + thing->flags2 |= MF2_PUSHED; } } } From cfcd7ce0d3959bcce0e8e00cc504b1354451cb50 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Tue, 8 Mar 2016 22:15:26 -0800 Subject: [PATCH 045/109] Readded EvalMath to Lua. There is a caveat to this: The first time EvalMath is used, a deprecated function warning will be shown to the user that tells them to use _G[] instead. This reverts commit 9d36cf37bd6fc1e5e0e9770031925db3a92a9929. --- src/lua_baselib.c | 9 +++++++++ src/lua_script.h | 11 +++++++++++ 2 files changed, 20 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index c415eecb..2cc79db4 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -85,6 +85,14 @@ static int lib_print(lua_State *L) return 0; } +static int lib_evalMath(lua_State *L) +{ + const char *word = luaL_checkstring(L, 1); + LUA_Deprecated(L, "EvalMath(string)", "_G[string]"); + lua_pushinteger(L, LUA_EvalMath(word)); + return 1; +} + // M_RANDOM ////////////// @@ -1899,6 +1907,7 @@ static int lib_gTicsToMilliseconds(lua_State *L) static luaL_Reg lib[] = { {"print", lib_print}, + {"EvalMath", lib_evalMath}, // m_random {"P_Random",lib_pRandom}, diff --git a/src/lua_script.h b/src/lua_script.h index ec67703c..96f832e2 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -70,4 +70,15 @@ void COM_Lua_f(void); #define LUA_ErrInvalid(L, type) luaL_error(L, "accessed " type " doesn't exist anymore, please check 'valid' before using " type "."); +// Deprecation warnings +// Shows once upon use. Then doesn't show again. +#define LUA_Deprecated(L,this_func,use_instead)\ +{\ + static UINT8 seen = 0;\ + if (!seen) {\ + seen = 1;\ + CONS_Alert(CONS_WARNING,"\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead);\ + }\ +} + #endif From 7ae87cc2c66de2e3a23490bb090caa9febec43f8 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Tue, 8 Mar 2016 22:22:30 -0800 Subject: [PATCH 046/109] Revert "No more stupidity for No More Enemies special plz" This reverts commit 474ad01b46ddfc1983203ed006532eed403b6fa2. --- src/p_floor.c | 66 ++++++++++++++++++--------------------------------- src/p_spec.c | 1 - 2 files changed, 23 insertions(+), 44 deletions(-) diff --git a/src/p_floor.c b/src/p_floor.c index b8d3f7b5..cacaadf8 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -1973,71 +1973,51 @@ void T_NoEnemiesSector(levelspecthink_t *nobaddies) { size_t i; fixed_t upperbound, lowerbound; - sector_t *sec = NULL; - sector_t *targetsec = NULL; - INT32 secnum = -1; + INT32 s; + sector_t *checksector; msecnode_t *node; mobj_t *thing; - boolean FOFsector = false; + boolean exists = false; - while ((secnum = P_FindSectorFromLineTag(nobaddies->sourceline, secnum)) >= 0) + for (i = 0; i < nobaddies->sector->linecount; i++) { - sec = §ors[secnum]; - - FOFsector = false; - - // Check the lines of this sector, to see if it is a FOF control sector. - for (i = 0; i < sec->linecount; i++) + if (nobaddies->sector->lines[i]->special == 223) { - INT32 targetsecnum = -1; - if (sec->lines[i]->special < 100 || sec->lines[i]->special >= 300) - continue; + upperbound = nobaddies->sector->ceilingheight; + lowerbound = nobaddies->sector->floorheight; - FOFsector = true; - - while ((targetsecnum = P_FindSectorFromLineTag(sec->lines[i], targetsecnum)) >= 0) + for (s = -1; (s = P_FindSectorFromLineTag(nobaddies->sector->lines[i], s)) >= 0 ;) { - targetsec = §ors[targetsecnum]; + checksector = §ors[s]; - upperbound = targetsec->ceilingheight; - lowerbound = targetsec->floorheight; - node = targetsec->touching_thinglist; // things touching this sector + node = checksector->touching_thinglist; // things touching this sector while (node) { thing = node->m_thing; if ((thing->flags & (MF_ENEMY|MF_BOSS)) && thing->health > 0 - && thing->z < upperbound && thing->z+thing->height > lowerbound) - return; + && thing->z < upperbound && thing->z+thing->height > lowerbound) + { + exists = true; + goto foundenemy; + } node = node->m_snext; } } } - - if (!FOFsector) - { - upperbound = sec->ceilingheight; - lowerbound = sec->floorheight; - node = sec->touching_thinglist; // things touching this sector - while (node) - { - thing = node->m_thing; - - if ((thing->flags & (MF_ENEMY|MF_BOSS)) && thing->health > 0 - && thing->z < upperbound && thing->z+thing->height > lowerbound) - return; - - node = node->m_snext; - } - } } +foundenemy: + if (exists) + return; - CONS_Debug(DBG_GAMELOGIC, "Running no-more-enemies exec with tag of %d\n", nobaddies->sourceline->tag); + s = P_AproxDistance(nobaddies->sourceline->dx, nobaddies->sourceline->dy)>>FRACBITS; - // No enemies found, run the linedef exec and terminate this thinker - P_RunTriggerLinedef(nobaddies->sourceline, NULL, NULL); + CONS_Debug(DBG_GAMELOGIC, "Running no-more-enemies exec with tag of %d\n", s); + + // Otherwise, run the linedef exec and terminate this thinker + P_LinedefExecute((INT16)s, NULL, NULL); P_RemoveThinker(&nobaddies->thinker); } diff --git a/src/p_spec.c b/src/p_spec.c index 34b77906..285da0e7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1891,7 +1891,6 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller || specialtype == 304 // Ring count - Once || specialtype == 307 // Character ability - Once || specialtype == 308 // Race only - Once - || specialtype == 313 // No More Enemies - Once || specialtype == 315 // No of pushables - Once || specialtype == 318 // Unlockable trigger - Once || specialtype == 320 // Unlockable - Once From 6aa708b5afdfd84da47d78c1f548b8ee4175dbd5 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 00:49:35 -0800 Subject: [PATCH 047/109] I don't think we need the BLUE_SPHERES define anymore... --- src/dehacked.c | 2 -- src/doomdef.h | 4 ---- src/info.c | 2 -- src/info.h | 2 -- src/p_inter.c | 7 +------ src/p_mobj.c | 18 ------------------ src/p_user.c | 5 +---- 7 files changed, 2 insertions(+), 38 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 60f3b059..926c3a48 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6229,9 +6229,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s // Collectible Items "MT_RING", "MT_FLINGRING", // Lost ring -#ifdef BLUE_SPHERES "MT_BLUEBALL", // Blue sphere replacement for special stages -#endif "MT_REDTEAMRING", //Rings collectable by red team. "MT_BLUETEAMRING", //Rings collectable by blue team. "MT_EMMY", // emerald token for special stage diff --git a/src/doomdef.h b/src/doomdef.h index 0fc4a1fe..4fd50e92 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -449,10 +449,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Polyobject fake flat code #define POLYOBJECTS_PLANES -/// Blue spheres for future use. -/// \todo Remove this define. -#define BLUE_SPHERES // Blue spheres for future use. - /// Improved way of dealing with ping values and a ping limit. #define NEWPING diff --git a/src/info.c b/src/info.c index fb19fa2b..0eda4177 100644 --- a/src/info.c +++ b/src/info.c @@ -4569,7 +4569,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, -#ifdef BLUE_SPHERES { // MT_BLUEBALL -1, // doomednum S_BLUEBALL, // spawnstate @@ -4596,7 +4595,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MF_SLIDEME|MF_SPECIAL|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags S_NULL // raisestate }, -#endif { // MT_REDTEAMRING 308, // doomednum diff --git a/src/info.h b/src/info.h index 9596f038..6e14448f 100644 --- a/src/info.h +++ b/src/info.h @@ -3049,9 +3049,7 @@ typedef enum mobj_type // Collectible Items MT_RING, MT_FLINGRING, // Lost ring -#ifdef BLUE_SPHERES MT_BLUEBALL, // Blue sphere replacement for special stages -#endif MT_REDTEAMRING, //Rings collectable by red team. MT_BLUETEAMRING, //Rings collectable by blue team. MT_EMMY, // emerald token for special stage diff --git a/src/p_inter.c b/src/p_inter.c index 6ab6aaf4..b8101f12 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -405,7 +405,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGCOIN) P_DoNightsScore(player); break; -#ifdef BLUE_SPHERES case MT_BLUEBALL: if (!(P_CanPickupItem(player, false))) return; @@ -422,7 +421,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (maptol & TOL_NIGHTS) P_DoNightsScore(player); break; -#endif case MT_AUTOPICKUP: case MT_BOUNCEPICKUP: case MT_SCATTERPICKUP: @@ -766,10 +764,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } if (!(mo2->type == MT_NIGHTSWING || mo2->type == MT_RING || mo2->type == MT_COIN -#ifdef BLUE_SPHERES - || mo2->type == MT_BLUEBALL -#endif - )) + || mo2->type == MT_BLUEBALL)) continue; // Yay! The thing's in reach! Pull it in! diff --git a/src/p_mobj.c b/src/p_mobj.c index cb9bc775..4e60ad61 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2188,9 +2188,7 @@ static boolean P_ZMovement(mobj_t *mo) case MT_RING: // Ignore still rings case MT_COIN: -#ifdef BLUE_SPHERES case MT_BLUEBALL: -#endif case MT_REDTEAMRING: case MT_BLUETEAMRING: case MT_FLINGRING: @@ -6479,14 +6477,12 @@ void P_MobjThinker(mobj_t *mobj) else if (mobj->health <= 0) // Dead things think differently than the living. switch (mobj->type) { -#ifdef BLUE_SPHERES case MT_BLUEBALL: if ((mobj->tics>>2)+1 > 0 && (mobj->tics>>2)+1 <= tr_trans60) // tr_trans50 through tr_trans90, shifting once every second frame mobj->frame = (NUMTRANSMAPS-((mobj->tics>>2)+1))<frame = tr_trans60<z <= mobj->floorz) { @@ -6944,9 +6940,7 @@ void P_MobjThinker(mobj_t *mobj) break; case MT_RING: case MT_COIN: -#ifdef BLUE_SPHERES case MT_BLUEBALL: -#endif case MT_REDTEAMRING: case MT_BLUETEAMRING: // No need to check water. Who cares? @@ -7712,9 +7706,7 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) break; case MT_RING: case MT_COIN: -#ifdef BLUE_SPHERES case MT_BLUEBALL: -#endif nummaprings++; default: break; @@ -7840,9 +7832,7 @@ void P_RemoveMobj(mobj_t *mobj) if (mobj->spawnpoint && (mobj->type == MT_RING || mobj->type == MT_COIN -#ifdef BLUE_SPHERES || mobj->type == MT_BLUEBALL -#endif || mobj->type == MT_REDTEAMRING || mobj->type == MT_BLUETEAMRING || P_WeaponOrPanel(mobj->type)) @@ -9628,11 +9618,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) ringthing = (gametype == GT_CTF) ? MT_BLUETEAMRING : MT_RING; break; default: -#ifdef BLUE_SPHERES // Spawn rings as blue spheres in special stages, ala S3+K. if (G_IsSpecialStage(gamemap) && useNightsSS) ringthing = MT_BLUEBALL; -#endif break; } @@ -9697,11 +9685,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) if (ultimatemode && !(G_IsSpecialStage(gamemap) || maptol & TOL_NIGHTS)) return; -#ifdef BLUE_SPHERES // Spawn rings as blue spheres in special stages, ala S3+K. if (G_IsSpecialStage(gamemap) && useNightsSS) ringthing = MT_BLUEBALL; -#endif for (r = 1; r <= 5; r++) { @@ -9752,11 +9738,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) if (ultimatemode && !(G_IsSpecialStage(gamemap) || maptol & TOL_NIGHTS)) return; -#ifdef BLUE_SPHERES // Spawn rings as blue spheres in special stages, ala S3+K. if (G_IsSpecialStage(gamemap) && useNightsSS) ringthing = MT_BLUEBALL; -#endif angle >>= ANGLETOFINESHIFT; @@ -9849,11 +9833,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing) if (ultimatemode && !(G_IsSpecialStage(gamemap) || (maptol & TOL_NIGHTS))) continue; -#ifdef BLUE_SPHERES // Spawn rings as blue spheres in special stages, ala S3+K. if (G_IsSpecialStage(gamemap) && useNightsSS) itemToSpawn = MT_BLUEBALL; -#endif } fa = i*FINEANGLES/numitems; diff --git a/src/p_user.c b/src/p_user.c index 46393729..03b2c1dd 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8857,10 +8857,7 @@ void P_PlayerThink(player_t *player) mo2 = (mobj_t *)th; if (!(mo2->type == MT_NIGHTSWING || mo2->type == MT_RING || mo2->type == MT_COIN -#ifdef BLUE_SPHERES - || mo2->type == MT_BLUEBALL -#endif - )) + || mo2->type == MT_BLUEBALL)) continue; if (P_AproxDistance(P_AproxDistance(mo2->x - x, mo2->y - y), mo2->z - z) > FixedMul(128*FRACUNIT, player->mo->scale)) From 5a38088623fceb0d31c43d79ab8cb42b85a635ff Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 01:09:21 -0800 Subject: [PATCH 048/109] Well, we don't need "experimental" slopes anymore either Not when we have properly working ones! --- src/doomdef.h | 3 --- src/hardware/hw_glob.h | 2 -- src/hardware/hw_main.c | 21 ++------------------- src/p_spec.c | 25 ------------------------- src/r_defs.h | 8 -------- 5 files changed, 2 insertions(+), 57 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 4fd50e92..a44fe477 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -427,9 +427,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// \note obsoleted by cv_maxportals //#define PORTAL_LIMIT 8 -/// Fun experimental slope stuff! -//#define SLOPENESS - /// Kalaron/Eternity Engine slope code (SRB2CB ported) #define ESLOPE diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index 83dff02f..94eef1d3 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -36,9 +36,7 @@ typedef struct { float x; float y; -//#ifdef SLOPENESS float z; -//#endif } polyvertex_t; #ifdef _MSC_VER diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 409900b9..58e4e87f 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -539,6 +539,8 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi static FOutVector *planeVerts = NULL; static UINT16 numAllocedPlaneVerts = 0; + (void)sector; + // no convex poly were generated for this subsector if (!xsub->planepoly) return; @@ -678,25 +680,6 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, fixed_t fi v3d->x = pv->x; v3d->y = height; v3d->z = pv->y; -#ifdef SLOPENESS - if (sector && sector->special == 65535) - { - size_t q; - for (q = 0; q < sector->linecount; q++) - { - if (v3d->x == sector->lines[q]->v1->x>>FRACBITS) - { - if (v3d->z == sector->lines[q]->v1->y>>FRACBITS) - { - v3d->y += sector->lines[q]->v1->z>>FRACBITS; - break; - } - } - } - } -#else - (void)sector; -#endif } // only useful for flat coloured triangles diff --git a/src/p_spec.c b/src/p_spec.c index 285da0e7..277fe19e 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6028,31 +6028,6 @@ void P_SpawnSpecials(INT32 fromnetsave) P_AddRaiseThinker(lines[i].frontsector, &lines[i]); break; -#ifdef SLOPENESS - case 999: - sec = sides[*lines[i].sidenum].sector-sectors; - for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) - { - size_t counting; - - sectors[s].floorangle = ANGLE_45; - for (counting = 0; counting < sectors[s].linecount/2; counting++) - { - sectors[s].lines[counting]->v1->z = sectors[sec].floorheight; - CONS_Debug(DBG_GAMELOGIC, "Set it to %d\n", sectors[s].lines[counting]->v1->z>>FRACBITS); - } - - for (counting = sectors[s].linecount/2; counting < sectors[s].linecount; counting++) - { - sectors[s].lines[counting]->v1->z = sectors[sec].ceilingheight; - CONS_Debug(DBG_GAMELOGIC, "Set it to %d\n", sectors[s].lines[counting]->v1->z>>FRACBITS); - } - sectors[s].special = 65535; - CONS_Debug(DBG_GAMELOGIC, "Found & Set slope!\n"); - } - break; -#endif - case 200: // Double light effect P_AddFakeFloorsByLine(i, FF_EXISTS|FF_CUTSPRITES|FF_DOUBLESHADOW, secthinkers); break; diff --git a/src/r_defs.h b/src/r_defs.h index f18410fe..2915b925 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -369,14 +369,6 @@ typedef struct sector_s double lineoutLength; #endif // ----- end special tricks ----- - // ZDoom C++ to Legacy C conversion (for slopes) - // store floor and ceiling planes instead of heights - //secplane_t floorplane, ceilingplane; -#ifdef SLOPENESS - //fixed_t floortexz, ceilingtexz; // [RH] used for wall texture mapping - angle_t floorangle; -#endif - // This points to the master's floorheight, so it can be changed in realtime! fixed_t *gravity; // per-sector gravity boolean verticalflip; // If gravity < 0, then allow flipped physics From 54f95eb3877ce02eeab87cad1bf1ccd835990c83 Mon Sep 17 00:00:00 2001 From: JTE Date: Wed, 20 May 2015 23:54:04 -0400 Subject: [PATCH 049/109] Revert "Change angle_t handling in Lua." This partially reverts commit ef0e61fc3357fc8fb5367b522dd738edc96b2a7a. --- src/dehacked.c | 60 ++++++++++++++++++++++++------------------------ src/lua_script.h | 6 ++--- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index c21e8fb9..47c87eef 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7267,36 +7267,36 @@ struct { {"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. // Angles - {"ANG1",ANG1>>16}, - {"ANG2",ANG2>>16}, - {"ANG10",ANG10>>16}, - {"ANG15",ANG15>>16}, - {"ANG20",ANG20>>16}, - {"ANG30",ANG30>>16}, - {"ANG60",ANG60>>16}, - {"ANG64h",ANG64h>>16}, - {"ANG105",ANG105>>16}, - {"ANG210",ANG210>>16}, - {"ANG255",ANG255>>16}, - {"ANG340",ANG340>>16}, - {"ANG350",ANG350>>16}, - {"ANGLE_11hh",ANGLE_11hh>>16}, - {"ANGLE_22h",ANGLE_22h>>16}, - {"ANGLE_45",ANGLE_45>>16}, - {"ANGLE_67h",ANGLE_67h>>16}, - {"ANGLE_90",ANGLE_90>>16}, - {"ANGLE_112h",ANGLE_112h>>16}, - {"ANGLE_135",ANGLE_135>>16}, - {"ANGLE_157h",ANGLE_157h>>16}, - {"ANGLE_180",ANGLE_180>>16}, - {"ANGLE_202h",ANGLE_202h>>16}, - {"ANGLE_225",ANGLE_225>>16}, - {"ANGLE_247h",ANGLE_247h>>16}, - {"ANGLE_270",ANGLE_270>>16}, - {"ANGLE_292h",ANGLE_292h>>16}, - {"ANGLE_315",ANGLE_315>>16}, - {"ANGLE_337h",ANGLE_337h>>16}, - {"ANGLE_MAX",ANGLE_MAX>>16}, + {"ANG1",ANG1}, + {"ANG2",ANG2}, + {"ANG10",ANG10}, + {"ANG15",ANG15}, + {"ANG20",ANG20}, + {"ANG30",ANG30}, + {"ANG60",ANG60}, + {"ANG64h",ANG64h}, + {"ANG105",ANG105}, + {"ANG210",ANG210}, + {"ANG255",ANG255}, + {"ANG340",ANG340}, + {"ANG350",ANG350}, + {"ANGLE_11hh",ANGLE_11hh}, + {"ANGLE_22h",ANGLE_22h}, + {"ANGLE_45",ANGLE_45}, + {"ANGLE_67h",ANGLE_67h}, + {"ANGLE_90",ANGLE_90}, + {"ANGLE_112h",ANGLE_112h}, + {"ANGLE_135",ANGLE_135}, + {"ANGLE_157h",ANGLE_157h}, + {"ANGLE_180",ANGLE_180}, + {"ANGLE_202h",ANGLE_202h}, + {"ANGLE_225",ANGLE_225}, + {"ANGLE_247h",ANGLE_247h}, + {"ANGLE_270",ANGLE_270}, + {"ANGLE_292h",ANGLE_292h}, + {"ANGLE_315",ANGLE_315}, + {"ANGLE_337h",ANGLE_337h}, + {"ANGLE_MAX",ANGLE_MAX}, // P_Chase directions (dirtype_t) {"DI_NODIR",DI_NODIR}, diff --git a/src/lua_script.h b/src/lua_script.h index ec67703c..b4b668ce 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -30,9 +30,9 @@ #define lua_pushfixed(L, f) lua_pushinteger(L, f) // angle_t casting -// we reduce the angle to a fixed point between 0.0 and 1.0 -#define luaL_checkangle(L, i) (((angle_t)(luaL_checkfixed(L, i)&0xFFFF))<<16) -#define lua_pushangle(L, a) lua_pushfixed(L, a>>16) +// TODO deal with signedness +#define luaL_checkangle(L, i) ((angle_t)luaL_checkinteger(L, i)) +#define lua_pushangle(L, a) lua_pushinteger(L, a) #ifdef _DEBUG void LUA_ClearExtVars(void); From 280e932f02c64a8ac3d01bd89e5e578938d32363 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 9 Mar 2016 13:38:30 +0000 Subject: [PATCH 050/109] Shifted down the last few mobj eflags to close gap left by MF2_PUSHED -> MFE_PUSHED undo --- src/p_mobj.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/p_mobj.h b/src/p_mobj.h index e24b0965..44b3ceee 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -232,11 +232,10 @@ typedef enum MFE_VERTICALFLIP = 1<<5, // Goo water MFE_GOOWATER = 1<<6, - // free: to and including 1<<7 // Mobj was already sprung this tic - MFE_SPRUNG = 1<<8, + MFE_SPRUNG = 1<<7, // Platform movement - MFE_APPLYPMOMZ = 1<<9, + MFE_APPLYPMOMZ = 1<<8, // free: to and including 1<<15 } mobjeflag_t; From bf415b8618c51f7826cb76ab91fe4a0003c3d238 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 9 Mar 2016 13:59:10 +0000 Subject: [PATCH 051/109] Revert "Shifted down the last few mobj eflags to close gap left by MF2_PUSHED -> MFE_PUSHED undo" This reverts commit 280e932f02c64a8ac3d01bd89e5e578938d32363. --- src/p_mobj.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.h b/src/p_mobj.h index 44b3ceee..e24b0965 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -232,10 +232,11 @@ typedef enum MFE_VERTICALFLIP = 1<<5, // Goo water MFE_GOOWATER = 1<<6, + // free: to and including 1<<7 // Mobj was already sprung this tic - MFE_SPRUNG = 1<<7, + MFE_SPRUNG = 1<<8, // Platform movement - MFE_APPLYPMOMZ = 1<<8, + MFE_APPLYPMOMZ = 1<<9, // free: to and including 1<<15 } mobjeflag_t; From 4625118ee863b43a3c8828c79879f92ff649b850 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 9 Mar 2016 14:03:20 +0000 Subject: [PATCH 052/109] MFE_DUMMY now exists to fill the slot where MFE_PUSHED was, bleh --- src/dehacked.c | 1 + src/p_mobj.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 926c3a48..31cf3763 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6711,6 +6711,7 @@ static const char *const MOBJEFLAG_LIST[] = { "JUSTSTEPPEDDOWN", // used for ramp sectors "VERTICALFLIP", // Vertically flip sprite/allow upside-down physics "GOOWATER", // Goo water + "DUMMY", // free: 1<<7 "SPRUNG", // Mobj was already sprung this tic "APPLYPMOMZ", // Platform movement NULL diff --git a/src/p_mobj.h b/src/p_mobj.h index e24b0965..3979b130 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -232,7 +232,8 @@ typedef enum MFE_VERTICALFLIP = 1<<5, // Goo water MFE_GOOWATER = 1<<6, - // free: to and including 1<<7 + // free: 1<<7 + MFE_DUMMY = 1<<7, // Mobj was already sprung this tic MFE_SPRUNG = 1<<8, // Platform movement From f40cfb0271a5945a736c6edafd012174b09f71e8 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 06:22:40 -0800 Subject: [PATCH 053/109] Revert "MFE_DUMMY now exists to fill the slot where MFE_PUSHED was, bleh" This reverts commit 4625118ee863b43a3c8828c79879f92ff649b850. --- src/dehacked.c | 1 - src/p_mobj.h | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 31cf3763..926c3a48 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6711,7 +6711,6 @@ static const char *const MOBJEFLAG_LIST[] = { "JUSTSTEPPEDDOWN", // used for ramp sectors "VERTICALFLIP", // Vertically flip sprite/allow upside-down physics "GOOWATER", // Goo water - "DUMMY", // free: 1<<7 "SPRUNG", // Mobj was already sprung this tic "APPLYPMOMZ", // Platform movement NULL diff --git a/src/p_mobj.h b/src/p_mobj.h index 3979b130..e24b0965 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -232,8 +232,7 @@ typedef enum MFE_VERTICALFLIP = 1<<5, // Goo water MFE_GOOWATER = 1<<6, - // free: 1<<7 - MFE_DUMMY = 1<<7, + // free: to and including 1<<7 // Mobj was already sprung this tic MFE_SPRUNG = 1<<8, // Platform movement From a7cb049b65ddd126c1532d4a5f13dbba35942947 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 06:23:57 -0800 Subject: [PATCH 054/109] leave a dummy string in dehacked, nothing more. a courtesy fuck you to gitlab for making me have to keep the previous screwed up bullshit in this branch. --- src/dehacked.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dehacked.c b/src/dehacked.c index 926c3a48..61bccb4f 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -6711,6 +6711,7 @@ static const char *const MOBJEFLAG_LIST[] = { "JUSTSTEPPEDDOWN", // used for ramp sectors "VERTICALFLIP", // Vertically flip sprite/allow upside-down physics "GOOWATER", // Goo water + "\x01", // free: 1<<7 (name un-matchable) "SPRUNG", // Mobj was already sprung this tic "APPLYPMOMZ", // Platform movement NULL From 83e9eb6df4a0e75b3dbc958d4d0f482a7059e314 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 18:30:11 -0800 Subject: [PATCH 055/109] patch.dta officially in use. Version number updated. --- src/config.h.in | 8 ++++++++ src/d_main.c | 18 +++++++++++++----- src/doomdef.h | 12 ++++++++---- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 5cd75fa5..eef4fec1 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -15,7 +15,9 @@ #define ASSET_HASH_PLAYER_DTA "${SRB2_ASSET_player.dta_HASH}" #define ASSET_HASH_RINGS_DTA "${SRB2_ASSET_rings.dta_HASH}" #define ASSET_HASH_ZONES_DTA "${SRB2_ASSET_zones.dta_HASH}" +#ifdef USE_PATCH_DTA #define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}" +#endif #define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}" #define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}" @@ -26,10 +28,16 @@ #else +/* Manually defined asset hashes for non-CMake builds + * Last updated 2000 / 00 / 00 + */ #define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7" #define ASSET_HASH_ZONES_DTA "303838c6c534d9540288360fa49cca60" #define ASSET_HASH_PLAYER_DTA "cfca0f1c73023cbbd8f844f45480f799" #define ASSET_HASH_RINGS_DTA "85901ad4bf94637e5753d2ac2c03ea26" +#ifdef USE_PATCH_DTA +#define ASSET_HASH_PATCH_DTA "0c66790502e648bfce90fdc5bb15722e" +#endif #endif #endif diff --git a/src/d_main.c b/src/d_main.c index 3918d811..1349a64e 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -841,8 +841,10 @@ static void IdentifyVersion(void) // Add the weapons D_AddFile(va(pandf,srb2waddir,"rings.dta")); +#ifdef USE_PATCH_DTA // Add our crappy patches to fix our bugs - // D_AddFile(va(pandf,srb2waddir,"patch.dta")); + D_AddFile(va(pandf,srb2waddir,"patch.dta")); +#endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) { @@ -1133,12 +1135,18 @@ void D_SRB2Main(void) W_VerifyFileMD5(1, ASSET_HASH_ZONES_DTA); // zones.dta W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta W_VerifyFileMD5(3, ASSET_HASH_RINGS_DTA); // rings.dta - //W_VerifyFileMD5(4, "0c66790502e648bfce90fdc5bb15722e"); // patch.dta - // don't check music.dta because people like to modify it, and it doesn't matter if they do - // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. +#ifdef USE_PATCH_DTA + W_VerifyFileMD5(4, ASSET_HASH_PATCH_DTA); // patch.dta #endif - mainwads = 4; // there are 5 wads not to unload + // don't check music.dta because people like to modify it, and it doesn't matter if they do + // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. +#endif //ifndef DEVELOP + + mainwads = 4; // there are 4 wads not to unload +#ifdef USE_PATCH_DTA + ++mainwads; // patch.dta adds one more +#endif cht_Init(); diff --git a/src/doomdef.h b/src/doomdef.h index a44fe477..c3a0bfa6 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -148,13 +148,17 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 201 // Game version -#define SUBVERSION 14 // more precise version number -#define VERSIONSTRING "v2.1.14" -#define VERSIONSTRINGW L"v2.1.14" +#define SUBVERSION 15 // more precise version number +#define VERSIONSTRING "v2.1.15" +#define VERSIONSTRINGW L"v2.1.15" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif +// Does this version require an added patch file? +// Comment or uncomment this as necessary. +#define USE_PATCH_DTA + // Modification options // If you want to take advantage of the Master Server's ability to force clients to update // to the latest version, fill these out. Otherwise, just comment out UPDATE_ALERT and leave @@ -208,7 +212,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 19 +#define MODVERSION 20 // ========================================================================= From 5b89164cf7e4ada2ac999ed41d163059c2a1ec76 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 10 Mar 2016 20:50:54 +0000 Subject: [PATCH 056/109] Fix camera going nuts around intangible polyobjects --- src/p_map.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 61d57dcd..5c5d9cdf 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1616,7 +1616,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) po->validcount = validcount; - if (!P_PointInsidePolyobj(po, x, y)) + if (!P_PointInsidePolyobj(po, x, y) || !(po->flags & POF_SOLID)) { plink = (polymaplink_t *)(plink->link.next); continue; diff --git a/src/p_user.c b/src/p_user.c index 03b2c1dd..c08eea5c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8163,7 +8163,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall po->validcount = validcount; - if (!P_PointInsidePolyobj(po, x, y)) + if (!P_PointInsidePolyobj(po, x, y) || !(po->flags & POF_SOLID)) { plink = (polymaplink_t *)(plink->link.next); continue; From 509516f59f2711856c0edbbacbf6f3fa11de8b36 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 10 Mar 2016 16:38:06 -0500 Subject: [PATCH 057/109] travis: enable apt and ccache cache --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c652584f..5815e711 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ compiler: - clang cache: + apt: true + ccache: true directories: - $HOME/srb2_cache From f9949a3026a7ac965c036a2e7c12bbc9f5627a4b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:24:51 -0400 Subject: [PATCH 058/109] dropping NOVERSION, you will not build SRB2 without a SCM --- src/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index d4cc64a4..8520d8d5 100644 --- a/src/Makefile +++ b/src/Makefile @@ -262,9 +262,7 @@ else OBJS+=$(OBJDIR)/hw3sound.o endif -ifndef NOVERSION OPTS += -DCOMPVERSION -endif ifndef NONX86 ifndef GCC29 @@ -550,9 +548,6 @@ cleandep: $(REMOVE) comptime.h pre-build: -ifdef NOVERSION - -@touch comptime.c -else ifdef WINDOWSHELL -..\comptime.bat . else From f5b56f2a076e89a59ad6fdcdb6e4c2e26f02c3e1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:28:22 -0400 Subject: [PATCH 059/109] fixup --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8520d8d5..701cdcfb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -553,7 +553,6 @@ ifdef WINDOWSHELL else -@../comptime.sh . endif -endif clean: $(REMOVE) *~ *.flc From 2ecdd9e6f9ea891c7cead7f3331b1b626df2681b Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:31:48 -0800 Subject: [PATCH 060/109] Branch and revision information in builds Also makes comptime.bat work with git if able. Development builds will now show the branch and the SHA1 hash of the revision. Also been tested to work with subversion, where it displays "Subversion r####". You know, just in case. --- comptime.bat | 28 ++++++++++++++++++++++++---- comptime.sh | 10 +++++++--- src/comptime.c | 2 ++ src/d_netcmd.c | 4 ++++ src/doomdef.h | 7 +++++-- src/m_menu.c | 9 ++++++--- src/m_misc.c | 10 ++++------ 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/comptime.bat b/comptime.bat index 23ee7ea5..b8450ff6 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,10 +1,30 @@ @ECHO OFF -set REV=Unknown +set BRA=Unknown +set REV=illegal + copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul -SET REV=illegal -FOR /F "usebackq" %%s IN (`svnversion %1`) DO @SET REV=%%s + +if exist .git goto gitrev +if exist .svn goto svnrev +goto filwri + +:gitrev +set GIT=%2 +if "%GIT%"=="" set GIT=git +FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s +FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +set REV=%REV:~0,8% +goto filwri + +:svnrev +set BRA=Subversion +FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +goto filwri + +:filwri ECHO // Do not edit! This file was autogenerated > %1\comptime.h ECHO // by the %0 batch file >> %1\comptime.h ECHO // >> %1\comptime.h -ECHO const char* comprevision = "r%REV%"; >> %1\comptime.h +ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h +ECHO const char* comprevision = "%REV%"; >> %1\comptime.h diff --git a/comptime.sh b/comptime.sh index 703bb2d3..71c5f08a 100755 --- a/comptime.sh +++ b/comptime.sh @@ -5,13 +5,15 @@ if [ x"$1" != x ]; then fi versiongit() { - gitversion=`git describe` + gitbranch=`git rev-parse --abbrev-ref HEAD` + gitversion=`git rev-parse HEAD` cat < $path/comptime.h // Do not edit! This file was autogenerated -// by the $0 script with git svn +// by the $0 script with git // -const char* comprevision = "$gitversion"; +const char* compbranch = "$gitbranch"; +const char* comprevision = "${gitversion:0:8}"; EOF exit 0 } @@ -23,6 +25,7 @@ versionsvn() { // Do not edit! This file was autogenerated // by the $0 script with subversion // +const char* compbranch = "Subversion"; const char* comprevision = "r$svnrevision"; EOF exit 0 @@ -34,6 +37,7 @@ versionfake() { // Do not edit! This file was autogenerated // by the $0 script with an unknown or nonexist SCM // +const char* compbranch = "Unknown"; const char* comprevision = "illegal"; EOF } diff --git a/src/comptime.c b/src/comptime.c index a4dc5b0f..9f1fe2f7 100644 --- a/src/comptime.c +++ b/src/comptime.c @@ -9,12 +9,14 @@ #if (defined(CMAKECONFIG)) #include "config.h" +const char *compbranch = ""; // hell if I know what to do with cmake const char *comprevision = SRB2_COMP_REVISION; #elif (defined(COMPVERSION)) #include "comptime.h" #else +const char *compbranch = "Unknown"; const char *comprevision = "illegal"; #endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 266161c7..30208422 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3179,7 +3179,11 @@ static void Command_ListWADS_f(void) */ static void Command_Version_f(void) { +#ifdef DEVELOP + CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime); +#else CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision); +#endif } #ifdef UPDATE_ALERT diff --git a/src/doomdef.h b/src/doomdef.h index e4b426eb..fe7fad8a 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -141,7 +141,10 @@ extern FILE *logstream; #if 0 #define VERSION 0 // Game version #define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "Trunk" +#define VERSIONSTRING "Development EXE" +#define VERSIONSTRINGW L"Development EXE" +// most interface strings are ignored in development mode. +// we use comprevision and compbranch instead. #else #define VERSION 201 // Game version #define SUBVERSION 14 // more precise version number @@ -413,7 +416,7 @@ INT32 I_GetKey(void); #endif // Compile date and time and revision. -extern const char *compdate, *comptime, *comprevision; +extern const char *compdate, *comptime, *comprevision, *compbranch; // Disabled code and code under testing // None of these that are disabled in the normal build are guaranteed to work perfectly diff --git a/src/m_menu.c b/src/m_menu.c index 1e774553..780de7ad 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2463,11 +2463,14 @@ void M_Drawer(void) V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring); } else -#if VERSION > 0 || SUBVERSION > 0 + { +#ifdef DEVELOP // Development -- show revision / branch info + V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch); + V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision); +#else // Regular build V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); -#else // Trunk build, show revision info - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s (%s)", VERSIONSTRING, comprevision)); #endif + } } } diff --git a/src/m_misc.c b/src/m_misc.c index 21728792..22effddd 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1800,16 +1800,14 @@ UINT8 M_HighestBit(UINT32 num) const char *GetRevisionString(void) { - INT32 vinfo; - static char rev[8] = {0}; + static char rev[9] = {0}; if (rev[0]) return rev; - vinfo = atoi(&comprevision[1]); - if (vinfo) - snprintf(rev, 7, "r%d", vinfo); + if (comprevision[0] == 'r') + strncpy(rev, comprevision, 7); else - strcpy(rev, "rNULL"); + snprintf(rev, 7, "r%s", comprevision); rev[7] = '\0'; return rev; From 7e174290d7e2ade1a3dde14a77e9ab6e6a48bec0 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:36:27 -0800 Subject: [PATCH 061/109] SVN needs the revision prefixed with 'r' --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index b8450ff6..119b3bb5 100644 --- a/comptime.bat +++ b/comptime.bat @@ -20,6 +20,7 @@ goto filwri :svnrev set BRA=Subversion FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +set REV=r%REV% goto filwri :filwri From 2f21c24d7703732a3e9a209991240d3850300484 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sat, 16 Jan 2016 11:35:34 -0800 Subject: [PATCH 062/109] Makefile can run comptime.bat from src\ too --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 119b3bb5..9e127f00 100644 --- a/comptime.bat +++ b/comptime.bat @@ -6,6 +6,7 @@ copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul if exist .git goto gitrev +if exist ..\.git goto gitrev if exist .svn goto svnrev goto filwri From 873fa10fe192ffc4a545b4fa129153f13ca311c4 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 17:47:02 -0400 Subject: [PATCH 063/109] comptime.bat: Windows 8.1 sucks --- comptime.bat | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/comptime.bat b/comptime.bat index 9e127f00..9028e288 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,4 +1,3 @@ -@ECHO OFF set BRA=Unknown set REV=illegal @@ -13,20 +12,20 @@ goto filwri :gitrev set GIT=%2 if "%GIT%"=="" set GIT=git -FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s -FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s set REV=%REV:~0,8% goto filwri :svnrev set BRA=Subversion -FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s set REV=r%REV% goto filwri :filwri -ECHO // Do not edit! This file was autogenerated > %1\comptime.h -ECHO // by the %0 batch file >> %1\comptime.h -ECHO // >> %1\comptime.h -ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h -ECHO const char* comprevision = "%REV%"; >> %1\comptime.h +echo // Do not edit! This file was autogenerated > %1\comptime.h +echo // by the %0 batch file >> %1\comptime.h +echo // >> %1\comptime.h +echo const char* compbranch = "%BRA%"; >> %1\comptime.h +echo const char* comprevision = "%REV%"; >> %1\comptime.h From bbe93a6d31d9d9f7ac1c77c60800e9c2f2f5d810 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 14 Mar 2016 20:36:37 -0500 Subject: [PATCH 064/109] comptime.bat: Put @echo off back in --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e288..0c7ea06d 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From c4e54d52e704ae16835237b039253c3428295547 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 21:54:53 -0400 Subject: [PATCH 065/109] comptime.bat: restore echo off --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e288..0c7ea06d 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From 5dd0e533b37e980c273901d137f17061c70ec6dd Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 15 Mar 2016 21:18:25 +0000 Subject: [PATCH 066/109] Removed unused "supdate" variable --- src/d_main.c | 2 -- src/d_main.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a959a863..0a3fae3b 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -509,7 +509,6 @@ static void D_Display(void) // ========================================================================= tic_t rendergametic; -boolean supdate; void D_SRB2Loop(void) { @@ -600,7 +599,6 @@ void D_SRB2Loop(void) // Update display, next frame, with current state. D_Display(); - supdate = false; if (moviemode) M_SaveFrame(); diff --git a/src/d_main.h b/src/d_main.h index 800b61f5..c5ce19ef 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -17,7 +17,6 @@ #include "d_event.h" #include "w_wad.h" // for MAX_WADFILES -extern boolean supdate; extern boolean advancedemo; // make sure not to write back the config until it's been correctly loaded From 76d71bda926d11eb1315bf1e0fe36fa39d87ec59 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 25 Mar 2016 19:43:17 +0000 Subject: [PATCH 067/109] destend now scales the added-on patch width properly if needed --- src/v_video.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index df81ac6d..3eb71bb0 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -477,7 +477,16 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t } deststart = desttop; - destend = desttop + SHORT(patch->width) * dupx; + if (pscale != FRACUNIT) // scale width properly + { + fixed_t pwidth = SHORT(patch->width)<>= FRACBITS; + destend = desttop + pwidth; + } + else + destend = desttop + SHORT(patch->width) * dupx; for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++x, desttop++) { From 3698c2583d36a0d302e2b005cea221d838ad80af Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 25 Mar 2016 20:04:49 +0000 Subject: [PATCH 068/109] wrap prevention code now takes flipped patches into account --- src/v_video.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 3eb71bb0..b9bdb271 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -336,6 +336,8 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t const column_t *column; UINT8 *desttop, *dest, *deststart, *destend; const UINT8 *source, *deststop; + fixed_t pwidth; // patch width + fixed_t offx = 0; // x offset if (rendermode == render_none) return; @@ -476,25 +478,36 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t } } - deststart = desttop; if (pscale != FRACUNIT) // scale width properly { - fixed_t pwidth = SHORT(patch->width)<width)<>= FRACBITS; - destend = desttop + pwidth; } else - destend = desttop + SHORT(patch->width) * dupx; + pwidth = SHORT(patch->width) * dupx; - for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++x, desttop++) + deststart = desttop; + destend = desttop + pwidth; + + for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++) { INT32 topdelta, prevdelta = -1; - if (x < 0) // don't draw off the left of the screen (WRAP PREVENTION) - continue; - if (x >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) - break; + if (flip) // offx is measured from right edge instead of left + { + if (x+pwidth-offx < 0) // don't draw off the left of the screen (WRAP PREVENTION) + break; + if (x+pwidth-offx >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) + continue; + } + else + { + if (x+offx < 0) // don't draw off the left of the screen (WRAP PREVENTION) + continue; + if (x+offx >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) + break; + } column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[col>>FRACBITS])); while (column->topdelta != 0xff) From 0953c9430b18bc8380aaf00f6871309a75c31a07 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:16:35 -0400 Subject: [PATCH 069/109] travis-ci: try osx building --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5815e711..e58f0951 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: c -sudo: required -dist: trusty + +matrix: + include: + - os: linux + dist: trusty + sudo: required + - os: osx env: - CFLAGS=-Wno-absolute-value -Werror From 73dd5cd8035c368d7858ee45fe0eeb1e24166766 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:48:39 -0400 Subject: [PATCH 070/109] travis-ci: add brew packages --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e58f0951..049d465a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,4 +37,8 @@ before_script: - cd build - cmake .. +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + script: make From 8d36a77e42c092f8108248a17ccca20f6af9110f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:53:13 -0400 Subject: [PATCH 071/109] travis-ci: libpng, not libsdl --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 049d465a..d70e1dc9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c +sudo: required matrix: include: - os: linux dist: trusty - sudo: required - os: osx env: @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi script: make From dfa41ed8782ea24485bcfa2f3d4066bc14b6d2c9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:05 -0400 Subject: [PATCH 072/109] travis-ci: drop libpng for osx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d70e1dc9..bc548930 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi script: make From 9162e7da9d59f869bf99691a2f381f405ae0629d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:51 -0400 Subject: [PATCH 073/109] travis-ci: move dist setting to top --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc548930..d131a82b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c sudo: required +dist: trusty matrix: include: - os: linux - dist: trusty - os: osx env: From 23c9892fea6af16054f82d8eb3f295f590c11448 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:02:57 -0400 Subject: [PATCH 074/109] travis-ci: fixup os list --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d131a82b..4ebef34a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - - os: osx +os: + - linux + - osx env: - CFLAGS=-Wno-absolute-value -Werror From 0c9081f762dd5d4cbcdcfe3871bcc599fbefc316 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:10:14 -0400 Subject: [PATCH 075/109] cmake: try to fixup mac build --- src/sdl/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 7190efaa..f44e3dee 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -117,7 +117,7 @@ if(${SDL2_FOUND}) add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) - if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + if(${CMAKE_SYSTEM} MATCHES Darwin) add_framework(CoreFoundation SRB2SDL2) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) @@ -227,7 +227,7 @@ if(${SDL2_FOUND}) endif() #### Installation #### - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(TARGETS SRB2SDL2 BUNDLE DESTINATION . ) @@ -268,7 +268,7 @@ if(${SDL2_FOUND}) # Mac bundle fixup - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(CODE " include(BundleUtilities) fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\" From dadf8e1260a83125089f43ba2a6ddb119f2a474a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:21:56 -0400 Subject: [PATCH 076/109] cmake: remove fixed HWRENDER define --- src/doomtype.h | 1 - src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doomtype.h b/src/doomtype.h index 8e7da688..d833176f 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -94,7 +94,6 @@ typedef long ssize_t; #ifdef __APPLE_CC__ #define DIRECTFULLSCREEN #define DEBUG_LOG -#define HWRENDER #define NOIPX #endif diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 98599fb6..c3f0d3b3 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1270,6 +1270,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; @@ -1392,6 +1393,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; From 2165c6806661ccdc3d854dae3e528a5e9ed339f3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:25:52 -0400 Subject: [PATCH 077/109] travis: add -Wno-unknown-warning-option --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ebef34a..c7e8b66b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: - osx env: -- CFLAGS=-Wno-absolute-value -Werror +- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror compiler: - gcc From 18f51b343b17d0ce70b271a3c6a832ab9cf9028a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:37:14 -0400 Subject: [PATCH 078/109] build: more mac fixes --- .travis.yml | 2 ++ src/md5.c | 2 +- src/string.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7e8b66b..e781c46e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ dist: trusty os: - linux + env: CFLAGS=-Wno-absolute-value -Werror - osx + env: CFLAGS=--Werror env: - CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror diff --git a/src/md5.c b/src/md5.c index aeaac2cd..ba89c499 100644 --- a/src/md5.c +++ b/src/md5.c @@ -36,7 +36,7 @@ #include #else #ifndef HAVE_MEMCPY - #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) + #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) && !defined (__APPLE__) #define memcpy(d, s, n) bcopy ((s), (d), (n)) #endif #endif diff --git a/src/string.c b/src/string.c index 43675730..19540547 100644 --- a/src/string.c +++ b/src/string.c @@ -15,6 +15,8 @@ #include #include "doomdef.h" +#if !defined (__APPLE__) + // Like the OpenBSD version, but it doesn't check for src not being a valid // C string. size_t strlcat(char *dst, const char *src, size_t siz) @@ -46,3 +48,5 @@ size_t strlcpy(char *dst, const char *src, size_t siz) dst[0] = '\0'; return strlcat(dst, src, siz); } + +#endif From fc1d71454b0c7ccdf3071a34e586ab27918c5c4d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:56:04 -0400 Subject: [PATCH 079/109] travis: fixup xml --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e781c46e..88d47d48 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,11 @@ language: c sudo: required dist: trusty -os: - - linux - env: CFLAGS=-Wno-absolute-value -Werror - - osx - env: CFLAGS=--Werror - -env: -- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror +matrix: + include: + - os: linux + env: CFLAGS=Wno-absolute-value -Werror + - osx compiler: - gcc From 7122908560818ff3d36d862243983fa28c07e652 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:57:57 -0400 Subject: [PATCH 080/109] travis: matrix is not correct --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88d47d48..c378e9ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - env: CFLAGS=Wno-absolute-value -Werror - - osx +os: + - linux + - osx compiler: - gcc From 9bc6ce3d85b3d353a4d14df9b78d292c65de602e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 21:43:17 -0400 Subject: [PATCH 081/109] travis: steal SDL2 dmg for Mac build --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c378e9ef..84bf5dea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,5 +36,7 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make From 2c4a27c7c6c2262debab568f5b0c466bf740b4c8 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:07:34 -0400 Subject: [PATCH 082/109] macosx: let fix linking to SDL frameworks --- .travis.yml | 2 +- src/sdl/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84bf5dea..df89593c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f44e3dee..f57aa2c1 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,10 +118,10 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) - add_framework(CoreFoundation SRB2SDL2) - add_framework(SDL2 SRB2SDL2) - add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + CoreFoundation + SDL2 + SDL2_mixer ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} From 077781cc567d1b7b6bee96abbba652fea0b121da Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:11:39 -0400 Subject: [PATCH 083/109] macosx: drop CoreFoundation linking --- src/sdl/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f57aa2c1..26448cb6 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -119,7 +119,6 @@ if(${SDL2_FOUND}) if(${CMAKE_SYSTEM} MATCHES Darwin) target_link_libraries(SRB2SDL2 PRIVATE - CoreFoundation SDL2 SDL2_mixer ${GME_LIBRARIES} From 0f853640e219bda4a2af3406d1fdade541be88ad Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:23:47 -0400 Subject: [PATCH 084/109] macosx: We need CoreFoudation for SDLMain --- src/sdl/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 26448cb6..7f677126 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,7 +118,9 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) + find_library(CORE_LIB CoreFoundation) target_link_libraries(SRB2SDL2 PRIVATE + ${CORE_LIB} SDL2 SDL2_mixer ${GME_LIBRARIES} From 1108a52959780c51201c2808d8ec35ee5e204bfe Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 29 Mar 2016 22:44:16 +0100 Subject: [PATCH 085/109] Check change in ceilinglightsec for markceiling code, not floorlightsec --- src/r_segs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index 04873b29..2820262e 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1922,7 +1922,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) || backsector->ceilingpic_angle != frontsector->ceilingpic_angle //SoM: 3/22/2000: Prevents bleeding. || (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum) - || backsector->floorlightsec != frontsector->floorlightsec + || backsector->ceilinglightsec != frontsector->ceilinglightsec //SoM: 4/3/2000: Check for colormaps || frontsector->extra_colormap != backsector->extra_colormap || (frontsector->ffloors != backsector->ffloors && frontsector->tag != backsector->tag)) From 0fe6ee533990adbd50da7abef36e54d76e9bf70d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 00:22:12 -0400 Subject: [PATCH 086/109] cleanup abs warnings --- src/b_bot.c | 2 +- src/lua_hudlib.c | 2 +- src/p_map.c | 4 ++-- src/p_user.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 3072b1d7..5e128bff 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { cmd->forwardmove = sonic->player->cmd.forwardmove; - cmd->angleturn = abs((tails->angle - sonic->angle))>>16; + cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16; if (sonic->angle < tails->angle) cmd->angleturn = -cmd->angleturn; } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 19390d50..d5947489 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -408,7 +408,7 @@ static int libd_drawPaddedNum(lua_State *L) HUDONLY x = luaL_checkinteger(L, 1); y = luaL_checkinteger(L, 2); - num = abs(luaL_checkinteger(L, 3)); + num = labs(luaL_checkinteger(L, 3)); digits = luaL_optinteger(L, 4, 2); flags = luaL_optinteger(L, 5, 0); flags &= ~V_PARAMMASK; // Don't let crashes happen. diff --git a/src/p_map.c b/src/p_map.c index 1aa8bc39..09f49423 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2507,8 +2507,8 @@ isblocking: climbangle += (ANGLE_90 * (whichside ? -1 : 1)); - if (((!slidemo->player->climbing && abs((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) - || (slidemo->player->climbing == 1 && abs((slidemo->angle - climbline)) < ANGLE_135)) + if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) + || (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135)) && P_IsClimbingValid(slidemo->player, climbangle)) { slidemo->angle = climbangle; diff --git a/src/p_user.c b/src/p_user.c index ce68e2d6..34d2d4ba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player == &players[consoleplayer]) { if (focusangle >= localangle) - localangle += abs((focusangle - localangle))>>5; + localangle += (angle_t)((focusangle - localangle))>>5; else - localangle -= abs((focusangle - localangle))>>5; + localangle -= (angle_t)((focusangle - localangle))>>5; } } else if (P_AnalogMove(player)) // Analog From 7e07d2d77a660139244a3dea823cf4d020dc0672 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 00:23:28 -0400 Subject: [PATCH 087/109] travis-ci: reenable -Werror --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index df89593c..c15cc679 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: c sudo: required dist: trusty +env: +- CFLAGS=-Werror + os: - linux - osx From b169529dfde93925add91bd6b4dd0486a327492d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 11:47:27 -0400 Subject: [PATCH 088/109] switich to do the angle math in signed, then run it thur abs() --- src/b_bot.c | 2 +- src/p_map.c | 4 ++-- src/p_user.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 5e128bff..e9b00497 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { cmd->forwardmove = sonic->player->cmd.forwardmove; - cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16; + cmd->angleturn = abs((signed)(tails->angle - sonic->angle))>>16; if (sonic->angle < tails->angle) cmd->angleturn = -cmd->angleturn; } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) diff --git a/src/p_map.c b/src/p_map.c index 09f49423..bcb3c08a 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2507,8 +2507,8 @@ isblocking: climbangle += (ANGLE_90 * (whichside ? -1 : 1)); - if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) - || (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135)) + if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) + || (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135)) && P_IsClimbingValid(slidemo->player, climbangle)) { slidemo->angle = climbangle; diff --git a/src/p_user.c b/src/p_user.c index 34d2d4ba..6053ad1e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player == &players[consoleplayer]) { if (focusangle >= localangle) - localangle += (angle_t)((focusangle - localangle))>>5; + localangle += abs((signed)(focusangle - localangle))>>5; else - localangle -= (angle_t)((focusangle - localangle))>>5; + localangle -= abs((signed)(focusangle - localangle))>>5; } } else if (P_AnalogMove(player)) // Analog From 10cc421fae6095dc6151700b9cd9006164cc0d3c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 12:58:00 -0400 Subject: [PATCH 089/109] travis: add all/extra warnings --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c15cc679..54c5901d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required dist: trusty env: -- CFLAGS=-Werror +- CFLAGS=-Wall -W -Werror os: - linux From d90536967d6cd05b1e454f45d252723909bf3d10 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 14:05:07 -0400 Subject: [PATCH 090/109] removed/remline ununsed code --- src/am_map.c | 33 -------- src/hardware/hw_main.c | 6 -- src/hardware/hw_md2.c | 185 ----------------------------------------- src/m_cheat.c | 20 ----- src/mserv.c | 27 ------ src/p_maputl.c | 15 ---- src/p_spec.c | 6 +- src/r_things.c | 5 -- src/sdl/i_video.c | 13 --- 9 files changed, 5 insertions(+), 305 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 70714fac..97b7c516 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -30,9 +30,7 @@ static const UINT8 REDRANGE = 16; static const UINT8 GRAYS = (1*16); static const UINT8 GRAYSRANGE = 16; static const UINT8 BROWNS = (3*16); -static const UINT8 BROWNRANGE = 16; static const UINT8 YELLOWS = (7*16); -static const UINT8 YELLOWRANGE = 8; static const UINT8 GREENS = (10*16); static const UINT8 GREENRANGE = 16; static const UINT8 DBLACK = 31; @@ -41,11 +39,8 @@ static const UINT8 DWHITE = 0; static const UINT8 NOCLIMBREDS = 248; static const UINT8 NOCLIMBREDRANGE = 8; static const UINT8 NOCLIMBGRAYS = 204; -static const UINT8 NOCLIMBGRAYSRANGE = 4; static const UINT8 NOCLIMBBROWNS = (2*16); -static const UINT8 NOCLIMBBROWNRANGE = 16; static const UINT8 NOCLIMBYELLOWS = (11*16); -static const UINT8 NOCLIMBYELLOWRANGE = 8; #ifdef _NDS @@ -67,15 +62,10 @@ static const UINT8 NOCLIMBYELLOWRANGE = 8; #define TSWALLCOLORS GRAYS #define TSWALLRANGE GRAYSRANGE #define NOCLIMBTSWALLCOLORS NOCLIMBGRAYS -#define NOCLIMBTSWALLRANGE NOCLIMBGRAYSRANGE #define FDWALLCOLORS BROWNS -#define FDWALLRANGE BROWNRANGE #define NOCLIMBFDWALLCOLORS NOCLIMBBROWNS -#define NOCLIMBFDWALLRANGE NOCLIMBBROWNRANGE #define CDWALLCOLORS YELLOWS -#define CDWALLRANGE YELLOWRANGE #define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS -#define NOCLIMBCDWALLRANGE NOCLIMBYELLOWRANGE #define THINGCOLORS GREENS #define THINGRANGE GREENRANGE #define SECRETWALLCOLORS WALLCOLORS @@ -255,29 +245,6 @@ static AMDRAWFLINEFUNC AM_drawFline; static void AM_drawFline_soft(const fline_t *fl, INT32 color); -/** Calculates the slope and slope according to the x-axis of a line - * segment in map coordinates (with the upright y-axis and all) so - * that it can be used with the braindead drawing stuff. - * - * \param ml The line segment. - * \param is Holds the result. - */ -static inline void AM_getIslope(const mline_t *ml, islope_t *is) -{ - INT32 dx, dy; - - dy = ml->a.y - ml->b.y; - dx = ml->b.x - ml->a.x; - if (!dy) - is->islp = (dx < 0 ? -INT32_MAX : INT32_MAX); - else - is->islp = FixedDiv(dx, dy); - if (!dx) - is->slp = (dy < 0 ? -INT32_MAX : INT32_MAX); - else - is->slp = FixedDiv(dy, dx); -} - static void AM_activateNewScale(void) { m_x += m_w/2; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index b0186049..ae26b8de 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3404,12 +3404,6 @@ static void HWR_ClearSprites(void) gr_visspritecount = 0; } -static inline void HWR_ResetVisSpriteChunks(void) -{ - memset(gr_visspritechunks, 0, sizeof(gr_visspritechunks)); -} - - // -------------------------------------------------------------------------- // HWR_NewVisSprite // -------------------------------------------------------------------------- diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 0745b9a0..a160be67 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -406,191 +406,6 @@ static md2_model_t *md2_readModel(const char *filename) return model; } -/* - * center model - */ -static inline void md2_getBoundingBox (md2_model_t *model, float *minmax) -{ - size_t i; - float minx, maxx; - float miny, maxy; - float minz, maxz; - - minx = miny = minz = 999999.0f; - maxx = maxy = maxz = -999999.0f; - - /* get bounding box */ - for (i = 0; i < model->header.numVertices; i++) - { - md2_triangleVertex_t *v = &model->frames[0].vertices[i]; - - if (v->vertex[0] < minx) - minx = v->vertex[0]; - else if (v->vertex[0] > maxx) - maxx = v->vertex[0]; - - if (v->vertex[1] < miny) - miny = v->vertex[1]; - else if (v->vertex[1] > maxy) - maxy = v->vertex[1]; - - if (v->vertex[2] < minz) - minz = v->vertex[2]; - else if (v->vertex[2] > maxz) - maxz = v->vertex[2]; - } - - minmax[0] = minx; - minmax[1] = maxx; - minmax[2] = miny; - minmax[3] = maxy; - minmax[4] = minz; - minmax[5] = maxz; -} - -static inline INT32 md2_getAnimationCount(md2_model_t *model) -{ - size_t i, pos; - INT32 j = 0, count; - char name[16], last[16]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - strcpy(last, name); - count++; - } - } - - return count; -} - -static inline const char * md2_getAnimationName (md2_model_t *model, INT32 animation) -{ - size_t i, pos; - INT32 j = 0, count; - static char last[32]; - char name[32]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - if (count == animation) - return last; - - strcpy(last, name); - count++; - } - } - - return 0; -} - -static inline void md2_getAnimationFrames(md2_model_t *model, - INT32 animation, INT32 *startFrame, INT32 *endFrame) -{ - size_t i, pos; - INT32 j = 0, count, numFrames, frameCount; - char name[16], last[16]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - numFrames = 0; - frameCount = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - strcpy(last, name); - - if (count == animation) - { - *startFrame = frameCount - numFrames; - *endFrame = frameCount - 1; - return; - } - - count++; - numFrames = 0; - } - frameCount++; - numFrames++; - } - *startFrame = *endFrame = 0; -} - static inline void md2_printModelInfo (md2_model_t *model) { #if 0 diff --git a/src/m_cheat.c b/src/m_cheat.c index 8cea4c6a..c8a19666 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -161,26 +161,6 @@ static UINT8 cht_CheckCheat(cheatseq_t *cht, char key) return rc; } -static inline void cht_GetParam(cheatseq_t *cht, char *buffer) -{ - UINT8 *p; - UINT8 c; - - p = cht->sequence; - while (*(p++) != 1) - ; - - do - { - c = *p; - *(buffer++) = c; - *(p++) = 0; - } while (c && *p != 0xff); - - if (*p == 0xff) - *buffer = 0; -} - boolean cht_Responder(event_t *ev) { UINT8 ret = 0, ch = 0; diff --git a/src/mserv.c b/src/mserv.c index 568474d7..c47d149e 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -351,33 +351,6 @@ static INT32 GetServersList(void) } #endif -/** Get the MOTD from the master server. - */ -static inline INT32 GetMSMOTD(void) -{ - msg_t msg; - INT32 count = 0; - - msg.type = GET_MOTD_MSG; - msg.length = 0; - if (MS_Write(&msg) < 0) - return MS_WRITE_ERROR; - - while (MS_Read(&msg) >= 0) - { - if (!msg.length) - { - if (!count) - CONS_Alert(CONS_NOTICE, M_GetText("No servers currently running.\n")); - return MS_NO_ERROR; - } - count++; - CONS_Printf("%s",msg.buffer); - } - - return MS_READ_ERROR; -} - // // MS_Connect() // diff --git a/src/p_maputl.c b/src/p_maputl.c index 48dd54e8..2aa66781 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -34,21 +34,6 @@ fixed_t P_AproxDistance(fixed_t dx, fixed_t dy) return dx + dy - (dy>>1); } -// -// P_PartialDistance -// Useful only for iterations finding the 'closest point' -// -FUNCMATH static inline fixed_t P_PartialDistance(fixed_t dx, fixed_t dy) -{ - dx >>= FRACBITS; - dy >>= FRACBITS; - - dx *= dx; - dy *= dy; - - return dx + dy; -} - // // P_ClosestPointOnLine // Finds the closest point on a given line to the supplied point diff --git a/src/p_spec.c b/src/p_spec.c index 8228c60b..a292a8bb 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -102,7 +102,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, mobj_t * static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t offset, INT32 line, INT32 sourceline); static void P_AddBlockThinker(sector_t *sec, line_t *sourceline); static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline); -static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); +//static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers); static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec); static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer); @@ -593,6 +593,7 @@ void P_SetupLevelFlatAnims(void) // UTILITIES // +#if 0 /** Gets a side from a sector line. * * \param currentSector Sector the line is in. @@ -632,6 +633,7 @@ static inline boolean twoSided(INT32 sector, INT32 line) { return (sectors[sector].lines[line])->sidenum[1] != 0xffff; } +#endif /** Finds sector next to current. * @@ -5050,6 +5052,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline) * \sa P_SpawnSpecials, T_BridgeThinker * \author SSNTails */ +/* static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec) { levelspecthink_t *bridge; @@ -5072,6 +5075,7 @@ static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec) bridge->vars[4] = sourceline->tag; // Start tag bridge->vars[5] = (sides[sourceline->sidenum[0]].textureoffset>>FRACBITS); // End tag } +*/ /** Adds a Mario block thinker, which changes the block's texture between blank * and ? depending on whether it has contents. diff --git a/src/r_things.c b/src/r_things.c index 9a8b1319..c5f3c524 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -550,11 +550,6 @@ void R_ClearSprites(void) visspritecount = clippedvissprites = 0; } -static inline void R_ResetVisSpriteChunks(void) -{ - memset(visspritechunks, 0, sizeof(visspritechunks)); -} - // // R_NewVisSprite // diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 963310a2..0f9fa58a 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -126,8 +126,6 @@ static Uint8 BitsPerPixel = 16; #endif Uint16 realwidth = BASEVIDWIDTH; Uint16 realheight = BASEVIDHEIGHT; -static const Uint32 surfaceFlagsW = 0/*|SDL_RESIZABLE*/; -static const Uint32 surfaceFlagsF = 0; static SDL_bool mousegrabok = SDL_TRUE; #define HalfWarpMouse(x,y) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2)) static SDL_bool videoblitok = SDL_FALSE; @@ -1252,17 +1250,6 @@ static inline boolean I_SkipFrame(void) } } -static inline SDL_bool SDLmatchVideoformat(void) -{ - const SDL_PixelFormat *vidformat = vidSurface->format; - const INT32 vfBPP = vidformat?vidformat->BitsPerPixel:0; - return (((vfBPP == 8 && vid.bpp == 1 && - !vidformat->Rmask && !vidformat->Gmask && !vidformat->Bmask) || - (vfBPP == 15 && vid.bpp == 2 && vidformat->Rmask == 0x7C00 && - vidformat->Gmask == 0x03E0 && vidformat->Bmask == 0x001F )) && - !vidformat->Amask && (vidSurface->flags & SDL_RLEACCEL) == 0); -} - // // I_FinishUpdate // From 75f65c4d44d07e3b7538cafc65141b0e0c7f6016 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 20:17:09 -0400 Subject: [PATCH 091/109] using abs() on unsigned have no effect --- src/g_game.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3b7ef158..9ea51eba 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4336,7 +4336,7 @@ void G_GhostTicker(void) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) g->mo->color = SKINCOLOR_SUPER1; - g->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); + g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index 45f86011..72b08db9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } - player->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); + player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) From de630d0c33ed786fe33a0e3fc5b1492812c02c2e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 20:30:24 -0400 Subject: [PATCH 092/109] appveyor: let check warnings as well --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 4edcd7a7..3ddec6df 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,7 @@ environment: SDL2_MIXER_URL: https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-mingw.tar.gz SDL2_MIXER_ARCHIVE: SDL2_mixer-devel-2.0.1-mingw.tar SDL2_MIXER_MOVE: SDL2_mixer-2.0.1\i686-w64-mingw32 + CFLAGS: -Wall -W -Werror cache: - SDL2-devel-2.0.4-mingw.tar.gz From 3812b6bc20c313b6eed1471f837f70485d73a0bd Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:48:08 -0700 Subject: [PATCH 093/109] the abs() is necessary; force unsigned shift and signed result --- src/g_game.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 9ea51eba..9578cbf8 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4336,7 +4336,7 @@ void G_GhostTicker(void) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) g->mo->color = SKINCOLOR_SUPER1; - g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index 72b08db9..51832119 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } - player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) From 690b65b47fe996b2f325eca1846b23b13fcdcad1 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:51:04 -0700 Subject: [PATCH 094/109] "Sonic can now become Super Sonic" exists again Fixed an off-by-one array error in the process --- src/y_inter.c | 86 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 104c1004..32a72261 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -77,10 +77,14 @@ typedef union struct { - char passed1[13]; // KNUCKLES GOT - char passed2[16]; // A CHAOS EMERALD + char passed1[SKINNAMESIZE+1]; // KNUCKLES GOT / CRAWLA HONCHO + char passed2[17]; // A CHAOS EMERALD / GOT THEM ALL! + char passed3[15]; // CAN NOW BECOME + char passed4[SKINNAMESIZE+7]; // SUPER CRAWLA HONCHO INT32 passedx1; INT32 passedx2; + INT32 passedx3; + INT32 passedx4; y_bonus_t bonus; patch_t *bonuspatch; @@ -250,19 +254,62 @@ void Y_IntermissionDrawer(void) } else if (intertype == int_spec) { - // draw the header -/* if (endtic != -1 && ALL7EMERALDS(emeralds) && data.spec.nowsuper != NULL) - V_DrawScaledPatch(48, 32, 0, data.spec.nowsuper); - else - V_DrawScaledPatch(data.spec.headx, 26, 0, data.spec.cemerald); */ + static tic_t animatetic = 0; + INT32 ttheight = 16; + INT32 xoffset1 = 0; // Line 1 x offset + INT32 xoffset2 = 0; // Line 2 x offset + INT32 xoffset3 = 0; // Line 3 x offset + UINT8 drawsection = 0; - if (data.spec.passed1[0] != '\0') + // draw the header + if (intertic <= TICRATE) + animatetic = 0; + else if (!animatetic && data.spec.bonus.points == 0 && data.spec.passed3[0] != '\0') + animatetic = intertic; + + if (animatetic) { - V_DrawLevelTitle(data.spec.passedx1, 24, 0, data.spec.passed1); - V_DrawLevelTitle(data.spec.passedx2, 24+V_LevelNameHeight(data.spec.passed2)+2, 0, data.spec.passed2); + INT32 animatetimer = (intertic - animatetic); + if (animatetimer <= 8) + { + xoffset1 = -(animatetimer * 40); + xoffset2 = -((animatetimer-2) * 40); + if (xoffset2 > 0) xoffset2 = 0; + } + else if (animatetimer <= 19) + { + drawsection = 1; + xoffset1 = (16-animatetimer) * 40; + xoffset2 = (18-animatetimer) * 40; + xoffset3 = (20-animatetimer) * 40; + if (xoffset1 < 0) xoffset1 = 0; + if (xoffset2 < 0) xoffset2 = 0; + } + else + drawsection = 1; + } + + if (drawsection == 1) + { + ttheight = 16; + V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); + ttheight += V_LevelNameHeight(data.spec.passed3) + 2; + V_DrawLevelTitle(data.spec.passedx3 + xoffset2, ttheight, 0, data.spec.passed3); + ttheight += V_LevelNameHeight(data.spec.passed4) + 2; + V_DrawLevelTitle(data.spec.passedx4 + xoffset3, ttheight, 0, data.spec.passed4); + } + else if (data.spec.passed1[0] != '\0') + { + ttheight = 24; + V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); + ttheight += V_LevelNameHeight(data.spec.passed2) + 2; + V_DrawLevelTitle(data.spec.passedx2 + xoffset2, ttheight, 0, data.spec.passed2); } else - V_DrawLevelTitle(data.spec.passedx2, 24+(V_LevelNameHeight(data.spec.passed2)/2)+2, 0, data.spec.passed2); + { + ttheight = 24 + (V_LevelNameHeight(data.spec.passed2)/2) + 2; + V_DrawLevelTitle(data.spec.passedx2 + xoffset1, ttheight, 0, data.spec.passed2); + } // draw the emeralds if (intertic & 1) @@ -1098,6 +1145,10 @@ void Y_StartIntermission(void) data.spec.nowsuper = NULL; } */ + // Super form stuff (normally blank) + data.spec.passed3[0] = '\0'; + data.spec.passed4[0] = '\0'; + // set up the "got through act" message according to skin name if (stagefailed) { @@ -1111,10 +1162,19 @@ void Y_StartIntermission(void) skins[players[consoleplayer].skin].realname); data.spec.passed1[sizeof data.spec.passed1 - 1] = '\0'; strcpy(data.spec.passed2, "GOT THEM ALL!"); + + if (skins[players[consoleplayer].skin].flags & SF_SUPER) + { + strcpy(data.spec.passed3, "CAN NOW BECOME"); + snprintf(data.spec.passed4, + sizeof data.spec.passed4, "SUPER %s", + skins[players[consoleplayer].skin].realname); + data.spec.passed4[sizeof data.spec.passed4 - 1] = '\0'; + } } else { - if (strlen(skins[players[consoleplayer].skin].realname) <= 8) + if (strlen(skins[players[consoleplayer].skin].realname) <= SKINNAMESIZE-5) { snprintf(data.spec.passed1, sizeof data.spec.passed1, "%s GOT", @@ -1127,6 +1187,8 @@ void Y_StartIntermission(void) } data.spec.passedx1 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed1))/2; data.spec.passedx2 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed2))/2; + data.spec.passedx3 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed3))/2; + data.spec.passedx4 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed4))/2; break; } From fc8e7728cd79afa6edba40333378ebf3ab90faf5 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:57:11 -0700 Subject: [PATCH 095/109] I meant to extend this to 4 seconds but forgot --- src/y_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 32a72261..71e72122 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -755,7 +755,7 @@ void Y_Ticker(void) { if (intertic > tallydonetic) { - endtic = intertic + 4*TICRATE; // 4 second pause after end of tally for sound + endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_flgcap); // cha-ching! } return; @@ -775,7 +775,7 @@ void Y_Ticker(void) if (data.spec.continues & 0x80) // don't set endtic yet! tallydonetic = intertic + (3*TICRATE)/2; else // okay we're good. - endtic = intertic + 3*TICRATE; // 3 second pause after end of tally + endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_chchng); // cha-ching! From f3f2c5962255b2f731c6acefd1067bb49b03c980 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 31 Mar 2016 20:42:01 -0500 Subject: [PATCH 096/109] Remove p_fab.c --- src/CMakeLists.txt | 1 - src/Makefile | 1 - src/p_fab.c | 15 --------------- 3 files changed, 17 deletions(-) delete mode 100644 src/p_fab.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13d3312d..035b4655 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,7 +139,6 @@ set(SRB2_CORE_RENDER_SOURCES set(SRB2_CORE_GAME_SOURCES p_ceilng.c p_enemy.c - p_fab.c p_floor.c p_inter.c p_lights.c diff --git a/src/Makefile b/src/Makefile index 449b4065..0c034143 100644 --- a/src/Makefile +++ b/src/Makefile @@ -437,7 +437,6 @@ OBJS:=$(i_main_o) \ $(OBJDIR)/info.o \ $(OBJDIR)/p_ceilng.o \ $(OBJDIR)/p_enemy.o \ - $(OBJDIR)/p_fab.o \ $(OBJDIR)/p_floor.o \ $(OBJDIR)/p_inter.o \ $(OBJDIR)/p_lights.o \ diff --git a/src/p_fab.c b/src/p_fab.c deleted file mode 100644 index 7ccb93a9..00000000 --- a/src/p_fab.c +++ /dev/null @@ -1,15 +0,0 @@ -// SONIC ROBO BLAST 2 -//----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2014 by Sonic Team Junior. -// -// This program is free software distributed under the -// terms of the GNU General Public License, version 2. -// See the 'LICENSE' file for more details. -//----------------------------------------------------------------------------- -/// \file p_fab.c -/// \brief some new action routines, separated from the original doom -/// sources, so that you can include it or remove it easy. - -/// \todo -/// This file is now unused, please remove at some point From 033090b2c883f9f6df1de1555f1e0037ab06bd1f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 31 Mar 2016 20:47:57 -0500 Subject: [PATCH 097/109] Remove p_fab.c from Code::Blocks project --- SRB2.cbp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/SRB2.cbp b/SRB2.cbp index 5a03955b..43696ee2 100644 --- a/SRB2.cbp +++ b/SRB2.cbp @@ -3293,23 +3293,6 @@ HW3SOUND for 3D hardware sound support