mirror of https://github.com/OpenTTD/OpenTTD
Codechange: Add default initialisation for Rect to remove MemSetT.
parent
c905472650
commit
62b8b93476
|
@ -73,10 +73,10 @@ inline const RectPadding RectPadding::zero{};
|
||||||
|
|
||||||
/** Specification of a rectangle with absolute coordinates of all edges */
|
/** Specification of a rectangle with absolute coordinates of all edges */
|
||||||
struct Rect {
|
struct Rect {
|
||||||
int left;
|
int left = 0;
|
||||||
int top;
|
int top = 0;
|
||||||
int right;
|
int right = 0;
|
||||||
int bottom;
|
int bottom = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get width of Rect.
|
* Get width of Rect.
|
||||||
|
@ -232,10 +232,10 @@ struct Rect {
|
||||||
* (relative) width/height
|
* (relative) width/height
|
||||||
*/
|
*/
|
||||||
struct PointDimension {
|
struct PointDimension {
|
||||||
int x;
|
int x = 0;
|
||||||
int y;
|
int y = 0;
|
||||||
int width;
|
int width = 0;
|
||||||
int height;
|
int height = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* GEOMETRY_TYPE_HPP */
|
#endif /* GEOMETRY_TYPE_HPP */
|
||||||
|
|
|
@ -21,7 +21,6 @@
|
||||||
#include "../progress.h"
|
#include "../progress.h"
|
||||||
#include "../core/random_func.hpp"
|
#include "../core/random_func.hpp"
|
||||||
#include "../core/math_func.hpp"
|
#include "../core/math_func.hpp"
|
||||||
#include "../core/mem_func.hpp"
|
|
||||||
#include "../core/geometry_func.hpp"
|
#include "../core/geometry_func.hpp"
|
||||||
#include "../fileio_func.h"
|
#include "../fileio_func.h"
|
||||||
#include "../framerate_type.h"
|
#include "../framerate_type.h"
|
||||||
|
@ -144,7 +143,7 @@ bool VideoDriver_SDL_OpenGL::AllocateBackingStore(int w, int h, bool force)
|
||||||
|
|
||||||
w = std::max(w, 64);
|
w = std::max(w, 64);
|
||||||
h = std::max(h, 64);
|
h = std::max(h, 64);
|
||||||
MemSetT(&this->dirty_rect, 0);
|
this->dirty_rect = {};
|
||||||
|
|
||||||
bool res = OpenGLBackend::Get()->Resize(w, h, force);
|
bool res = OpenGLBackend::Get()->Resize(w, h, force);
|
||||||
SDL_GL_SwapWindow(this->sdl_window);
|
SDL_GL_SwapWindow(this->sdl_window);
|
||||||
|
@ -167,7 +166,7 @@ void VideoDriver_SDL_OpenGL::ReleaseVideoPointer()
|
||||||
{
|
{
|
||||||
if (this->anim_buffer != nullptr) OpenGLBackend::Get()->ReleaseAnimBuffer(this->dirty_rect);
|
if (this->anim_buffer != nullptr) OpenGLBackend::Get()->ReleaseAnimBuffer(this->dirty_rect);
|
||||||
OpenGLBackend::Get()->ReleaseVideoBuffer(this->dirty_rect);
|
OpenGLBackend::Get()->ReleaseVideoBuffer(this->dirty_rect);
|
||||||
MemSetT(&this->dirty_rect, 0);
|
this->dirty_rect = {};
|
||||||
this->anim_buffer = nullptr;
|
this->anim_buffer = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue