Fixed regression introduced with GfxObj: the character sprite was sometimes removed from the rendering list.
svn-id: r32974
This commit is contained in:
parent
d24e770605
commit
18b48c74a9
5 changed files with 33 additions and 18 deletions
|
@ -32,7 +32,7 @@
|
||||||
|
|
||||||
namespace Parallaction {
|
namespace Parallaction {
|
||||||
|
|
||||||
GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : type(objType), _frames(frames), x(0), y(0), z(0), frame(0), layer(3), _flags(0), _keep(true) {
|
GfxObj::GfxObj(uint objType, Frames *frames, const char* name) : type(objType), _frames(frames), x(0), y(0), z(0), frame(0), layer(3), _flags(kGfxObjNormal), _keep(true) {
|
||||||
if (name) {
|
if (name) {
|
||||||
_name = strdup(name);
|
_name = strdup(name);
|
||||||
} else {
|
} else {
|
||||||
|
@ -124,15 +124,22 @@ GfxObj* Gfx::loadDoor(const char *name) {
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::clearGfxObjects() {
|
void Gfx::clearGfxObjects(uint filter) {
|
||||||
_gfxobjList.clear();
|
|
||||||
|
GfxObjList::iterator b = _gfxobjList.begin();
|
||||||
|
GfxObjList::iterator e = _gfxobjList.end();
|
||||||
|
|
||||||
|
for ( ; b != e; ) {
|
||||||
|
if (((*b)->_flags & filter) != 0) {
|
||||||
|
b = _gfxobjList.erase(b);
|
||||||
|
} else {
|
||||||
|
b++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Gfx::showGfxObj(GfxObj* obj, bool visible) {
|
void Gfx::showGfxObj(GfxObj* obj, bool visible) {
|
||||||
// if (!obj || obj->isVisible() == visible) {
|
|
||||||
// return;
|
|
||||||
// }
|
|
||||||
|
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -141,9 +148,7 @@ void Gfx::showGfxObj(GfxObj* obj, bool visible) {
|
||||||
obj->setFlags(kGfxObjVisible);
|
obj->setFlags(kGfxObjVisible);
|
||||||
} else {
|
} else {
|
||||||
obj->clearFlags(kGfxObjVisible);
|
obj->clearFlags(kGfxObjVisible);
|
||||||
// _gfxobjList.remove(obj);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -187,8 +192,6 @@ void Gfx::drawGfxObjects(Graphics::Surface &surf) {
|
||||||
|
|
||||||
sortAnimations();
|
sortAnimations();
|
||||||
// TODO: some zones don't appear because of wrong masking (3 or 0?)
|
// TODO: some zones don't appear because of wrong masking (3 or 0?)
|
||||||
// TODO: Dr.Ki is not visible inside the club
|
|
||||||
|
|
||||||
|
|
||||||
GfxObjList::iterator b = _gfxobjList.begin();
|
GfxObjList::iterator b = _gfxobjList.begin();
|
||||||
GfxObjList::iterator e = _gfxobjList.end();
|
GfxObjList::iterator e = _gfxobjList.end();
|
||||||
|
|
|
@ -340,12 +340,15 @@ class Disk;
|
||||||
enum {
|
enum {
|
||||||
kGfxObjVisible = 1,
|
kGfxObjVisible = 1,
|
||||||
|
|
||||||
|
kGfxObjNormal = 2,
|
||||||
|
kGfxObjCharacter = 4,
|
||||||
|
|
||||||
kGfxObjTypeDoor = 0,
|
kGfxObjTypeDoor = 0,
|
||||||
kGfxObjTypeGet = 1,
|
kGfxObjTypeGet = 1,
|
||||||
kGfxObjTypeAnim = 2,
|
kGfxObjTypeAnim = 2,
|
||||||
kGfxObjTypeLabel = 3,
|
kGfxObjTypeLabel = 3,
|
||||||
kGfxObjTypeBalloon = 4
|
kGfxObjTypeBalloon = 4,
|
||||||
|
kGfxObjTypeCharacter = 8
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@ -356,7 +359,6 @@ enum {
|
||||||
class GfxObj {
|
class GfxObj {
|
||||||
char *_name;
|
char *_name;
|
||||||
Frames *_frames;
|
Frames *_frames;
|
||||||
uint32 _flags;
|
|
||||||
|
|
||||||
bool _keep;
|
bool _keep;
|
||||||
|
|
||||||
|
@ -365,6 +367,7 @@ public:
|
||||||
|
|
||||||
int32 z;
|
int32 z;
|
||||||
|
|
||||||
|
uint32 _flags;
|
||||||
|
|
||||||
uint type;
|
uint type;
|
||||||
uint frame;
|
uint frame;
|
||||||
|
@ -478,7 +481,7 @@ public:
|
||||||
GfxObj* loadDoor(const char *name);
|
GfxObj* loadDoor(const char *name);
|
||||||
void drawGfxObjects(Graphics::Surface &surf);
|
void drawGfxObjects(Graphics::Surface &surf);
|
||||||
void showGfxObj(GfxObj* obj, bool visible);
|
void showGfxObj(GfxObj* obj, bool visible);
|
||||||
void clearGfxObjects();
|
void clearGfxObjects(uint filter);
|
||||||
void sortAnimations();
|
void sortAnimations();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ Parallaction::~Parallaction() {
|
||||||
delete _globalTable;
|
delete _globalTable;
|
||||||
delete _callableNames;
|
delete _callableNames;
|
||||||
|
|
||||||
|
_gfx->clearGfxObjects(kGfxObjCharacter | kGfxObjNormal);
|
||||||
|
hideDialogueStuff();
|
||||||
freeLocation();
|
freeLocation();
|
||||||
|
|
||||||
freeCharacter();
|
freeCharacter();
|
||||||
|
@ -166,6 +168,8 @@ void Parallaction::freeCharacter() {
|
||||||
delete _objectsNames;
|
delete _objectsNames;
|
||||||
_objectsNames = 0;
|
_objectsNames = 0;
|
||||||
|
|
||||||
|
_gfx->clearGfxObjects(kGfxObjCharacter);
|
||||||
|
|
||||||
_char.free();
|
_char.free();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -248,7 +252,7 @@ void Parallaction::freeLocation() {
|
||||||
|
|
||||||
_location._walkNodes.clear();
|
_location._walkNodes.clear();
|
||||||
|
|
||||||
_gfx->clearGfxObjects();
|
_gfx->clearGfxObjects(kGfxObjNormal);
|
||||||
freeBackground();
|
freeBackground();
|
||||||
|
|
||||||
_location._programs.clear();
|
_location._programs.clear();
|
||||||
|
@ -569,10 +573,14 @@ void Character::setName(const char *name) {
|
||||||
const char *end = begin + strlen(name);
|
const char *end = begin + strlen(name);
|
||||||
|
|
||||||
_prefix = _empty;
|
_prefix = _empty;
|
||||||
|
_suffix = _empty;
|
||||||
|
|
||||||
_dummy = IS_DUMMY_CHARACTER(name);
|
_dummy = IS_DUMMY_CHARACTER(name);
|
||||||
|
|
||||||
if (!_dummy) {
|
if (!_dummy) {
|
||||||
|
if (!strstr(name, "donna")) {
|
||||||
|
_engineFlags &= ~kEngineTransformedDonna;
|
||||||
|
} else
|
||||||
if (_engineFlags & kEngineTransformedDonna) {
|
if (_engineFlags & kEngineTransformedDonna) {
|
||||||
_suffix = _suffixTras;
|
_suffix = _suffixTras;
|
||||||
} else {
|
} else {
|
||||||
|
@ -581,8 +589,6 @@ void Character::setName(const char *name) {
|
||||||
_engineFlags |= kEngineTransformedDonna;
|
_engineFlags |= kEngineTransformedDonna;
|
||||||
_suffix = _suffixTras;
|
_suffix = _suffixTras;
|
||||||
end = s;
|
end = s;
|
||||||
} else {
|
|
||||||
_suffix = _empty;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (IS_MINI_CHARACTER(name)) {
|
if (IS_MINI_CHARACTER(name)) {
|
||||||
|
|
|
@ -224,7 +224,7 @@ void Parallaction_br::changeLocation(char *location) {
|
||||||
// free open location stuff
|
// free open location stuff
|
||||||
clearSubtitles();
|
clearSubtitles();
|
||||||
freeBackground();
|
freeBackground();
|
||||||
_gfx->clearGfxObjects();
|
_gfx->clearGfxObjects(kGfxObjNormal | kGfxObjCharacter);
|
||||||
_location._programs.clear();
|
_location._programs.clear();
|
||||||
freeZones();
|
freeZones();
|
||||||
freeAnimations();
|
freeAnimations();
|
||||||
|
|
|
@ -306,6 +306,7 @@ void Parallaction_ns::changeLocation(char *location) {
|
||||||
setArrowCursor();
|
setArrowCursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_gfx->showGfxObj(_char._ani->gfxobj, false);
|
||||||
_location._animations.remove(_char._ani);
|
_location._animations.remove(_char._ani);
|
||||||
|
|
||||||
freeLocation();
|
freeLocation();
|
||||||
|
@ -327,6 +328,7 @@ void Parallaction_ns::changeLocation(char *location) {
|
||||||
}
|
}
|
||||||
|
|
||||||
_location._animations.push_front(_char._ani);
|
_location._animations.push_front(_char._ani);
|
||||||
|
_gfx->showGfxObj(_char._ani->gfxobj, true);
|
||||||
|
|
||||||
strcpy(_saveData1, locname.location());
|
strcpy(_saveData1, locname.location());
|
||||||
parseLocation(_saveData1);
|
parseLocation(_saveData1);
|
||||||
|
@ -411,6 +413,7 @@ void Parallaction_ns::changeCharacter(const char *name) {
|
||||||
|
|
||||||
Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_DEMO) ? "disk0" : "disk1");
|
Common::String oldArchive = _disk->selectArchive((getFeatures() & GF_DEMO) ? "disk0" : "disk1");
|
||||||
_char._ani->gfxobj = _gfx->loadAnim(_char.getFullName());
|
_char._ani->gfxobj = _gfx->loadAnim(_char.getFullName());
|
||||||
|
_char._ani->gfxobj->setFlags(kGfxObjCharacter);
|
||||||
|
|
||||||
if (!_char.dummy()) {
|
if (!_char.dummy()) {
|
||||||
if (getPlatform() == Common::kPlatformAmiga) {
|
if (getPlatform() == Common::kPlatformAmiga) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue