From b3939ef2ea3c96adc7f0e5ce386711e6cb7a45b6 Mon Sep 17 00:00:00 2001 From: skyjake Date: Sun, 13 Jul 2003 14:32:52 +0000 Subject: [PATCH] Added R_GetPatchInfo() --- doomsday/Include/doomsday.h | 1 + doomsday/Include/r_things.h | 1 + doomsday/Src/Doomsday.def | 3 ++- doomsday/Src/r_things.c | 15 +++++++++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/doomsday/Include/doomsday.h b/doomsday/Include/doomsday.h index fef51cb64e..238c1cee3a 100644 --- a/doomsday/Include/doomsday.h +++ b/doomsday/Include/doomsday.h @@ -152,6 +152,7 @@ void R_RenderPlayerView(ddplayer_t *player); void R_ViewWindow(int x, int y, int w, int h); void R_SetBorderGfx(char *lumps[9]); void R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *sprinfo); +void R_GetPatchInfo(int lump, spriteinfo_t *info); int R_FlatNumForName(char *name); int R_CheckTextureNumForName(char *name); int R_TextureNumForName(char *name); diff --git a/doomsday/Include/r_things.h b/doomsday/Include/r_things.h index 5419e7af14..70290ea3c3 100644 --- a/doomsday/Include/r_things.h +++ b/doomsday/Include/r_things.h @@ -112,6 +112,7 @@ extern vissprite_t vispsprites[DDMAXPSPRITES]; extern vissprite_t vsprsortedhead; void R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *sprinfo); +void R_GetPatchInfo(int lump, spriteinfo_t *info); int R_VisualRadius(mobj_t *mo); fixed_t R_GetBobOffset(mobj_t *mo); void R_ProjectSprite(mobj_t *thing); diff --git a/doomsday/Src/Doomsday.def b/doomsday/Src/Doomsday.def index e587b11815..42d83a42ee 100644 --- a/doomsday/Src/Doomsday.def +++ b/doomsday/Src/Doomsday.def @@ -2,7 +2,7 @@ NAME "DOOMSDAY" DESCRIPTION "The Doomsday Engine" ; Highest ordinal is currently -; --> 236 <-- +; --> 237 <-- ; Other available ordinals: 158, 175 @@ -147,6 +147,7 @@ EXPORTS R_ViewWindow @92 NONAME R_SetBorderGfx @93 NONAME R_GetSpriteInfo @94 NONAME + R_GetPatchInfo @237 NONAME R_FlatNumForName @95 NONAME R_CheckTextureNumForName @96 NONAME R_TextureNumForName @97 NONAME diff --git a/doomsday/Src/r_things.c b/doomsday/Src/r_things.c index 9ea5c3c45a..414d48f729 100644 --- a/doomsday/Src/r_things.c +++ b/doomsday/Src/r_things.c @@ -373,6 +373,21 @@ void R_GetSpriteInfo(int sprite, int frame, spriteinfo_t *sprinfo) sprinfo->height = sprlump->height; } +//=========================================================================== +// R_GetPatchInfo +//=========================================================================== +void R_GetPatchInfo(int lump, spriteinfo_t *info) +{ + patch_t *patch = W_CacheLumpNum(lump, PU_CACHE); + + memset(info, 0, sizeof(*info)); + info->lump = info->realLump = lump; + info->width = patch->width; + info->height = patch->height; + info->topOffset = patch->topoffset; + info->offset = patch->leftoffset; +} + //=========================================================================== // R_VisualRadius // Returns the radius of the mobj as it would visually appear to be.