aboutsummaryrefslogtreecommitdiff
path: root/engines/cge
diff options
context:
space:
mode:
authorD G Turner2019-07-24 21:57:35 +0100
committerD G Turner2019-07-24 21:57:35 +0100
commitaf850a3e372495fe527be4c81ced3a57cbbe490d (patch)
treec0120d4eebb803767233b9ee7e5afcedbbf0f276 /engines/cge
parent47811167d5ddd9cbf64099ad36f2da5ae413fc86 (diff)
downloadscummvm-rg350-af850a3e372495fe527be4c81ced3a57cbbe490d.tar.gz
scummvm-rg350-af850a3e372495fe527be4c81ced3a57cbbe490d.tar.bz2
scummvm-rg350-af850a3e372495fe527be4c81ced3a57cbbe490d.zip
CGE: Fix GCC Warnings by Explicit Structure Initialization
Some of the members of the structures do not need this as they have constructors which do this implicitly.
Diffstat (limited to 'engines/cge')
-rw-r--r--engines/cge/events.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/engines/cge/events.cpp b/engines/cge/events.cpp
index d7c065ef6a..0cc32ce11d 100644
--- a/engines/cge/events.cpp
+++ b/engines/cge/events.cpp
@@ -238,8 +238,15 @@ void Mouse::newMouse(Common::Event &event) {
EventManager::EventManager(CGEEngine *vm) : _vm(vm){
_eventQueueHead = 0;
_eventQueueTail = 0;
- memset(&_eventQueue, 0, kEventMax * sizeof(CGEEvent));
- 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() {