flexible array stuff for columnofs

hopefully this fixes some crashes or smth
This commit is contained in:
Alug committed 2024-06-01 16:29:55 +02:00
1 parent b01a2836ea
commit 37a394ebaa
3 files changed
+14 -19

No files matched your search

+1 -1
View File
@@ -648,7 +648,7 @@ typedef struct
INT16 height;
INT16 leftoffset; // pixels to the left of origin
INT16 topoffset; // pixels below the origin
INT32 columnofs[8]; // only [width] used
INT32 columnofs[]; // only [width] used
// the [0] is &columnofs[width]
}ATTRPACK patch_t;
+12 -16
View File
@@ -772,6 +772,17 @@ static UINT16 GetPatchPixel(patch_t *patch, INT32 x, INT32 y, boolean flip)
return 0xFF00;
}
#ifdef HWRENDER
static patch_t *R_CreateHardwarePatch(patch_t *patch)
{
GLPatch_t *grPatch = Z_Calloc(sizeof(GLPatch_t), PU_HWRPATCHINFO, NULL);
grPatch->mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_HWRPATCHINFO, NULL);
grPatch->rawpatch = patch;
HWR_MakePatch(patch, grPatch, grPatch->mipmap, false);
return (patch_t *)grPatch;
}
#endif
#ifdef ROTSPRITE
//
// R_GetRollAngle
@@ -792,11 +803,7 @@ INT32 R_GetRollAngle(angle_t rollangle)
return ra;
}
patch_t *Patch_GetRotatedSprite(
spriteframe_t *sprite,
size_t frame, size_t spriteangle,
boolean flip, boolean adjustfeet,
void *info, INT32 rotationangle)
patch_t *Patch_GetRotatedSprite(spriteframe_t *sprite, size_t frame, size_t spriteangle, boolean flip, boolean adjustfeet, void *info, INT32 rotationangle)
{
rotsprite_t *rotsprite;
spriteinfo_t *sprinfo = (spriteinfo_t *)info;
@@ -882,17 +889,6 @@ static void RotatedPatch_CalculateDimensions(
*newheight = max(height, max(h1, h2));
}
#ifdef HWRENDER
static patch_t *R_CreateHardwarePatch(patch_t *patch)
{
GLPatch_t *grPatch = Z_Calloc(sizeof(GLPatch_t), PU_HWRPATCHINFO, NULL);
grPatch->mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_HWRPATCHINFO, NULL);
grPatch->rawpatch = patch;
HWR_MakePatch(patch, grPatch, grPatch->mipmap, false);
return (patch_t *)grPatch;
}
#endif
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip)
{
UINT32 i;
+1 -2
View File
@@ -1370,8 +1370,7 @@ static void R_ProjectSprite(mobj_t *thing)
rollsum += thing->rollangle;
rollangle = R_GetRollAngle(rollsum);
rotsprite = Patch_GetRotatedSprite(
sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
if (rotsprite != NULL)
{