Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
bradharding committed Nov 27, 2023
1 parent d6d27a9 commit b2ec244
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/d_deh.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ static int linecount;
int dehcount = 0;
int dehmaptitlecount = 0;
bool dehacked = false;
bool norocketsmoke = false;
bool norockettrails = false;

extern byte *defined_codeptr_args;

Expand Down Expand Up @@ -3842,7 +3842,7 @@ static void deh_procText(DEHFILE *fpin, const char *line)
mobjinfo[MT_BARREL].frames = 2;
}
else if (i == SPR_RSMK)
norocketsmoke = true;
norockettrails = true;
}
}

Expand Down Expand Up @@ -4140,7 +4140,7 @@ void deh_procBexSprites(DEHFILE *fpin, const char *line)
mobjinfo[MT_BARREL].frames = 2;
}
else if (match == SPR_RSMK)
norocketsmoke = true;
norockettrails = true;

sprnames[match] = M_StringDuplicate(candidate);
}
Expand Down Expand Up @@ -4456,7 +4456,7 @@ void D_PostProcessDeh(void)
states[i].args[j] = bexptr_match->default_args[j];
}

norocketsmoke |= (!states[S_TRAIL].dehacked && !states[S_TRAIL2].dehacked
norockettrails |= (!states[S_TRAIL].dehacked && !states[S_TRAIL2].dehacked
&& !states[S_TRAIL3].dehacked && !states[S_TRAIL4].dehacked);

dsdh_FreeTables();
Expand Down
2 changes: 1 addition & 1 deletion src/d_deh.h
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ extern const int nummapnamesn;

extern int dehcount;
extern int dehmaptitlecount;
extern bool norocketsmoke;
extern bool norockettrails;

void D_ProcessDehFile(char *filename, int lumpnum, bool autoloaded);
void D_BuildBEXTables(void);
Expand Down
2 changes: 1 addition & 1 deletion src/p_enemy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,7 @@ void A_Tracer(mobj_t *actor, player_t *player, pspdef_t *psp)
// spawn a puff of smoke behind the homing rocket
if (!doom4vanilla)
{
if (r_rockettrails && !PUFFA0 && !norocketsmoke && !incompatiblepalette)
if (r_rockettrails && !PUFFA0 && !norockettrails && !incompatiblepalette)
actor->flags2 |= MF2_SMOKETRAIL;
else
P_SpawnPuff(actor->x, actor->y, actor->z, actor->angle);
Expand Down
2 changes: 1 addition & 1 deletion src/p_mobj.c
Original file line number Diff line number Diff line change
Expand Up @@ -1740,7 +1740,7 @@ mobj_t *P_SpawnPlayerMissile(mobj_t *source, mobjtype_t type)
P_NoiseAlert(source);

if (type == MT_ROCKET && r_rockettrails && !(th->flags & MF_BOUNCES)
&& viewplayer->readyweapon == wp_missile && !chex && !hacx && !norocketsmoke && !incompatiblepalette)
&& viewplayer->readyweapon == wp_missile && !chex && !hacx && !norockettrails && !incompatiblepalette)
{
th->flags2 |= MF2_SMOKETRAIL;
th->pursuecount = 0;
Expand Down
8 changes: 4 additions & 4 deletions src/v_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -1758,14 +1758,14 @@ char lbmpath2[MAX_PATH];
static bool V_SavePNG(SDL_Window *sdlwindow, SDL_Renderer *sdlrenderer, const char *path)
{
bool result = false;
int width;
int height;
int width = 0;
int height = 0;
SDL_Surface *screenshot;

SDL_GetWindowSize(sdlwindow, &width, &height);

if ((screenshot = SDL_CreateRGBSurface(0, (vid_widescreen ? width : height * 4 / 3), height,
bpp, rmask, gmask, bmask, amask)))
if (width && height && (screenshot = SDL_CreateRGBSurface(0, (vid_widescreen ? width : height * 4 / 3),
height, bpp, rmask, gmask, bmask, amask)))
{
if (!SDL_RenderReadPixels(sdlrenderer, NULL, 0, screenshot->pixels, screenshot->pitch))
result = !IMG_SavePNG(screenshot, path);
Expand Down

0 comments on commit b2ec244

Please sign in to comment.