diff options
author | uruk | 2013-08-16 12:21:37 +0200 |
---|---|---|
committer | uruk | 2013-08-16 12:21:37 +0200 |
commit | ea65a8667872cd2128d786eda2e77c3786161f36 (patch) | |
tree | 7d37d3bfbf849a57fc87f7d1c62328508175541d /engines | |
parent | fde55085028b5837a95a394fe8beab394f843fb0 (diff) | |
download | scummvm-rg350-ea65a8667872cd2128d786eda2e77c3786161f36.tar.gz scummvm-rg350-ea65a8667872cd2128d786eda2e77c3786161f36.tar.bz2 scummvm-rg350-ea65a8667872cd2128d786eda2e77c3786161f36.zip |
AVALANCHE: Implement Gyro::load_a_mouse(), some cosmetic correction in Gyro.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/avalanche/gyro2.cpp | 129 | ||||
-rw-r--r-- | engines/avalanche/gyro2.h | 1 |
2 files changed, 83 insertions, 47 deletions
diff --git a/engines/avalanche/gyro2.cpp b/engines/avalanche/gyro2.cpp index 73a321af07..4bb2305568 100644 --- a/engines/avalanche/gyro2.cpp +++ b/engines/avalanche/gyro2.cpp @@ -54,7 +54,7 @@ const char *Gyro::copyright = "1995"; const mp Gyro::mps[9] = { { - /* 1 - up-arrow */ + // 1 - up-arrow { {65151, 64575, 64575, 63519, 63519, 61455, 61455, 57351, 57351, 49155, 49155, 64575, 64575, 64575, 64575, 64575}, {0, 384, 384, 960, 960, 2016, 2016, 4080, 4080, 8184, 384, 384, 384, 384, 384, 0} }, @@ -63,17 +63,16 @@ const mp Gyro::mps[9] = { }, { - /* 2 - screwdriver */ + // 2 - screwdriver { {8191, 4095, 2047, 34815, 50175, 61951, 63743, 64543, 65039, 65031, 65027, 65281, 65408, 65472, 65505, 65523}, {0, 24576, 28672, 12288, 2048, 1024, 512, 256, 224, 176, 216, 96, 38, 10, 12, 0} - }, 0, 0 }, { - /* 3 - right-arrow */ + // 3 - right-arrow { {65535, 65535, 64639, 64543, 7, 1, 0, 1, 7, 64543, 64639, 65535, 65535, 65535, 65535, 65535}, {0, 0, 0, 384, 480, 32760, 32766, 32760, 480, 384, 0, 0, 0, 0, 0, 0} }, @@ -82,58 +81,58 @@ const mp Gyro::mps[9] = { }, { - /* 4 - fletch */ + // 4 - fletch { {255, 511, 1023, 2047, 1023, 4607, 14591, 31871, 65031, 65283, 65281, 65280, 65280, 65409, 65473, 65511}, {0, 10240, 20480, 24576, 26624, 17408, 512, 256, 128, 88, 32, 86, 72, 20, 16, 0} }, 0, 0 - }, + }, - { - /* 5 - hourglass */ - { {0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0}, - {0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0} - }, - 8, - 7 + { + // 5 - hourglass + { {0, 0, 0, 34785, 50115, 61455, 61455, 63519, 63519, 61839, 61455, 49155, 32769, 0, 0, 0}, + {0, 32766, 16386, 12300, 2064, 1440, 1440, 576, 576, 1056, 1440, 3024, 14316, 16386, 32766, 0} }, + 8, + 7 + }, - { - /* 6 - TTHand */ - { {62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443}, - {3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092} - }, - 4, - 0 + { + // 6 - TTHand + { {62463, 57855, 57855, 57855, 57471, 49167, 32769, 0, 0, 0, 0, 32768, 49152, 57344, 61441, 61443}, + {3072, 4608, 4608, 4608, 4992, 12912, 21070, 36937, 36873, 36865, 32769, 16385, 8193, 4097, 2050, 4092} }, + 4, + 0 + }, - { - /* 7- Mark's crosshairs */ - { {65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535}, - {0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0} - }, - 8, - 5 + { + // 7- Mark's crosshairs + { {65535, 65151, 65151, 65151, 65151, 0, 65151, 65151, 65151, 65151, 65535, 65535, 65535, 65535, 65535, 65535}, + {0, 384, 384, 384, 384, 65535, 384, 384, 384, 384, 0, 0, 0, 0, 0, 0} }, + 8, + 5 + }, - { - /* 8- I-beam. */ - { {65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535}, - {0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0} - }, - 8, - 7 + { + // 8- I-beam + { {65535, 65535, 63631, 63503, 63503, 65087, 65087, 65087, 65087, 65087, 63503, 63503, 63631, 65535, 65535, 65535}, + {0, 0, 0, 864, 128, 128, 128, 128, 128, 128, 128, 864, 0, 0, 0, 0} }, + 8, + 7 + }, - { - /* 9- Question mark. */ - { {511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695}, - {65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840} - }, - 0, - 0 - } + { + // 9 - question mark + { {511, 1023, 2047, 31, 15, 8199, 32647, 65415, 63503, 61471, 61503, 61695, 63999, 63999, 61695, 61695}, + {65024, 33792, 34816, 34784, 40976, 57224, 32840, 72, 1936, 2080, 2496, 2304, 1536, 1536, 2304, 3840} + }, + 0, + 0 + } }; const Common::String Gyro::lads[17] = { @@ -279,7 +278,8 @@ Common::String Gyro::strf(int32 x) { } void Gyro::newpointer(byte m) { - if (m == cmp) return; + if (m == cmp) + return; cmp = m; /*r.ax = 9; @@ -295,7 +295,7 @@ void Gyro::newpointer(byte m) { load_a_mouse(m); } -void Gyro::wait() { /* makes hourglass */ +void Gyro::wait() { // Makes hourglass. newpointer(5); } @@ -587,13 +587,48 @@ void Gyro::load_a_mouse(byte which) { return; } + ::Graphics::Surface cursor; + cursor.create(16, 32, ::Graphics::PixelFormat::createFormatCLUT8()); + cursor.fillRect(Common::Rect(0, 0, 16, 32), 255); + + + // The AND mask. f.seek(mouse_size * 2 * (which - 1) + 134); - f.read(vmc.andpic, mouse_size); - - f.read(vmc.xorpic, mouse_size); + ::Graphics::Surface mask = _vm->_graphics->loadPictureGraphic(f); + + for (byte j = 0; j < mask.h; j++) + for (byte i = 0; i < mask.w; i++) + for (byte k = 0; k < 2; k++) + if (*(byte *)mask.getBasePtr(i, j) == 0) + *(byte *)cursor.getBasePtr(i, j * 2 + k) = 0; + mask.free(); + + // The OR mask. + f.seek(mouse_size * 2 * (which - 1) + 134 * 2); + + mask = _vm->_graphics->loadPictureGraphic(f); + + for (byte j = 0; j < mask.h; j++) + for (byte i = 0; i < mask.w; i++) + for (byte k = 0; k < 2; k++) { + byte pixel = *(byte *)mask.getBasePtr(i, j); + if (pixel != 0) + *(byte *)cursor.getBasePtr(i, j * 2 + k) = pixel; + } + + mask.free(); + f.close(); + + + + CursorMan.replaceCursor(cursor.pixels, 16, 32, mps[which].horzhotspot, mps[which].verthotspot, 255, false); + + cursor.free(); + + vmc.ofsx = -mps[which].horzhotspot; vmc.ofsy = -mps[which].verthotspot; diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 03c2ef4fa3..a5271fa133 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -35,6 +35,7 @@ #include "common/file.h" #include "graphics/surface.h" +#include "graphics/cursorman.h" #include "avalanche/roomnums.h" #include "avalanche/color.h" |