diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85cda35f665e6a6f4bf0293f107e0e3740429107..17c565398d353c09ef24c21b1668616dfdafe7af 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -412,7 +412,6 @@ if(${SRB2_CONFIG_HWRENDER}) ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_defs.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_dll.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_drv.h - ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_glide.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_glob.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_light.h ${CMAKE_CURRENT_SOURCE_DIR}/hardware/hw_main.h diff --git a/src/Makefile b/src/Makefile index 6f7927077b61f69ffd0a4bb3cd42f17d556761cb..25f486a3f57a274953d637af414b4ae8eded0edd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -732,8 +732,8 @@ ifdef SDL ifdef MINGW $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \ doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \ - command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \ - hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ + command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \ + hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \ am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \ p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h @@ -741,8 +741,8 @@ $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h else $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \ doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \ - command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \ - hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ + command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \ + hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \ am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \ p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h @@ -895,8 +895,8 @@ ifndef SDL ifndef NOHW $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h \ doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \ - command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \ - hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ + command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \ + hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \ am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \ p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h @@ -904,8 +904,8 @@ $(OBJDIR)/r_opengl.o: hardware/r_opengl/r_opengl.c hardware/r_opengl/r_opengl.h $(OBJDIR)/ogl_win.o: hardware/r_opengl/ogl_win.c hardware/r_opengl/r_opengl.h \ doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \ - command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \ - hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ + command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \ + hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \ am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \ p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h @@ -913,8 +913,8 @@ $(OBJDIR)/ogl_win.o: hardware/r_opengl/ogl_win.c hardware/r_opengl/r_opengl.h \ $(OBJDIR)/r_minigl.o: hardware/r_minigl/r_minigl.c hardware/r_opengl/r_opengl.h \ doomdef.h doomtype.h g_state.h m_swap.h hardware/hw_drv.h screen.h \ - command.h hardware/hw_data.h hardware/hw_glide.h hardware/hw_defs.h \ - hardware/hw_md2.h hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ + command.h hardware/hw_data.h hardware/hw_defs.h hardware/hw_md2.h \ + hardware/hw_glob.h hardware/hw_main.h hardware/hw_clip.h \ hardware/hw_md2load.h hardware/hw_md3load.h hardware/hw_model.h hardware/u_list.h \ am_map.h d_event.h d_player.h p_pspr.h m_fixed.h tables.h info.h d_think.h \ p_mobj.h doomdata.h d_ticcmd.h r_defs.h hardware/hw_dll.h diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 8d1d71c8e36b6ef22bee39f416e064fb18bca9ca..161a30cc56cbe512bae63d1ee76f77bd76246263 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -25,10 +25,6 @@ #include "../v_video.h" #include "../r_draw.h" -//Hurdler: 25/04/2000: used for new colormap code in hardware mode -//static UINT8 *gr_colormap = NULL; // by default it must be NULL ! (because colormap tables are not initialized) -boolean firetranslucent = false; - // Values set after a call to HWR_ResizeBlock() static INT32 blocksize, blockwidth, blockheight; @@ -133,11 +129,7 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap, count--; texel = source[yfrac>>FRACBITS]; - - if (firetranslucent && (transtables[(texel<<8)+0x40000]!=texel)) - alpha = 0x80; - else - alpha = 0xff; + alpha = 0xff; //Hurdler: not perfect, but better than holes if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX && (mipmap->flags & TF_CHROMAKEYED)) @@ -175,16 +167,16 @@ static void HWR_DrawPatchInCache(GLMipmap_t *mipmap, } -// resize the patch to be 3dfx compliant +// resize the patch // set : blocksize = blockwidth * blockheight (no bpp used) // blockwidth // blockheight //note : 8bit (1 byte per pixel) palettized format static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight, - GrTexInfo *grInfo) + GLTexInfo *grInfo) { // Build the full textures from patches. - static const GrLOD_t gr_lods[9] = + static const GLlod_t gr_lods[9] = { GR_LOD_LOG2_256, GR_LOD_LOG2_128, @@ -199,7 +191,7 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight, typedef struct { - GrAspectRatio_t aspect; + GLAspectRatio_t aspect; float max_s; float max_t; } booring_aspect_t; @@ -220,41 +212,21 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight, INT32 j,k; INT32 max,min; - // find a power of 2 width/height - if (cv_grrounddown.value) - { - blockwidth = 256; - while (originalwidth < blockwidth) - blockwidth >>= 1; - if (blockwidth < 1) - I_Error("3D GenerateTexture : too small"); - - blockheight = 256; - while (originalheight < blockheight) - blockheight >>= 1; - if (blockheight < 1) - I_Error("3D GenerateTexture : too small"); - } - else - { - //size up to nearest power of 2 - blockwidth = 1; - while (blockwidth < originalwidth) - blockwidth <<= 1; - // scale down the original graphics to fit in 256 - if (blockwidth > 2048) - blockwidth = 2048; - //I_Error("3D GenerateTexture : too big"); - - //size up to nearest power of 2 - blockheight = 1; - while (blockheight < originalheight) - blockheight <<= 1; - // scale down the original graphics to fit in 256 - if (blockheight > 2048) - blockheight = 2048; - //I_Error("3D GenerateTexture : too big"); - } + // size up to nearest power of 2 + blockwidth = 1; + while (blockwidth < originalwidth) + blockwidth <<= 1; + // scale down the original graphics to fit in 2048 + if (blockwidth > 2048) + blockwidth = 2048; + + // size up to nearest power of 2 + blockheight = 1; + while (blockheight < originalheight) + blockheight <<= 1; + // scale down the original graphics to fit in 2048 + if (blockheight > 2048) + blockheight = 2048; // do the boring LOD stuff.. blech! if (blockwidth >= blockheight) @@ -424,7 +396,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex) } // patch may be NULL if grMipmap has been initialised already and makebitmap is false -void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap) +void HWR_MakePatch (patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap) { INT32 newwidth, newheight; @@ -439,8 +411,8 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm grPatch->leftoffset = SHORT(patch->leftoffset); grPatch->topoffset = SHORT(patch->topoffset); - // find the good 3dfx size (boring spec) - HWR_ResizeBlock (SHORT(patch->width), SHORT(patch->height), &grMipmap->grInfo); + // resize patch + HWR_ResizeBlock(SHORT(patch->width), SHORT(patch->height), &grMipmap->grInfo); grMipmap->width = (UINT16)blockwidth; grMipmap->height = (UINT16)blockheight; @@ -459,23 +431,12 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm Z_Free(grMipmap->grInfo.data); grMipmap->grInfo.data = NULL; - // if rounddown, rounddown patches as well as textures - if (cv_grrounddown.value) - { - newwidth = blockwidth; - newheight = blockheight; - } - else - { - // no rounddown, do not size up patches, so they don't look 'scaled' - newwidth = min(grPatch->width, blockwidth); - newheight = min(grPatch->height, blockheight); - } + newwidth = min(grPatch->width, blockwidth); + newheight = min(grPatch->height, blockheight); if (makebitmap) { MakeBlock(grMipmap); - HWR_DrawPatchInCache(grMipmap, newwidth, newheight, blockwidth*format2bpp[grMipmap->grInfo.format], @@ -489,7 +450,6 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm grPatch->max_t = (float)newheight / (float)blockheight; } - // ================================================= // CACHING HANDLING // ================================================= @@ -556,7 +516,7 @@ void HWR_PrepLevelCache(size_t pnumtextures) gr_numtextures = pnumtextures; gr_textures = calloc(pnumtextures, sizeof (*gr_textures)); if (gr_textures == NULL) - I_Error("3D can't alloc gr_textures"); + I_Error("HWR_PrepLevelCache: can't alloc gr_textures"); } void HWR_SetPalette(RGBA_t *palette) @@ -587,7 +547,7 @@ GLTexture_t *HWR_GetTexture(INT32 tex) GLTexture_t *grtex; #ifdef PARANOIA if ((unsigned)tex >= gr_numtextures) - I_Error(" HWR_GetTexture: tex >= numtextures\n"); + I_Error("HWR_GetTexture: tex >= numtextures\n"); #endif grtex = &gr_textures[tex]; @@ -695,12 +655,12 @@ void HWR_GetPatch(GLPatch_t *gpatch) { // load the software patch, PU_STATIC or the Z_Malloc for hardware patch will // flush the software patch before the conversion! oh yeah I suffered - patch_t *ptr = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC); - HWR_MakePatch(ptr, gpatch, &gpatch->mipmap, true); + patch_t *patch = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC); + HWR_MakePatch(patch, gpatch, &gpatch->mipmap, true); // this is inefficient.. but the hardware patch in heap is purgeable so it should // not fragment memory, and besides the REAL cache here is the hardware memory - Z_Free(ptr); + Z_Free(patch); } HWD.pfnSetTexture(&gpatch->mipmap); @@ -760,160 +720,6 @@ void HWR_UnlockCachedPatch(GLPatch_t *gpatch) Z_ChangeTag(gpatch, PU_HWRPATCHINFO_UNLOCKED); } -static const INT32 picmode2GR[] = -{ - GR_TEXFMT_P_8, // PALETTE - 0, // INTENSITY (unsupported yet) - GR_TEXFMT_ALPHA_INTENSITY_88, // INTENSITY_ALPHA (corona use this) - 0, // RGB24 (unsupported yet) - GR_RGBA, // RGBA32 (opengl only) -}; - -static void HWR_DrawPicInCache(UINT8 *block, INT32 pblockwidth, INT32 pblockheight, - INT32 blockmodulo, pic_t *pic, INT32 bpp) -{ - INT32 i,j; - fixed_t posx, posy, stepx, stepy; - UINT8 *dest, *src, texel; - UINT16 texelu16; - INT32 picbpp; - RGBA_t col; - - stepy = ((INT32)SHORT(pic->height)<<FRACBITS)/pblockheight; - stepx = ((INT32)SHORT(pic->width)<<FRACBITS)/pblockwidth; - picbpp = format2bpp[picmode2GR[pic->mode]]; - posy = 0; - for (j = 0; j < pblockheight; j++) - { - posx = 0; - dest = &block[j*blockmodulo]; - src = &pic->data[(posy>>FRACBITS)*SHORT(pic->width)*picbpp]; - for (i = 0; i < pblockwidth;i++) - { - switch (pic->mode) - { // source bpp - case PALETTE : - texel = src[(posx+FRACUNIT/2)>>FRACBITS]; - switch (bpp) - { // destination bpp - case 1 : - *dest++ = texel; break; - case 2 : - texelu16 = (UINT16)(texel | 0xff00); - memcpy(dest, &texelu16, sizeof(UINT16)); - dest += sizeof(UINT16); - break; - case 3 : - col = V_GetColor(texel); - memcpy(dest, &col, sizeof(RGBA_t)-sizeof(UINT8)); - dest += sizeof(RGBA_t)-sizeof(UINT8); - break; - case 4 : - memcpy(dest, &V_GetColor(texel), sizeof(RGBA_t)); - dest += sizeof(RGBA_t); - break; - } - break; - case INTENSITY : - *dest++ = src[(posx+FRACUNIT/2)>>FRACBITS]; - break; - case INTENSITY_ALPHA : // assume dest bpp = 2 - memcpy(dest, src + ((posx+FRACUNIT/2)>>FRACBITS)*sizeof(UINT16), sizeof(UINT16)); - dest += sizeof(UINT16); - break; - case RGB24 : - break; // not supported yet - case RGBA32 : // assume dest bpp = 4 - dest += sizeof(UINT32); - memcpy(dest, src + ((posx+FRACUNIT/2)>>FRACBITS)*sizeof(UINT32), sizeof(UINT32)); - break; - } - posx += stepx; - } - posy += stepy; - } -} - -// -----------------+ -// HWR_GetPic : Download a Doom pic (raw row encoded with no 'holes') -// Returns : -// -----------------+ -GLPatch_t *HWR_GetPic(lumpnum_t lumpnum) -{ - GLPatch_t *grpatch; - - grpatch = HWR_GetCachedGLPatch(lumpnum); - - if (!grpatch->mipmap.downloaded && !grpatch->mipmap.grInfo.data) - { - pic_t *pic; - UINT8 *block; - size_t len; - INT32 newwidth, newheight; - - pic = W_CacheLumpNum(lumpnum, PU_CACHE); - grpatch->width = SHORT(pic->width); - grpatch->height = SHORT(pic->height); - len = W_LumpLength(lumpnum) - sizeof (pic_t); - - grpatch->leftoffset = 0; - grpatch->topoffset = 0; - - // find the good 3dfx size (boring spec) - HWR_ResizeBlock (grpatch->width, grpatch->height, &grpatch->mipmap.grInfo); - grpatch->mipmap.width = (UINT16)blockwidth; - grpatch->mipmap.height = (UINT16)blockheight; - - if (pic->mode == PALETTE) - grpatch->mipmap.grInfo.format = textureformat; // can be set by driver - else - grpatch->mipmap.grInfo.format = picmode2GR[pic->mode]; - - Z_Free(grpatch->mipmap.grInfo.data); - - // allocate block - block = MakeBlock(&grpatch->mipmap); - - // if rounddown, rounddown patches as well as textures - if (cv_grrounddown.value) - { - newwidth = blockwidth; - newheight = blockheight; - } - else - { - // no rounddown, do not size up patches, so they don't look 'scaled' - newwidth = min(SHORT(pic->width),blockwidth); - newheight = min(SHORT(pic->height),blockheight); - } - - - if (grpatch->width == blockwidth && - grpatch->height == blockheight && - format2bpp[grpatch->mipmap.grInfo.format] == format2bpp[picmode2GR[pic->mode]]) - { - // no conversion needed - M_Memcpy(grpatch->mipmap.grInfo.data, pic->data,len); - } - else - HWR_DrawPicInCache(block, newwidth, newheight, - blockwidth*format2bpp[grpatch->mipmap.grInfo.format], - pic, - format2bpp[grpatch->mipmap.grInfo.format]); - - Z_Unlock(pic); - Z_ChangeTag(block, PU_HWRCACHE_UNLOCKED); - - grpatch->mipmap.flags = 0; - grpatch->max_s = (float)newwidth / (float)blockwidth; - grpatch->max_t = (float)newheight / (float)blockheight; - } - HWD.pfnSetTexture(&grpatch->mipmap); - //CONS_Debug(DBG_RENDER, "picloaded at %x as texture %d\n",grpatch->mipmap.grInfo.data, grpatch->mipmap.downloaded); - - return grpatch; -} - GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wadnum, UINT16 lumpnum) { aatree_t *hwrcache = wadfiles[wadnum]->hwrcache; diff --git a/src/hardware/hw_data.h b/src/hardware/hw_data.h index 492b3cff47998fc8aa8b6752940f008389ed3d4c..b80f5de817fa88777aa88050f7f2031f8519f3b5 100644 --- a/src/hardware/hw_data.h +++ b/src/hardware/hw_data.h @@ -14,33 +14,69 @@ #ifndef _HWR_DATA_ #define _HWR_DATA_ -#if defined (_WIN32) && !defined (__CYGWIN__) && !defined (_XBOX) -//#define WIN32_LEAN_AND_MEAN -#define RPC_NO_WINDOWS_H -#include <windows.h> -#endif - #include "../doomdef.h" -//THIS MUST DISAPPEAR!!! -#include "hw_glide.h" #include "../screen.h" - // ========================================================================== // TEXTURE INFO // ========================================================================== +// +// hw_glide.h +// + +typedef long GLAspectRatio_t; +#define GR_ASPECT_LOG2_8x1 3 /* 8W x 1H */ +#define GR_ASPECT_LOG2_4x1 2 /* 4W x 1H */ +#define GR_ASPECT_LOG2_2x1 1 /* 2W x 1H */ +#define GR_ASPECT_LOG2_1x1 0 /* 1W x 1H */ +#define GR_ASPECT_LOG2_1x2 -1 /* 1W x 2H */ +#define GR_ASPECT_LOG2_1x4 -2 /* 1W x 4H */ +#define GR_ASPECT_LOG2_1x8 -3 /* 1W x 8H */ + +typedef long GLlod_t; +#define GR_LOD_LOG2_256 0x8 +#define GR_LOD_LOG2_128 0x7 +#define GR_LOD_LOG2_64 0x6 +#define GR_LOD_LOG2_32 0x5 +#define GR_LOD_LOG2_16 0x4 +#define GR_LOD_LOG2_8 0x3 +#define GR_LOD_LOG2_4 0x2 +#define GR_LOD_LOG2_2 0x1 +#define GR_LOD_LOG2_1 0x0 + +typedef long GLTextureFormat_t; +#define GR_TEXFMT_ALPHA_8 0x2 /* (0..0xFF) alpha */ +#define GR_TEXFMT_INTENSITY_8 0x3 /* (0..0xFF) intensity */ +#define GR_TEXFMT_ALPHA_INTENSITY_44 0x4 +#define GR_TEXFMT_P_8 0x5 /* 8-bit palette */ +#define GR_TEXFMT_RGB_565 0xa +#define GR_TEXFMT_ARGB_1555 0xb +#define GR_TEXFMT_ARGB_4444 0xc +#define GR_TEXFMT_ALPHA_INTENSITY_88 0xd +#define GR_TEXFMT_AP_88 0xe /* 8-bit alpha 8-bit palette */ +#define GR_RGBA 0x6 // 32 bit RGBA ! + +typedef struct +{ + GLlod_t smallLodLog2; + GLlod_t largeLodLog2; + GLAspectRatio_t aspectRatioLog2; + GLTextureFormat_t format; + void *data; +} GLTexInfo; + // grInfo.data holds the address of the graphics data cached in heap memory // NULL if the texture is not in Doom heap cache. struct GLMipmap_s { - GrTexInfo grInfo; - FxU32 flags; + GLTexInfo grInfo; + unsigned long flags; UINT16 width, height; UINT32 downloaded; // tex_downloaded - struct GLMipmap_s *nextmipmap; - struct GLMipmap_s *nextcolormap; + struct GLMipmap_s *nextmipmap; + struct GLMipmap_s *nextcolormap; const UINT8 *colormap; }; typedef struct GLMipmap_s GLMipmap_t; diff --git a/src/hardware/hw_draw.c b/src/hardware/hw_draw.c index a7e3c94bd7d56a8878ad65c2a1abbcb3e73b5779..08bb182ef3247355f41ac7381b822d5e59ae7681 100644 --- a/src/hardware/hw_draw.c +++ b/src/hardware/hw_draw.c @@ -454,41 +454,6 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal HWD.pfnDrawPolygon(NULL, v, 4, flags); } -void HWR_DrawPic(INT32 x, INT32 y, lumpnum_t lumpnum) -{ - FOutVector v[4]; - const GLPatch_t *patch; - - // make pic ready in hardware cache - patch = HWR_GetPic(lumpnum); - -// 3--2 -// | /| -// |/ | -// 0--1 - - v[0].x = v[3].x = 2.0f * (float)x/vid.width - 1; - v[2].x = v[1].x = 2.0f * (float)(x + patch->width*FIXED_TO_FLOAT(vid.fdupx))/vid.width - 1; - v[0].y = v[1].y = 1.0f - 2.0f * (float)y/vid.height; - v[2].y = v[3].y = 1.0f - 2.0f * (float)(y + patch->height*FIXED_TO_FLOAT(vid.fdupy))/vid.height; - - v[0].z = v[1].z = v[2].z = v[3].z = 1.0f; - - v[0].sow = v[3].sow = 0; - v[2].sow = v[1].sow = patch->max_s; - v[0].tow = v[1].tow = 0; - v[2].tow = v[3].tow = patch->max_t; - - - //Hurdler: Boris, the same comment as above... but maybe for pics - // it not a problem since they don't have any transparent pixel - // if I'm right !? - // But then, the question is: why not 0 instead of PF_Masked ? - // or maybe PF_Environment ??? (like what I said above) - // BP: PF_Environment don't change anything ! and 0 is undifined - HWD.pfnDrawPolygon(NULL, v, 4, PF_Translucent | PF_NoDepthTest); -} - // ========================================================================== // V_VIDEO.C STUFF // ========================================================================== diff --git a/src/hardware/hw_glide.h b/src/hardware/hw_glide.h deleted file mode 100644 index 4c69443f86fffe4f96aa19e1839e2b216876809a..0000000000000000000000000000000000000000 --- a/src/hardware/hw_glide.h +++ /dev/null @@ -1,66 +0,0 @@ -// SONIC ROBO BLAST 2 -//----------------------------------------------------------------------------- -// Copyright (C) 1993-1996 by id Software, Inc. -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2019 by Sonic Team Junior. -// -// This program is free software distributed under the -// terms of the GNU General Public License, version 2. -// See the 'LICENSE' file for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief Declaration needed by Glide renderer -/// !!! To be replaced by our own def in the future !!! - -#ifndef _GLIDE_H_ -#define _GLIDE_H_ - -#ifndef __GLIDE_H__ - -typedef unsigned long FxU32; -typedef long FxI32; - -typedef FxI32 GrAspectRatio_t; -#define GR_ASPECT_LOG2_8x1 3 /* 8W x 1H */ -#define GR_ASPECT_LOG2_4x1 2 /* 4W x 1H */ -#define GR_ASPECT_LOG2_2x1 1 /* 2W x 1H */ -#define GR_ASPECT_LOG2_1x1 0 /* 1W x 1H */ -#define GR_ASPECT_LOG2_1x2 -1 /* 1W x 2H */ -#define GR_ASPECT_LOG2_1x4 -2 /* 1W x 4H */ -#define GR_ASPECT_LOG2_1x8 -3 /* 1W x 8H */ - -typedef FxI32 GrLOD_t; -#define GR_LOD_LOG2_256 0x8 -#define GR_LOD_LOG2_128 0x7 -#define GR_LOD_LOG2_64 0x6 -#define GR_LOD_LOG2_32 0x5 -#define GR_LOD_LOG2_16 0x4 -#define GR_LOD_LOG2_8 0x3 -#define GR_LOD_LOG2_4 0x2 -#define GR_LOD_LOG2_2 0x1 -#define GR_LOD_LOG2_1 0x0 - -typedef FxI32 GrTextureFormat_t; -#define GR_TEXFMT_ALPHA_8 0x2 /* (0..0xFF) alpha */ -#define GR_TEXFMT_INTENSITY_8 0x3 /* (0..0xFF) intensity */ -#define GR_TEXFMT_ALPHA_INTENSITY_44 0x4 -#define GR_TEXFMT_P_8 0x5 /* 8-bit palette */ -#define GR_TEXFMT_RGB_565 0xa -#define GR_TEXFMT_ARGB_1555 0xb -#define GR_TEXFMT_ARGB_4444 0xc -#define GR_TEXFMT_ALPHA_INTENSITY_88 0xd -#define GR_TEXFMT_AP_88 0xe /* 8-bit alpha 8-bit palette */ -#define GR_RGBA 0x6 // 32 bit RGBA ! - -typedef struct -{ - GrLOD_t smallLodLog2; - GrLOD_t largeLodLog2; - GrAspectRatio_t aspectRatioLog2; - GrTextureFormat_t format; - void *data; -} GrTexInfo; - -#endif // __GLIDE_H__ (defined in <glide.h>) - -#endif // _GLIDE_H_ diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index 4a132db0851c9443ae00ad5bb45fd4bef90bfbf0..2acc2bafc11bc97d972cf265e230dff62db2bf56 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -92,14 +92,14 @@ void HWR_GetFlat(lumpnum_t flatlumpnum); GLTexture_t *HWR_GetTexture(INT32 tex); void HWR_GetPatch(GLPatch_t *gpatch); void HWR_GetMappedPatch(GLPatch_t *gpatch, const UINT8 *colormap); +void HWR_MakePatch(patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_UnlockCachedPatch(GLPatch_t *gpatch); -GLPatch_t *HWR_GetPic(lumpnum_t lumpnum); void HWR_SetPalette(RGBA_t *palette); GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wad, UINT16 lump); GLPatch_t *HWR_GetCachedGLPatch(lumpnum_t lumpnum); void HWR_GetFadeMask(lumpnum_t fademasklumpnum); -// jimita +// hardware driver extern INT32 gl_leveltime; // -------- @@ -109,6 +109,5 @@ extern consvar_t cv_grrounddown; // on/off extern INT32 patchformat; extern INT32 textureformat; -extern boolean firetranslucent; #endif //_HW_GLOB_ diff --git a/src/hardware/hw_main.h b/src/hardware/hw_main.h index 9d899b7690cd3376c32eb08118150d853bd865d9..cb37f3cf62145d9e9eb26587044298fb2e191ae5 100644 --- a/src/hardware/hw_main.h +++ b/src/hardware/hw_main.h @@ -46,12 +46,10 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option); void HWR_DrawFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, const UINT8 *colormap); void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t scale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, INT32 option, fixed_t scale, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h); -void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, boolean makebitmap); void HWR_CreatePlanePolygons(INT32 bspnum); void HWR_PrepLevelCache(size_t pnumtextures); void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color); void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32 options); // Lat: separate flags from color since color needs to be an uint to work right. -void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum); void HWR_AddCommands(void); void HWR_CorrectSWTricks(void); diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 000efc2f0c050390e6d0884484a553809d09046e..965d6e9dc3941b8a2a4596dad305d5a1a76cac29 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -141,7 +141,7 @@ static void PNG_warn(png_structp PNG, png_const_charp pngtext) CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext); } -static GrTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch) +static GLTextureFormat_t PNG_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch) { png_structp png_ptr; png_infop png_info_ptr; @@ -271,7 +271,7 @@ typedef struct UINT8 filler[54]; } PcxHeader; -static GrTextureFormat_t PCX_Load(const char *filename, int *w, int *h, +static GLTextureFormat_t PCX_Load(const char *filename, int *w, int *h, GLPatch_t *grpatch) { PcxHeader header; diff --git a/src/m_menu.c b/src/m_menu.c index 72f30cb4a7cf4ad92383041c77f6324f68a5e481..fae58e53abd175e9b64a1ca6cc326b6811359078 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -3861,18 +3861,11 @@ static void M_StopMessage(INT32 choice) // You can even put multiple images in one menu! static void M_DrawImageDef(void) { - // Grr. Need to autodetect for pic_ts. - pic_t *pictest = (pic_t *)W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); - if (!pictest->zero) - V_DrawScaledPic(0,0,0,W_GetNumForName(currentMenu->menuitems[itemOn].text)); + patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); + if (patch->width <= BASEVIDWIDTH) + V_DrawScaledPatch(0,0,0,patch); else - { - patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); - if (patch->width <= BASEVIDWIDTH) - V_DrawScaledPatch(0,0,0,patch); - else - V_DrawSmallScaledPatch(0,0,0,patch); - } + V_DrawSmallScaledPatch(0,0,0,patch); if (currentMenu->numitems > 1) V_DrawString(0,192,V_TRANSLUCENT, va("PAGE %d of %hd", itemOn+1, currentMenu->numitems)); diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index a8b881650114ddc531e7671a440331b9af171b1b..a3088da37cf2146e8ff6674a8aa9749263de5719 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -222,7 +222,6 @@ <ClInclude Include="..\hardware\hw_defs.h" /> <ClInclude Include="..\hardware\hw_dll.h" /> <ClInclude Include="..\hardware\hw_drv.h" /> - <ClInclude Include="..\hardware\hw_glide.h" /> <ClInclude Include="..\hardware\hw_glob.h" /> <ClInclude Include="..\hardware\hw_light.h" /> <ClInclude Include="..\hardware\hw_main.h" /> diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index d9caf5ce5e7fbef17af96047b7bc6fc4c5d56809..c61d60221cbba49cf8132419cd263642ad57e13c 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -231,9 +231,6 @@ <ClInclude Include="..\hardware\hw_drv.h"> <Filter>Hw_Hardware</Filter> </ClInclude> - <ClInclude Include="..\hardware\hw_glide.h"> - <Filter>Hw_Hardware</Filter> - </ClInclude> <ClInclude Include="..\hardware\hw_glob.h"> <Filter>Hw_Hardware</Filter> </ClInclude> diff --git a/src/sdl/Srb2SDL-vc9.vcproj b/src/sdl/Srb2SDL-vc9.vcproj index 3898aeba4efc53c9bd06fe38834d164ae31d64c1..b21eedb870c801403f58d25f8246ae5d8bb10087 100644 --- a/src/sdl/Srb2SDL-vc9.vcproj +++ b/src/sdl/Srb2SDL-vc9.vcproj @@ -2410,10 +2410,6 @@ RelativePath="..\hardware\hw_drv.h" > </File> - <File - RelativePath="..\hardware\hw_glide.h" - > - </File> <File RelativePath="..\hardware\hw_glob.h" > diff --git a/src/sdl/Srb2SDL.dsp b/src/sdl/Srb2SDL.dsp index 879113ca2f0d7c6f8a71e7e709303224046cb91f..ce35e2e23d0eab733e6f1d68cab441b7db4283c9 100644 --- a/src/sdl/Srb2SDL.dsp +++ b/src/sdl/Srb2SDL.dsp @@ -7,19 +7,19 @@ CFG=Srb2SDL - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2SDL.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2SDL.mak" CFG="Srb2SDL - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Srb2SDL - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "Srb2SDL - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -85,7 +85,7 @@ LINK32=link.exe # ADD LINK32 SDL.lib SDL_mixer.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /pdb:"C:\srb2demo2\srb2sdldebug.pdb" /debug /machine:I386 /out:"C:\srb2demo2\srb2sdldebug.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none -!ENDIF +!ENDIF # Begin Target @@ -213,7 +213,7 @@ SOURCE=.\SDL_main\SDL_win32_main.c # PROP Exclude_From_Build 1 -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -274,7 +274,7 @@ InputName=tmap # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -308,7 +308,7 @@ InputName=tmap_mmx # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -339,7 +339,7 @@ InputName=tmap_vc # End Custom Build -!ENDIF +!ENDIF # End Source File # End Group @@ -576,10 +576,6 @@ SOURCE=..\hardware\hw_drv.h # End Source File # Begin Source File -SOURCE=..\hardware\hw_glide.h -# End Source File -# Begin Source File - SOURCE=..\hardware\hw_glob.h # End Source File # Begin Source File diff --git a/src/sdl/macosx/Srb2mac.pbproj/project.pbxproj b/src/sdl/macosx/Srb2mac.pbproj/project.pbxproj index de12201f5dc080390a9accea387021637c75aee5..ee0bf4697786da59064f241576fa47d97111213d 100644 --- a/src/sdl/macosx/Srb2mac.pbproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.pbproj/project.pbxproj @@ -1064,13 +1064,6 @@ path = ../../hardware/hw_drv.h; refType = 2; }; - 8417773B085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_glide.h; - path = ../../hardware/hw_glide.h; - refType = 2; - }; 8417773C085A106C000C01D8 = { fileEncoding = 30; isa = PBXFileReference; diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index a8ecbf7f85984eaeb63a1b3254f001da6c0d0f32..0ed95c88687bbbb0baf99e28a1f70cfa926aa576 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -181,7 +181,6 @@ 1E44AE640B67CC2B00BAD059 /* hw_cache.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_cache.c; path = ../../hardware/hw_cache.c; sourceTree = SOURCE_ROOT; }; 1E44AE650B67CC2B00BAD059 /* hw_dll.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_dll.h; path = ../../hardware/hw_dll.h; sourceTree = SOURCE_ROOT; }; 1E44AE660B67CC2B00BAD059 /* hw_drv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_drv.h; path = ../../hardware/hw_drv.h; sourceTree = SOURCE_ROOT; }; - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_glide.h; path = ../../hardware/hw_glide.h; sourceTree = SOURCE_ROOT; }; 1E44AE680B67CC2B00BAD059 /* hw_light.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_light.c; path = ../../hardware/hw_light.c; sourceTree = SOURCE_ROOT; }; 1E44AE690B67CC2B00BAD059 /* hw_light.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_light.h; path = ../../hardware/hw_light.h; sourceTree = SOURCE_ROOT; }; 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw3sound.h; path = ../../hardware/hw3sound.h; sourceTree = SOURCE_ROOT; }; @@ -535,7 +534,6 @@ 1E44AE640B67CC2B00BAD059 /* hw_cache.c */, 1E44AE650B67CC2B00BAD059 /* hw_dll.h */, 1E44AE660B67CC2B00BAD059 /* hw_drv.h */, - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */, 1E44AE680B67CC2B00BAD059 /* hw_light.c */, 1E44AE690B67CC2B00BAD059 /* hw_light.h */, 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */, diff --git a/src/sdl12/Srb2SDL-vc10.vcxproj b/src/sdl12/Srb2SDL-vc10.vcxproj index 99916f58d405351a1cb15bb83063d623b6d67bf2..4b7e8ea367bf3756e90588ab3e701c1157ade1b2 100644 --- a/src/sdl12/Srb2SDL-vc10.vcxproj +++ b/src/sdl12/Srb2SDL-vc10.vcxproj @@ -1335,7 +1335,6 @@ <ClInclude Include="..\hardware\hw_defs.h" /> <ClInclude Include="..\hardware\hw_dll.h" /> <ClInclude Include="..\hardware\hw_drv.h" /> - <ClInclude Include="..\hardware\hw_glide.h" /> <ClInclude Include="..\hardware\hw_glob.h" /> <ClInclude Include="..\hardware\hw_light.h" /> <ClInclude Include="..\hardware\hw_main.h" /> diff --git a/src/sdl12/Srb2SDL-vc9.vcproj b/src/sdl12/Srb2SDL-vc9.vcproj index fa386e381b11ab04d98cfd05e7e747ac34767bc2..9d807be213e0f5b465a158b8e848f88e1b8e80c2 100644 --- a/src/sdl12/Srb2SDL-vc9.vcproj +++ b/src/sdl12/Srb2SDL-vc9.vcproj @@ -2410,10 +2410,6 @@ RelativePath="..\hardware\hw_drv.h" > </File> - <File - RelativePath="..\hardware\hw_glide.h" - > - </File> <File RelativePath="..\hardware\hw_glob.h" > diff --git a/src/sdl12/Srb2SDL.dsp b/src/sdl12/Srb2SDL.dsp index 879113ca2f0d7c6f8a71e7e709303224046cb91f..ce35e2e23d0eab733e6f1d68cab441b7db4283c9 100644 --- a/src/sdl12/Srb2SDL.dsp +++ b/src/sdl12/Srb2SDL.dsp @@ -7,19 +7,19 @@ CFG=Srb2SDL - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2SDL.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2SDL.mak" CFG="Srb2SDL - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Srb2SDL - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "Srb2SDL - Win32 Debug" (based on "Win32 (x86) Console Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -85,7 +85,7 @@ LINK32=link.exe # ADD LINK32 SDL.lib SDL_mixer.lib user32.lib advapi32.lib ws2_32.lib /nologo /subsystem:console /pdb:"C:\srb2demo2\srb2sdldebug.pdb" /debug /machine:I386 /out:"C:\srb2demo2\srb2sdldebug.exe" /pdbtype:sept # SUBTRACT LINK32 /pdb:none -!ENDIF +!ENDIF # Begin Target @@ -213,7 +213,7 @@ SOURCE=.\SDL_main\SDL_win32_main.c # PROP Exclude_From_Build 1 -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -274,7 +274,7 @@ InputName=tmap # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -308,7 +308,7 @@ InputName=tmap_mmx # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -339,7 +339,7 @@ InputName=tmap_vc # End Custom Build -!ENDIF +!ENDIF # End Source File # End Group @@ -576,10 +576,6 @@ SOURCE=..\hardware\hw_drv.h # End Source File # Begin Source File -SOURCE=..\hardware\hw_glide.h -# End Source File -# Begin Source File - SOURCE=..\hardware\hw_glob.h # End Source File # Begin Source File diff --git a/src/sdl12/macosx/Srb2mac.pbproj/project.pbxproj b/src/sdl12/macosx/Srb2mac.pbproj/project.pbxproj index 1f8e3276a01c5666c76da3a3f8b4a824b4476d60..1fe2ea2d8b41b6bbd3caa19c10e4f74d1407443b 100644 --- a/src/sdl12/macosx/Srb2mac.pbproj/project.pbxproj +++ b/src/sdl12/macosx/Srb2mac.pbproj/project.pbxproj @@ -1064,13 +1064,6 @@ path = ../../hardware/hw_drv.h; refType = 2; }; - 8417773B085A106C000C01D8 = { - fileEncoding = 30; - isa = PBXFileReference; - name = hw_glide.h; - path = ../../hardware/hw_glide.h; - refType = 2; - }; 8417773C085A106C000C01D8 = { fileEncoding = 30; isa = PBXFileReference; diff --git a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj index 69c544c56e0db6c8652e551b2b6a40dd62cdf8ce..78b5953a1972562d362767b27b4f25b2d2e917ee 100644 --- a/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl12/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -181,7 +181,6 @@ 1E44AE640B67CC2B00BAD059 /* hw_cache.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_cache.c; path = ../../hardware/hw_cache.c; sourceTree = SOURCE_ROOT; }; 1E44AE650B67CC2B00BAD059 /* hw_dll.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_dll.h; path = ../../hardware/hw_dll.h; sourceTree = SOURCE_ROOT; }; 1E44AE660B67CC2B00BAD059 /* hw_drv.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_drv.h; path = ../../hardware/hw_drv.h; sourceTree = SOURCE_ROOT; }; - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_glide.h; path = ../../hardware/hw_glide.h; sourceTree = SOURCE_ROOT; }; 1E44AE680B67CC2B00BAD059 /* hw_light.c */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.c; name = hw_light.c; path = ../../hardware/hw_light.c; sourceTree = SOURCE_ROOT; }; 1E44AE690B67CC2B00BAD059 /* hw_light.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw_light.h; path = ../../hardware/hw_light.h; sourceTree = SOURCE_ROOT; }; 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = hw3sound.h; path = ../../hardware/hw3sound.h; sourceTree = SOURCE_ROOT; }; @@ -535,7 +534,6 @@ 1E44AE640B67CC2B00BAD059 /* hw_cache.c */, 1E44AE650B67CC2B00BAD059 /* hw_dll.h */, 1E44AE660B67CC2B00BAD059 /* hw_drv.h */, - 1E44AE670B67CC2B00BAD059 /* hw_glide.h */, 1E44AE680B67CC2B00BAD059 /* hw_light.c */, 1E44AE690B67CC2B00BAD059 /* hw_light.h */, 1E44AE6A0B67CC2B00BAD059 /* hw3sound.h */, diff --git a/src/v_video.c b/src/v_video.c index a2294731ef5b088518973c425471f098259bf605..09f399ef342b2220b26f02e705c90c08d9e73cb1 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -696,61 +696,6 @@ void V_DrawBlock(INT32 x, INT32 y, INT32 scrn, INT32 width, INT32 height, const } } -static void V_BlitScaledPic(INT32 px1, INT32 py1, INT32 scrn, pic_t *pic); -// Draw a linear pic, scaled, TOTALLY CRAP CODE!!! OPTIMISE AND ASM!! -// -void V_DrawScaledPic(INT32 rx1, INT32 ry1, INT32 scrn, INT32 lumpnum) -{ -#ifdef HWRENDER - if (rendermode != render_soft) - { - HWR_DrawPic(rx1, ry1, lumpnum); - return; - } -#endif - - V_BlitScaledPic(rx1, ry1, scrn, W_CacheLumpNum(lumpnum, PU_CACHE)); -} - -static void V_BlitScaledPic(INT32 rx1, INT32 ry1, INT32 scrn, pic_t * pic) -{ - INT32 dupx, dupy; - INT32 x, y; - UINT8 *src, *dest; - INT32 width, height; - - width = SHORT(pic->width); - height = SHORT(pic->height); - scrn &= V_PARAMMASK; - - if (pic->mode != 0) - { - CONS_Debug(DBG_RENDER, "pic mode %d not supported in Software\n", pic->mode); - return; - } - - dest = screens[scrn] + max(0, ry1 * vid.width) + max(0, rx1); - // y cliping to the screen - if (ry1 + height * vid.dupy >= vid.width) - height = (vid.width - ry1) / vid.dupy - 1; - // WARNING no x clipping (not needed for the moment) - - for (y = max(0, -ry1 / vid.dupy); y < height; y++) - { - for (dupy = vid.dupy; dupy; dupy--) - { - src = pic->data + y * width; - for (x = 0; x < width; x++) - { - for (dupx = vid.dupx; dupx; dupx--) - *dest++ = *src; - src++; - } - dest += vid.width - vid.dupx * width; - } - } -} - // // Fills a box of pixels with a single color, NOTE: scaled to screen size // diff --git a/src/v_video.h b/src/v_video.h index 877a619b5ac56ad60bb423918f1647b7dbb7d0af..c3d5eb5bd3118942d64b45f79d76347516a389ed 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -134,9 +134,6 @@ void V_DrawContinueIcon(INT32 x, INT32 y, INT32 flags, INT32 skinnum, UINT8 skin // Draw a linear block of pixels into the view buffer. void V_DrawBlock(INT32 x, INT32 y, INT32 scrn, INT32 width, INT32 height, const UINT8 *src); -// draw a pic_t, SCALED -void V_DrawScaledPic (INT32 px1, INT32 py1, INT32 scrn, INT32 lumpnum); - // fill a box with a single color void V_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c); void V_DrawFillConsoleMap(INT32 x, INT32 y, INT32 w, INT32 h, INT32 c); diff --git a/src/w_wad.c b/src/w_wad.c index a0981aba132fdd4ce3027d529341277932fab15d..9fa2bb8137ff3f1d0378c00804f55aa2ef6e3422 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1518,6 +1518,7 @@ void *W_CachePatchName(const char *name, INT32 tag) return W_CachePatchNum(W_GetNumForName("MISSING"), tag); return W_CachePatchNum(num, tag); } + #ifndef NOMD5 #define MD5_LEN 16 diff --git a/src/win32/Srb2win-vc9.vcproj b/src/win32/Srb2win-vc9.vcproj index a64b8638cde6986a2377440a62bfe060293cb93f..cac081ad4d32ea4a06cf6d8b582d280f64a241f8 100644 --- a/src/win32/Srb2win-vc9.vcproj +++ b/src/win32/Srb2win-vc9.vcproj @@ -2151,10 +2151,6 @@ RelativePath="..\hardware\hw_drv.h" > </File> - <File - RelativePath="..\hardware\hw_glide.h" - > - </File> <File RelativePath="..\hardware\hw_glob.h" > diff --git a/src/win32/Srb2win.dsp b/src/win32/Srb2win.dsp index 501bd26b804c8abda66084cf93b78c8ed0618fdd..c52873f7beb0414b0ce6947f1e5ef1c688bdb5eb 100644 --- a/src/win32/Srb2win.dsp +++ b/src/win32/Srb2win.dsp @@ -7,19 +7,19 @@ CFG=Srb2win - Win32 Debug !MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE use the Export Makefile command and run -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2win.mak". -!MESSAGE +!MESSAGE !MESSAGE You can specify a configuration when running NMAKE !MESSAGE by defining the macro CFG on the command line. For example: -!MESSAGE +!MESSAGE !MESSAGE NMAKE /f "Srb2win.mak" CFG="Srb2win - Win32 Debug" -!MESSAGE +!MESSAGE !MESSAGE Possible choices for configuration are: -!MESSAGE +!MESSAGE !MESSAGE "Srb2win - Win32 Release" (based on "Win32 (x86) Application") !MESSAGE "Srb2win - Win32 Debug" (based on "Win32 (x86) Application") -!MESSAGE +!MESSAGE # Begin Project # PROP AllowPerConfigDependencies 0 @@ -84,7 +84,7 @@ LINK32=link.exe # ADD LINK32 dxguid.lib user32.lib gdi32.lib winmm.lib advapi32.lib ws2_32.lib dinput.lib /nologo /subsystem:windows /profile /debug /machine:I386 /out:"C:\srb2demo2\srb2debug.exe" # SUBTRACT LINK32 /nodefaultlib -!ENDIF +!ENDIF # Begin Target @@ -148,7 +148,7 @@ SOURCE=.\Srb2win.rc !ELSEIF "$(CFG)" == "Srb2win - Win32 Debug" -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -233,7 +233,7 @@ InputName=tmap # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -266,7 +266,7 @@ InputName=tmap_mmx # End Custom Build -!ENDIF +!ENDIF # End Source File # Begin Source File @@ -298,7 +298,7 @@ InputName=tmap_vc # End Custom Build -!ENDIF +!ENDIF # End Source File # End Group @@ -535,10 +535,6 @@ SOURCE=..\hardware\hw_drv.h # End Source File # Begin Source File -SOURCE=..\hardware\hw_glide.h -# End Source File -# Begin Source File - SOURCE=..\hardware\hw_glob.h # End Source File # Begin Source File