mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
safer dynalum tweak
svn-id: r10992
This commit is contained in:
parent
1ab811c4ec
commit
cb2306373d
@ -143,18 +143,19 @@ void Display::dynalumInit(Resource *resource, const char *roomName, uint16 roomN
|
||||
debug(9, "Display::dynalumInit(%s, %d)", roomName, roomNum);
|
||||
memset(_dynalum.msk, 0, sizeof(_dynalum.msk));
|
||||
memset(_dynalum.lum, 0, sizeof(_dynalum.lum));
|
||||
_dynalum.valid = false;
|
||||
// FIXME: are these tests really needed ?
|
||||
if (roomNum < 90 || ((roomNum > 94) && (roomNum < 114))) {
|
||||
char filename[20];
|
||||
|
||||
sprintf(filename, "%s.msk", roomName);
|
||||
_dynalum.haveMsk = resource->exists(filename);
|
||||
if (_dynalum.haveMsk)
|
||||
_dynalum.valid = resource->exists(filename);
|
||||
if (_dynalum.valid)
|
||||
resource->loadFile(filename, 0, (uint8*)_dynalum.msk);
|
||||
|
||||
sprintf(filename, "%s.lum", roomName);
|
||||
_dynalum.haveLum = resource->exists(filename);
|
||||
if (_dynalum.haveLum)
|
||||
_dynalum.valid = resource->exists(filename);
|
||||
if (_dynalum.valid)
|
||||
resource->loadFile(filename, 0, (uint8*)_dynalum.lum);
|
||||
}
|
||||
}
|
||||
@ -162,7 +163,7 @@ void Display::dynalumInit(Resource *resource, const char *roomName, uint16 roomN
|
||||
|
||||
void Display::dynalumUpdate(int x, int y) {
|
||||
|
||||
if (!_dynalum.haveMsk)
|
||||
if (!_dynalum.valid)
|
||||
return;
|
||||
|
||||
if (x >= _bdWidth) {
|
||||
|
@ -43,8 +43,7 @@ enum JoePalette {
|
||||
|
||||
|
||||
struct Dynalum {
|
||||
bool haveMsk;
|
||||
bool haveLum;
|
||||
bool valid;
|
||||
uint8 msk[50 * 160];
|
||||
int8 lum[8 * 3];
|
||||
uint8 prevColMask;
|
||||
|
Loading…
Reference in New Issue
Block a user