Remove screen static initializer
Most of the fields are initialized dynamically.
This commit is contained in:
parent
5cfa159e16
commit
738d17e843
@ -194,9 +194,13 @@ screen_update_content_rect(struct screen *screen) {
|
||||
void
|
||||
screen_init(struct screen *screen, struct video_buffer *vb,
|
||||
struct fps_counter *fps_counter) {
|
||||
*screen = (struct screen) SCREEN_INITIALIZER;
|
||||
screen->vb = vb;
|
||||
screen->fps_counter = fps_counter;
|
||||
|
||||
screen->resize_pending = false;
|
||||
screen->has_frame = false;
|
||||
screen->fullscreen = false;
|
||||
screen->maximized = false;
|
||||
}
|
||||
|
||||
static inline SDL_Texture *
|
||||
|
@ -38,39 +38,6 @@ struct screen {
|
||||
bool mipmaps;
|
||||
};
|
||||
|
||||
#define SCREEN_INITIALIZER { \
|
||||
.vb = NULL, \
|
||||
.fps_counter = NULL, \
|
||||
.window = NULL, \
|
||||
.renderer = NULL, \
|
||||
.texture = NULL, \
|
||||
.gl = {0}, \
|
||||
.frame_size = { \
|
||||
.width = 0, \
|
||||
.height = 0, \
|
||||
}, \
|
||||
.content_size = { \
|
||||
.width = 0, \
|
||||
.height = 0, \
|
||||
}, \
|
||||
.resize_pending = false, \
|
||||
.windowed_content_size = { \
|
||||
.width = 0, \
|
||||
.height = 0, \
|
||||
}, \
|
||||
.rotation = 0, \
|
||||
.rect = { \
|
||||
.x = 0, \
|
||||
.y = 0, \
|
||||
.w = 0, \
|
||||
.h = 0, \
|
||||
}, \
|
||||
.has_frame = false, \
|
||||
.fullscreen = false, \
|
||||
.maximized = false, \
|
||||
.mipmaps = false, \
|
||||
}
|
||||
|
||||
// initialize default values
|
||||
void
|
||||
screen_init(struct screen *screen, struct video_buffer *vb,
|
||||
|
Loading…
x
Reference in New Issue
Block a user