FREESCAPE: added basic VIS implementation

This commit is contained in:
neuromancer 2022-07-02 10:00:58 +02:00 committed by Eugene Sandulenko
parent 93de5a6d60
commit a684bc9506
No known key found for this signature in database
GPG key ID: 014D387312D34F08
5 changed files with 19 additions and 6 deletions

View file

@ -408,6 +408,9 @@ void FreescapeEngine::executeCode(FCLInstructionVector &code, bool shot, bool co
case Token::INVIS: case Token::INVIS:
executeMakeInvisible(instruction); executeMakeInvisible(instruction);
break; break;
case Token::VIS:
executeMakeVisible(instruction);
break;
} }
ip++; ip++;
@ -422,6 +425,13 @@ void FreescapeEngine::executeMakeInvisible(FCLInstruction &instruction) {
obj->makeInvisible(); 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) { void FreescapeEngine::executeGoto(FCLInstruction &instruction) {
uint16 areaID = instruction.source; uint16 areaID = instruction.source;
uint16 entranceID = instruction.destination; uint16 entranceID = instruction.destination;

View file

@ -123,7 +123,7 @@ public:
void executeGoto(FCLInstruction &instruction); void executeGoto(FCLInstruction &instruction);
void executeIfThenElse(FCLInstruction &instruction); void executeIfThenElse(FCLInstruction &instruction);
void executeMakeInvisible(FCLInstruction &instruction); void executeMakeInvisible(FCLInstruction &instruction);
void executeMakeVisible(FCLInstruction &instruction);
// Rendering // Rendering
void drawFrame(); void drawFrame();

View file

@ -120,6 +120,7 @@ Common::String *detokenise8bitCondition(Common::Array<uint8> &tokenisedCondition
case 7: case 7:
case 4: case 4:
detokenisedStream += "VIS ("; detokenisedStream += "VIS (";
currentInstruction = FCLInstruction(Token::VIS);
break; // hence each getting two case statement entries break; // hence each getting two case statement entries
case 8: case 8:
case 5: case 5:

View file

@ -16,10 +16,11 @@ uint16 Object::getObjectFlags() { return _flags; }
Math::Vector3d Object::getOrigin() { return _origin; } Math::Vector3d Object::getOrigin() { return _origin; }
Math::Vector3d Object::getSize() { return _size; } Math::Vector3d Object::getSize() { return _size; }
//void Object::draw(Freescape::Renderer *gfx) {
// gfx;
//}
bool Object::isDrawable() { return false; } bool Object::isDrawable() { return false; }
bool Object::isPlanar() { 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() {} Object::~Object() {}

View file

@ -49,8 +49,9 @@ public:
virtual bool isDrawable(); virtual bool isDrawable();
virtual bool isPlanar(); virtual bool isPlanar();
bool isInvisible() { return _flags & 0x80; } bool isInvisible();
void makeInvisible() { _flags = _flags | 0x80; } void makeInvisible();
void makeVisible();
virtual ~Object(); virtual ~Object();