Fix Simple opengl merge conflicts

hw_cache.c, hw_data.h, hw_defs.h, hw_dll.h, hw_draw.c, hw_drv.h, hw_glob.h, hw_md2.c, hw_md2.h, r_opengl.c
This commit is contained in:
Sryder 2020-08-10 17:39:34 +01:00
parent 9e99b3e9d2
commit 67486dc0b6
10 changed files with 0 additions and 557 deletions

View file

@ -1,13 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -422,140 +416,6 @@ static void HWR_DrawTexturePatchInCache(GLMipmap_t *mipmap,
}
}
<<<<<<< HEAD
// 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,
GLTexInfo *grInfo)
{
#ifdef GLIDE_API_COMPATIBILITY
// Build the full textures from patches.
static const GLlod_t gr_lods[9] =
{
GR_LOD_LOG2_256,
GR_LOD_LOG2_128,
GR_LOD_LOG2_64,
GR_LOD_LOG2_32,
GR_LOD_LOG2_16,
GR_LOD_LOG2_8,
GR_LOD_LOG2_4,
GR_LOD_LOG2_2,
GR_LOD_LOG2_1
};
typedef struct
{
GLAspectRatio_t aspect;
float max_s;
float max_t;
} booring_aspect_t;
static const booring_aspect_t gr_aspects[8] =
{
{GR_ASPECT_LOG2_1x1, 255, 255},
{GR_ASPECT_LOG2_2x1, 255, 127},
{GR_ASPECT_LOG2_4x1, 255, 63},
{GR_ASPECT_LOG2_8x1, 255, 31},
{GR_ASPECT_LOG2_1x1, 255, 255},
{GR_ASPECT_LOG2_1x2, 127, 255},
{GR_ASPECT_LOG2_1x4, 63, 255},
{GR_ASPECT_LOG2_1x8, 31, 255}
};
INT32 j,k;
INT32 max,min;
#else
(void)grInfo;
#endif
// 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
{
#ifdef GLIDE_API_COMPATIBILITY
//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");
#else
blockwidth = originalwidth;
blockheight = originalheight;
#endif
}
// do the boring LOD stuff.. blech!
#ifdef GLIDE_API_COMPATIBILITY
if (blockwidth >= blockheight)
{
max = blockwidth;
min = blockheight;
}
else
{
max = blockheight;
min = blockwidth;
}
for (k = 2048, j = 0; k > max; j++)
k>>=1;
grInfo->smallLodLog2 = gr_lods[j];
grInfo->largeLodLog2 = gr_lods[j];
for (k = max, j = 0; k > min && j < 4; j++)
k>>=1;
// aspect ratio too small for 3Dfx (eg: 8x128 is 1x16 : use 1x8)
if (j == 4)
{
j = 3;
//CONS_Debug(DBG_RENDER, "HWR_ResizeBlock : bad aspect ratio %dx%d\n", blockwidth,blockheight);
if (blockwidth < blockheight)
blockwidth = max>>3;
else
blockheight = max>>3;
}
if (blockwidth < blockheight)
j += 4;
grInfo->aspectRatioLog2 = gr_aspects[j].aspect;
#endif
blocksize = blockwidth * blockheight;
//CONS_Debug(DBG_RENDER, "Width is %d, Height is %d\n", blockwidth, blockheight);
}
=======
>>>>>>> srb2/next
static UINT8 *MakeBlock(GLMipmap_t *grMipmap)
{
UINT8 *block;
@ -617,7 +477,6 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex)
grtex->mipmap.height = (UINT16)texture->height;
grtex->mipmap.format = textureformat;
<<<<<<< HEAD
grtex->mipmap.colormap = colormaps;
#ifdef GLENCORE
@ -625,11 +484,9 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex)
grtex->mipmap.colormap += (256*32);
#endif
=======
blockwidth = texture->width;
blockheight = texture->height;
blocksize = (blockwidth * blockheight);
>>>>>>> srb2/next
block = MakeBlock(&grtex->mipmap);
if (skyspecial) //Hurdler: not efficient, but better than holes in the sky (and it's done only at level loading)
@ -716,16 +573,9 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, bo
grPatch->leftoffset = SHORT(patch->leftoffset);
grPatch->topoffset = SHORT(patch->topoffset);
<<<<<<< HEAD
// resize patch
HWR_ResizeBlock(SHORT(patch->width), SHORT(patch->height), &grMipmap->grInfo);
grMipmap->width = (UINT16)blockwidth;
grMipmap->height = (UINT16)blockheight;
=======
grMipmap->width = grMipmap->height = 1;
while (grMipmap->width < grPatch->width) grMipmap->width <<= 1;
while (grMipmap->height < grPatch->height) grMipmap->height <<= 1;
>>>>>>> srb2/next
// no wrap around, no chroma key
grMipmap->flags = 0;
@ -943,18 +793,7 @@ static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum)
// the flat raw data needn't be converted with palettized textures
W_ReadLump(flatlumpnum, Z_Malloc(W_LumpLength(flatlumpnum),
<<<<<<< HEAD
PU_HWRCACHE, &grMipmap->grInfo.data));
#ifdef GLENCORE
flat = grMipmap->grInfo.data;
for (steppy = 0; steppy < size; steppy++)
if (flat[steppy] != HWR_PATCHES_CHROMAKEY_COLORINDEX)
flat[steppy] = grMipmap->colormap[flat[steppy]];
#endif
=======
PU_HWRCACHE, &grMipmap->data));
>>>>>>> srb2/next
}
static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum)
@ -982,7 +821,6 @@ void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
return;
grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap;
<<<<<<< HEAD
grmip->colormap = colormaps;
@ -999,10 +837,7 @@ void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum, boolean noencoremap)
#endif
grmip = HWR_GetCachedGLPatch(flatlumpnum)->mipmap;
if (!grmip->downloaded && !grmip->grInfo.data)
=======
if (!grmip->downloaded && !grmip->data)
>>>>>>> srb2/next
HWR_CacheFlat(grmip, flatlumpnum);
// If hardware does not have the texture, then call pfnSetTexture to upload it

View file

@ -1,25 +1,14 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
<<<<<<< HEAD
/// \file
/// \brief defines structures and exports for the standard GPU driver
=======
/// \file hw_data.h
/// \brief defines structures and exports for the hardware interface used by Sonic Robo Blast 2
>>>>>>> srb2/next
#ifndef _HWR_DATA_
#define _HWR_DATA_
@ -37,61 +26,6 @@
// TEXTURE INFO
// ==========================================================================
<<<<<<< HEAD
//
// 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
{
GLTexInfo grInfo;
unsigned long flags;
UINT16 width, height;
UINT32 downloaded; // tex_downloaded
=======
typedef enum GLTextureFormat_e
{
GL_TEXFMT_P_8 = 0x01, /* 8-bit palette */
@ -116,7 +50,6 @@ struct GLMipmap_s
UINT16 height;
UINT16 width;
UINT32 downloaded; // the dll driver have it in there cache ?
>>>>>>> srb2/next
struct GLMipmap_s *nextmipmap;
struct GLMipmap_s *nextcolormap;

View file

@ -85,61 +85,6 @@ typedef struct
// a vertex of a Doom 'plane' polygon
typedef struct
{
<<<<<<< HEAD
float x;
float y;
float z;
} polyvertex_t;
#ifdef _MSC_VER
#pragma warning(disable : 4200)
#endif
// a convex 'plane' polygon, clockwise order
typedef struct
{
INT32 numpts;
polyvertex_t pts[0];
} poly_t;
#ifdef _MSC_VER
#pragma warning(default : 4200)
#endif
// holds extra info for 3D render, for each subsector in subsectors[]
typedef struct
{
poly_t *planepoly; // the generated convex polygon
} extrasubsector_t;
// needed for sprite rendering
// equivalent of the software renderer's vissprites
typedef struct gr_vissprite_s
{
// Doubly linked list
struct gr_vissprite_s *prev;
struct gr_vissprite_s *next;
float x1, x2;
float z1, z2;
float tz, ty;
lumpnum_t patchlumpnum;
boolean flip;
UINT8 translucency; //alpha level 0-255
mobj_t *mobj;
boolean precip; // Tails 08-25-2002
boolean vflip;
//Hurdler: 25/04/2000: now support colormap in hardware mode
UINT8 *colormap;
INT32 dispoffset; // copy of info->dispoffset, affects ordering but not drawing
} gr_vissprite_t;
// Kart features
#define USE_FTRANSFORM_ANGLEZ
#define USE_FTRANSFORM_MIRROR
// Vanilla features
//#define USE_MODEL_NEXTFRAME
=======
FLOAT x,y,z;
} FVector;
@ -152,7 +97,6 @@ typedef struct gr_vissprite_s
// -----------
// structures
// -----------
>>>>>>> srb2/next
//Hurdler: Transform (coords + angles)
//BP: transform order : scale(rotation_x(rotation_y(translation(v))))
@ -194,11 +138,6 @@ typedef struct
typedef struct
{
FLOAT x,y,z;
<<<<<<< HEAD
FLOAT s,t;
} FOutVector;
=======
FLOAT s; // s texture ordinate (s over w)
FLOAT t; // t texture ordinate (t over w)
} FOutVector;
@ -238,7 +177,6 @@ typedef struct
gl_skyvertex_t *data;
} gl_sky_t;
>>>>>>> srb2/next
// ==========================================================================
// RENDER MODES
// ==========================================================================
@ -273,12 +211,6 @@ enum EPolyFlags
PF_RemoveYWrap = 0x00010000, // Force clamp texture on Y
PF_ForceWrapX = 0x00020000, // Force repeat texture on X
PF_ForceWrapY = 0x00040000, // Force repeat texture on Y
<<<<<<< HEAD
// 0x20000000
// 0x40000000
// 0x80000000
=======
PF_Clip = 0x40000000, // clip to frustum and nearz plane (glide only, automatic in opengl)
PF_NoZClip = 0x20000000, // in conjonction with PF_Clip
PF_Debug = 0x80000000 // print debug message in driver :)
@ -288,7 +220,6 @@ enum EPolyFlags
enum ESurfFlags
{
SF_DYNLIGHT = 0x00000001,
>>>>>>> srb2/next
};
enum ETextureFlags
@ -322,15 +253,6 @@ struct FSurfaceInfo
};
typedef struct FSurfaceInfo FSurfaceInfo;
<<<<<<< HEAD
enum hwdsetspecialstate
{
HWD_SET_SHADERS = 1,
HWD_SET_MODEL_LIGHTING,
HWD_SET_FOG_MODE,
HWD_SET_FOG_COLOR,
HWD_SET_FOG_DENSITY,
=======
#define GL_DEFAULTMIX 0x00000000
#define GL_DEFAULTFOG 0xFF000000
@ -339,7 +261,6 @@ enum hwdsetspecialstate
{
HWD_SET_MODEL_LIGHTING = 1,
HWD_SET_SHADERS,
>>>>>>> srb2/next
HWD_SET_TEXTUREFILTERMODE,
HWD_SET_TEXTUREANISOTROPICMODE,
@ -347,10 +268,6 @@ enum hwdsetspecialstate
};
typedef enum hwdsetspecialstate hwdspecialstate_t;
<<<<<<< HEAD
#define GL_DEFAULTMIX 0x00000000
#define GL_DEFAULTFOG 0xFF000000
=======
// Lactozilla: Shader info
// Generally set at the start of the frame.
enum hwdshaderinfo
@ -359,7 +276,6 @@ enum hwdshaderinfo
};
typedef enum hwdshaderinfo hwdshaderinfo_t;
>>>>>>> srb2/next
enum hwdfiltermode
{

View file

@ -55,10 +55,6 @@
#define DEGREE (0.017453292519943295769236907684883l) // 2*PI/360
void GL_DBG_Printf(const char *format, ...) /*FUNCPRINTF*/;
<<<<<<< HEAD
#define DBG_Printf GL_DBG_Printf
=======
>>>>>>> srb2/next
#ifdef _WINDOWS
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);

View file

@ -1,13 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -550,8 +544,6 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
HWD.pfnDrawPolygon(NULL, v, 4, flags);
}
<<<<<<< HEAD
=======
void HWR_DrawPic(INT32 x, INT32 y, lumpnum_t lumpnum)
{
FOutVector v[4];
@ -587,7 +579,6 @@ void HWR_DrawPic(INT32 x, INT32 y, lumpnum_t lumpnum)
HWD.pfnDrawPolygon(NULL, v, 4, PF_Translucent | PF_NoDepthTest | PF_Clip | PF_NoZClip);
}
>>>>>>> srb2/next
// ==========================================================================
// V_VIDEO.C STUFF
// ==========================================================================
@ -958,17 +949,10 @@ void HWR_DrawViewBorder(INT32 clearlines)
clearlines = BASEVIDHEIGHT; // refresh all
// calc view size based on original game resolution
<<<<<<< HEAD
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_viewheight), vid.fdupy));
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_baseviewwindowy), vid.fdupy));
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gr_baseviewwindowx), vid.fdupx));
=======
baseviewwidth = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwidth), vid.fdupx)); //(cv_viewsize.value * BASEVIDWIDTH/10)&~7;
baseviewheight = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewheight), vid.fdupy));
top = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_baseviewwindowy), vid.fdupy));
side = FixedInt(FixedDiv(FLOAT_TO_FIXED(gl_viewwindowx), vid.fdupx));
>>>>>>> srb2/next
// top
HWR_DrawFlatFill(0, 0,

View file

@ -1,25 +1,14 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
//-----------------------------------------------------------------------------
<<<<<<< HEAD
/// \file
/// \brief imports/exports for the GPU hardware low-level interface API
=======
/// \file hw_drv.h
/// \brief imports/exports for the 3D hardware low-level interface API
>>>>>>> srb2/next
#ifndef __HWR_DRV_H__
#define __HWR_DRV_H__
@ -61,19 +50,10 @@ 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(DrawModel) (model_t *model, INT32 frameIndex, INT32 duration, INT32 tics, INT32 nextFrameIndex, FTransform *pos, float scale, UINT8 flipped, UINT8 hflipped, FSurfaceInfo *Surface);
>>>>>>> srb2/next
EXPORT void HWRAPI(CreateModelVBOs) (model_t *model);
EXPORT void HWRAPI(SetTransform) (FTransform *stransform);
EXPORT INT32 HWRAPI(GetTextureUsed) (void);
<<<<<<< HEAD
EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform);
=======
>>>>>>> srb2/next
EXPORT void HWRAPI(FlushScreenTextures) (void);
EXPORT void HWRAPI(StartScreenWipe) (void);
@ -93,17 +73,9 @@ EXPORT void HWRAPI(KillShaders) (void);
EXPORT void HWRAPI(SetShader) (int shader);
EXPORT void HWRAPI(UnSetShader) (void);
<<<<<<< HEAD
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment);
EXPORT void HWRAPI(InitCustomShaders) (void);
EXPORT void HWRAPI(StartBatching) (void);
EXPORT void HWRAPI(RenderBatches) (int *sNumPolys, int *sNumVerts, int *sNumCalls, int *sNumShaders, int *sNumTextures, int *sNumPolyFlags, int *sNumColors);
=======
EXPORT void HWRAPI(SetShaderInfo) (hwdshaderinfo_t info, INT32 value);
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment);
EXPORT boolean HWRAPI(InitCustomShaders) (void);
>>>>>>> srb2/next
// ==========================================================================
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
@ -148,20 +120,6 @@ struct hwdriver_s
MakeScreenFinalTexture pfnMakeScreenFinalTexture;
DrawScreenFinalTexture pfnDrawScreenFinalTexture;
<<<<<<< HEAD
RenderSkyDome pfnRenderSkyDome;
LoadShaders pfnLoadShaders;
KillShaders pfnKillShaders;
SetShader pfnSetShader;
UnSetShader pfnUnSetShader;
LoadCustomShader pfnLoadCustomShader;
InitCustomShaders pfnInitCustomShaders;
StartBatching pfnStartBatching;
RenderBatches pfnRenderBatches;
=======
LoadShaders pfnLoadShaders;
KillShaders pfnKillShaders;
SetShader pfnSetShader;
@ -170,7 +128,6 @@ struct hwdriver_s
SetShaderInfo pfnSetShaderInfo;
LoadCustomShader pfnLoadCustomShader;
InitCustomShaders pfnInitCustomShaders;
>>>>>>> srb2/next
};
extern struct hwdriver_s hwdriver;

View file

@ -1,13 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -98,13 +92,8 @@ void HWR_FreeMipmapCache(void);
void HWR_FreeExtraSubsectors(void);
void HWR_GetLevelFlat(levelflat_t *levelflat);
<<<<<<< HEAD
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum, boolean noencoremap);
GLTexture_t *HWR_GetTexture(INT32 tex);
=======
void HWR_LiterallyGetFlat(lumpnum_t flatlumpnum);
GLMapTexture_t *HWR_GetTexture(INT32 tex);
>>>>>>> srb2/next
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);
@ -117,11 +106,6 @@ void HWR_GetFadeMask(lumpnum_t fademasklumpnum);
// --------
// hw_draw.c
// --------
<<<<<<< HEAD
extern consvar_t cv_grrounddown; // on/off
=======
>>>>>>> srb2/next
extern INT32 patchformat;
extern INT32 textureformat;

View file

@ -1,13 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
@ -420,15 +414,6 @@ static void md2_loadTexture(md2_t *model)
V_CubeApply(&image->s.red, &image->s.green, &image->s.blue);
image++;
}
<<<<<<< HEAD
#ifdef GLIDE_API_COMPATIBILITY
// not correct!
grpatch->mipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_256;
grpatch->mipmap->grInfo.largeLodLog2 = GR_LOD_LOG2_256;
grpatch->mipmap->grInfo.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
=======
>>>>>>> srb2/next
}
HWD.pfnSetTexture(grpatch->mipmap);
@ -468,11 +453,7 @@ static void md2_loadBlendTexture(md2_t *model)
grpatch->mipmap->format = PCX_Load(filename, &w, &h, grpatch);
if (grpatch->mipmap->format == 0)
{
<<<<<<< HEAD
grpatch->notfound = true;// mark it so its not searched for again repeatedly
=======
model->noblendfile = true; // mark it so its not searched for again repeatedly
>>>>>>> srb2/next
Z_Free(filename);
return;
}
@ -484,15 +465,6 @@ static void md2_loadBlendTexture(md2_t *model)
grpatch->height = (INT16)h;
grpatch->mipmap->width = (UINT16)w;
grpatch->mipmap->height = (UINT16)h;
<<<<<<< HEAD
#ifdef GLIDE_API_COMPATIBILITY
// not correct!
grpatch->mipmap->grInfo.smallLodLog2 = GR_LOD_LOG2_256;
grpatch->mipmap->grInfo.largeLodLog2 = GR_LOD_LOG2_256;
grpatch->mipmap->grInfo.aspectRatioLog2 = GR_ASPECT_LOG2_1x1;
=======
>>>>>>> srb2/next
}
HWD.pfnSetTexture(grpatch->mipmap); // We do need to do this so that it can be cleared and knows to recreate it when necessary
@ -1313,13 +1285,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
}
HWR_Lighting(&Surf, lightlevel, colormap);
<<<<<<< HEAD
}
else
{
Surf.PolyColor.rgba = 0xFFFFFFFF;
=======
>>>>>>> srb2/next
}
else
Surf.PolyColor.rgba = 0xFFFFFFFF;
@ -1616,11 +1581,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
#endif
HWD.pfnSetShader(4); // model shader
<<<<<<< HEAD
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, color);
=======
HWD.pfnDrawModel(md2->model, frame, durs, tics, nextFrame, &p, finalscale, flip, hflip, &Surf);
>>>>>>> srb2/next
}
return true;

View file

@ -1,13 +1,7 @@
// SONIC ROBO BLAST 2
//-----------------------------------------------------------------------------
<<<<<<< HEAD
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2019 by Sonic Team Junior.
=======
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
>>>>>>> srb2/next
//
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.

View file

@ -94,11 +94,8 @@ static GLuint finalScreenTexture = 0;
// Lactozilla: Set shader programs and uniforms
static void *Shader_Load(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade);
static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade);
<<<<<<< HEAD
=======
static GLRGBAFloat shader_defaultcolor = {1.0f, 1.0f, 1.0f, 1.0f};
>>>>>>> srb2/next
// shortcut for ((float)1/i)
static const GLfloat byte2float[256] = {
@ -154,19 +151,11 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...)
if (!gllogstream)
gllogstream = fopen("ogllog.txt", "w");
<<<<<<< HEAD
va_start(arglist, format);
vsnprintf(str, 4096, format, arglist);
va_end(arglist);
=======
va_start(arglist, format);
vsnprintf(str, 4096, format, arglist);
va_end(arglist);
>>>>>>> srb2/next
fwrite(str, strlen(str), 1, gllogstream);
#else
(void)format;
@ -521,7 +510,6 @@ boolean SetupGLfunc(void)
GETOPENGLFUNC(pglLightModelfv, glLightModelfv)
GETOPENGLFUNC(pglMaterialfv, glMaterialfv)
GETOPENGLFUNC(pglMateriali, glMateriali)
<<<<<<< HEAD
GETOPENGLFUNC(pglPixelStorei, glPixelStorei)
GETOPENGLFUNC(pglReadPixels, glReadPixels)
@ -535,21 +523,6 @@ boolean SetupGLfunc(void)
GETOPENGLFUNC(pglDeleteTextures, glDeleteTextures)
GETOPENGLFUNC(pglBindTexture, glBindTexture)
=======
GETOPENGLFUNC(pglPixelStorei, glPixelStorei)
GETOPENGLFUNC(pglReadPixels, glReadPixels)
GETOPENGLFUNC(pglTexEnvi, glTexEnvi)
GETOPENGLFUNC(pglTexParameteri, glTexParameteri)
GETOPENGLFUNC(pglTexImage2D, glTexImage2D)
GETOPENGLFUNC(pglTexSubImage2D, glTexSubImage2D)
GETOPENGLFUNC(pglGenTextures, glGenTextures)
GETOPENGLFUNC(pglDeleteTextures, glDeleteTextures)
GETOPENGLFUNC(pglBindTexture, glBindTexture)
>>>>>>> srb2/next
GETOPENGLFUNC(pglCopyTexImage2D, glCopyTexImage2D)
GETOPENGLFUNC(pglCopyTexSubImage2D, glCopyTexSubImage2D)
@ -799,8 +772,6 @@ static INT32 shader_leveltime = 0;
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * poly_color;\n" \
"}\0"
<<<<<<< HEAD
=======
//
// Sky fragment shader
// Modulates poly_color with gl_Color
@ -813,7 +784,6 @@ static INT32 shader_leveltime = 0;
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st) * gl_Color * poly_color;\n" \
"}\0"
>>>>>>> srb2/next
static const char *fragment_shaders[] = {
// Default fragment shader
GLSL_DEFAULT_FRAGMENT_SHADER,
@ -837,14 +807,7 @@ static const char *fragment_shaders[] = {
GLSL_FOG_FRAGMENT_SHADER,
// Sky fragment shader
<<<<<<< HEAD
"uniform sampler2D tex;\n"
"void main(void) {\n"
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
"}\0",
=======
GLSL_SKY_FRAGMENT_SHADER,
>>>>>>> srb2/next
// Model fragment shader + diffuse lighting from above
GLSL_SOFTWARE_MODEL_LIGHTING_FRAGMENT_SHADER,
@ -1963,51 +1926,9 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo)
}
else // initialization of the linked list
gl_cachetail = gl_cachehead = pTexInfo;
<<<<<<< HEAD
}
}
static void *Shader_Load(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade)
{
#ifdef GL_SHADERS
if (gl_shadersenabled && pglUseProgram)
{
gl_shaderprogram_t *shader = &gl_shaderprograms[gl_currentshaderprogram];
if (shader->program)
{
if (gl_shaderprogramchanged)
{
pglUseProgram(gl_shaderprograms[gl_currentshaderprogram].program);
gl_shaderprogramchanged = false;
}
Shader_SetUniforms(Surface, poly, tint, fade);
return shader;
}
else
pglUseProgram(0);
=======
>>>>>>> srb2/next
}
#else
(void)Surface;
(void)poly;
(void)tint;
(void)fade;
#endif
return NULL;
}
<<<<<<< HEAD
static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade)
{
#ifdef GL_SHADERS
if (gl_shadersenabled)
{
gl_shaderprogram_t *shader = &gl_shaderprograms[gl_currentshaderprogram];
if (!shader->program)
return;
=======
static void *Shader_Load(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAFloat *tint, GLRGBAFloat *fade)
{
#ifdef GL_SHADERS
@ -2053,7 +1974,6 @@ static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAF
if (fade == NULL)
fade = &shader_defaultcolor;
>>>>>>> srb2/next
#define UNIFORM_1(uniform, a, function) \
if (uniform != -1) \
function (uniform, a);
@ -2074,20 +1994,12 @@ static void Shader_SetUniforms(FSurfaceInfo *Surface, GLRGBAFloat *poly, GLRGBAF
UNIFORM_4(shader->uniforms[gluniform_poly_color], poly->red, poly->green, poly->blue, poly->alpha, pglUniform4f);
UNIFORM_4(shader->uniforms[gluniform_tint_color], tint->red, tint->green, tint->blue, tint->alpha, pglUniform4f);
UNIFORM_4(shader->uniforms[gluniform_fade_color], fade->red, fade->green, fade->blue, fade->alpha, pglUniform4f);
<<<<<<< HEAD
=======
>>>>>>> srb2/next
if (Surface != NULL)
{
UNIFORM_1(shader->uniforms[gluniform_lighting], Surface->LightInfo.light_level, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_start], Surface->LightInfo.fade_start, pglUniform1f);
UNIFORM_1(shader->uniforms[gluniform_fade_end], Surface->LightInfo.fade_end, pglUniform1f);
}
<<<<<<< HEAD
=======
>>>>>>> srb2/next
UNIFORM_1(shader->uniforms[gluniform_leveltime], ((float)shader_leveltime) / TICRATE, pglUniform1f);
#undef UNIFORM_1
@ -2232,35 +2144,6 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
}
EXPORT void HWRAPI(DrawIndexedTriangles) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, UINT32 *IndexArray)
<<<<<<< HEAD
{
PreparePolygon(pSurf, pOutVerts, PolyFlags);
pglVertexPointer(3, GL_FLOAT, sizeof(FOutVector), &pOutVerts[0].x);
pglTexCoordPointer(2, GL_FLOAT, sizeof(FOutVector), &pOutVerts[0].s);
pglDrawElements(GL_TRIANGLES, iNumPts, GL_UNSIGNED_INT, IndexArray);
// the DrawPolygon variant of this has some code about polyflags and wrapping here but havent noticed any problems from omitting it?
}
typedef struct vbo_vertex_s
{
float x, y, z;
float u, v;
unsigned char r, g, b, a;
} vbo_vertex_t;
typedef struct
{
int mode;
int vertexcount;
int vertexindex;
int use_texture;
} GLSkyLoopDef;
typedef struct
=======
>>>>>>> srb2/next
{
PreparePolygon(pSurf, pOutVerts, PolyFlags);