Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Sep 11, 2024
1 parent b91f01b commit c53dc56
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 34 deletions.
4 changes: 2 additions & 2 deletions src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -2847,13 +2847,13 @@ static void deh_procThing(DEHFILE *fpin, const char *line)
if (!gibhealth && mobjinfo[indexnum].spawnhealth && !mobjinfo[indexnum].gibhealth)
mobjinfo[indexnum].gibhealth = -mobjinfo[indexnum].spawnhealth;

// [BH] Clip feet, cast shadow if no "Retro bits" set.
// [BH] Clip feet, cast shadow, don't bob if no "Retro bits" set.
if (!mobjinfo[indexnum].flags2)
{
mobjinfo[indexnum].flags2 |= MF2_FOOTCLIP;

if (mobjinfo[indexnum].flags & MF_SHOOTABLE)
mobjinfo[indexnum].flags2 |= MF2_CASTSHADOW;
mobjinfo[indexnum].flags2 |= (MF2_CASTSHADOW | MF2_NOLIQUIDBOB);
}

// [BH] Disable bobbing and translucency if thing no longer a pickup
Expand Down
21 changes: 7 additions & 14 deletions src/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,7 @@ void I_SetPalette(const byte *playpal)
colors[i].r = BETWEEN(0, (int)((128 + (r - 128) * contrast) * brightness), 255) & ~3;
colors[i].g = BETWEEN(0, (int)((128 + (g - 128) * contrast) * brightness), 255) & ~3;
colors[i].b = BETWEEN(0, (int)((128 + (b - 128) * contrast) * brightness), 255) & ~3;
colors[i].a = 0xFF;
}

SDL_SetPaletteColors(palette, colors, 0, 256);
Expand Down Expand Up @@ -1065,7 +1066,6 @@ static void GetDisplays(void)
bool I_CreateExternalAutomap(void)
{
const char *displayname;
uint32_t pixelformat;

mapscreen = *screens;
mapblitfunc = &nullfunc;
Expand Down Expand Up @@ -1117,26 +1117,23 @@ bool I_CreateExternalAutomap(void)
if (!(mapsurface = SDL_CreateRGBSurface(0, MAPWIDTH, MAPHEIGHT, 8, 0, 0, 0, 0)))
I_SDLError("SDL_CreateRGBSurface", -1);

if ((pixelformat = SDL_GetWindowPixelFormat(mapwindow)) == SDL_PIXELFORMAT_UNKNOWN)
I_SDLError("SDL_GetWindowPixelFormat", -1);

if (!(mapbuffer = SDL_CreateRGBSurfaceWithFormatFrom(NULL, MAPWIDTH, MAPHEIGHT, 8, 0, SDL_PIXELFORMAT_ARGB8888)))
if (!(mapbuffer = SDL_CreateRGBSurfaceWithFormatFrom(NULL, MAPWIDTH, MAPHEIGHT, 0, 0, SDL_PIXELFORMAT_ARGB8888)))
I_SDLError("SDL_CreateRGBSurfaceWithFormatFrom", -1);

SDL_FillRect(mapbuffer, NULL, BLACK);

if (nearestlinear)
SDL_SetHintWithPriority(SDL_HINT_RENDER_SCALE_QUALITY, vid_scalefilter_nearest, SDL_HINT_OVERRIDE);

if (!(maptexture = SDL_CreateTexture(maprenderer, pixelformat, SDL_TEXTUREACCESS_STREAMING,
if (!(maptexture = SDL_CreateTexture(maprenderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING,
MAPWIDTH, MAPHEIGHT)))
I_SDLError("SDL_CreateTexture", -2);

if (nearestlinear)
{
SDL_SetHintWithPriority(SDL_HINT_RENDER_SCALE_QUALITY, vid_scalefilter_linear, SDL_HINT_OVERRIDE);

if (!(maptexture_upscaled = SDL_CreateTexture(maprenderer, pixelformat,
if (!(maptexture_upscaled = SDL_CreateTexture(maprenderer, SDL_PIXELFORMAT_ARGB8888,
SDL_TEXTUREACCESS_TARGET, upscaledwidth * MAPWIDTH, upscaledheight * MAPHEIGHT)))
I_SDLError("SDL_CreateTexture", -2);

Expand Down Expand Up @@ -1331,7 +1328,6 @@ static void SetVideoMode(const bool createwindow, const bool output)
SDL_RendererInfo rendererinfo;
const char *displayname = SDL_GetDisplayName((displayindex = vid_display - 1));
bool instead = false;
uint32_t pixelformat;

if (displayindex >= numdisplays)
{
Expand Down Expand Up @@ -1751,25 +1747,22 @@ static void SetVideoMode(const bool createwindow, const bool output)

screens[0] = surface->pixels;

if ((pixelformat = SDL_GetWindowPixelFormat(window)) == SDL_PIXELFORMAT_UNKNOWN)
I_SDLError("SDL_GetWindowPixelFormat", -1);

if (!(buffer = SDL_CreateRGBSurfaceWithFormatFrom(NULL, SCREENWIDTH, SCREENHEIGHT, 8, 0, SDL_PIXELFORMAT_ARGB8888)))
if (!(buffer = SDL_CreateRGBSurfaceWithFormatFrom(NULL, SCREENWIDTH, SCREENHEIGHT, 0, 0, SDL_PIXELFORMAT_ARGB8888)))
I_SDLError("SDL_CreateRGBSurfaceWithFormatFrom", -1);

SDL_FillRect(buffer, NULL, BLACK);

if (nearestlinear)
SDL_SetHintWithPriority(SDL_HINT_RENDER_SCALE_QUALITY, vid_scalefilter_nearest, SDL_HINT_OVERRIDE);

if (!(texture = SDL_CreateTexture(renderer, pixelformat, SDL_TEXTUREACCESS_STREAMING, SCREENWIDTH, SCREENHEIGHT)))
if (!(texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, SCREENWIDTH, SCREENHEIGHT)))
I_SDLError("SDL_CreateTexture", -1);

if (nearestlinear)
{
SDL_SetHintWithPriority(SDL_HINT_RENDER_SCALE_QUALITY, vid_scalefilter_linear, SDL_HINT_OVERRIDE);

if (!(texture_upscaled = SDL_CreateTexture(renderer, pixelformat, SDL_TEXTUREACCESS_TARGET,
if (!(texture_upscaled = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_TARGET,
upscaledwidth * SCREENWIDTH, upscaledheight * SCREENHEIGHT)))
I_SDLError("SDL_CreateTexture", -2);
}
Expand Down
25 changes: 10 additions & 15 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -2133,20 +2133,6 @@ static void M_ChangeMessages(int choice)
//
static bool endinggame;

void M_EndingGame(void)
{
endinggame = true;

if (gamemission == pack_nerve)
gamemission = doom2;

if (!M_StringCompare(console[numconsolestrings - 1].string, "endgame"))
C_Input("endgame");

C_AddConsoleDivider();
D_StartTitle(1);
}

static void M_EndGameResponse(int key)
{
messagetoprint = false;
Expand Down Expand Up @@ -2174,7 +2160,16 @@ static void M_EndGameResponse(int key)
S_StartSound(NULL, sfx_swtchx);
MainDef.laston = 0;
st_palette = 0;
M_EndingGame();
endinggame = true;

if (gamemission == pack_nerve)
gamemission = doom2;

if (!M_StringCompare(console[numconsolestrings - 1].string, "endgame"))
C_Input("endgame");

C_AddConsoleDivider();
D_StartTitle(1);
}

void M_EndGame(int choice)
Expand Down
3 changes: 0 additions & 3 deletions src/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,9 +710,6 @@ static void R_InitSpriteLumps(void)
mobjinfo[MT_BANSHEE].flags |= MF_NOBLOOD;
mobjinfo[MT_VASSAGO].flags |= MF_NOBLOOD;

for (int i = MT_GHOUL; i <= MT_TYRANTBOSS2; i++)
mobjinfo[i].flags2 |= MF2_NOLIQUIDBOB;

M_StringCopy(mobjinfo[MT_EXTRA06].name1, "tyrant", sizeof(mobjinfo[0].name1));
M_StringCopy(mobjinfo[MT_EXTRA06].plural1, "tyrants", sizeof(mobjinfo[0].plural1));
M_StringCopy(mobjinfo[MT_EXTRA07].name1, "tyrant", sizeof(mobjinfo[0].name1));
Expand Down

0 comments on commit c53dc56

Please sign in to comment.