diff --git a/lib/ivis_common/pieblitfunc.h b/lib/ivis_common/pieblitfunc.h index aacbe469a..d2b4f4b29 100644 --- a/lib/ivis_common/pieblitfunc.h +++ b/lib/ivis_common/pieblitfunc.h @@ -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); diff --git a/lib/ivis_opengl/pieblitfunc.c b/lib/ivis_opengl/pieblitfunc.c index 4deca36e8..c25127d49 100644 --- a/lib/ivis_opengl/pieblitfunc.c +++ b/lib/ivis_opengl/pieblitfunc.c @@ -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); } diff --git a/src/radar.c b/src/radar.c index 0fc23eb2e..8ca1dce9c 100644 --- a/src/radar.c +++ b/src/radar.c @@ -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); }