TETRAEDGE: Small fixes.

This commit is contained in:
Matthew Duggan authored and Eugene Sandulenko committed 2023-01-16 17:36:43 +01:00
1 parent 87bbf9660e
commit 48015aa751
8 files changed
+24 -10

No files matched your search

+1 -1
View File
@@ -299,7 +299,7 @@ void Application::startGame(bool newGame, int difficulty) {
_appSpriteLayout.unload();
if (newGame)
_difficulty = difficulty;
g_engine->getGame()->enter(newGame);
g_engine->getGame()->enter();
}
void Application::resume() {
+6 -2
View File
@@ -271,7 +271,7 @@ void Game::draw() {
}
}
void Game::enter(bool newgame) {
void Game::enter() {
_enteredFlag2 = true;
_entered = true;
_luaShowOwnerError = false;
@@ -339,7 +339,7 @@ void Game::enter(bool newgame) {
_inventory.cellphone()->onCallNumber().add(this, &Game::onCallNumber);
if (!newgame) {
if (hasLoadName()) {
loadBackup(_loadName);
} else {
_gameLoadState = 1;
@@ -1016,6 +1016,10 @@ bool Game::onMouseClick(const Common::Point &pt) {
if (app->isFading())
return true;
// In case we capture a click during a video..
if (!_scene.currentCamera())
return false;
_posPlayer = TeVector3f32(-1.0f, -1.0f, -1.0f);
if (_previousMousePos == TeVector2s32(-1, -1)) {
_previousMousePos = pt;
+1 -1
View File
@@ -101,7 +101,7 @@ public:
void deleteNoScale();
void draw();
void enter(bool newgame);
void enter(); // will load game if _loadName is set.
// Note: game uses ILayouts here..
static TeI3DObject2 *findLayoutByName(TeLayout *parent, const Common::String &name);
static TeSpriteLayout *findSpriteLayoutByName(TeLayout *parent, const Common::String &name);
+3 -1
View File
@@ -124,7 +124,9 @@ void MainMenu::enter() {
versionNum->setText(versionSectionStr + app->getVersionString());
}
if (ConfMan.get("skip_mainmenu") == "true") {
// Skip the menu if we are loading.
Game *game = g_engine->getGame();
if (game->hasLoadName() || ConfMan.get("skip_mainmenu") == "true") {
onNewGameConfirmed();
}
}
+1 -1
View File
@@ -79,7 +79,7 @@ public:
int projMatrixType() const { return _projectionMatrixType; }
void setPerspectiveVal(float val) { _somePerspectiveVal = val; }
float orthoNearPlane() const { return _orthNearVal; }
float orthoFarPlane() const { return _orthNearVal; }
float orthoFarPlane() const { return _orthFarVal; }
private:
void updateProjectionMatrix();
@@ -807,6 +807,8 @@ TePickMesh2 *TeFreeMoveZone::findNearestMesh(TeIntrusivePtr<TeCamera> &camera, c
Common::Array<TePickMesh2*> &pickMeshes, TeVector3f32 *outloc, bool lastHitFirst) {
TeVector3f32 closestLoc;
TePickMesh2 *nearestMesh = nullptr;
if (!camera)
return nullptr;
float closestDist = camera->orthoFarPlane();
Math::Ray camRay;
for (unsigned int i = 0; i < pickMeshes.size(); i++) {
+3 -1
View File
@@ -214,7 +214,9 @@ void TeTextBase2::drawEmptyChar(unsigned int offset) {
void TeTextBase2::drawLine(TeImage &img, const Common::String &str, int yoffset) {
TeIntrusivePtr<TeFont3> font = _fonts[0];
font->draw(img, str, _fontSize, yoffset, _globalColor, _alignStyle);
// Note: We draw this with black because the global color will be applied on
// the mesh.
font->draw(img, str, _fontSize, yoffset, TeColor(0, 0, 0, 255), _alignStyle);
}
unsigned int TeTextBase2::endOfWord(unsigned int offset) const {
+7 -3
View File
@@ -148,7 +148,7 @@ Common::Error TetraedgeEngine::loadGameState(int slot) {
return Common::kReadingFailed;
// The game will reopen the file and do the loading, see Game::initLoadedBackupData
_game->setLoadName(saveStateName);
getGame()->setLoadName(saveStateName);
delete saveFile;
return Common::kNoError;
@@ -193,18 +193,22 @@ Common::Error TetraedgeEngine::run() {
_renderer = new TeRenderer();
_renderer->init();
_renderer->reset();
_application->create();
// Set the engine's debugger console
setDebugger(new Console());
getInputMgr()->_keyUpSignal.add(this, &TetraedgeEngine::onKeyUp);
// If a savegame was selected from the launcher, load it
// If a savegame was selected from the launcher, load it.
// Should be before application->create() because it only
// sets the game name to load inside the Game object. It will
// actually be loaded when the application is created.
int saveSlot = ConfMan.getInt("save_slot");
if (saveSlot != -1)
(void)loadGameState(saveSlot);
_application->create();
Common::Event e;
while (!shouldQuit()) {