aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk
diff options
context:
space:
mode:
authorMatthew Hoops2011-03-04 23:17:57 -0500
committerMatthew Hoops2011-03-04 23:17:57 -0500
commitc66233f83e2d86b72f45aff20fb3198976850e42 (patch)
tree23d5e007641fe950eea3d89fc0b538902699c36f /engines/mohawk
parent550cff84f81f016a2b54700e170b4cd9712793f3 (diff)
downloadscummvm-rg350-c66233f83e2d86b72f45aff20fb3198976850e42.tar.gz
scummvm-rg350-c66233f83e2d86b72f45aff20fb3198976850e42.tar.bz2
scummvm-rg350-c66233f83e2d86b72f45aff20fb3198976850e42.zip
GRAPHICS: Split the NE cursor code from the NEResources class
Now the code lies in Graphics and all cursors are not cached upon opening an exe. The engine is now in charge of caching which cursors it wants.
Diffstat (limited to 'engines/mohawk')
-rw-r--r--engines/mohawk/cursors.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/mohawk/cursors.cpp b/engines/mohawk/cursors.cpp
index cdfdbb3a78..fe4b434f9c 100644
--- a/engines/mohawk/cursors.cpp
+++ b/engines/mohawk/cursors.cpp
@@ -34,6 +34,7 @@
#include "common/system.h"
#include "common/winexe_ne.h"
#include "graphics/cursorman.h"
+#include "graphics/wincursor.h"
namespace Mohawk {
@@ -295,16 +296,14 @@ NECursorManager::~NECursorManager() {
}
void NECursorManager::setCursor(uint16 id) {
- if (!_exe) {
- Common::Array<Common::NECursorGroup> cursors = _exe->getCursors();
-
- for (uint32 i = 0; i < cursors.size(); i++) {
- if (cursors[i].id == id) {
- Common::NECursor *cursor = cursors[i].cursors[0];
- CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor());
- CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256);
- return;
- }
+ if (_exe) {
+ Graphics::WinCursorGroup *cursorGroup = Graphics::WinCursorGroup::createCursorGroup(*_exe, id);
+
+ if (cursorGroup) {
+ Graphics::WinCursor *cursor = cursorGroup->cursors[0].cursor;
+ CursorMan.replaceCursor(cursor->getSurface(), cursor->getWidth(), cursor->getHeight(), cursor->getHotspotX(), cursor->getHotspotY(), cursor->getKeyColor());
+ CursorMan.replaceCursorPalette(cursor->getPalette(), 0, 256);
+ return;
}
}