1
0
Fork 0

Change bpp to unsigned int around render code

Max value of bpp is 32, so there's really no reason to tie this variable
to architecture size.  This change prevents few -Wformat warnings.
This commit is contained in:
Patryk Obara 2020-03-27 13:57:08 +01:00 committed by Patryk Obara
parent 241f6d1c41
commit 06805b28fb
3 changed files with 19 additions and 18 deletions

View file

@ -52,7 +52,7 @@ typedef struct {
struct {
Bitu width, start;
Bitu height;
Bitu bpp;
unsigned bpp;
bool dblw,dblh;
double ratio;
float fps;
@ -93,12 +93,12 @@ typedef struct {
extern Render_t render;
extern ScalerLineHandler_t RENDER_DrawLine;
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh);
void RENDER_SetSize(Bitu width, Bitu height, unsigned bpp, float fps,
double ratio, bool dblw, bool dblh);
bool RENDER_StartUpdate(void);
void RENDER_EndUpdate(bool abort);
void RENDER_SetPal(Bit8u entry,Bit8u red,Bit8u green,Bit8u blue);
bool RENDER_GetForceUpdate(void);
void RENDER_SetForceUpdate(bool);
#endif

View file

@ -547,7 +547,9 @@ static void RENDER_CallBack( GFX_CallBackFunctions_t function ) {
}
}
void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool dblw,bool dblh) {
void RENDER_SetSize(Bitu width, Bitu height, unsigned bpp, float fps,
double ratio, bool dblw, bool dblh)
{
RENDER_Halt( );
if (!width || !height || width > SCALER_MAXWIDTH || height > SCALER_MAXHEIGHT) {
return;
@ -558,13 +560,13 @@ void RENDER_SetSize(Bitu width,Bitu height,Bitu bpp,float fps,double ratio,bool
} else {
//This would alter the width of the screen, we don't care about rounding errors here
}
render.src.width=width;
render.src.height=height;
render.src.bpp=bpp;
render.src.dblw=dblw;
render.src.dblh=dblh;
render.src.fps=fps;
render.src.ratio=ratio;
render.src.width = width;
render.src.height = height;
render.src.bpp = bpp;
render.src.dblw = dblw;
render.src.dblh = dblh;
render.src.fps = fps;
render.src.ratio = ratio;
RENDER_Reset( );
}

View file

@ -1334,8 +1334,7 @@ void VGA_SetupDrawing(Bitu /*val*/) {
bool doubleheight=false;
bool doublewidth=false;
//Set the bpp
Bitu bpp;
unsigned bpp;
switch (vga.mode) {
case M_LIN15:
bpp = 15;
@ -1357,7 +1356,7 @@ void VGA_SetupDrawing(Bitu /*val*/) {
doublewidth=true;
width<<=2;
if ((IS_VGA_ARCH) && (svgaCard==SVGA_None)) {
bpp=16;
bpp = 16;
VGA_DrawLine = VGA_Draw_Xlat16_Linear_Line;
} else VGA_DrawLine = VGA_Draw_Linear_Line;
break;
@ -1408,7 +1407,7 @@ void VGA_SetupDrawing(Bitu /*val*/) {
width<<=3;
if ((IS_VGA_ARCH) && (svgaCard==SVGA_None)) {
// This would also be required for EGA in Spacepigs Megademo
bpp=16;
bpp = 16;
VGA_DrawLine = VGA_Draw_Xlat16_Linear_Line;
} else VGA_DrawLine=VGA_Draw_Linear_Line;
@ -1448,7 +1447,7 @@ void VGA_SetupDrawing(Bitu /*val*/) {
aspect_ratio*=1.125;
}
VGA_DrawLine=VGA_TEXT_Xlat16_Draw_Line;
bpp=16;
bpp = 16;
} else {
// not vgaonly: force 8-pixel wide fonts
width*=8; // 8 bit wide text font
@ -1603,9 +1602,9 @@ void VGA_SetupDrawing(Bitu /*val*/) {
LOG(LOG_VGA,LOG_NORMAL)("%s width, %s height aspect %f",
doublewidth ? "double":"normal",doubleheight ? "double":"normal",aspect_ratio);
#endif
if (!vga.draw.vga_override)
if (!vga.draw.vga_override)
RENDER_SetSize(width, height, bpp, (float)fps, aspect_ratio,
doublewidth, doubleheight);
doublewidth, doubleheight);
}
}