aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStrangerke2012-11-12 00:01:08 +0100
committerStrangerke2012-11-12 00:01:08 +0100
commitedb264ae1290d6658ce5738bc8035ac8ff66b2ba (patch)
treeb6b18b249b42790be8c8bcc31856deb15409eb6e
parent8521e614a9dd6d7817d7582645785bbf818ddbfd (diff)
downloadscummvm-rg350-edb264ae1290d6658ce5738bc8035ac8ff66b2ba.tar.gz
scummvm-rg350-edb264ae1290d6658ce5738bc8035ac8ff66b2ba.tar.bz2
scummvm-rg350-edb264ae1290d6658ce5738bc8035ac8ff66b2ba.zip
HOPKINS: Implement CREDIT_AFFICHE()
-rw-r--r--engines/hopkins/globals.h2
-rw-r--r--engines/hopkins/hopkins.cpp45
-rw-r--r--engines/hopkins/hopkins.h2
3 files changed, 44 insertions, 5 deletions
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index 17c78ca883..c9cda8fbcb 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -458,7 +458,7 @@ public:
int Credit_by1;
int Credit_y;
int Credit_lignes;
- char Credit[12000];
+ byte Credit[12000];
int Credit_step;
int OCEAN_SENS;
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index e95ecba330..c6ee0ac530 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -2368,8 +2368,47 @@ void HopkinsEngine::Charge_Credits() {
warning("STUB - Charge_Credits()");
}
-void HopkinsEngine::CREDIT_AFFICHE(int a1, int a2, char a3) {
- warning("STUB - CREDIT_AFFICHE");
+void HopkinsEngine::CREDIT_AFFICHE(int startPosY, byte *buffer, char colour) {
+ warning("CREDIT_AFFICHE");
+
+ byte *v3 = buffer;
+ byte *v4 = buffer;
+ int strWidth = 0;
+ byte curChar;
+ while (1) {
+ curChar = *v4++;
+ if (!curChar)
+ break;
+ if (curChar > 31)
+ strWidth += _objectsManager.Get_Largeur(_globals.police, curChar - 32);
+ }
+ int startPosX = 320 - strWidth / 2;
+ int endPosX = strWidth + startPosX;
+ int endPosY = startPosY + 12;
+ if ((_globals.Credit_bx == -1) && (_globals.Credit_bx1 == -1) && (_globals.Credit_by == -1) && (_globals.Credit_by1 == -1)) {
+ _globals.Credit_bx = startPosX;
+ _globals.Credit_bx1 = endPosX;
+ _globals.Credit_by = startPosY;
+ _globals.Credit_by1 = endPosY;
+ }
+ if (startPosX < _globals.Credit_bx)
+ _globals.Credit_bx = startPosX;
+ if (endPosX > _globals.Credit_bx1)
+ _globals.Credit_bx1 = endPosX;
+ if (_globals.Credit_by > startPosY)
+ _globals.Credit_by = startPosY;
+ if (endPosY > _globals.Credit_by1)
+ _globals.Credit_by1 = endPosY;
+
+ while (1) {
+ curChar = *v3++;
+ if (!curChar)
+ break;
+ if (curChar > 31) {
+ _graphicsManager.Affiche_Fonte(_graphicsManager.VESA_BUFFER, _globals.police, startPosX, startPosY, curChar - 32, colour);
+ startPosX += _objectsManager.Get_Largeur(_globals.police, curChar - 32);
+ }
+ }
}
void HopkinsEngine::Credits() {
@@ -2405,7 +2444,7 @@ void HopkinsEngine::Credits() {
a1 = 162;
// if (*(_WORD *)&Credit[60 * i + 8] != -1)
if ((_globals.Credit[60 * i + 8] != 0xFF) && _globals.Credit[60 * i + 9] != 0xFF)
- CREDIT_AFFICHE(nextY, 60 * i + 8, a1);
+ CREDIT_AFFICHE(nextY, _globals.Credit + (60 * i + 8), a1);
}
}
}
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 1042c4d22a..6b210fffed 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -101,7 +101,7 @@ private:
void OCEAN_HOME();
void OCEAN(int16 a1, Common::String a2, Common::String a3, int16 a4, int16 a5, int16 a6, int16 a7, int16 a8, int16 a9);
void Charge_Credits();
- void CREDIT_AFFICHE(int a1, int a2, char a3);
+ void CREDIT_AFFICHE(int startPosY, byte *buffer, char colour);
void Credits();
bool runLinuxDemo();