- made loadPointer return a new StaticCnv instead of accepting a parameter.

- adjusted Gfx code handling mouse pointers.

svn-id: r26201
This commit is contained in:
Nicola Mettifogo 2007-03-18 10:30:51 +00:00
parent ec58e9ac05
commit 8f74bc15ae
4 changed files with 8 additions and 12 deletions

View File

@ -307,8 +307,10 @@ StaticCnv* Disk::loadHead(const char* name) {
}
void Disk::loadPointer(StaticCnv* cnv) {
StaticCnv* Disk::loadPointer() {
StaticCnv* cnv = new StaticCnv;
loadExternalStaticCnv("pointer", cnv);
return cnv;
}
void Disk::loadFont(const char* name, Cnv* cnv) {

View File

@ -107,7 +107,7 @@ public:
Script* loadScript(const char* name);
Cnv* loadTalk(const char *name);
void loadObjects(const char *name, Cnv *cnv);
void loadPointer(StaticCnv* cnv);
StaticCnv* loadPointer();
StaticCnv* loadHead(const char* name);
void loadFont(const char* name, Cnv* cnv);
void loadStatic(const char* name, StaticCnv* cnv);

View File

@ -51,7 +51,6 @@ const byte _glyphWidths[126] = {
bool Gfx::_proportionalFont = false;
Point Gfx::_labelPosition[2] = { { 0, 0 }, { 0, 0 } };
StaticCnv Gfx::_mouseComposedArrow;
byte * Gfx::_buffers[];
#define PALETTE_BACKUP PALETTE_SIZE
@ -458,7 +457,7 @@ void jobEraseLabel(void *parm, Job *j) {
void Gfx::initMouse(uint16 arg_0) {
_vm->_disk->loadPointer(&_mouseComposedArrow);
_mouseComposedArrow = _vm->_disk->loadPointer();
byte temp[16*16];
memcpy(temp, _mouseArrow, 16*16);
@ -485,17 +484,12 @@ void Gfx::setMousePointer(int16 index) {
g_system->showMouse(true);
} else {
// inventory item pointer
StaticCnv mouse_pointer;
memcpy(&mouse_pointer, &_mouseComposedArrow, sizeof(StaticCnv));
byte *v8 = mouse_pointer._data0;
byte *v8 = _mouseComposedArrow->_data0;
// FIXME: target offseting is not clear
// FIXME: target offseting is not clear
extractInventoryGraphics(index, v8 + 7 + 32 * 7);
g_system->setMouseCursor(v8, 32, 32, 0, 0, 0);
}
return;

View File

@ -149,7 +149,7 @@ protected:
static byte * _buffers[NUM_BUFFERS];
static byte _mouseArrow[256];
static StaticCnv _mouseComposedArrow;
StaticCnv *_mouseComposedArrow;
Cnv _font;