[Scummvm-cvs-logs] SF.net SVN: scummvm:[39883] residual/trunk/engine
aquadran at users.sourceforge.net
aquadran at users.sourceforge.net
Tue Apr 7 14:01:07 CEST 2009
Revision: 39883
http://scummvm.svn.sourceforge.net/scummvm/?rev=39883&view=rev
Author: aquadran
Date: 2009-04-07 12:01:07 +0000 (Tue, 07 Apr 2009)
Log Message:
-----------
corrected y position of text displaying
Modified Paths:
--------------
residual/trunk/engine/lua.cpp
residual/trunk/engine/registry.cpp
residual/trunk/engine/textobject.cpp
Modified: residual/trunk/engine/lua.cpp
===================================================================
--- residual/trunk/engine/lua.cpp 2009-04-07 10:41:23 UTC (rev 39882)
+++ residual/trunk/engine/lua.cpp 2009-04-07 12:01:07 UTC (rev 39883)
@@ -2307,7 +2307,7 @@
if (strmatch(key_text, "x"))
textObject->setX(atoi(lua_getstring(lua_getresult(2))));
else if (strmatch(key_text, "y"))
- textObject->setY(atoi(lua_getstring(lua_getresult(2))) + 5);
+ textObject->setY(atoi(lua_getstring(lua_getresult(2))));
else if (strmatch(key_text, "width"))
textObject->setWidth(atoi(lua_getstring(lua_getresult(2))));
else if (strmatch(key_text, "height"))
@@ -2387,14 +2387,15 @@
static void ChangeTextObject() {
TextObject *modifyObject, *textObject;
lua_Object tableObj;
+ const char *line;
DEBUG_FUNCTION();
textObject = check_textobject(1);
// when called in certain instances (such as don's computer)
// the second parameter is the string and the third is the table
- if (lua_isstring(lua_getparam(2)))
+ if (lua_isstring(lua_getparam(2))) {
tableObj = lua_getparam(3);
- else
+ } else
tableObj = lua_getparam(2);
modifyObject = TextObjectExists((char *)textObject->name());
@@ -2408,9 +2409,10 @@
if (lua_istable(tableObj))
getTextObjectParams(modifyObject, tableObj);
- else if (debugLevel == DEBUG_WARN || debugLevel == DEBUG_ALL)
- warning("Expecting table parameter!");
-
+ else if (lua_isstring(lua_getparam(2))) {
+ line = lua_getstring(lua_getparam(2));
+ modifyObject->setText((char *)line);
+ }
modifyObject->createBitmap();
lua_pushnumber(modifyObject->getBitmapWidth());
@@ -2454,7 +2456,6 @@
//printf("Make: %s\n", (char *)text.c_str());
textObject->setText((char *)text.c_str());
- //textObject->subBaseOffsetY();
textObject->createBitmap();
g_engine->registerTextObject(textObject);
Modified: residual/trunk/engine/registry.cpp
===================================================================
--- residual/trunk/engine/registry.cpp 2009-04-07 10:41:23 UTC (rev 39882)
+++ residual/trunk/engine/registry.cpp 2009-04-07 12:01:07 UTC (rev 39883)
@@ -125,8 +125,8 @@
void Registry::set(const char *key, const char *val) {
// Hack: Don't save these, so we can run in good_times mode
// without new games being bogus.
- if (strstr(key, "GrimLastSet") || strstr(key, "GrimMannyState"))
- return;
+// if (strstr(key, "GrimLastSet") || strstr(key, "GrimMannyState"))
+// return;
_dirty = true;
assert(val);
Modified: residual/trunk/engine/textobject.cpp
===================================================================
--- residual/trunk/engine/textobject.cpp 2009-04-07 10:41:23 UTC (rev 39882)
+++ residual/trunk/engine/textobject.cpp 2009-04-07 12:01:07 UTC (rev 39883)
@@ -213,9 +213,19 @@
int y;
if (_blastDraw)
- y = _y;
- else
- y = _y - _font->getBaseOffsetY();
+ y = _y + 5;
+ else {
+ if (_font->getHeight() == 21)
+ y = _y - 6;
+ else if (_font->getHeight() == 26)
+ y = _y - 12;
+ else if (_font->getHeight() == 13)
+ y = _y;
+ else if (_font->getHeight() == 19)
+ y = _y - 6;
+ else
+ y = _y;
+ }
if (y < 0)
y = 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list