aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authoruruk2013-07-04 11:41:42 +0200
committeruruk2013-07-04 11:41:42 +0200
commit218c7c3ffb939d9e23b9670dd57a4c71b2385308 (patch)
tree9389d5dc9dbccf9532a6d3ab9363ff14fa1b19ff /engines
parentd66e89c888b53b8d4424480825db82e855bd93de (diff)
downloadscummvm-rg350-218c7c3ffb939d9e23b9670dd57a4c71b2385308.tar.gz
scummvm-rg350-218c7c3ffb939d9e23b9670dd57a4c71b2385308.tar.bz2
scummvm-rg350-218c7c3ffb939d9e23b9670dd57a4c71b2385308.zip
AVALANCHE: Gyro: change void* to byte*, make memory handling more C++-like.
Diffstat (limited to 'engines')
-rw-r--r--engines/avalanche/gyro2.cpp16
-rw-r--r--engines/avalanche/gyro2.h4
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;