TWINE: replaced hardcoded resolution constants with function calls

This commit is contained in:
Martin Gerhardy 2021-01-07 21:17:53 +01:00
parent 4b7dd811a4
commit 3cf6eee18b
16 changed files with 148 additions and 153 deletions

View file

@ -1712,7 +1712,7 @@ static int32 lPROJ_3D(TwinEEngine *engine, LifeScriptContext &ctx) {
engine->flip();
engine->_scene->changeRoomVar10 = false;
engine->_renderer->setCameraPosition(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2, 128, 1024, 1024);
engine->_renderer->setCameraPosition(engine->width() / 2, engine->height() / 2, 128, 1024, 1024);
engine->_renderer->setCameraAngle(0, 1500, 0, 25, -128, 0, 13000);
engine->_renderer->setLightVector(896, 950, ANGLE_0);
@ -1741,8 +1741,8 @@ static int32 lTEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
int32 textBoxRight = textSize;
engine->_text->setFontColor(15);
engine->_text->drawText(0, drawVar1, textStr);
if (textSize > SCREEN_WIDTH - 1) {
textBoxRight = SCREEN_WIDTH - 1;
if (textSize > engine->width() - 1) {
textBoxRight = engine->width() - 1;
}
drawVar1 += 40;
@ -1759,7 +1759,7 @@ static int32 lTEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
*/
static int32 lCLEAR_TEXT(TwinEEngine *engine, LifeScriptContext &ctx) {
drawVar1 = 0;
const Common::Rect rect(0, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT / 2);
const Common::Rect rect(0, 0, engine->width() - 1, engine->height() / 2);
engine->_interface->drawSplittedBox(rect, 0);
engine->copyBlockPhys(rect);
return 0;