Skip to content

Commit

Permalink
Continued the reorganisation of the various texture resource data str…
Browse files Browse the repository at this point in the history
…ucts, moving things into material_t where appropriate and reworking interfaces accordingly.

* GL texture info (OGL name, masked property and average color) is now held in material_t
* Redesigned how DOOM textures are handled. We now store texture definitions (basically the content of PNAMES) and have no need for texture_t, which has been removed.
* Reimplemented R_InitTextures, separating the reading of PNAMES into a subroutine and redesigning the algorithm used to build the texture definition list (and subsequently the materials) to get rid of the noticeable pause during startup.
* rendpspriteparams_t nows takes a sprite number rather than a lump num.
* The additional offsets used with "upscaled and sharpened" patches is now stored in patch_t
* GL texture mag mode and aniso filter are now set each time a texture is bound with GL_BindTexture.
* Sky textures are now handled completely separately from regular textures. The skytop colors have been moved into skytexture_t
* Implemented a hashing schema for RAW textures.
* If available, enable multisampling in Rend_RenderMap.
* If available, take advantage of non-power-of-two textures (if mip maps are not required) rather than rescaling.
* There is no need to do a full texreset when changing the mag mode.
* Got rid of the ddTextures array as it is no longer needed.
* Fixed issue with hires skys where the top line color was being determined using the lowres version instead.
* Fixed bug in calculation to determine halo visual offsets in LO_AddLuminous
  • Loading branch information
danij committed Jun 26, 2008
1 parent 2dd96e1 commit 0bc47ed
Show file tree
Hide file tree
Showing 20 changed files with 1,495 additions and 1,526 deletions.
41 changes: 17 additions & 24 deletions doomsday/engine/portable/include/gl_texmanager.h
Expand Up @@ -70,7 +70,7 @@ extern int useSmartFilter;
extern byte loadExtAlways;
extern int texMagMode;
extern int upscaleAndSharpenPatches;

extern int glmode[6];
extern unsigned int curTex;
extern int palLump;

Expand All @@ -88,13 +88,13 @@ void GL_DoUpdateTexParams(cvar_t *unused);
int GL_InitPalettedTexture(void);
void GL_ResetLumpTexData(void);

void GL_BindTexture(DGLuint texname);
void GL_BindTexture(DGLuint texname, int magMode);
void GL_TextureFilterMode(int target, int parm);
DGLuint GL_BindTexPatch(struct patch_s *p);
DGLuint GL_GetPatchOtherPart(lumpnum_t lump, texinfo_t **info);
DGLuint GL_BindTexPatch(struct patchtex_s *p);
DGLuint GL_GetPatchOtherPart(lumpnum_t lump);
void GL_SetPatch(lumpnum_t lump, int wrapS, int wrapT); // No mipmaps are generated.
DGLuint GL_BindTexRaw(struct rawtex_s *r);
DGLuint GL_GetRawOtherPart(lumpnum_t lump, texinfo_t **info);
DGLuint GL_GetRawOtherPart(lumpnum_t lump);
void GL_SetRawTex(lumpnum_t lump, int part);

void GL_LowRes(void);
Expand All @@ -104,7 +104,7 @@ byte *GL_LoadImage(image_t *img, const char *imagefn,
byte *GL_LoadImageCK(image_t *img, const char *imagefn,
boolean useModelPath);
void GL_DestroyImage(image_t *img);
byte *GL_LoadTexture(image_t *img, char *name);
byte *GL_LoadTexture(image_t *img, const char *name);
DGLuint GL_LoadGraphics(const char *name, gfxmode_t mode);
DGLuint GL_LoadGraphics2(resourceclass_t resClass, const char *name,
gfxmode_t mode, int useMipmap, boolean clamped,
Expand All @@ -126,21 +126,17 @@ DGLuint GL_UploadTexture(byte *data, int width, int height,
int wrapS, int wrapT, int otherFlags);
DGLuint GL_UploadTexture2(texturecontent_t *content);

DGLuint GL_GetMaterialInfo2(const struct material_s *mat, boolean translate, texinfo_t **info);
DGLuint GL_PrepareMaterial(struct material_s *mat, texinfo_t **info);
DGLuint GL_PrepareMaterial2(struct material_s *mat, texinfo_t **info);

DGLuint GL_PrepareSky(const struct material_s *mat, boolean zeroMask, texinfo_t **info);

DGLuint GL_GetPatchInfo(int idx, boolean part2, texinfo_t **info);
DGLuint GL_GetRawTexInfo(lumpnum_t lump, boolean part2, texinfo_t **texinfo);
DGLuint GL_PreparePatch(lumpnum_t lump, texinfo_t **info);
DGLuint GL_PrepareRawTex(lumpnum_t lump, boolean part2, texinfo_t **info);
DGLuint GL_PrepareLSTexture(lightingtexid_t which, texinfo_t **info);
DGLuint GL_PrepareFlareTexture(flaretexid_t flare, texinfo_t **info);
void GL_BufferSkyTexture(int idx, byte **outbuffer, int *width,
int *height, boolean zeroMask);
unsigned int GL_PreparePSprite(int pnum, texinfo_t **info);
DGLuint GL_PrepareMaterial(struct material_s* mat);
DGLuint GL_PrepareMaterial2(struct material_s* mat);

DGLuint GL_PrepareSky(struct skytexture_s* skyTex, boolean zeroMask);

DGLuint GL_GetRawTexInfo(lumpnum_t lump, boolean part2);
DGLuint GL_PreparePatch(lumpnum_t lump);
DGLuint GL_PrepareRawTex(lumpnum_t lump, boolean part2);
DGLuint GL_PrepareLSTexture(lightingtexid_t which);
DGLuint GL_PrepareFlareTexture(flaretexid_t flare);
unsigned int GL_PreparePSprite(int pnum);
byte *GL_GetPalette(void);
byte *GL_GetPal18to8(void);

Expand All @@ -152,13 +148,10 @@ void GL_SetTranslatedSprite(int pnum, int tmap, int tclass);
void GL_NewSplitTex(lumpnum_t lump, DGLuint part2name);
void GL_SetNoTexture(void);
void GL_UpdateTexParams(int mipmode);
void GL_UpdateRawScreenParams(int smoothing);
void GL_DeleteRawImages(void);
void GL_DeleteHUDSprite(int spritelump);

boolean GL_IsColorKeyed(const char *path);
void GL_GetSkyTopColor(int texidx, float *rgb);
void GL_GetSpriteColorf(int pnum, float *rgb);

// Load the skin texture and prepare it for rendering.
unsigned int GL_PrepareSkin(skintex_t *stp, boolean allowTexComp);
Expand Down

0 comments on commit 0bc47ed

Please sign in to comment.