mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Basic merge some of the easier HW files.
hw_main and hw_md2 still need merge. hw_cache needs evaluating for encore mode.
This commit is contained in:
parent
63917ffccc
commit
5cccff08aa
13 changed files with 9 additions and 1744 deletions
|
|
@ -754,13 +754,10 @@ static INT32 SolveTProblem(void)
|
|||
return 0;
|
||||
|
||||
CONS_Debug(DBG_RENDER, "Solving T-joins. This may take a while. Please wait...\n");
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#ifdef HWR_LOADING_SCREEN
|
||||
CON_Drawer(); //let the user know what we are doing
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
#endif
|
||||
>>>>>>> srb2/next
|
||||
|
||||
numsplitpoly = 0;
|
||||
|
||||
|
|
@ -888,11 +885,8 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
|
|||
CON_Drawer(); //let the user know what we are doing
|
||||
I_FinishUpdate(); // page flip or blit buffer
|
||||
#endif
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
HWR_ClearPolys();
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// find min/max boundaries of map
|
||||
//CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
|
||||
|
|
|
|||
|
|
@ -25,11 +25,8 @@
|
|||
#include "../z_zone.h"
|
||||
#include "../v_video.h"
|
||||
#include "../r_draw.h"
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#include "../r_patch.h"
|
||||
#include "../p_setup.h"
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// Values set after a call to HWR_ResizeBlock()
|
||||
static INT32 blocksize, blockwidth, blockheight;
|
||||
|
|
@ -423,55 +420,11 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
|
|||
else
|
||||
patchcol = (const column_t *)((const UINT8 *)realpatch + LONG(realpatch->columnofs[xfrac>>FRACBITS]));
|
||||
|
||||
<<<<<<< HEAD
|
||||
dest = block + (position*blockmodulo);
|
||||
while (count > 0)
|
||||
{
|
||||
count--;
|
||||
|
||||
texel = source[yfrac>>FRACBITS];
|
||||
alpha = 0xff;
|
||||
|
||||
//Hurdler: not perfect, but better than holes
|
||||
if (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX && (mipmap->flags & TF_CHROMAKEYED))
|
||||
alpha = 0x00;
|
||||
|
||||
//Hurdler: 25/04/2000: now support colormap in hardware mode
|
||||
if (mipmap->colormap)
|
||||
texel = mipmap->colormap[texel];
|
||||
|
||||
// hope compiler will get this switch out of the loops (dreams...)
|
||||
// gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?)
|
||||
// Alam: SRB2 uses Mingw, HUGS
|
||||
switch (bpp)
|
||||
{
|
||||
case 2 : texelu16 = (UINT16)((alpha<<8) | texel);
|
||||
memcpy(dest, &texelu16, sizeof(UINT16));
|
||||
break;
|
||||
case 3 : colortemp = V_GetColor(texel);
|
||||
memcpy(dest, &colortemp, sizeof(RGBA_t)-sizeof(UINT8));
|
||||
break;
|
||||
case 4 : colortemp = V_GetColor(texel);
|
||||
colortemp.s.alpha = alpha;
|
||||
memcpy(dest, &colortemp, sizeof(RGBA_t));
|
||||
break;
|
||||
// default is 1
|
||||
default: *dest = texel;
|
||||
break;
|
||||
}
|
||||
|
||||
dest += blockmodulo;
|
||||
yfrac += yfracstep;
|
||||
}
|
||||
patchcol = (const column_t *)((const UINT8 *)patchcol + patchcol->length + 4);
|
||||
}
|
||||
=======
|
||||
ColumnDrawerPointer(patchcol, block, mipmap,
|
||||
pblockheight, blockmodulo,
|
||||
yfracstep, scale_y,
|
||||
patch, height,
|
||||
bpp);
|
||||
>>>>>>> srb2/next
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -525,23 +478,6 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
|
|||
(void)grInfo;
|
||||
#endif
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 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;
|
||||
=======
|
||||
// find a power of 2 width/height
|
||||
if (cv_grrounddown.value)
|
||||
{
|
||||
|
|
@ -582,7 +518,6 @@ static void HWR_ResizeBlock(INT32 originalwidth, INT32 originalheight,
|
|||
blockheight = originalheight;
|
||||
#endif
|
||||
}
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// do the boring LOD stuff.. blech!
|
||||
#ifdef GLIDE_API_COMPATIBILITY
|
||||
|
|
@ -799,10 +734,6 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, bo
|
|||
Z_Free(grMipmap->grInfo.data);
|
||||
grMipmap->grInfo.data = NULL;
|
||||
|
||||
<<<<<<< HEAD
|
||||
newwidth = min(grPatch->width, blockwidth);
|
||||
newheight = min(grPatch->height, blockheight);
|
||||
=======
|
||||
// if rounddown, rounddown patches as well as textures
|
||||
if (cv_grrounddown.value)
|
||||
{
|
||||
|
|
@ -815,7 +746,6 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, bo
|
|||
newwidth = min(grPatch->width, blockwidth);
|
||||
newheight = min(grPatch->height, blockheight);
|
||||
}
|
||||
>>>>>>> srb2/next
|
||||
|
||||
if (makebitmap)
|
||||
{
|
||||
|
|
@ -849,14 +779,6 @@ static void FreeMipmapColormap(INT32 patchnum, void *patch)
|
|||
{
|
||||
GLPatch_t* const pat = patch;
|
||||
(void)patchnum; //unused
|
||||
<<<<<<< HEAD
|
||||
while (grpatch->mipmap->nextcolormap)
|
||||
{
|
||||
GLMipmap_t *grmip = grpatch->mipmap->nextcolormap;
|
||||
grpatch->mipmap->nextcolormap = grmip->nextcolormap;
|
||||
if (grmip->grInfo.data) Z_Free(grmip->grInfo.data);
|
||||
free(grmip);
|
||||
=======
|
||||
|
||||
// The patch must be valid, obviously
|
||||
if (!pat)
|
||||
|
|
@ -889,7 +811,6 @@ static void FreeMipmapColormap(INT32 patchnum, void *patch)
|
|||
|
||||
// Free the old colormap mipmap from memory.
|
||||
free(next);
|
||||
>>>>>>> srb2/next
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -934,11 +855,6 @@ void HWR_LoadTextures(size_t pnumtextures)
|
|||
|
||||
// Why not Z_Malloc?
|
||||
gr_numtextures = pnumtextures;
|
||||
<<<<<<< HEAD
|
||||
gr_textures = calloc(pnumtextures, sizeof (*gr_textures));
|
||||
if (gr_textures == NULL)
|
||||
I_Error("HWR_PrepLevelCache: can't alloc gr_textures");
|
||||
=======
|
||||
gr_textures = calloc(gr_numtextures, sizeof(*gr_textures));
|
||||
gr_flats = calloc(gr_numtextures, sizeof(*gr_flats));
|
||||
|
||||
|
|
@ -946,7 +862,6 @@ void HWR_LoadTextures(size_t pnumtextures)
|
|||
// should never ever happen (right?!)
|
||||
if ((gr_textures == NULL) || (gr_flats == NULL))
|
||||
I_Error("HWR_LoadTextures: ran out of memory for OpenGL textures. Sad!");
|
||||
>>>>>>> srb2/next
|
||||
}
|
||||
|
||||
void HWR_SetPalette(RGBA_t *palette)
|
||||
|
|
@ -1076,17 +991,15 @@ static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum)
|
|||
}
|
||||
|
||||
// Download a Doom 'flat' to the hardware cache and make it ready for use
|
||||
<<<<<<< HEAD
|
||||
void HWR_GetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
||||
=======
|
||||
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum)
|
||||
>>>>>>> srb2/next
|
||||
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
|
||||
{
|
||||
GLMipmap_t *grmip;
|
||||
if (flatlumpnum == LUMPERROR)
|
||||
return;
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (needpatchflush)
|
||||
W_FlushCachedPatches();
|
||||
|
||||
grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap;
|
||||
|
||||
grmip->colormap = colormaps;
|
||||
|
|
@ -1103,11 +1016,6 @@ void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum)
|
|||
grmip->colormap += (256*32);
|
||||
#endif
|
||||
|
||||
=======
|
||||
if (needpatchflush)
|
||||
W_FlushCachedPatches();
|
||||
>>>>>>> srb2/next
|
||||
|
||||
grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap;
|
||||
if (!grmip->downloaded && !grmip->grInfo.data)
|
||||
HWR_CacheFlat(grmip, flatlumpnum);
|
||||
|
|
@ -1194,14 +1102,6 @@ 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
|
||||
<<<<<<< HEAD
|
||||
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(patch);
|
||||
=======
|
||||
patch_t *ptr = gpatch->rawpatch;
|
||||
if (!ptr)
|
||||
ptr = W_CacheLumpNumPwad(gpatch->wadnum, gpatch->lumpnum, PU_STATIC);
|
||||
|
|
@ -1211,7 +1111,6 @@ void HWR_GetPatch(GLPatch_t *gpatch)
|
|||
// not fragment memory, and besides the REAL cache here is the hardware memory
|
||||
if (!gpatch->rawpatch)
|
||||
Z_Free(ptr);
|
||||
>>>>>>> srb2/next
|
||||
}
|
||||
|
||||
HWD.pfnSetTexture(gpatch->mipmap);
|
||||
|
|
@ -1274,8 +1173,6 @@ void HWR_UnlockCachedPatch(GLPatch_t *gpatch)
|
|||
Z_ChangeTag(gpatch, PU_HWRPATCHINFO_UNLOCKED);
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
static const INT32 picmode2GR[] =
|
||||
{
|
||||
GR_TEXFMT_P_8, // PALETTE
|
||||
|
|
@ -1433,7 +1330,6 @@ GLPatch_t *HWR_GetPic(lumpnum_t lumpnum)
|
|||
return grpatch;
|
||||
}
|
||||
|
||||
>>>>>>> srb2/next
|
||||
GLPatch_t *HWR_GetCachedGLPatchPwad(UINT16 wadnum, UINT16 lumpnum)
|
||||
{
|
||||
aatree_t *hwrcache = wadfiles[wadnum]->hwrcache;
|
||||
|
|
@ -1548,12 +1444,9 @@ void HWR_GetFadeMask(lumpnum_t fademasklumpnum)
|
|||
{
|
||||
GLMipmap_t *grmip;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
if (needpatchflush)
|
||||
W_FlushCachedPatches();
|
||||
|
||||
>>>>>>> srb2/next
|
||||
grmip = HWR_GetCachedGLPatch(fademasklumpnum)->mipmap;
|
||||
|
||||
if (!grmip->downloaded && !grmip->grInfo.data)
|
||||
|
|
|
|||
|
|
@ -381,11 +381,7 @@ void gld_FrustrumSetup(void)
|
|||
float t;
|
||||
float clip[16];
|
||||
|
||||
<<<<<<< HEAD
|
||||
pglGetFloatv(GL_PROJECTION_MATRIX, projMatrix);
|
||||
=======
|
||||
pglGeFloatv(GL_PROJECTION_MATRIX, projMatrix);
|
||||
>>>>>>> srb2/next
|
||||
pglGetFloatv(GL_MODELVIEW_MATRIX, viewMatrix);
|
||||
|
||||
clip[0] = CALCMATRIX(0, 0, 1, 4, 2, 8, 3, 12);
|
||||
|
|
|
|||
|
|
@ -14,15 +14,12 @@
|
|||
#ifndef _HWR_DATA_
|
||||
#define _HWR_DATA_
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#if defined (_WIN32) && !defined (__CYGWIN__)
|
||||
//#define WIN32_LEAN_AND_MEAN
|
||||
#define RPC_NO_WINDOWS_H
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
>>>>>>> srb2/next
|
||||
#include "../doomdef.h"
|
||||
#include "../screen.h"
|
||||
|
||||
|
|
@ -116,14 +113,9 @@ struct GLPatch_s
|
|||
float max_s,max_t;
|
||||
UINT16 wadnum; // the software patch lump num for when the hardware patch
|
||||
UINT16 lumpnum; // was flushed, and we need to re-create it
|
||||
<<<<<<< HEAD
|
||||
GLMipmap_t *mipmap;
|
||||
|
||||
boolean notfound; // if the texture file was not found, mark it here (used in model texture loading)
|
||||
=======
|
||||
void *rawpatch; // :^)
|
||||
GLMipmap_t *mipmap;
|
||||
>>>>>>> srb2/next
|
||||
} ATTRPACK;
|
||||
typedef struct GLPatch_s GLPatch_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -43,13 +43,10 @@ typedef unsigned char FBOOLEAN;
|
|||
|
||||
// byte value for paletted graphics, which represent the transparent color
|
||||
#define HWR_PATCHES_CHROMAKEY_COLORINDEX 255
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
//#define HWR_CHROMAKEY_EQUIVALENTCOLORINDEX 130
|
||||
|
||||
// the chroma key color shows on border sprites, set it to black
|
||||
#define HWR_PATCHES_CHROMAKEY_COLORVALUE (0x00000000) //RGBA format as in grSstWinOpen()
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// RGBA Color components with float type ranging [ 0 ... 1 ]
|
||||
struct FRGBAFloat
|
||||
|
|
@ -148,8 +145,6 @@ typedef struct gr_vissprite_s
|
|||
// Vanilla features
|
||||
//#define USE_MODEL_NEXTFRAME
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
//Hurdler: Transform (coords + angles)
|
||||
//BP: transform order : scale(rotation_x(rotation_y(translation(v))))
|
||||
|
||||
|
|
@ -160,7 +155,6 @@ typedef struct gr_vissprite_s
|
|||
// Vanilla features
|
||||
#define USE_MODEL_NEXTFRAME
|
||||
|
||||
>>>>>>> srb2/next
|
||||
typedef struct
|
||||
{
|
||||
FLOAT x,y,z; // position
|
||||
|
|
@ -173,13 +167,8 @@ typedef struct
|
|||
FLOAT fovxangle, fovyangle;
|
||||
UINT8 splitscreen;
|
||||
boolean flip; // screenflip
|
||||
<<<<<<< HEAD
|
||||
#ifdef USE_FTRANSFORM_MIRROR
|
||||
boolean mirror; // SRB2Kart: Encore Mode
|
||||
#endif
|
||||
boolean shearing; // 14042019
|
||||
angle_t viewaiming; // 17052019
|
||||
=======
|
||||
boolean roll;
|
||||
SINT8 rollflip;
|
||||
FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ
|
||||
|
|
@ -188,7 +177,6 @@ typedef struct
|
|||
#ifdef USE_FTRANSFORM_MIRROR
|
||||
boolean mirror; // SRB2Kart: Encore Mode
|
||||
#endif
|
||||
>>>>>>> srb2/next
|
||||
} FTransform;
|
||||
|
||||
// Transformed vector, as passed to HWR API
|
||||
|
|
@ -226,15 +214,9 @@ enum EPolyFlags
|
|||
PF_Decal = 0x00000800, // Enable polygon offset
|
||||
PF_Modulated = 0x00001000, // Modulation (multiply output with constant ARGB)
|
||||
// When set, pass the color constant into the FSurfaceInfo -> FlatColor
|
||||
<<<<<<< HEAD
|
||||
PF_NoTexture = 0x00002000, // Disable texture
|
||||
PF_Ripple = 0x00004000, // Water shader effect
|
||||
// 0x00008000
|
||||
=======
|
||||
PF_NoTexture = 0x00002000, // Use the small white texture
|
||||
PF_Corona = 0x00004000, // Tell the rendrer we are drawing a corona
|
||||
PF_Unused = 0x00008000, // Unused
|
||||
>>>>>>> srb2/next
|
||||
PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y
|
||||
PF_ForceWrapX = 0x00020000, // Force repeat texture on X
|
||||
PF_ForceWrapY = 0x00040000, // Force repeat texture on Y
|
||||
|
|
@ -277,15 +259,11 @@ typedef struct FSurfaceInfo FSurfaceInfo;
|
|||
|
||||
enum hwdsetspecialstate
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
HWD_SET_SHADERS,
|
||||
|
||||
=======
|
||||
HWD_SET_MODEL_LIGHTING = 1,
|
||||
HWD_SET_SHADERS = 1,
|
||||
HWD_SET_MODEL_LIGHTING,
|
||||
HWD_SET_FOG_MODE,
|
||||
HWD_SET_FOG_COLOR,
|
||||
HWD_SET_FOG_DENSITY,
|
||||
>>>>>>> srb2/next
|
||||
HWD_SET_TEXTUREFILTERMODE,
|
||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||
|
||||
|
|
|
|||
|
|
@ -200,13 +200,12 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
|||
cy -= offsety;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
if (option & V_SPLITSCREEN)
|
||||
cy += FIXED_TO_FLOAT((BASEVIDHEIGHT/2)<<FRACBITS);
|
||||
|
||||
if (option & V_HORZSCREEN)
|
||||
cx += FIXED_TO_FLOAT((BASEVIDWIDTH/2)<<FRACBITS);
|
||||
=======
|
||||
|
||||
if (splitscreen && (option & V_PERPLAYER))
|
||||
{
|
||||
float adjusty = ((option & V_NOSCALESTART) ? vid.height : BASEVIDHEIGHT)/2.0f;
|
||||
|
|
@ -274,7 +273,6 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
|||
}
|
||||
}
|
||||
}
|
||||
>>>>>>> srb2/next
|
||||
|
||||
if (!(option & V_NOSCALESTART))
|
||||
{
|
||||
|
|
@ -377,19 +375,11 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
|||
if (alphalevel)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
<<<<<<< HEAD
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[hudtrans];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[hudtrans];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
=======
|
||||
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
>>>>>>> srb2/next
|
||||
flags |= PF_Modulated;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
|
|
@ -520,12 +510,6 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
|||
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
<<<<<<< HEAD
|
||||
v[0].s = v[3].s = ((sx)/(float)SHORT(gpatch->width) )*gpatch->max_s;
|
||||
v[2].s = v[1].s = ((w )/(float)SHORT(gpatch->width) )*gpatch->max_s;
|
||||
v[0].t = v[1].t = ((sy)/(float)SHORT(gpatch->height))*gpatch->max_t;
|
||||
v[2].t = v[3].t = ((h )/(float)SHORT(gpatch->height))*gpatch->max_t;
|
||||
=======
|
||||
v[0].sow = v[3].sow = ((sx )/(float)SHORT(gpatch->width) )*gpatch->max_s;
|
||||
if (sx + w > SHORT(gpatch->width))
|
||||
v[2].sow = v[1].sow = gpatch->max_s;
|
||||
|
|
@ -537,7 +521,6 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
|||
v[2].tow = v[3].tow = gpatch->max_t;
|
||||
else
|
||||
v[2].tow = v[3].tow = ((sy+h)/(float)SHORT(gpatch->height))*gpatch->max_t;
|
||||
>>>>>>> srb2/next
|
||||
|
||||
flags = PF_Translucent|PF_NoDepthTest;
|
||||
|
||||
|
|
@ -550,19 +533,11 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
|||
if (alphalevel)
|
||||
{
|
||||
FSurfaceInfo Surf;
|
||||
<<<<<<< HEAD
|
||||
Surf.PolyColor.s.red = Surf.PolyColor.s.green = Surf.PolyColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[cv_translucenthud.value];
|
||||
else if (alphalevel == 14) Surf.PolyColor.s.alpha = softwaretranstogl[cv_translucenthud.value];
|
||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
|
||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
=======
|
||||
Surf.FlatColor.s.red = Surf.FlatColor.s.green = Surf.FlatColor.s.blue = 0xff;
|
||||
if (alphalevel == 13) Surf.FlatColor.s.alpha = softwaretranstogl_lo[st_translucency];
|
||||
else if (alphalevel == 14) Surf.FlatColor.s.alpha = softwaretranstogl[st_translucency];
|
||||
else if (alphalevel == 15) Surf.FlatColor.s.alpha = softwaretranstogl_hi[st_translucency];
|
||||
else Surf.FlatColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||
>>>>>>> srb2/next
|
||||
flags |= PF_Modulated;
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
||||
}
|
||||
|
|
@ -635,11 +610,7 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
|
|||
v[0].t = v[1].t = (float)((y & flatflag)/dflatsize);
|
||||
v[2].t = v[3].t = (float)(v[0].t + h/dflatsize);
|
||||
|
||||
<<<<<<< HEAD
|
||||
HWR_GetFlat(flatlumpnum, false); // Never Encore map drawflatfill, duh.
|
||||
=======
|
||||
HWR_LiterallyGetFlat(flatlumpnum);
|
||||
>>>>>>> srb2/next
|
||||
HWR_LiterallyGetFlat(flatlumpnum, false);
|
||||
|
||||
//Hurdler: Boris, the same comment as above... but maybe for pics
|
||||
// it not a problem since they don't have any transparent pixel
|
||||
|
|
@ -660,33 +631,6 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
|
|||
// 0--1
|
||||
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
v[0].x = v[3].x = -1.0f;
|
||||
v[2].x = v[1].x = 1.0f;
|
||||
v[0].y = v[1].y = -1.0f;
|
||||
v[2].y = v[3].y = 1.0f;
|
||||
v[0].z = v[1].z = v[2].z = v[3].z = 1.0f;
|
||||
|
||||
v[0].s = v[3].s = 0.0f;
|
||||
v[2].s = v[1].s = 1.0f;
|
||||
v[0].t = v[1].t = 1.0f;
|
||||
v[2].t = v[3].t = 0.0f;
|
||||
|
||||
if (color & 0xFF00) // Do COLORMAP fade.
|
||||
{
|
||||
Surf.PolyColor.rgba = UINT2RGBA(0x01010160);
|
||||
Surf.PolyColor.s.alpha = (strength*8);
|
||||
}
|
||||
else // Do TRANSMAP** fade.
|
||||
{
|
||||
Surf.PolyColor.rgba = pLocalPalette[color].rgba;
|
||||
Surf.PolyColor.s.alpha = (UINT8)(strength*25.5f);
|
||||
}
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
=======
|
||||
FOutVector v[4];
|
||||
FSurfaceInfo Surf;
|
||||
|
||||
|
|
@ -887,7 +831,6 @@ void HWR_DrawFadeFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT16 ac
|
|||
Surf.FlatColor.s.alpha = softwaretranstogl[strength];
|
||||
}
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
>>>>>>> srb2/next
|
||||
}
|
||||
|
||||
// Draw the console background with translucency support
|
||||
|
|
@ -1357,13 +1300,8 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32
|
|||
v[0].t = v[1].t = 0.0f;
|
||||
v[2].t = v[3].t = 1.0f;
|
||||
|
||||
<<<<<<< HEAD
|
||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||
Surf.PolyColor.s.alpha = 0x80;
|
||||
=======
|
||||
Surf.FlatColor.rgba = UINT2RGBA(actualcolor);
|
||||
Surf.FlatColor.s.alpha = 0x80;
|
||||
>>>>>>> srb2/next
|
||||
|
||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,14 +26,6 @@
|
|||
// STANDARD DLL EXPORTS
|
||||
// ==========================================================================
|
||||
|
||||
<<<<<<< HEAD
|
||||
EXPORT boolean HWRAPI(Init) (void);
|
||||
#if defined (PURESDL) || defined (macintosh)
|
||||
EXPORT void HWRAPI(SetPalette) (INT32 *, RGBA_t *gamma);
|
||||
#else
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
|
||||
#endif
|
||||
=======
|
||||
EXPORT boolean HWRAPI(Init) (I_Error_t ErrorFunction);
|
||||
#ifndef HAVE_SDL
|
||||
EXPORT void HWRAPI(Shutdown) (void);
|
||||
|
|
@ -42,7 +34,6 @@ EXPORT void HWRAPI(Shutdown) (void);
|
|||
EXPORT void HWRAPI(GetModeList) (vmode_t **pvidmodes, INT32 *numvidmodes);
|
||||
#endif
|
||||
EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal);
|
||||
>>>>>>> srb2/next
|
||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
||||
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
||||
|
|
@ -58,24 +49,15 @@ EXPORT void HWRAPI(ClearMipMapCache) (void);
|
|||
EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value);
|
||||
|
||||
//Hurdler: added for new development
|
||||
<<<<<<< HEAD
|
||||
EXPORT void HWRAPI(DrawModel) (model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, FSurfaceInfo *Surface);
|
||||
EXPORT void HWRAPI(CreateModelVBOs) (model_t *model);
|
||||
EXPORT void HWRAPI(SetTransform) (FTransform *stransform);
|
||||
=======
|
||||
EXPORT void HWRAPI(DrawModel) (model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 *color);
|
||||
EXPORT void HWRAPI(CreateModelVBOs) (model_t *model);
|
||||
EXPORT void HWRAPI(SetTransform) (FTransform *ptransform);
|
||||
>>>>>>> srb2/next
|
||||
EXPORT INT32 HWRAPI(GetTextureUsed) (void);
|
||||
|
||||
<<<<<<< HEAD
|
||||
EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform);
|
||||
|
||||
=======
|
||||
#define SCREENVERTS 10
|
||||
EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2]);
|
||||
>>>>>>> srb2/next
|
||||
EXPORT void HWRAPI(FlushScreenTextures) (void);
|
||||
EXPORT void HWRAPI(StartScreenWipe) (void);
|
||||
EXPORT void HWRAPI(EndScreenWipe) (void);
|
||||
|
|
@ -120,17 +102,11 @@ struct hwdriver_s
|
|||
ReadRect pfnReadRect;
|
||||
GClipRect pfnGClipRect;
|
||||
ClearMipMapCache pfnClearMipMapCache;
|
||||
<<<<<<< HEAD
|
||||
SetSpecialState pfnSetSpecialState;
|
||||
=======
|
||||
SetSpecialState pfnSetSpecialState;//Hurdler: added for backward compatibility
|
||||
>>>>>>> srb2/next
|
||||
DrawModel pfnDrawModel;
|
||||
CreateModelVBOs pfnCreateModelVBOs;
|
||||
SetTransform pfnSetTransform;
|
||||
GetTextureUsed pfnGetTextureUsed;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
GetRenderVersion pfnGetRenderVersion;
|
||||
#ifdef _WINDOWS
|
||||
GetModeList pfnGetModeList;
|
||||
|
|
@ -138,7 +114,6 @@ struct hwdriver_s
|
|||
#ifndef HAVE_SDL
|
||||
Shutdown pfnShutdown;
|
||||
#endif
|
||||
>>>>>>> srb2/next
|
||||
PostImgRedraw pfnPostImgRedraw;
|
||||
FlushScreenTextures pfnFlushScreenTextures;
|
||||
StartScreenWipe pfnStartScreenWipe;
|
||||
|
|
|
|||
|
|
@ -16,20 +16,15 @@
|
|||
|
||||
#include "hw_defs.h"
|
||||
#include "../m_misc.h"
|
||||
<<<<<<< HEAD
|
||||
#include "../r_defs.h"
|
||||
=======
|
||||
#include "../p_setup.h"
|
||||
|
||||
// the original aspect ratio of Doom graphics isn't square
|
||||
#define ORIGINAL_ASPECT (320.0f/200.0f)
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// Uncomment this to enable the OpenGL loading screen
|
||||
//#define HWR_LOADING_SCREEN
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// -----------
|
||||
// structures
|
||||
// -----------
|
||||
|
|
@ -85,7 +80,6 @@ typedef struct gr_vissprite_s
|
|||
float z1, z2;
|
||||
} gr_vissprite_t;
|
||||
|
||||
>>>>>>> srb2/next
|
||||
// --------
|
||||
// hw_bsp.c
|
||||
// --------
|
||||
|
|
@ -100,14 +94,8 @@ void HWR_FreeTextureCache(void);
|
|||
void HWR_FreeMipmapCache(void);
|
||||
void HWR_FreeExtraSubsectors(void);
|
||||
|
||||
<<<<<<< HEAD
|
||||
void HWR_GetFlat(lumpnum_t flatlumpnum, boolean noencoremap);
|
||||
// ^ some flats must NOT be remapped to encore, since we remap them as we cache them for ease, adding a toggle here seems wise.
|
||||
|
||||
=======
|
||||
void HWR_GetLevelFlat(levelflat_t *levelflat);
|
||||
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum);
|
||||
>>>>>>> srb2/next
|
||||
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum, boolean noencoremap);
|
||||
GLTexture_t *HWR_GetTexture(INT32 tex);
|
||||
void HWR_GetPatch(GLPatch_t *gpatch);
|
||||
void HWR_GetMappedPatch(GLPatch_t *gpatch, const UINT8 *colormap);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -252,11 +252,8 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
md2triangle_t *tris;
|
||||
md2texcoord_t *texcoords;
|
||||
md2frame_t *frames;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
char *fname = NULL;
|
||||
int foffset = 0;
|
||||
>>>>>>> srb2/next
|
||||
|
||||
int t;
|
||||
|
||||
|
|
@ -331,8 +328,6 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
texcoords = (md2texcoord_t*)&buffer[header->offsetST];
|
||||
frames = (md2frame_t*)&buffer[header->offsetFrames];
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
retModel->framenames = (char*)Z_Calloc(header->numFrames*16, ztag, 0);
|
||||
fname = retModel->framenames;
|
||||
for (i = 0; i < header->numFrames; i++)
|
||||
|
|
@ -343,7 +338,6 @@ model_t *MD2_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
fname += 16;
|
||||
}
|
||||
|
||||
>>>>>>> srb2/next
|
||||
// Read in textures
|
||||
retModel->numMaterials = header->numSkins;
|
||||
|
||||
|
|
|
|||
|
|
@ -148,11 +148,8 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
{
|
||||
const float WUNITS = 1.0f;
|
||||
model_t *retModel = NULL;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
md3Frame *frames = NULL;
|
||||
char *fname = NULL;
|
||||
>>>>>>> srb2/next
|
||||
md3modelHeader *mdh;
|
||||
long fileLen;
|
||||
long fileReadLen;
|
||||
|
|
@ -232,8 +229,6 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
|
||||
retModel->meshes = (mesh_t*)Z_Calloc(sizeof(mesh_t)*retModel->numMeshes, ztag, 0);
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
frames = (md3Frame*)&buffer[mdh->offsetFrames];
|
||||
retModel->framenames = (char*)Z_Calloc(mdh->numFrames*16, ztag, 0);
|
||||
fname = retModel->framenames;
|
||||
|
|
@ -244,7 +239,6 @@ model_t *MD3_LoadModel(const char *fileName, int ztag, boolean useFloat)
|
|||
frames++;
|
||||
}
|
||||
|
||||
>>>>>>> srb2/next
|
||||
matCount = 0;
|
||||
for (i = 0, surfEnd = 0; i < mdh->numSurfaces; i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,13 +7,6 @@
|
|||
the licensing is for Sonic Robo Blast 2.
|
||||
*/
|
||||
|
||||
<<<<<<< HEAD
|
||||
#include "../z_zone.h"
|
||||
#include "../doomdef.h"
|
||||
#include "hw_model.h"
|
||||
#include "hw_md2load.h"
|
||||
#include "hw_md3load.h"
|
||||
=======
|
||||
#include "../doomdef.h"
|
||||
#include "../doomtype.h"
|
||||
#include "../info.h"
|
||||
|
|
@ -22,7 +15,6 @@
|
|||
#include "hw_md2load.h"
|
||||
#include "hw_md3load.h"
|
||||
#include "hw_md2.h"
|
||||
>>>>>>> srb2/next
|
||||
#include "u_list.h"
|
||||
#include <string.h>
|
||||
|
||||
|
|
@ -206,12 +198,9 @@ model_t *LoadModel(const char *filename, int ztag)
|
|||
|
||||
Optimize(model);
|
||||
GeneratePolygonNormals(model, ztag);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
LoadModelSprite2(model);
|
||||
if (!model->spr2frames)
|
||||
LoadModelInterpolationSettings(model);
|
||||
>>>>>>> srb2/next
|
||||
|
||||
// Default material properties
|
||||
for (i = 0 ; i < model->numMaterials; i++)
|
||||
|
|
@ -235,8 +224,6 @@ model_t *LoadModel(const char *filename, int ztag)
|
|||
return model;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void HWR_ReloadModels(void)
|
||||
{
|
||||
size_t i;
|
||||
|
|
@ -375,7 +362,6 @@ void LoadModelSprite2(model_t *model)
|
|||
model->spr2frames = spr2frames;
|
||||
}
|
||||
|
||||
>>>>>>> srb2/next
|
||||
//
|
||||
// GenerateVertexNormals
|
||||
//
|
||||
|
|
|
|||
|
|
@ -73,8 +73,6 @@ typedef struct tag_s
|
|||
// matrix_t transform;
|
||||
} tag_t;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
#define MODEL_INTERPOLATION_FLAG "+i"
|
||||
|
||||
typedef struct
|
||||
|
|
@ -84,7 +82,6 @@ typedef struct
|
|||
boolean interpolate;
|
||||
} modelspr2frames_t;
|
||||
|
||||
>>>>>>> srb2/next
|
||||
typedef struct model_s
|
||||
{
|
||||
int maxNumFrames;
|
||||
|
|
@ -98,32 +95,23 @@ typedef struct model_s
|
|||
|
||||
char *mdlFilename;
|
||||
boolean unloaded;
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
char *framenames;
|
||||
boolean interpolate[256];
|
||||
modelspr2frames_t *spr2frames;
|
||||
>>>>>>> srb2/next
|
||||
} model_t;
|
||||
|
||||
extern int numModels;
|
||||
extern model_t *modelHead;
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void HWR_ReloadModels(void);
|
||||
|
||||
>>>>>>> srb2/next
|
||||
tag_t *GetTagByName(model_t *model, char *name, int frame);
|
||||
model_t *LoadModel(const char *filename, int ztag);
|
||||
void UnloadModel(model_t *model);
|
||||
void Optimize(model_t *model);
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
void LoadModelInterpolationSettings(model_t *model);
|
||||
void LoadModelSprite2(model_t *model);
|
||||
>>>>>>> srb2/next
|
||||
void GenerateVertexNormals(model_t *model);
|
||||
void GeneratePolygonNormals(model_t *model, int ztag);
|
||||
void CreateVBOTiny(mesh_t *mesh, tinyframe_t *frame);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue