#660: convert wrong modeltype to warning

This commit is contained in:
Denis Pauk 2021-02-03 00:08:10 +02:00
parent 1882fc2dbc
commit 0b79fa99ed
3 changed files with 27 additions and 11 deletions

View file

@ -177,7 +177,9 @@ RE_Draw_StretchPicImplementation (int x, int y, int w, int h, const image_t *pic
(x + w > vid.width) || (x + w > vid.width) ||
(y + h > vid.height)) (y + h > vid.height))
{ {
ri.Sys_Error(ERR_FATAL, "%s: bad coordinates", __func__); R_Printf(PRINT_ALL, "%s: bad coordinates %dx%d[%dx%d]",
__func__, x, y, w, h);
return;
} }
VID_DamageBuffer(x, y); VID_DamageBuffer(x, y);

View file

@ -855,8 +855,13 @@ R_DrawEntitiesOnList (void)
R_AliasDrawModel(currententity, currentmodel); R_AliasDrawModel(currententity, currentmodel);
break; break;
default: case mod_brush:
break; break;
default:
R_Printf(PRINT_ALL, "%s: Bad modeltype %d\n",
__func__, currentmodel->type);
return;
} }
} }
} }
@ -900,8 +905,13 @@ R_DrawEntitiesOnList (void)
R_AliasDrawModel(currententity, currentmodel); R_AliasDrawModel(currententity, currentmodel);
break; break;
default: case mod_brush:
break; break;
default:
R_Printf(PRINT_ALL, "%s: Bad modeltype %d\n",
__func__, currentmodel->type);
return;
} }
} }
} }
@ -1453,7 +1463,8 @@ RE_BeginFrame( float camera_separation )
// we need redraw everything // we need redraw everything
VID_WholeDamageBuffer(); VID_WholeDamageBuffer();
// and backbuffer should be zeroed // and backbuffer should be zeroed
memset(swap_buffers + ((swap_current + 1)&1), 0, vid.height * vid.width * sizeof(pixel_t)); memset(swap_buffers + ((swap_current + 1)&1), 0,
vid.height * vid.width * sizeof(pixel_t));
vid_gamma->modified = false; vid_gamma->modified = false;
sw_overbrightbits->modified = false; sw_overbrightbits->modified = false;
@ -2140,7 +2151,8 @@ RE_CleanFrame(void)
int pitch; int pitch;
Uint32 *pixels; Uint32 *pixels;
memset(swap_buffers, 0, vid.height * vid.width * sizeof(pixel_t) * 2); memset(swap_buffers, 0,
vid.height * vid.width * sizeof(pixel_t) * 2);
if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch)) if (SDL_LockTexture(texture, NULL, (void**)&pixels, &pitch))
{ {
@ -2291,9 +2303,9 @@ SWimp_SetMode(int *pwidth, int *pheight, int mode, int fullscreen )
if(ri.GLimp_GetDesktopMode(&real_width, &real_height)) if(ri.GLimp_GetDesktopMode(&real_width, &real_height))
{ {
if (real_height) if (real_height && (real_height != *pheight))
{ {
*pwidth = (*pheight) * real_width / real_height; *pwidth = ((*pheight) * real_width) / real_height;
} }
} }

View file

@ -355,8 +355,9 @@ void R_DrawEntitiesOnList (void)
R_DrawSpriteModel(currententity, currentmodel); R_DrawSpriteModel(currententity, currentmodel);
break; break;
default: default:
ri.Sys_Error(ERR_DROP, "%s, Bad modeltype", __func__); R_Printf(PRINT_ALL, "%s: Bad modeltype %d\n",
break; __func__, currentmodel->type);
return;
} }
} }
} }
@ -394,8 +395,9 @@ void R_DrawEntitiesOnList (void)
R_DrawSpriteModel(currententity, currentmodel); R_DrawSpriteModel(currententity, currentmodel);
break; break;
default: default:
ri.Sys_Error(ERR_DROP, "%s, Bad modeltype", __func__); R_Printf(PRINT_ALL, "%s: Bad modeltype %d\n",
break; __func__, currentmodel->type);
return;
} }
} }
} }