From a11227b15a2ed5e8ef595271d07e678d52ff044d Mon Sep 17 00:00:00 2001 From: Alug Date: Wed, 8 Jan 2025 18:23:25 +0100 Subject: [PATCH] fix postimg data types mismatch also remove the "postimgflag_t" typedef since its useless and use smoler type for everything we dont need much space lol --- src/doomtype.h | 9 --------- src/p_local.h | 13 ++++++++++++- src/p_mobj.c | 2 +- src/p_user.c | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/doomtype.h b/src/doomtype.h index 429eba77e..116d5cdfb 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -342,15 +342,6 @@ union FColorRGBA } ATTRPACK; typedef union FColorRGBA RGBA_t; -typedef enum -{ - POSTIMG_WATER = 1, // Underwater screen effect. - POSTIMG_MOTION = 1<<1, // Unused motion blur effect. - POSTIMG_FLIP = 1<<2, // Flipcam screen effect. - POSTIMG_HEAT = 1<<3, // Heatwave screen effect. - POSTIMG_MIRROR = 1<<4, // encore screen effect. -} postimgflag_t; - typedef UINT32 lumpnum_t; // 16 : 16 unsigned long (wad num: lump num) #define LUMPERROR UINT32_MAX diff --git a/src/p_local.h b/src/p_local.h index d80223531..318f99f87 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -76,6 +76,7 @@ void P_UnlinkThinker(thinker_t *thinker); // // P_USER // + typedef struct camera_s { boolean chase; @@ -125,9 +126,19 @@ typedef struct camera_s fixed_t pan; // postproccess effects - UINT16 postimg; + UINT8 postimg; } camera_t; +// post process types +enum +{ + POSTIMG_WATER = 1, // Underwater screen effect. + POSTIMG_MOTION = 1<<1, // Unused motion blur effect. + POSTIMG_FLIP = 1<<2, // Flipcam screen effect. + POSTIMG_HEAT = 1<<3, // Heatwave screen effect. + POSTIMG_MIRROR = 1<<4, // encore screen effect. +}; + extern camera_t camera[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_cam_dist[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_cam_still[MAXSPLITSCREENPLAYERS]; diff --git a/src/p_mobj.c b/src/p_mobj.c index 2b120b99c..dd3f62169 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3235,7 +3235,7 @@ void P_DestroyRobots(void) void P_CalcChasePostImg(player_t *player, camera_t *thiscam) { const boolean flipcam = (player->pflags & PF_FLIPCAM && !(player->pflags & PF_NIGHTSMODE) && player->mo->eflags & MFE_VERTICALFLIP); - UINT16 postimgtype = 0; + UINT8 postimgtype = 0; if (encoremode) postimgtype |= POSTIMG_MIRROR; diff --git a/src/p_user.c b/src/p_user.c index 0675808b0..52399e56f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4252,7 +4252,7 @@ static boolean P_CameraCheckWaterFirstperson(player_t *player, sector_t *sector, static void P_CalcPostImg(player_t *player, camera_t *thiscam) { sector_t *sector = NULL; - INT16 postimgtype = 0; + UINT8 postimgtype = 0; //INT32 *param; fixed_t pviewheight = 0;