diff options
Diffstat (limited to 'engines/avalanche')
-rw-r--r-- | engines/avalanche/gyro2.cpp | 16 | ||||
-rw-r--r-- | engines/avalanche/gyro2.h | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 04a1d1425f..078eb1c14d 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -252,11 +252,11 @@ Gyro::Gyro() : interrogation(0), oncandopageswap(true) { Gyro::~Gyro() { /* These are allocated in Gyro::setup_vmc */ - free(vmc.andpic); - free(vmc.xorpic); + delete[] vmc.andpic; + delete[] vmc.xorpic; for (int fv = 0; fv < 2; fv ++) { - free(vmc.backpic[fv]); + delete[] vmc.backpic[fv]; } } @@ -480,11 +480,11 @@ void Gyro::wipe_vmc(byte page_) { } void Gyro::setup_vmc() { - vmc.andpic = malloc(mouse_size); - vmc.xorpic = malloc(mouse_size); + vmc.andpic = new byte[mouse_size]; + vmc.xorpic = new byte[mouse_size]; for (int fv = 0; fv < 2; fv ++) { - vmc.backpic[fv] = malloc(mouse_size); + vmc.backpic[fv] = new byte[mouse_size]; vmc.wherewas[fv].x = 32767; } } @@ -512,10 +512,10 @@ void Gyro::load_a_mouse(byte which) { f.seek(mouse_size * 2 * (which - 1) + 134); for (int i = 0; i < mouse_size; i++) - ((byte *) vmc.andpic)[i] = f.readByte(); + vmc.andpic[i] = f.readByte(); for (int i = 0; i < mouse_size; i++) - ((byte *) vmc.xorpic)[i] = f.readByte(); + vmc.xorpic[i] = f.readByte(); f.close(); diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 719d04875f..4aab2236da 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -230,8 +230,8 @@ struct PointType { }; struct vmctype { /* Virtual Mouse Cursor */ - void *andpic, *xorpic; - void *backpic[2]; + byte *andpic, *xorpic; + byte *backpic[2]; PointType wherewas[2]; byte picnumber; int8 ofsx, ofsy; |