From 64edd91dbd56de778695abb533590eac0f5df767 Mon Sep 17 00:00:00 2001 From: ZipperQR Date: Wed, 22 Apr 2020 00:59:12 +0300 Subject: [PATCH 01/15] Dust devil support --- src/d_player.h | 3 ++- src/dehacked.c | 1 + src/p_enemy.c | 5 ++++- src/p_user.c | 3 +++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 8697e9836..e5c7e7298 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -239,7 +239,8 @@ typedef enum CR_MACESPIN, CR_MINECART, CR_ROLLOUT, - CR_PTERABYTE + CR_PTERABYTE, + CR_DUSTDEVIL } carrytype_t; // pw_carry // Player powers. (don't edit this comment) diff --git a/src/dehacked.c b/src/dehacked.c index e9d029be0..15e5bb060 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9468,6 +9468,7 @@ struct { {"CR_MINECART",CR_MINECART}, {"CR_ROLLOUT",CR_ROLLOUT}, {"CR_PTERABYTE",CR_PTERABYTE}, + {"CR_DUSTDEVIL",CR_DUSTDEVIL}, // Ring weapons (ringweapons_t) // Useful for A_GiveWeapon diff --git a/src/p_enemy.c b/src/p_enemy.c index 2341be6d3..58f09cacb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13311,8 +13311,9 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing) P_ResetPlayer(player); A_PlayActiveSound(dustdevil); } + player->powers[pw_carry] = CR_DUSTDEVIL; player->powers[pw_nocontrol] = 2; - player->drawangle += ANG20; + P_SetTarget(&thing->tracer, dustdevil); P_SetPlayerMobjState(thing, S_PLAY_PAIN); if (dist > dragamount) @@ -13332,7 +13333,9 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing) P_ResetPlayer(player); thing->z = dustdevil->z + dustdevil->height; thrust = 20 * FRACUNIT; + player->powers[pw_carry] = CR_NONE; player->powers[pw_nocontrol] = 0; + P_SetTarget(&thing->tracer, NULL); S_StartSound(thing, sfx_wdjump); P_SetPlayerMobjState(thing, S_PLAY_FALL); } diff --git a/src/p_user.c b/src/p_user.c index 1f46a2dff..28d2d6a5e 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11950,6 +11950,9 @@ void P_PlayerThink(player_t *player) break; } /* FALLTHRU */ + case CR_DUSTDEVIL: + player->drawangle += ANG20; + break; default: player->drawangle = player->mo->angle; break; From 657ee8287e1a955d14797d7eb25568be857d2a07 Mon Sep 17 00:00:00 2001 From: Zipper Date: Wed, 22 Apr 2020 07:59:08 -0400 Subject: [PATCH 02/15] Update p_user.c --- src/p_user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 28d2d6a5e..a656aef34 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11943,6 +11943,9 @@ void P_PlayerThink(player_t *player) break; /* -- in case we wanted to have the camera freely movable during zoom tubes case CR_ZOOMTUBE:*/ + case CR_DUSTDEVIL: + player->drawangle += ANG20; + break; case CR_ROPEHANG: if (player->mo->momx || player->mo->momy) { @@ -11950,9 +11953,6 @@ void P_PlayerThink(player_t *player) break; } /* FALLTHRU */ - case CR_DUSTDEVIL: - player->drawangle += ANG20; - break; default: player->drawangle = player->mo->angle; break; From e0f9b82544df2d9cd248a663108ffbb70f188e08 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 26 Apr 2020 18:46:43 -0400 Subject: [PATCH 03/15] Fix window icon being reset when switching renderers on non-Windows platforms --- src/sdl/i_video.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index c042d141c..d9c08eca7 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -217,7 +217,6 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen, SDL_bool else { Impl_CreateWindow(fullscreen); - Impl_SetWindowIcon(); wasfullscreen = fullscreen; SDL_SetWindowSize(window, width, height); if (fullscreen) @@ -1630,12 +1629,15 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen) window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED, realwidth, realheight, flags); + if (window == NULL) { CONS_Printf(M_GetText("Couldn't create window: %s\n"), SDL_GetError()); return SDL_FALSE; } + Impl_SetWindowIcon(); + return Impl_CreateContext(); } @@ -1652,12 +1654,8 @@ static void Impl_SetWindowName(const char *title) static void Impl_SetWindowIcon(void) { - if (window == NULL || icoSurface == NULL) - { - return; - } - //SDL2STUB(); // Monster Iestyn: why is this stubbed? - SDL_SetWindowIcon(window, icoSurface); + if (window && icoSurface) + SDL_SetWindowIcon(window, icoSurface); } static void Impl_VideoSetupSDLBuffer(void) @@ -1764,6 +1762,11 @@ void I_StartupGraphics(void) VID_StartupOpenGL(); #endif + // Window icon +#ifdef HAVE_IMAGE + icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm); +#endif + // Fury: we do window initialization after GL setup to allow // SDL_GL_LoadLibrary to work well on Windows @@ -1782,11 +1785,6 @@ void I_StartupGraphics(void) #ifdef HAVE_TTF I_ShutdownTTF(); #endif - // Window icon -#ifdef HAVE_IMAGE - icoSurface = IMG_ReadXPMFromArray(SDL_icon_xpm); -#endif - Impl_SetWindowIcon(); VID_SetMode(VID_GetModeForSize(BASEVIDWIDTH, BASEVIDHEIGHT)); From dd645d88eaaa525f6f5ef97e576293b3a877921b Mon Sep 17 00:00:00 2001 From: Zipper Date: Fri, 1 May 2020 08:25:37 -0400 Subject: [PATCH 04/15] Update p_user.c --- src/p_user.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index a656aef34..69c38f79d 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -12720,6 +12720,18 @@ void P_PlayerAfterThink(player_t *player) } break; } + case CR_DUSTDEVIL: + { + mobj_t *mo = player->mo, *dustdevil = player->mo->tracer; + + if (abs(mo->x - dustdevil->x) > dustdevil->radius || abs(mo->y - dustdevil->y) > dustdevil->radius){ + P_SetTarget(&player->mo->tracer, NULL); + player->powers[pw_carry] = CR_NONE; + break; + } + + break; + } case CR_ROLLOUT: { mobj_t *mo = player->mo, *rock = player->mo->tracer; From 0d7c49e7e4c9da6e84f6d5d182940bf49f178e1f Mon Sep 17 00:00:00 2001 From: ZipperQR Date: Sun, 3 May 2020 13:59:00 +0300 Subject: [PATCH 05/15] no message --- src/p_enemy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 58f09cacb..e83e4cd4f 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13288,8 +13288,9 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing) if (!player) return true; - if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius) + if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius){ return true; + } if (thing->z + thing->height >= dustdevil->z && dustdevil->z + dustdevil->height >= thing->z) { fixed_t pos = thing->z - dustdevil->z; From 87f7100d2e50522c914762fe9c252a42d7bfc5da Mon Sep 17 00:00:00 2001 From: Zipper Date: Wed, 6 May 2020 09:30:15 -0400 Subject: [PATCH 06/15] Update p_user.c --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 69c38f79d..5770ae5d4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -11941,11 +11941,11 @@ void P_PlayerThink(player_t *player) factor = 4; } break; - /* -- in case we wanted to have the camera freely movable during zoom tubes - case CR_ZOOMTUBE:*/ case CR_DUSTDEVIL: player->drawangle += ANG20; break; + /* -- in case we wanted to have the camera freely movable during zoom tubes + case CR_ZOOMTUBE:*/ case CR_ROPEHANG: if (player->mo->momx || player->mo->momy) { From ab7987d1cf34fd5d30ce82385bf1c81caf1cb2d3 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sat, 9 May 2020 16:59:09 -0300 Subject: [PATCH 07/15] Fix OpenGL only recording the first frame of unoptimized GIFs --- src/m_anigif.c | 57 +++++++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 26 deletions(-) diff --git a/src/m_anigif.c b/src/m_anigif.c index ce2ca20b9..1b71a09bc 100644 --- a/src/m_anigif.c +++ b/src/m_anigif.c @@ -490,29 +490,28 @@ const UINT8 gifframe_gchead[4] = {0x21,0xF9,0x04,0x04}; // GCE, bytes, packed by static UINT8 *gifframe_data = NULL; static size_t gifframe_size = 8192; +// +// GIF_rgbconvert +// converts an RGB frame to a frame with a palette. +// #ifdef HWRENDER -static void hwrconvert(void) +static void GIF_rgbconvert(UINT8 *linear, UINT8 *scr) { - UINT8 *linear = HWR_GetScreenshot(); - UINT8 *dest = screens[2]; UINT8 r, g, b; - INT32 x, y; - size_t i = 0; + size_t src = 0, dest = 0; + size_t size = (vid.width * vid.height * 3); InitColorLUT(gif_framepalette); - for (y = 0; y < vid.height; y++) + while (src < size) { - for (x = 0; x < vid.width; x++, i += 3) - { - r = (UINT8)linear[i]; - g = (UINT8)linear[i + 1]; - b = (UINT8)linear[i + 2]; - dest[(y * vid.width) + x] = colorlookup[r >> SHIFTCOLORBITS][g >> SHIFTCOLORBITS][b >> SHIFTCOLORBITS]; - } + r = (UINT8)linear[src]; + g = (UINT8)linear[src + 1]; + b = (UINT8)linear[src + 2]; + scr[dest] = colorlookup[r >> SHIFTCOLORBITS][g >> SHIFTCOLORBITS][b >> SHIFTCOLORBITS]; + src += (3 * scrbuf_downscaleamt); + dest += scrbuf_downscaleamt; } - - free(linear); } #endif @@ -556,7 +555,11 @@ static void GIF_framewrite(void) I_ReadScreen(movie_screen); #ifdef HWRENDER else if (rendermode == render_opengl) - hwrconvert(); + { + UINT8 *linear = HWR_GetScreenshot(); + GIF_rgbconvert(linear, movie_screen); + free(linear); + } #endif } else @@ -565,18 +568,20 @@ static void GIF_framewrite(void) blitw = vid.width; blith = vid.height; - if (gif_frames == 0) - { - if (rendermode == render_soft) - I_ReadScreen(movie_screen); #ifdef HWRENDER - else if (rendermode == render_opengl) - { - hwrconvert(); - VID_BlitLinearScreen(screens[2], screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); - } -#endif + // Copy the current OpenGL frame into the base screen + if (rendermode == render_opengl) + { + UINT8 *linear = HWR_GetScreenshot(); + GIF_rgbconvert(linear, screens[0]); + free(linear); } +#endif + + // Copy the first frame into the movie screen + // OpenGL already does the same above. + if (gif_frames == 0 && rendermode == render_soft) + I_ReadScreen(movie_screen); movie_screen = screens[0]; } From 69c11a8220477e64348f1fb5b47f0e86df324ea1 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 30 Apr 2020 16:01:03 +0200 Subject: [PATCH 08/15] Support act numbers up to 99 and draw both digits individually. --- src/dehacked.c | 2 +- src/hu_stuff.c | 4 ++-- src/hu_stuff.h | 2 +- src/st_stuff.c | 9 +++++++-- src/v_video.c | 30 +++++++++++++++++++++++------- 5 files changed, 34 insertions(+), 13 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index a6c73e0b4..a71bfe055 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1557,7 +1557,7 @@ static void readlevelheader(MYFILE *f, INT32 num) } else if (fastcmp(word, "ACT")) { - if (i >= 0 && i < 20) // 0 for no act number, TTL1 through TTL19 + if (i >= 0 && i <= 99) // 0 for no act number mapheaderinfo[num-1]->actnum = (UINT8)i; else deh_warning("Level header %d: invalid act number %d", num, i); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 6aa5a4510..3ff9db2b6 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -68,7 +68,7 @@ patch_t *nightsnum[10]; // 0-9 // Level title and credits fonts patch_t *lt_font[LT_FONTSIZE]; patch_t *cred_font[CRED_FONTSIZE]; -patch_t *ttlnum[20]; // act numbers (0-19) +patch_t *ttlnum[10]; // act numbers (0-9) // Name tag fonts patch_t *ntb_font[NT_FONTSIZE]; @@ -243,7 +243,7 @@ void HU_LoadGraphics(void) tallinfin = (patch_t *)W_CachePatchName("STTINFIN", PU_HUDGFX); // cache act numbers for level titles - for (i = 0; i < 20; i++) + for (i = 0; i < 10; i++) { sprintf(buffer, "TTL%.2d", i); ttlnum[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 9e3c66747..63d85f1b8 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -85,7 +85,7 @@ extern patch_t *lt_font[LT_FONTSIZE]; extern patch_t *cred_font[CRED_FONTSIZE]; extern patch_t *ntb_font[NT_FONTSIZE]; extern patch_t *nto_font[NT_FONTSIZE]; -extern patch_t *ttlnum[20]; +extern patch_t *ttlnum[10]; extern patch_t *emeraldpics[3][8]; extern patch_t *rflagico; extern patch_t *bflagico; diff --git a/src/st_stuff.c b/src/st_stuff.c index b6226d085..26f2c1774 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1325,7 +1325,7 @@ void ST_drawTitleCard(void) { char *lvlttl = mapheaderinfo[gamemap-1]->lvlttl; char *subttl = mapheaderinfo[gamemap-1]->subttl; - INT32 actnum = mapheaderinfo[gamemap-1]->actnum; + UINT8 actnum = mapheaderinfo[gamemap-1]->actnum; INT32 lvlttlxpos, ttlnumxpos, zonexpos; INT32 subttlxpos = BASEVIDWIDTH/2; INT32 ttlscroll = FixedInt(lt_scroll); @@ -1382,7 +1382,12 @@ void ST_drawTitleCard(void) if (actnum) { if (!splitscreen) - V_DrawMappedPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat, colormap); + { + if (actnum > 9) + V_DrawMappedPatch(ttlnumxpos + (V_LevelActNumWidth(actnum)/4) + ttlscroll, 104 - ttlscroll, 0, actpat, colormap); + else + V_DrawMappedPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat, colormap); + } V_DrawLevelActNum(ttlnumxpos + ttlscroll, 104, V_PERPLAYER, actnum); } diff --git a/src/v_video.c b/src/v_video.c index 3ce0e79f5..e8d121f9a 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2952,13 +2952,19 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits) } // Draw an act number for a level title -// Todo: actually draw two-digit numbers as two act num patches -void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num) +void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num) { - if (num < 0 || num > 19) + if (num < 0 || num > 99) return; // not supported - V_DrawScaledPatch(x, y, flags, ttlnum[num]); + while (num > 0) + { + if (num > 9) + V_DrawScaledPatch(x + (V_LevelActNumWidth(num) - V_LevelActNumWidth(num%10)), y, flags, ttlnum[num%10]); + else + V_DrawScaledPatch(x, y, flags, ttlnum[num]); + num = num/10; + } } // Write a string using the credit font @@ -3340,12 +3346,22 @@ INT32 V_LevelNameHeight(const char *string) // For ST_drawTitleCard // Returns the width of the act num patch -INT32 V_LevelActNumWidth(INT32 num) +INT32 V_LevelActNumWidth(UINT8 num) { - if (num < 0 || num > 19) + SHORT result = 0; + if (num > 99) return 0; // not a valid number - return SHORT(ttlnum[num]->width); + if (num == 0) + return SHORT(ttlnum[num]->width); + + while (num > 0) + { + result = result + SHORT(ttlnum[num%10]->width); + num = num/10; + } + + return result; } // From 0287c6956e03ed8a5e690b4aea1a0b53086127d2 Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 30 Apr 2020 17:12:52 +0200 Subject: [PATCH 09/15] Fix some errors and add some comments. Also, actnum is not an INT32. --- src/d_clisrv.c | 2 +- src/g_game.c | 2 +- src/m_menu.c | 2 +- src/st_stuff.c | 2 +- src/v_video.c | 18 ++++++++---------- src/v_video.h | 4 ++-- src/y_inter.c | 2 +- 7 files changed, 15 insertions(+), 17 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 43321d92d..ed0b8e528 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -1690,7 +1690,7 @@ static void CL_LoadReceivedSavegame(void) // load a base level if (P_LoadNetGame()) { - const INT32 actnum = mapheaderinfo[gamemap-1]->actnum; + const UINT8 actnum = mapheaderinfo[gamemap-1]->actnum; CONS_Printf(M_GetText("Map is now \"%s"), G_BuildMapName(gamemap)); if (strcmp(mapheaderinfo[gamemap-1]->lvlttl, "")) { diff --git a/src/g_game.c b/src/g_game.c index 92d71fbae..5bcf9f580 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4629,7 +4629,7 @@ char *G_BuildMapTitle(INT32 mapnum) { size_t len = 1; const char *zonetext = NULL; - const INT32 actnum = mapheaderinfo[mapnum-1]->actnum; + const UINT8 actnum = mapheaderinfo[mapnum-1]->actnum; len += strlen(mapheaderinfo[mapnum-1]->lvlttl); if (!(mapheaderinfo[mapnum-1]->levelflags & LF_NOZONE)) diff --git a/src/m_menu.c b/src/m_menu.c index 2977b432f..c221571c8 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5186,7 +5186,7 @@ static boolean M_PrepareLevelPlatter(INT32 gt, boolean nextmappick) { if (M_CanShowLevelOnPlatter(mapnum, gt)) { - const INT32 actnum = mapheaderinfo[mapnum]->actnum; + const UINT8 actnum = mapheaderinfo[mapnum]->actnum; const boolean headingisname = (fastcmp(mapheaderinfo[mapnum]->selectheading, mapheaderinfo[mapnum]->lvlttl)); const boolean wide = (mapheaderinfo[mapnum]->menuflags & LF2_WIDEICON); diff --git a/src/st_stuff.c b/src/st_stuff.c index 26f2c1774..9d819b147 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1383,7 +1383,7 @@ void ST_drawTitleCard(void) { if (!splitscreen) { - if (actnum > 9) + if (actnum > 9) // slightly offset the act diamond for two-digit act numbers V_DrawMappedPatch(ttlnumxpos + (V_LevelActNumWidth(actnum)/4) + ttlscroll, 104 - ttlscroll, 0, actpat, colormap); else V_DrawMappedPatch(ttlnumxpos + ttlscroll, 104 - ttlscroll, 0, actpat, colormap); diff --git a/src/v_video.c b/src/v_video.c index e8d121f9a..e17df995b 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -2954,12 +2954,12 @@ void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits) // Draw an act number for a level title void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num) { - if (num < 0 || num > 99) + if (num > 99) return; // not supported while (num > 0) { - if (num > 9) + if (num > 9) // if there are two digits, draw second digit first V_DrawScaledPatch(x + (V_LevelActNumWidth(num) - V_LevelActNumWidth(num%10)), y, flags, ttlnum[num%10]); else V_DrawScaledPatch(x, y, flags, ttlnum[num]); @@ -3345,19 +3345,17 @@ INT32 V_LevelNameHeight(const char *string) } // For ST_drawTitleCard -// Returns the width of the act num patch -INT32 V_LevelActNumWidth(UINT8 num) +// Returns the width of the act num patch(es) +INT16 V_LevelActNumWidth(UINT8 num) { - SHORT result = 0; - if (num > 99) - return 0; // not a valid number + INT16 result = 0; if (num == 0) - return SHORT(ttlnum[num]->width); + result = ttlnum[num]->width; - while (num > 0) + while (num > 0 && num <= 99) { - result = result + SHORT(ttlnum[num%10]->width); + result = result + ttlnum[num%10]->width; num = num/10; } diff --git a/src/v_video.h b/src/v_video.h index ed623a57f..664fa8995 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -238,12 +238,12 @@ void V_DrawRightAlignedSmallThinStringAtFixed(fixed_t x, fixed_t y, INT32 option // Draw tall nums, used for menu, HUD, intermission void V_DrawTallNum(INT32 x, INT32 y, INT32 flags, INT32 num); void V_DrawPaddedTallNum(INT32 x, INT32 y, INT32 flags, INT32 num, INT32 digits); -void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, INT32 num); +void V_DrawLevelActNum(INT32 x, INT32 y, INT32 flags, UINT8 num); // Find string width from lt_font chars INT32 V_LevelNameWidth(const char *string); INT32 V_LevelNameHeight(const char *string); -INT32 V_LevelActNumWidth(INT32 num); // act number width +INT16 V_LevelActNumWidth(UINT8 num); // act number width void V_DrawCreditString(fixed_t x, fixed_t y, INT32 option, const char *string); INT32 V_CreditStringWidth(const char *string); diff --git a/src/y_inter.c b/src/y_inter.c index f1764a816..a2628832f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -73,7 +73,7 @@ typedef union UINT32 score, total; // fake score, total UINT32 tics; // time - INT32 actnum; // act number being displayed + UINT8 actnum; // act number being displayed patch_t *ptotal; // TOTAL UINT8 gotlife; // Number of extra lives obtained } coop; From 4eb5f09c6f6fada395a94d69eb5e599ba69a017f Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 30 Apr 2020 23:41:06 +0200 Subject: [PATCH 10/15] Restore SHORT(). --- src/v_video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index e17df995b..1e550fe9d 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -3351,11 +3351,11 @@ INT16 V_LevelActNumWidth(UINT8 num) INT16 result = 0; if (num == 0) - result = ttlnum[num]->width; + result = SHORT(ttlnum[num]->width); while (num > 0 && num <= 99) { - result = result + ttlnum[num%10]->width; + result = result + SHORT(ttlnum[num%10]->width); num = num/10; } From 89cd756cd83e4a03a34d1f16da18142d8167d889 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:37:15 +0100 Subject: [PATCH 11/15] make savegamename in doomdef.h an extern, put the actual definition in d_main.c --- src/d_main.c | 2 ++ src/doomdef.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index 07e15aec4..07a7ecf91 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -125,6 +125,8 @@ boolean advancedemo; INT32 debugload = 0; #endif +char savegamename[256]; + char srb2home[256] = "."; char srb2path[256] = "."; boolean usehome = true; diff --git a/src/doomdef.h b/src/doomdef.h index 6112881fb..4b425dc72 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -458,7 +458,7 @@ void CONS_Debug(INT32 debugflags, const char *fmt, ...) FUNCDEBUG; // Things that used to be in dstrings.h #define SAVEGAMENAME "srb2sav" -char savegamename[256]; +extern char savegamename[256]; // m_misc.h #ifdef GETTEXT From dab212dc56936dd92a935d0c81003ff1d35ee2ee Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:40:51 +0100 Subject: [PATCH 12/15] turn all non-extern variables in s_sound.h into externs (and put their real definitions in the .c file) --- src/s_sound.c | 5 +++++ src/s_sound.h | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/s_sound.c b/src/s_sound.c index d108363eb..5ed9fd83a 100644 --- a/src/s_sound.c +++ b/src/s_sound.c @@ -134,6 +134,7 @@ consvar_t cv_playmusicifunfocused = {"playmusicifunfocused", "No", CV_SAVE, CV_Y consvar_t cv_playsoundsifunfocused = {"playsoundsifunfocused", "No", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL}; #ifdef HAVE_OPENMPT +openmpt_module *openmpt_mhandle = NULL; static CV_PossibleValue_t interpolationfilter_cons_t[] = {{0, "Default"}, {1, "None"}, {2, "Linear"}, {4, "Cubic"}, {8, "Windowed sinc"}, {0, NULL}}; consvar_t cv_modfilter = {"modfilter", "0", CV_SAVE|CV_CALL, interpolationfilter_cons_t, ModFilter_OnChange, 0, NULL, NULL, 0, 0, NULL}; #endif @@ -1910,6 +1911,10 @@ UINT32 S_GetMusicPosition(void) /// In this section: mazmazz doesn't know how to do dynamic arrays or struct pointers! /// ------------------------ +char music_stack_nextmusname[7]; +boolean music_stack_noposition = false; +UINT32 music_stack_fadeout = 0; +UINT32 music_stack_fadein = 0; static musicstack_t *music_stacks = NULL; static musicstack_t *last_music_stack = NULL; diff --git a/src/s_sound.h b/src/s_sound.h index 119722af4..3334fcb69 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -22,7 +22,7 @@ #ifdef HAVE_OPENMPT #include "libopenmpt/libopenmpt.h" -openmpt_module *openmpt_mhandle; +extern openmpt_module *openmpt_mhandle; #endif // mask used to indicate sound origin is player item pickup @@ -262,10 +262,10 @@ typedef struct musicstack_s struct musicstack_s *next; } musicstack_t; -char music_stack_nextmusname[7]; -boolean music_stack_noposition; -UINT32 music_stack_fadeout; -UINT32 music_stack_fadein; +extern char music_stack_nextmusname[7]; +extern boolean music_stack_noposition; +extern UINT32 music_stack_fadeout; +extern UINT32 music_stack_fadein; void S_SetStackAdjustmentStart(void); void S_AdjustMusicStackTics(void); @@ -333,7 +333,7 @@ void S_StopSoundByNum(sfxenum_t sfxnum); #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]; +extern const char *compat_special_music_slots[16]; #endif #endif From 064f4bcf349e9600552a0b99bd0fbfb3cbcf0958 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:42:16 +0100 Subject: [PATCH 13/15] added missing extern keyword for ms_RoomId in mserv.h (the definition is already in the .c file in this case) --- src/mserv.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mserv.h b/src/mserv.h index 6d91da643..5f9b8da5f 100644 --- a/src/mserv.h +++ b/src/mserv.h @@ -68,7 +68,7 @@ extern consvar_t cv_masterserver, cv_servername; // < 0 to not connect (usually -1) (offline mode) // == 0 to show all rooms, not a valid hosting room // anything else is whatever room the MS assigns to that number (online mode) -INT16 ms_RoomId; +extern INT16 ms_RoomId; const char *GetMasterServerPort(void); const char *GetMasterServerIP(void); From 8c88c3dbb4479f09f65df9dec3c8ef5ef09792e3 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 12 May 2020 18:43:49 +0100 Subject: [PATCH 14/15] added missing extern keyword for ntemprecords in doomstat.h (definition is in g_game.c) --- src/doomstat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomstat.h b/src/doomstat.h index 1ec03a86c..0c2f1e975 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -545,7 +545,7 @@ extern recorddata_t *mainrecords[NUMMAPS]; extern UINT8 mapvisited[NUMMAPS]; // Temporary holding place for nights data for the current map -nightsdata_t ntemprecords; +extern nightsdata_t ntemprecords; extern UINT32 token; ///< Number of tokens collected in a level extern UINT32 tokenlist; ///< List of tokens collected From 6a9543b1c251bc802f1be9380cfa4faa3887614c Mon Sep 17 00:00:00 2001 From: ZipperQR Date: Thu, 14 May 2020 03:35:46 +0300 Subject: [PATCH 15/15] no message --- src/p_enemy.c | 3 +-- src/p_user.c | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index e83e4cd4f..58f09cacb 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -13288,9 +13288,8 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing) if (!player) return true; - if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius){ + if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius) return true; - } if (thing->z + thing->height >= dustdevil->z && dustdevil->z + dustdevil->height >= thing->z) { fixed_t pos = thing->z - dustdevil->z; diff --git a/src/p_user.c b/src/p_user.c index 5770ae5d4..726177ff9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -12724,7 +12724,8 @@ void P_PlayerAfterThink(player_t *player) { mobj_t *mo = player->mo, *dustdevil = player->mo->tracer; - if (abs(mo->x - dustdevil->x) > dustdevil->radius || abs(mo->y - dustdevil->y) > dustdevil->radius){ + if (abs(mo->x - dustdevil->x) > dustdevil->radius || abs(mo->y - dustdevil->y) > dustdevil->radius) + { P_SetTarget(&player->mo->tracer, NULL); player->powers[pw_carry] = CR_NONE; break;