FREESCAPE: added basic VIS implementation
This commit is contained in:
parent
93de5a6d60
commit
a684bc9506
5 changed files with 19 additions and 6 deletions
|
@ -408,6 +408,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
|
|||
case Token::INVIS:
|
||||
executeMakeInvisible(instruction);
|
||||
break;
|
||||
case Token::VIS:
|
||||
executeMakeVisible(instruction);
|
||||
break;
|
||||
|
||||
}
|
||||
ip++;
|
||||
|
@ -422,6 +425,13 @@ void FreescapeEngine::executeMakeInvisible(FCLInstruction &instruction) {
|
|||
obj->makeInvisible();
|
||||
}
|
||||
|
||||
void FreescapeEngine::executeMakeVisible(FCLInstruction &instruction) {
|
||||
uint16 objectID = instruction.source;
|
||||
debug("Making obj %d visible!", objectID);
|
||||
Object *obj = _currentArea->objectWithID(objectID);
|
||||
obj->makeVisible();
|
||||
}
|
||||
|
||||
void FreescapeEngine::executeGoto(FCLInstruction &instruction) {
|
||||
uint16 areaID = instruction.source;
|
||||
uint16 entranceID = instruction.destination;
|
||||
|
|
|
@ -123,7 +123,7 @@ public:
|
|||
void executeGoto(FCLInstruction &instruction);
|
||||
void executeIfThenElse(FCLInstruction &instruction);
|
||||
void executeMakeInvisible(FCLInstruction &instruction);
|
||||
|
||||
void executeMakeVisible(FCLInstruction &instruction);
|
||||
|
||||
// Rendering
|
||||
void drawFrame();
|
||||
|
|
|
@ -120,6 +120,7 @@ Common::String *detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition
|
|||
case 7:
|
||||
case 4:
|
||||
detokenisedStream += "VIS (";
|
||||
currentInstruction = FCLInstruction(Token::VIS);
|
||||
break; // hence each getting two case statement entries
|
||||
case 8:
|
||||
case 5:
|
||||
|
|
|
@ -16,10 +16,11 @@ uint16 Object::getObjectFlags() { return _flags; }
|
|||
Math::Vector3d Object::getOrigin() { return _origin; }
|
||||
Math::Vector3d Object::getSize() { return _size; }
|
||||
|
||||
//void Object::draw(Freescape::Renderer *gfx) {
|
||||
// gfx;
|
||||
//}
|
||||
bool Object::isDrawable() { return false; }
|
||||
bool Object::isPlanar() { return false; }
|
||||
|
||||
bool Object::isInvisible() { return _flags & 0x80; }
|
||||
void Object::makeInvisible() { _flags = _flags | 0x80; }
|
||||
void Object::makeVisible() { _flags = _flags & ~0x80; }
|
||||
|
||||
Object::~Object() {}
|
||||
|
|
|
@ -49,8 +49,9 @@ public:
|
|||
|
||||
virtual bool isDrawable();
|
||||
virtual bool isPlanar();
|
||||
bool isInvisible() { return _flags & 0x80; }
|
||||
void makeInvisible() { _flags = _flags | 0x80; }
|
||||
bool isInvisible();
|
||||
void makeInvisible();
|
||||
void makeVisible();
|
||||
|
||||
virtual ~Object();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue