From 76ec4b8d82b8bcefd752e221fe5f9e2184d1c643 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Wed, 24 Jul 2019 22:04:37 +0100 Subject: CGE2: Fix GCC Warnings by Explicit Structure Initialization This is as per the changes to the CGE engine. --- engines/cge2/events.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'engines/cge2') diff --git a/engines/cge2/events.cpp b/engines/cge2/events.cpp index b5c452745b..3493363d42 100644 --- a/engines/cge2/events.cpp +++ b/engines/cge2/events.cpp @@ -207,8 +207,15 @@ void Mouse::newMouse(Common::Event &event) { EventManager::EventManager(CGE2Engine *vm) : _vm(vm) { _eventQueueHead = 0; _eventQueueTail = 0; - memset(&_eventQueue, 0, kEventMax * sizeof(CGE2Event)); - memset(&_event, 0, sizeof(Common::Event)); + for (uint16 k = 0; k < kEventMax; k++) { + _eventQueue[k]._mask = 0; + _eventQueue[k]._x = 0; + _eventQueue[k]._y = 0; + _eventQueue[k]._spritePtr = nullptr; + } + _event.joystick.axis = 0; + _event.joystick.position = 0; + _event.joystick.button = 0; } void EventManager::poll() { -- cgit v1.2.3