mirror of https://github.com/OpenTTD/OpenTTD
Codefix: do not leave pointers to stack allocations in globals
parent
dae788e2e3
commit
c13226cdf8
|
@ -9907,8 +9907,8 @@ static void DecodeSpecialSprite(uint8_t *buf, uint num, GrfLoadingStage stage)
|
|||
*/
|
||||
static void LoadNewGRFFileFromFile(GRFConfig &config, GrfLoadingStage stage, SpriteFile &file)
|
||||
{
|
||||
_cur.file = &file;
|
||||
_cur.grfconfig = &config;
|
||||
AutoRestoreBackup cur_file(_cur.file, &file);
|
||||
AutoRestoreBackup cur_config(_cur.grfconfig, &config);
|
||||
|
||||
Debug(grf, 2, "LoadNewGRFFile: Reading NewGRF-file '{}'", config.filename);
|
||||
|
||||
|
|
|
@ -1833,7 +1833,7 @@ void ViewportDoDraw(const Viewport *vp, int left, int top, int right, int bottom
|
|||
dp.zoom = ZOOM_LVL_MIN;
|
||||
dp.width = UnScaleByZoom(dp.width, zoom);
|
||||
dp.height = UnScaleByZoom(dp.height, zoom);
|
||||
_cur_dpi = &dp;
|
||||
AutoRestoreBackup cur_dpi(_cur_dpi, &dp);
|
||||
|
||||
if (vp->overlay != nullptr && vp->overlay->GetCargoMask() != 0 && vp->overlay->GetCompanyMask().Any()) {
|
||||
/* translate to window coordinates */
|
||||
|
|
Loading…
Reference in New Issue