Remove ugly radar constants from pieblitfunc, where they do not belong.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@3691 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2008-02-04 18:03:02 +00:00
parent 18b604c40e
commit 79db811b58
3 changed files with 9 additions and 12 deletions

View File

@ -69,8 +69,8 @@ extern void pie_UniTransBoxFill(SDWORD x0,SDWORD y0, SDWORD x1, SDWORD y1, PIELI
extern BOOL pie_InitRadar(void);
extern BOOL pie_ShutdownRadar(void);
extern void pie_DownLoadRadar(UDWORD *buffer);
extern void pie_RenderRadar( int x, int y );
extern void pie_DownLoadRadar(UDWORD *buffer, int width, int height);
extern void pie_RenderRadar(int x, int y, int width, int height);
extern void pie_UploadDisplayBuffer(void);

View File

@ -53,9 +53,6 @@
#define pie_FILLBLUE 128
#define pie_FILLTRANS 128
#define RADARX 128
#define RADARY 128
static UDWORD radarTexture;
/***************************************************************************/
@ -304,10 +301,10 @@ BOOL pie_ShutdownRadar(void)
return TRUE;
}
void pie_DownLoadRadar(UDWORD *buffer)
void pie_DownLoadRadar(UDWORD *buffer, int width, int height)
{
pie_SetTexturePage(radarTexture);
glTexImage2D(GL_TEXTURE_2D, 0, wz_texture_compression, RADARX, RADARY, 0,
glTexImage2D(GL_TEXTURE_2D, 0, wz_texture_compression, width, height, 0,
GL_RGBA, GL_UNSIGNED_BYTE, buffer);
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
@ -316,7 +313,7 @@ void pie_DownLoadRadar(UDWORD *buffer)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
}
void pie_RenderRadar( int x, int y )
void pie_RenderRadar(int x, int y, int width, int height)
{
PIEIMAGE pieImage;
PIERECT dest;
@ -330,8 +327,8 @@ void pie_RenderRadar( int x, int y )
pieImage.th = 256;
dest.x = x;
dest.y = y;
dest.w = RADARX;
dest.h = RADARY;
dest.w = width;
dest.h = height;
pie_DrawImage(&pieImage, &dest);
}

View File

@ -346,14 +346,14 @@ void drawRadar(void)
if(frameSkip<=0)
{
pie_DownLoadRadar( radarBuffer );
pie_DownLoadRadar(radarBuffer, RADWIDTH, RADHEIGHT);
frameSkip=RADAR_FRAME_SKIP;
}
frameSkip--;
iV_TransBoxFill( RADTLX,RADTLY, RADTLX + RADWIDTH, RADTLY + RADHEIGHT);
pie_RenderRadar( RADTLX, RADTLY );
pie_RenderRadar(RADTLX, RADTLY, RADWIDTH, RADHEIGHT);
DrawRadarExtras(boxSizeH,boxSizeV);
UpdateRadar(boxSizeH,boxSizeV);
}