diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index df3c663ff..636836a64 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -452,9 +452,7 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex) UINT8 *pdata; INT32 blockwidth, blockheight, blocksize; -#ifdef GLENCORE UINT8 *colormap = colormaps; -#endif INT32 i; boolean skyspecial = false; //poor hack for Legacy large skies.. @@ -479,14 +477,12 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex) grtex->mipmap.height = (UINT16)texture->height; grtex->mipmap.format = textureformat; -#ifdef GLENCORE if (encoremap) colormap += COLORMAP_REMAPOFFSET; grtex->mipmap.colormap = Z_Calloc(sizeof(*grtex->mipmap.colormap), PU_HWRPATCHCOLMIPMAP, NULL); grtex->mipmap.colormap->source = colormap; M_Memcpy(grtex->mipmap.colormap->data, colormap, 256 * sizeof(UINT8)); -#endif blockwidth = texture->width; blockheight = texture->height; @@ -816,10 +812,8 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex) static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum) { -#ifdef GLENCORE UINT8 *flat; size_t steppy; -#endif size_t size, pflatsize; @@ -861,12 +855,10 @@ static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum) W_ReadLump(flatlumpnum, Z_Malloc(W_LumpLength(flatlumpnum), PU_HWRCACHE, &grMipmap->data)); -#ifdef GLENCORE flat = grMipmap->data; for (steppy = 0; steppy < size; steppy++) if (flat[steppy] != HWR_PATCHES_CHROMAKEY_COLORINDEX) flat[steppy] = grMipmap->colormap->source[flat[steppy]]; -#endif } static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum) @@ -895,9 +887,7 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum, boolean noencoremap) GLMipmap_t *grmip; patch_t *patch; -#ifdef GLENCORE UINT8 *colormap = colormaps; -#endif if (flatlumpnum == LUMPERROR) return; @@ -905,19 +895,17 @@ void HWR_GetRawFlat(lumpnum_t flatlumpnum, boolean noencoremap) patch = HWR_GetCachedGLPatch(flatlumpnum); grmip = ((GLPatch_t *)Patch_AllocateHardwarePatch(patch))->mipmap; -#ifdef GLENCORE - if (!noencoremap && encoremap) - colormap += COLORMAP_REMAPOFFSET; - - grmip->colormap = Z_Calloc(sizeof(*grmip->colormap), PU_HWRPATCHCOLMIPMAP, NULL); - grmip->colormap->source = colormap; - M_Memcpy(grmip->colormap->data, colormap, 256 * sizeof(UINT8)); -#else - (void)noencoremap; -#endif - if (!grmip->downloaded && !grmip->data) + { + if (!noencoremap && encoremap) + colormap += COLORMAP_REMAPOFFSET; + + grmip->colormap = Z_Calloc(sizeof(*grmip->colormap), PU_HWRPATCHCOLMIPMAP, NULL); + grmip->colormap->source = colormap; + M_Memcpy(grmip->colormap->data, colormap, 256 * sizeof(UINT8)); + HWR_CacheFlat(grmip, flatlumpnum); + } // If hardware does not have the texture, then call pfnSetTexture to upload it if (!grmip->downloaded) diff --git a/src/hardware/hw_glob.h b/src/hardware/hw_glob.h index 12d998084..bf9205c1f 100644 --- a/src/hardware/hw_glob.h +++ b/src/hardware/hw_glob.h @@ -30,7 +30,6 @@ extern "C" { //#define HWR_LOADING_SCREEN // SRB2Kart -//#define GLENCORE // ----------- // structures diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 5bb4c2990..7a7e93d5b 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -4828,7 +4828,7 @@ static void HWR_ProjectSprite(mobj_t *thing) { interpmobjstate_t casterinterp = {0}; fixed_t groundz; - fixed_t floordiff; + fixed_t floordiff; if (R_UsingFrameInterpolation() && !paused) { @@ -4838,7 +4838,7 @@ static void HWR_ProjectSprite(mobj_t *thing) { R_InterpolateMobjState(caster, FRACUNIT, &casterinterp); } - + groundz = R_GetShadowZ(thing, NULL); floordiff = abs(((thing->eflags & MFE_VERTICALFLIP) ? caster->height : 0) + casterinterp.z - groundz); @@ -5038,10 +5038,8 @@ static void HWR_ProjectSprite(mobj_t *thing) { vis->colormap = colormaps; -#ifdef GLENCORE if (encoremap && (thing->flags & (MF_SCENERY|MF_NOTHINK)) && !(thing->flags & MF_DONTENCOREMAP)) vis->colormap += COLORMAP_REMAPOFFSET; -#endif } // set top/bottom coords @@ -5176,10 +5174,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) vis->colormap = NULL; -#ifdef GLENCORE if (encoremap && !(thing->flags & MF_DONTENCOREMAP)) vis->colormap += COLORMAP_REMAPOFFSET; -#endif // set top/bottom coords vis->gzt = FIXED_TO_FLOAT(interp.z) + (FIXED_TO_FLOAT(spritecachedinfo[lumpoff].topoffset) * this_scale); diff --git a/src/r_data.c b/src/r_data.c index a0a0dea20..89e96ecac 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -897,16 +897,14 @@ extracolormap_t *R_CreateColormapFromLinedef(char *p1, char *p2, char *p3) #undef ALPHA2INT #undef HEX2INT -#ifdef GLENCORE if (encoremap) { - j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; + UINT8 j = encoremap[NearestColor((UINT8)cr, (UINT8)cg, (UINT8)cb)]; //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); cr = pLocalPalette[j].s.red; cg = pLocalPalette[j].s.green; cb = pLocalPalette[j].s.blue; } -#endif // Pack rgba values into combined var // OpenGL also uses this instead of lighttables for rendering