From 4ab2c336e7e19c73a1a287802dc0e1f0969a55b8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Mar 2016 19:32:07 +0000 Subject: [PATCH 01/24] 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 3b0c68de7..ea80af454 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 d9e25dbb8..6ec8f2d71 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 b3d734521..7190efaac 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 02/24] 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 367d5714a..ffb690822 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 03/24] 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 c21e8fb99..60f3b0592 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 d2454f267..cb9bc775a 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 6198f5bec..e24b09652 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 f9fa5f1f1..34b779068 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 04/24] 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 c415eecb8..2cc79db47 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 ec67703c3..96f832e2c 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 05/24] 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 b8d3f7b5e..cacaadf81 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 34b779068..285da0e7f 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 06/24] 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 60f3b0592..926c3a488 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 0fc4a1fea..4fd50e927 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 fb19fa2b4..0eda41770 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 9596f0384..6e14448f4 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 6ab6aaf40..b8101f12b 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 cb9bc775a..4e60ad612 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 463937290..03b2c1dd8 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 07/24] 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 4fd50e927..a44fe4779 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 83dff02f8..94eef1d3e 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 409900b98..58e4e87f2 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 285da0e7f..277fe19eb 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 f18410fe8..2915b9259 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 08/24] 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 c21e8fb99..47c87eefc 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 ec67703c3..b4b668ce7 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 09/24] 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 e24b09652..44b3ceeec 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 10/24] 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 44b3ceeec..e24b09652 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 11/24] 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 926c3a488..31cf37636 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 e24b09652..3979b1304 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 12/24] 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 31cf37636..926c3a488 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 3979b1304..e24b09652 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 13/24] 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 926c3a488..61bccb4f6 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 14/24] 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 5cd75fa5a..eef4fec13 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 3918d8118..1349a64e4 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 a44fe4779..c3a0bfa6e 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 509516f59f2711856c0edbbacbf6f3fa11de8b36 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 10 Mar 2016 16:38:06 -0500 Subject: [PATCH 15/24] travis: enable apt and ccache cache --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c652584f8..5815e711f 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 16/24] 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 d4cc64a4b..8520d8d5e 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 17/24] fixup --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8520d8d5e..701cdcfb1 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 18/24] 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 23ee7ea55..b8450ff64 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 703bb2d35..71c5f08aa 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 a4dc5b0f9..9f1fe2f71 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 266161c7c..30208422f 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 e4b426ebc..fe7fad8ae 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 1e7745535..780de7ad5 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 21728792f..22effdddf 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 19/24] SVN needs the revision prefixed with 'r' --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index b8450ff64..119b3bb5c 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 20/24] 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 119b3bb5c..9e127f001 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 21/24] 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 9e127f001..9028e2888 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 22/24] comptime.bat: Put @echo off back in --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 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 23/24] comptime.bat: restore echo off --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 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 24/24] 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 a959a8632..0a3fae3b5 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 800b61f53..c5ce19ef4 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