mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-02 00:42:24 +00:00
AGOS: Silence GCC memset() warnings
Recent GCC versions complain if you memset() a class or struct that contain non-POD data types. Get around that by either initializing the object when created, or by adding a reset() method.
This commit is contained in:
parent
71a9def71e
commit
b5b136b177
@ -132,7 +132,18 @@ struct VgaSprite {
|
||||
uint16 priority;
|
||||
uint16 windowNum;
|
||||
uint16 zoneNum;
|
||||
VgaSprite() { memset(this, 0, sizeof(*this)); }
|
||||
VgaSprite() { reset(); }
|
||||
|
||||
void reset() {
|
||||
id = 0;
|
||||
image = 0;
|
||||
palette = 0;
|
||||
x = y = 0;
|
||||
flags = 0;
|
||||
priority = 0;
|
||||
windowNum = 0;
|
||||
zoneNum = 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct VgaSleepStruct {
|
||||
|
@ -1083,7 +1083,7 @@ void AGOSEngine::vc27_resetSprite() {
|
||||
|
||||
_lastVgaWaitFor = 0;
|
||||
|
||||
memset(&bak, 0, sizeof(bak));
|
||||
bak.reset();
|
||||
|
||||
vsp = _vgaSprites;
|
||||
while (vsp->id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user