-
diff -r -N -u lure.old/anim.cpp lure/anim.cpp
old
|
new
|
|
136 | 136 | return true; |
137 | 137 | } |
138 | 138 | |
139 | | } // end of namespace Lure |
140 | | No newline at end of file |
| 139 | } // end of namespace Lure |
-
diff -r -N -u lure.old/anim.h lure/anim.h
old
|
new
|
|
32 | 32 | |
33 | 33 | } // End of namespace Lure |
34 | 34 | |
35 | | #endif |
36 | | No newline at end of file |
| 35 | #endif |
-
diff -r -N -u lure.old/decode.cpp lure/decode.cpp
old
|
new
|
|
130 | 130 | return dest; |
131 | 131 | } |
132 | 132 | |
133 | | } // end of namespace Lure |
134 | | No newline at end of file |
| 133 | } // end of namespace Lure |
-
diff -r -N -u lure.old/decode.h lure/decode.h
old
|
new
|
|
33 | 33 | |
34 | 34 | } // End of namespace Lure |
35 | 35 | |
36 | | #endif |
37 | | No newline at end of file |
| 36 | #endif |
-
diff -r -N -u lure.old/disk.cpp lure/disk.cpp
old
|
new
|
|
143 | 143 | return &_entries[entryIndex]; |
144 | 144 | } |
145 | 145 | |
146 | | } // end of namespace Lure |
147 | | No newline at end of file |
| 146 | } // end of namespace Lure |
-
diff -r -N -u lure.old/disk.h lure/disk.h
old
|
new
|
|
50 | 50 | |
51 | 51 | } // end of namespace Lure |
52 | 52 | |
53 | | #endif |
54 | | No newline at end of file |
| 53 | #endif |
-
diff -r -N -u lure.old/events.cpp lure/events.cpp
old
|
new
|
|
48 | 48 | case OSystem::EVENT_RBUTTONUP: |
49 | 49 | _rButton = false; |
50 | 50 | break; |
| 51 | case OSystem::EVENT_KEYDOWN: |
| 52 | case OSystem::EVENT_KEYUP: |
| 53 | case OSystem::EVENT_MOUSEMOVE: |
| 54 | case OSystem::EVENT_WHEELUP: |
| 55 | case OSystem::EVENT_WHEELDOWN: |
| 56 | case OSystem::EVENT_SCREEN_CHANGED: |
| 57 | break; |
| 58 | case OSystem::EVENT_QUIT: |
| 59 | _system.quit(); |
| 60 | break; |
51 | 61 | } |
52 | 62 | } |
53 | 63 | |
… |
… |
|
65 | 75 | void Mouse::setCursorNum(uint8 cursorNum) |
66 | 76 | { |
67 | 77 | _cursorNum = cursorNum; |
68 | | int x = 7, y = 7; |
69 | | if ((cursorNum == CURSOR_ARROW) || (cursorNum == CURSOR_MENUBAR)) |
70 | | { |
71 | | x = 0; y = 0; |
| 78 | int x1 = 7, y1 = 7; |
| 79 | if ((cursorNum == CURSOR_ARROW) || (cursorNum == CURSOR_MENUBAR)) { |
| 80 | x1 = 0; |
| 81 | y1 = 0; |
72 | 82 | } |
73 | 83 | |
74 | 84 | byte *cursorAddr = _cursors->data() + (cursorNum * CURSOR_SIZE); |
75 | | _system.setMouseCursor(cursorAddr, CURSOR_WIDTH, CURSOR_HEIGHT, x, y, 0); |
| 85 | _system.setMouseCursor(cursorAddr, CURSOR_WIDTH, CURSOR_HEIGHT, x1, y1, 0); |
76 | 86 | } |
77 | 87 | |
78 | 88 | void Mouse::setCursorNum(uint8 cursorNum, int hotspotX, int hotspotY) |
… |
… |
|
82 | 92 | _system.setMouseCursor(cursorAddr, CURSOR_WIDTH, CURSOR_HEIGHT, hotspotX, hotspotY, 0); |
83 | 93 | } |
84 | 94 | |
85 | | void Mouse::setPosition(int x, int y) |
| 95 | void Mouse::setPosition(int x1, int y1) |
86 | 96 | { |
87 | | _system.warpMouse(x, y); |
| 97 | _system.warpMouse(x1, y1); |
88 | 98 | } |
89 | 99 | |
90 | 100 | /*--------------------------------------------------------------------------*/ |
… |
… |
|
121 | 131 | case OSystem::EVENT_WHEELUP: |
122 | 132 | case OSystem::EVENT_WHEELDOWN: |
123 | 133 | _mouse.handleEvent(_event); |
| 134 | break; |
| 135 | |
| 136 | case OSystem::EVENT_KEYDOWN: |
| 137 | case OSystem::EVENT_KEYUP: |
| 138 | case OSystem::EVENT_SCREEN_CHANGED: |
124 | 139 | break; |
125 | 140 | } |
126 | 141 | |
-
diff -r -N -u lure.old/events.h lure/events.h
old
|
new
|
|
53 | 53 | |
54 | 54 | } // End of namespace Lure |
55 | 55 | |
56 | | #endif |
57 | | No newline at end of file |
| 56 | #endif |
-
diff -r -N -u lure.old/game.cpp lure/game.cpp
old
|
new
|
|
141 | 141 | void Game::doTextSpeed() |
142 | 142 | { |
143 | 143 | slowSpeedFlag = !slowSpeedFlag; |
144 | | char *pSrc = slowSpeedFlag ? "Slow" : "Fast"; |
| 144 | const char *pSrc = slowSpeedFlag ? "Slow" : "Fast"; |
145 | 145 | char *pDest = _menu.getMenu(2).getEntry(1); |
146 | 146 | memcpy(pDest, pSrc, 4); |
147 | 147 | } |
… |
… |
|
149 | 149 | void Game::doSound() |
150 | 150 | { |
151 | 151 | soundFlag = !soundFlag; |
152 | | char *pSrc = soundFlag ? "on " : "off"; |
| 152 | const char *pSrc = soundFlag ? "on " : "off"; |
153 | 153 | char *pDest = _menu.getMenu(2).getEntry(2) + 6; |
154 | 154 | memcpy(pDest, pSrc, 3); |
155 | 155 | } |
156 | 156 | |
157 | 157 | |
158 | | } |
159 | | No newline at end of file |
| 158 | } |
-
diff -r -N -u lure.old/intro.cpp lure/intro.cpp
old
|
new
|
|
15 | 15 | static const uint16 start_screens[] = {0x18, 0x1A, 0x1E, 0x1C, 0}; |
16 | 16 | static const AnimRecord anim_screens[] = {{0x40, 0, true, true}, {0x42, 1, false, true}, |
17 | 17 | {0x44, 2, false, false}, {0x24, 3, false, true}, {0x46, 3, false, false}, |
18 | | {0}}; |
| 18 | {0, 0, false, false}}; |
19 | 19 | |
20 | 20 | // showScreen |
21 | 21 | // Shows a screen by loading it from the given resource, and then fading it in |
… |
… |
|
89 | 89 | |
90 | 90 | result = false; |
91 | 91 | switch (anim->show()) { |
92 | | case ABORT_NONE: |
93 | | if (curr_anim->endingPause) { |
94 | | result = delay(12000); |
95 | | } |
96 | | break; |
97 | | case ABORT_END_INTRO: |
98 | | result = true; |
99 | | break; |
| 92 | case ABORT_NONE: |
| 93 | if (curr_anim->endingPause) { |
| 94 | result = delay(12000); |
| 95 | } |
| 96 | break; |
| 97 | |
| 98 | case ABORT_END_INTRO: |
| 99 | result = true; |
| 100 | break; |
| 101 | |
| 102 | case ABORT_NEXT_SCENE: |
| 103 | break; |
100 | 104 | } |
101 | 105 | delete anim; |
102 | 106 | |
… |
… |
|
123 | 127 | return false; |
124 | 128 | } |
125 | 129 | |
126 | | } // end of namespace Lure |
127 | | No newline at end of file |
| 130 | } // end of namespace Lure |
-
diff -r -N -u lure.old/intro.h lure/intro.h
old
|
new
|
|
24 | 24 | |
25 | 25 | } // End of namespace Lure |
26 | 26 | |
27 | | #endif |
28 | | No newline at end of file |
| 27 | #endif |
-
diff -r -N -u lure.old/lure.cpp lure/lure.cpp
old
|
new
|
|
126 | 126 | return new LureEngine(detector, system); |
127 | 127 | } |
128 | 128 | |
129 | | REGISTER_PLUGIN(LURE, "Lure of the Temptress Engine"); |
| 129 | REGISTER_PLUGIN(LURE, "Lure of the Temptress Engine") |
130 | 130 | |
131 | 131 | namespace Lure { |
132 | 132 | |
… |
… |
|
143 | 143 | |
144 | 144 | _features = 0; |
145 | 145 | _game = 0; |
| 146 | } |
146 | 147 | |
| 148 | void LureEngine::detectGame() { |
147 | 149 | // Make sure all the needed files are present |
148 | 150 | for (uint8 fileNum=0; fileNum<5; ++fileNum) |
149 | 151 | { |
… |
… |
|
159 | 161 | error("Missing disk%d.vga", fileNum); |
160 | 162 | } |
161 | 163 | } |
162 | | |
163 | 164 | |
164 | 165 | uint8 md5sum[16]; |
165 | 166 | char md5str[32 + 1]; |
166 | 167 | const LureGameSettings *g; |
167 | 168 | bool found = false; |
168 | 169 | |
| 170 | *md5str = 0; |
| 171 | |
169 | 172 | for (g = lure_games; g->name; g++) { |
170 | 173 | if (!Common::File::exists(g->checkFile)) |
171 | 174 | continue; |
… |
… |
|
216 | 219 | driver->property(MidiDriver::PROP_CHANNEL_MASK, 0x03FE); |
217 | 220 | } |
218 | 221 | |
| 222 | detectGame(); |
| 223 | |
219 | 224 | _disk = new Disk(_gameDataPath); |
220 | 225 | _screen = new Screen(*_system); |
221 | 226 | _mouse = new Mouse(*_system); |
… |
… |
|
246 | 251 | if (!_events->quitFlag) |
247 | 252 | { |
248 | 253 | // Play the game |
249 | | Game game(*_system); |
250 | | game.execute(); |
| 254 | Game game1(*_system); |
| 255 | game1.execute(); |
251 | 256 | } |
252 | 257 | |
253 | 258 | quitGame(); |
-
diff -r -N -u lure.old/lure.h lure/lure.h
old
|
new
|
|
39 | 39 | uint32 features() { return _features; } |
40 | 40 | uint8 game() { return _game; } |
41 | 41 | Disk &disk() { return *_disk; } |
| 42 | |
| 43 | private: |
| 44 | void detectGame(); |
42 | 45 | }; |
43 | 46 | |
44 | 47 | } // End of namespace Lure |
-
diff -r -N -u lure.old/memory.cpp lure/memory.cpp
old
|
new
|
|
29 | 29 | |
30 | 30 | /*--------------------------------------------------------------------------*/ |
31 | 31 | |
32 | | MemoryBlock::MemoryBlock(uint32 size) |
| 32 | MemoryBlock::MemoryBlock(uint32 size1) |
33 | 33 | { |
34 | | _data = (uint8 *) malloc(size); |
| 34 | _data = (uint8 *) malloc(size1); |
35 | 35 | if (!_data) error ("Failed allocating memory block"); |
36 | | _size = size; |
| 36 | _size = size1; |
37 | 37 | } |
38 | 38 | |
39 | 39 | MemoryBlock::MemoryBlock(MemoryBlock *src) |
… |
… |
|
82 | 82 | memcpy(pDest, pSrc, srcLen); |
83 | 83 | } |
84 | 84 | |
85 | | void MemoryBlock::reallocate(uint32 size) |
| 85 | void MemoryBlock::reallocate(uint32 size1) |
86 | 86 | { |
87 | | _size = size; |
88 | | _data = (byte *) realloc(_data, size); |
| 87 | _size = size1; |
| 88 | _data = (byte *) realloc(_data, size1); |
89 | 89 | if (!_data) error ("Failed reallocating memory block"); |
90 | 90 | } |
91 | 91 | |
92 | 92 | void MemoryBlock::saveToFile(const Common::String &filename) |
93 | 93 | { |
94 | 94 | Common::File *f = new Common::File(); |
95 | | f->open(filename.c_str(), Common::File::AccessMode::kFileWriteMode); |
| 95 | f->open(filename.c_str(), Common::File::kFileWriteMode); |
96 | 96 | f->write(_data, _size); |
97 | 97 | f->close(); |
98 | 98 | delete f; |
99 | 99 | } |
100 | 100 | |
101 | 101 | |
102 | | } // end of namespace Lure |
103 | | No newline at end of file |
| 102 | } // end of namespace Lure |
-
diff -r -N -u lure.old/memory.h lure/memory.h
old
|
new
|
|
39 | 39 | |
40 | 40 | } // end of namspace Lure |
41 | 41 | |
42 | | #endif |
43 | | No newline at end of file |
| 42 | #endif |
-
diff -r -N -u lure.old/menu.cpp lure/menu.cpp
old
|
new
|
|
5 | 5 | namespace Lure |
6 | 6 | { |
7 | 7 | |
8 | | MenuRecord::MenuRecord(uint16 hsxstart, uint16 hsxend, uint16 xstart, uint16 width, char *strings) |
| 8 | MenuRecord::MenuRecord(uint16 hsxstrt, uint16 hsxnd, uint16 xstrt, uint16 wdth, char *strings) |
9 | 9 | { |
10 | | _xstart = xstart; _width = width; |
11 | | _hsxstart = hsxstart; _hsxend = hsxend; |
| 10 | _xstart = xstrt; _width = wdth; |
| 11 | _hsxstart = hsxstrt; _hsxend = hsxnd; |
12 | 12 | |
13 | 13 | // Figure out the number of entries |
14 | 14 | char *s = strings; |
-
diff -r -N -u lure.old/menu.h lure/menu.h
old
|
new
|
|
60 | 60 | |
61 | 61 | } // End of namespace Lure |
62 | 62 | |
63 | | #endif |
64 | | No newline at end of file |
| 63 | #endif |
-
diff -r -N -u lure.old/module.mk lure/module.mk
old
|
new
|
|
| 1 | MODULE := lure |
| 2 | |
| 3 | MODULE_OBJS := \ |
| 4 | lure/anim.o \ |
| 5 | lure/decode.o \ |
| 6 | lure/disk.o \ |
| 7 | lure/events.o \ |
| 8 | lure/game.o \ |
| 9 | lure/intro.o \ |
| 10 | lure/lure.o \ |
| 11 | lure/memory.o \ |
| 12 | lure/menu.o \ |
| 13 | lure/palette.o \ |
| 14 | lure/screen.o \ |
| 15 | lure/surface.o |
| 16 | |
| 17 | MODULE_DIRS += \ |
| 18 | lure |
| 19 | |
| 20 | # This module can be built as a plugin |
| 21 | ifdef BUILD_PLUGINS |
| 22 | PLUGIN := 1 |
| 23 | endif |
| 24 | |
| 25 | # Include common rules |
| 26 | include $(srcdir)/common.rules |
-
diff -r -N -u lure.old/palette.cpp lure/palette.cpp
old
|
new
|
|
20 | 20 | // Consructor |
21 | 21 | // Sets up a palette with the given number of entries and a copy of the passed data |
22 | 22 | |
23 | | Palette::Palette(uint8 numEntries, const byte *data, PaletteSource paletteSource) |
| 23 | Palette::Palette(uint8 numEntries1, const byte *data1, PaletteSource paletteSource) |
24 | 24 | { |
25 | | _numEntries = numEntries; |
| 25 | _numEntries = numEntries1; |
26 | 26 | _palette = Memory::allocate(_numEntries * 4); |
27 | 27 | |
28 | | if (data) |
| 28 | if (data1) |
29 | 29 | { |
30 | 30 | if (paletteSource == RGB64) |
31 | | convertPalette(data, _numEntries); |
| 31 | convertPalette(data1, _numEntries); |
32 | 32 | else |
33 | | _palette->copyFrom(data, 0, 0, _numEntries*4); |
| 33 | _palette->copyFrom(data1, 0, 0, _numEntries*4); |
34 | 34 | } |
35 | 35 | |
36 | 36 | // If no data provided, set a null palette |
37 | | if (!data) _palette->empty(); |
| 37 | if (!data1) _palette->empty(); |
38 | 38 | } |
39 | 39 | |
40 | 40 | // Constructor |
… |
… |
|
63 | 63 | delete srcData; |
64 | 64 | } |
65 | 65 | |
66 | | void Palette::convertPalette(const byte *palette, uint16 numEntries) |
| 66 | void Palette::convertPalette(const byte *palette1, uint16 numEntries1) |
67 | 67 | { |
68 | 68 | byte *pDest = _palette->data(); |
69 | | const byte *pSrc = palette; |
| 69 | const byte *pSrc = palette1; |
70 | 70 | |
71 | | while (numEntries-- > 0) { |
| 71 | while (numEntries1-- > 0) { |
72 | 72 | *pDest++ = (pSrc[0] << 2) + (pSrc[0] >> 4); |
73 | 73 | *pDest++ = (pSrc[1] << 2) + (pSrc[1] >> 4); |
74 | 74 | *pDest++ = (pSrc[2] << 2) + (pSrc[2] >> 4); |
… |
… |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | |
137 | | } // end of namespace Lure |
138 | | No newline at end of file |
| 137 | } // end of namespace Lure |
-
diff -r -N -u lure.old/palette.h lure/palette.h
old
|
new
|
|
46 | 46 | |
47 | 47 | } // end of namspace Lure |
48 | 48 | |
49 | | #endif |
50 | | No newline at end of file |
| 49 | #endif |
-
diff -r -N -u lure.old/screen.cpp lure/screen.cpp
old
|
new
|
|
144 | 144 | _system.updateScreen(); |
145 | 145 | } |
146 | 146 | |
147 | | } // end of namespace Lure |
148 | | No newline at end of file |
| 147 | } // end of namespace Lure |
-
diff -r -N -u lure.old/screen.h lure/screen.h
old
|
new
|
|
42 | 42 | |
43 | 43 | } // End of namespace Lure |
44 | 44 | |
45 | | #endif |
46 | | No newline at end of file |
| 45 | #endif |
-
diff -r -N -u lure.old/surface.cpp lure/surface.cpp
old
|
new
|
|
24 | 24 | |
25 | 25 | /*--------------------------------------------------------------------------*/ |
26 | 26 | |
27 | | Surface::Surface(MemoryBlock *src, uint16 width, uint16 height): _data(src), |
28 | | _width(width), _height(height) |
| 27 | Surface::Surface(MemoryBlock *src, uint16 wdth, uint16 hght): _data(src), |
| 28 | _width(wdth), _height(hght) |
29 | 29 | { |
30 | | if ((uint32) (width * height) != src->size()) |
| 30 | if ((uint32) (wdth * hght) != src->size()) |
31 | 31 | error("Surface dimensions do not match size of passed data"); |
32 | 32 | } |
33 | 33 | |
34 | | Surface::Surface(uint16 width, uint16 height): _data(Memory::allocate(width*height)), |
35 | | _width(width), _height(height) |
| 34 | Surface::Surface(uint16 wdth, uint16 hght): _data(Memory::allocate(wdth*hght)), |
| 35 | _width(wdth), _height(hght) |
36 | 36 | { |
37 | 37 | } |
38 | 38 | |
… |
… |
|
53 | 53 | byte *pDest; |
54 | 54 | uint8 charWidth = 0; |
55 | 55 | |
56 | | for (int y=0; y<8; ++y) |
| 56 | for (int y1=0; y1<8; ++y1) |
57 | 57 | { |
58 | 58 | v = *pFont++; |
59 | | pDest = addr + (y * _width); |
| 59 | pDest = addr + (y1 * _width); |
60 | 60 | |
61 | | for (int x=0; x<8; ++x, ++pDest) |
| 61 | for (int x1=0; x1<8; ++x1, ++pDest) |
62 | 62 | { |
63 | 63 | if (v & 0x80) { |
64 | 64 | *pDest = colour; |
65 | | if (x+1 > charWidth) charWidth = x+1; |
| 65 | if (x1+1 > charWidth) charWidth = x1+1; |
66 | 66 | } |
67 | 67 | else if (!transparent) *pDest = 0; |
68 | 68 | v = (v << 1) & 0xff; |
… |
… |
|
77 | 77 | uint8 colour, bool varLength) |
78 | 78 | { |
79 | 79 | const char *sPtr = line.c_str(); |
80 | | const byte *addr = _data->data() + (y * _width) + x; |
| 80 | //const byte *addr = _data->data() + (y * _width) + x; |
81 | 81 | uint8 charWidth; |
82 | 82 | |
83 | 83 | while (*sPtr) |
… |
… |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | |
216 | | } |
217 | | No newline at end of file |
| 216 | } |
-
diff -r -N -u lure.old/surface.h lure/surface.h
old
|
new
|
|
43 | 43 | |
44 | 44 | } // End of namespace Lure |
45 | 45 | |
46 | | #endif |
47 | | No newline at end of file |
| 46 | #endif |