1
0
Fork 0

Codechange: Add default initialisation for Rect to remove MemSetT.

pull/13829/head
Peter Nelson 2025-03-08 19:52:02 +00:00 committed by Peter Nelson
parent c905472650
commit 62b8b93476
2 changed files with 10 additions and 11 deletions

View File

@ -73,10 +73,10 @@ inline const RectPadding RectPadding::zero{};
/** Specification of a rectangle with absolute coordinates of all edges */
struct Rect {
int left;
int top;
int right;
int bottom;
int left = 0;
int top = 0;
int right = 0;
int bottom = 0;
/**
* Get width of Rect.
@ -232,10 +232,10 @@ struct Rect {
* (relative) width/height
*/
struct PointDimension {
int x;
int y;
int width;
int height;
int x = 0;
int y = 0;
int width = 0;
int height = 0;
};
#endif /* GEOMETRY_TYPE_HPP */

View File

@ -21,7 +21,6 @@
#include "../progress.h"
#include "../core/random_func.hpp"
#include "../core/math_func.hpp"
#include "../core/mem_func.hpp"
#include "../core/geometry_func.hpp"
#include "../fileio_func.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);
h = std::max(h, 64);
MemSetT(&this->dirty_rect, 0);
this->dirty_rect = {};
bool res = OpenGLBackend::Get()->Resize(w, h, force);
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);
OpenGLBackend::Get()->ReleaseVideoBuffer(this->dirty_rect);
MemSetT(&this->dirty_rect, 0);
this->dirty_rect = {};
this->anim_buffer = nullptr;
}