Skip to content

Commit

Permalink
Remove legacy graphics code.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@550 4a71c877-e1ca-e34f-864e-861f7616d084
  • Loading branch information
perim committed Aug 8, 2006
1 parent 17bc3e6 commit 081ec89
Show file tree
Hide file tree
Showing 30 changed files with 41 additions and 586 deletions.
5 changes: 0 additions & 5 deletions lib/ivis_common/imd.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,6 @@

//*************************************************************************

void iV_IMDDrawTextureRaise(iIMDShape *shape, float scale);
void iV_IMDDrawTexturedHeightScaled(iIMDShape *shape, float scale);
void iV_IMDDrawTexturedShade(iIMDShape *shape, int32 lightLevel);


// Output BSP Tree to a file


Expand Down
19 changes: 0 additions & 19 deletions lib/ivis_common/imd.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,23 +89,4 @@ extern void iV_IMDRelease(iIMDShape *s);
// How low do we stop looking?
#define DROID_VIS_LOWER 10

/* not for PIEDRAW
extern void iV_IMDDrawTextured(iIMDShape *s);
extern void iV_PIEDraw(iIMDShape *s,int frame);
extern void iV_IMDDrawTexturedEnv(iIMDShape *shape, iTexture *env);
extern int iV_IMDDrawTexturedExtended(iIMDShape *shape, iPoint *point2d, uint32 flags);
extern void iV_IMDDrawWire(iIMDShape *shape, uint32 col);
extern void iV_IMDDrawWireExtended(iIMDShape *shape, uint32 col, uint32 flags);
extern void iV_IMDDrawTexturedHeightScaled(iIMDShape *shape, float scale);
// utils *****************************************************************
extern void iV_IMDRotateProject(iIMDShape *shape, iPoint *points2d);
extern void iV_IMDDraw2D(iIMDShape *shape, iPoint *points2d, uint32 col);
extern int iV_IMDPointInShape2D(iIMDShape *shape, iPoint *points2d, iPoint *point);
extern iBool iV_IMDPointInBoundXZ(iIMDShape *s, iPoint *point);
extern void iV_IMDDrawTextureRaise(iIMDShape *shape, float scale);
extern void iV_IMDDrawTexturedShade(iIMDShape *shape, int lightLevel);
*/

#endif
3 changes: 0 additions & 3 deletions lib/ivis_common/pieblitfunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ extern void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,i

extern void pie_UploadDisplayBuffer(UBYTE *DisplayBuffer);
extern void pie_DownloadDisplayBuffer(UBYTE *DisplayBuffer);
extern void pie_ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB);

extern void pie_D3DSetupRenderForFlip(SDWORD surfaceOffsetX, SDWORD surfaceOffsetY, UWORD* pSrcData, SDWORD srcWidth, SDWORD srcHeight, SDWORD srcStride);
extern void pie_D3DRenderForFlip(void);
Expand All @@ -80,6 +79,4 @@ typedef enum _screenType
extern void pie_LoadBackDrop(SCREENTYPE screenType, BOOL b3DFX);
extern void pie_ResetBackDrop(void);

void bufferTo16Bit(UBYTE *origBuffer,UWORD *newBuffer, BOOL b3DFX);

#endif //
6 changes: 2 additions & 4 deletions lib/ivis_common/piemode.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extern int32 _iVPRIM_DIVTABLE[];
* Global ProtoTypes
*/
/***************************************************************************/
extern BOOL pie_Initialise(SDWORD mode);
extern BOOL pie_Initialise(void);
extern void pie_ShutDown(void);
extern void pie_ScreenFlip(CLEAR_MODE ClearMode);
extern void pie_Clear(UDWORD colour);
Expand All @@ -52,7 +52,5 @@ extern void pie_GlobalRenderEnd(BOOL bForceClearToBlack);
extern void pie_LocalRenderBegin(void);
extern void pie_LocalRenderEnd(void);
extern UDWORD pie_GetResScalingFactor( void );
extern void pie_SetDitherStatus( BOOL val );
extern BOOL pie_GetDitherStatus( void );

#endif //
#endif
1 change: 0 additions & 1 deletion lib/ivis_common/piepalette.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
extern uint8 colours[];
extern uint8 palShades[PALETTE_SIZE * PALETTE_SHADE_LEVEL];
extern uint8 transLookup[PALETTE_SIZE][PALETTE_SIZE];
extern UWORD palette16Bit[PALETTE_SIZE]; //16 bit version of the present palette


//*************************************************************************
Expand Down
10 changes: 0 additions & 10 deletions lib/ivis_common/piestate.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@ void pie_SetDefaultStates(void)//Sets all states
pie_SetBilinear(TRUE);
}

void pie_SetRenderEngine(REND_ENGINE rendEngine)
{
rendStates.rendEngine = rendEngine;
}

REND_ENGINE pie_GetRenderEngine(void)
{
return rendStates.rendEngine;
}

//***************************************************************************
//
// pie_SetTranslucent(BOOL val);
Expand Down
12 changes: 0 additions & 12 deletions lib/ivis_common/piestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@
*/
/***************************************************************************/

typedef enum REND_ENGINE
{
ENGINE_UNDEFINED,
ENGINE_4101,
ENGINE_OPENGL
}
REND_ENGINE;

typedef enum REND_MODE
{
REND_GOURAUD_TEX,
Expand Down Expand Up @@ -108,7 +100,6 @@ typedef enum ALPHA_MODE

typedef struct RENDER_STATE
{
REND_ENGINE rendEngine;
DEPTH_MODE depthBuffer;
BOOL translucent;
BOOL additive;
Expand Down Expand Up @@ -151,9 +142,6 @@ extern SDWORD pieStateCount;
*/
/***************************************************************************/
extern void pie_SetDefaultStates();//Sets all states
//render engine
extern void pie_SetRenderEngine(REND_ENGINE rendEngine);
extern REND_ENGINE pie_GetRenderEngine(void);
extern void pie_SetDepthBufferStatus(DEPTH_MODE depthMode);
extern WZ_DEPRECATED void pie_SetGammaValue(float val);
//renderer capability
Expand Down
5 changes: 2 additions & 3 deletions lib/ivis_common/rendmode.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

//*************************************************************************

#define iV_MODE_4101 0x4101 // DDX 640x480x256
#define REND_D3D_RGB 0x133 // Direct3D 640x480x16bit RGB renderer (mmx)
#define REND_D3D_HAL 0x143 // Direct3D 640x480x16bit hardware
#define REND_D3D_REF 0x153 // Direct3D 640x480x16bit hardware
Expand Down Expand Up @@ -81,8 +80,8 @@ extern void iV_VideoMemoryFree(void);
extern void iV_VideoMemoryUnlock(void);
extern uint8 *iV_VideoMemoryAlloc(int mode);
extern void rend_AssignScreen(void);
extern void rend_Assign(int mode, iSurface *s);
extern void iV_RenderAssign(int mode, iSurface *s);
extern void rend_Assign(iSurface *s);
extern void iV_RenderAssign(iSurface *s);
extern void iV_SurfaceDestroy(iSurface *s);
extern iSurface *iV_SurfaceCreate(uint32 flags, int width, int height, int xp, int yp, uint8 *buffer);

Expand Down
142 changes: 0 additions & 142 deletions lib/ivis_opengl/pieblitfunc.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,19 +445,6 @@ void pie_DownloadDisplayBuffer(UBYTE *DisplayBuffer)
*/
}

void pie_ScaleBitmapRGB(UBYTE *DisplayBuffer,int Width,int Height,int ScaleR,int ScaleG,int ScaleB)
{
switch (pie_GetRenderEngine())
{
case ENGINE_4101:
ScaleBitmapRGB(DisplayBuffer, Width, Height, ScaleR, ScaleG, ScaleB);
break;
case ENGINE_OPENGL:
default:
break;
}
}

UDWORD radarTexture;
unsigned char radarBitmap[128*128*4];

Expand Down Expand Up @@ -545,135 +532,6 @@ void pie_RenderRadarRotated(IMAGEDEF *Image,iBitmap *Bmp,UDWORD Modulus,int x,in
}


/* Converts an 8 bit raw (palettised) source image to
a 16 bit argb destination image
*/
void bufferTo16Bit(UBYTE *origBuffer,UWORD *newBuffer, BOOL b3DFX)
{
UBYTE paletteIndex;
UWORD newColour;
UWORD gun;
UDWORD i;
ULONG mask, amask, rmask, gmask, bmask;
BYTE ap = 0, ac = 0, rp = 0, rc = 0, gp = 0, gc = 0, bp = 0, bc = 0;
iColour* psPalette;
UDWORD size;

if (b3DFX)
{
// 565 RGB
ap = 16;
ac = 0;
rp = 11;
rc = 5;
gp = 5;
gc = 6;
bp = 0;
bc = 5;
}
else
{
/*
// Cannot playback if not 16bit mode
*/
if( screenGetBackBufferBitDepth() == 16 )
{
screenGetBackBufferPixelFormatMasks(&amask, &rmask, &gmask, &bmask);
/*
// Find out the RGB type of the surface and tell the codec...
*/
mask = amask;
if(mask!=0)
{
while(!(mask & 1))
{
mask>>=1;
ap++;
}
}
while((mask & 1))
{
mask>>=1;
ac++;
}

mask = rmask;
if(mask!=0)
{
while(!(mask & 1))
{
mask>>=1;
rp++;
}
}
while((mask & 1))
{
mask>>=1;
rc++;
}

mask = gmask;
if(mask!=0)
{
while(!(mask & 1))
{
mask>>=1;
gp++;
}
}
while((mask & 1))
{
mask>>=1;
gc++;
}

mask = bmask;
if(mask!=0)
{
while(!(mask & 1))
{
mask>>=1;
bp++;
}
}
while((mask & 1))
{
mask>>=1;
bc++;
}
}
}

/*
640*480, 8 bit colour source image
640*480, 16 bit colour destination image
*/
size = BACKDROP_WIDTH*BACKDROP_HEIGHT;//pie_GetVideoBufferWidth()*pie_GetVideoBufferHeight();
for(i=0; i<size; i++)
{
psPalette = pie_GetGamePal();
/* Get the next colour */
paletteIndex = *origBuffer++;
/* Flush out destination word (and alpha bits) */
newColour = 0;
/* Get red bits - 5 */
gun = (UWORD)(psPalette[paletteIndex].r>>(8-rc));
gun = gun << rp;
newColour += gun;
/* Get green bits - 6 */
gun = (UWORD)(psPalette[paletteIndex].g>>(8-gc));
gun = gun << gp;
newColour += gun;
/* Get blue bits - 5 */
gun = (UWORD)(psPalette[paletteIndex].b>>(8-bc));
gun = gun << bp;
newColour += gun;
/* Copy over */
*newBuffer++ = newColour;
}
}


void pie_ResetBackDrop(void)
{
screen_SetBackDrop(backDropBmp, BACKDROP_WIDTH, BACKDROP_HEIGHT);
Expand Down
24 changes: 2 additions & 22 deletions lib/ivis_opengl/piemode.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@
int32 _iVPRIM_DIVTABLE[DIVIDE_TABLE_SIZE];


//static BOOL fogColourSet = FALSE;
//static SDWORD d3dActive = 0;
static BOOL bDither = FALSE;

/***************************************************************************/
/*
* Local ProtoTypes
Expand All @@ -56,25 +52,13 @@ extern void screenDoDumpToDiskIfRequired();
*/
/***************************************************************************/

BOOL pie_GetDitherStatus( void )
BOOL pie_Initialise(void)
{
return bDither;
}

void pie_SetDitherStatus( BOOL val )
{
bDither = val;
}

BOOL pie_Initialise(SDWORD mode)
{
// BOOL r;//result
int i;

pie_InitMaths();
pie_TexInit();

pie_SetRenderEngine(ENGINE_UNDEFINED);
rendSurface.usr = REND_UNDEFINED;
rendSurface.flags = REND_SURFACE_UNDEFINED;
rendSurface.buffer = NULL;
Expand Down Expand Up @@ -104,10 +88,8 @@ BOOL pie_Initialise(SDWORD mode)
rendSurface.xpshift = 10;
rendSurface.ypshift = 10;

pie_SetRenderEngine(ENGINE_OPENGL); //was ENGINE_D3D -Q

pie_SetDefaultStates();
iV_RenderAssign(mode,&rendSurface);
iV_RenderAssign(&rendSurface);
pal_Init();

return TRUE;
Expand All @@ -120,8 +102,6 @@ void pie_ShutDown(void) {
rendSurface.usr = REND_UNDEFINED;
rendSurface.size = 0;

pie_SetRenderEngine(ENGINE_UNDEFINED);

pie_CleanUp();
}

Expand Down
Loading

0 comments on commit 081ec89

Please sign in to comment.