Skip to content

Commit

Permalink
HOPKINS: Implementing font methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 26, 2012
1 parent 377554e commit ddb4fdc
Show file tree
Hide file tree
Showing 8 changed files with 565 additions and 13 deletions.
498 changes: 497 additions & 1 deletion engines/hopkins/font.cpp

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions engines/hopkins/font.h
Expand Up @@ -33,16 +33,17 @@ class HopkinsEngine;
struct TxtItem {
int field0;
int field2;
int field4;
Common::String field4;
int field8;
int fieldA;
int fieldC;
int fieldE;
int field10;
int field12;
Common::String field14[10];
int field3FC;
int field3FE;
int field400;
byte *field400;
int field404;
int field406;
int field408;
Expand All @@ -64,11 +65,22 @@ class FontManager {
public:
TxtItem Txt[12];
ListeTxtItem ListeTxt[12];
int TRIER_TEXT[21];
Common::String oldname;
Common::String nom_index;
int Index[4048];
byte *texte_tmp;
public:
void setParent(HopkinsEngine *vm);
void clearAll();

void TEXTE_ON(int idx);
void TEXTE_OFF(int idx);
void COUL_TXT(int idx, byte colByte);
void OPTI_COUL_TXT(int idx1, int idx2, int idx3, int idx4);
void DOS_TEXT(int idx, int a2, const Common::String &filename, int a4, int a5, int a6, int a7, int a8, int a9, int a10);
void BOITE(int idx, int a2, const Common::String &filename, int xp, int yp);
void TEXT_NOW1(int xp, int yp, const Common::String &message, int transColour);
};

} // End of namespace Hopkins
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/globals.cpp
Expand Up @@ -200,7 +200,7 @@ void Globals::clearAll() {

texte_tmp = PTRNUL;
texte_long = 0;
police = (void *)PTRNUL;
police = PTRNUL;
police_h = 0;
police_l = 0;
hauteur_boite = 0;
Expand Down
2 changes: 1 addition & 1 deletion engines/hopkins/globals.h
Expand Up @@ -234,7 +234,7 @@ class Globals {
int g_old_anim;
int g_old_sens;
int HopkinsArr[140];
void *police;
byte *police;
int police_l;
int police_h;
byte *TETE;
Expand Down
49 changes: 49 additions & 0 deletions engines/hopkins/graphics.cpp
Expand Up @@ -2192,4 +2192,53 @@ void GraphicsManager::Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned
} while (yCurrent != 1);
}

void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int xp, int yp,
int characterIndex, int transColour) {
const byte *v6;
int i;
const byte *v8;
int v9;
int v10;
const byte *v11;
byte *destP;
int v13;
byte v14;
byte *destLineP;
int v16;

v6 = spriteData + 3;
for (i = characterIndex; i; --i)
v6 += READ_LE_UINT32(v6) + 16;

v9 = 0;
v10 = 0;
v8 = v6 + 4;
v9 = READ_LE_UINT16(v8);
v8 += 2;
v10 = READ_LE_UINT16(v8);
v11 = v8 + 10;
destP = surface + xp + nbrligne2 * yp;
Largeur = v9;

do {
v16 = v10;
destLineP = destP;
v13 = v9;
do {
v14 = *v11;
if (*v11) {
if (v14 == (byte)-4)
v14 = transColour;
*destP = v14;
}

++destP;
++v11;
--v13;
} while (v13);
destP = nbrligne2 + destLineP;
v10 = v16 - 1;
} while (v16 != 1);
}

} // End of namespace Hopkins
1 change: 1 addition & 0 deletions engines/hopkins/graphics.h
Expand Up @@ -167,6 +167,7 @@ class GraphicsManager {
void AFFICHE_SPEED(const byte *spriteData, int xp, int yp, int spriteIndex);
void SCOPY(const byte *surface, int x1, int y1, int x2, int y2, byte *destSurface, int destX, int destY);
void Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned int width, int height, byte *destSurface, int destX, int destY);
void Affiche_Fonte(byte *surface, const byte *spriteData, int xp, int yp, int characterIndex, int transColour);
};

} // End of namespace Hopkins
Expand Down
8 changes: 2 additions & 6 deletions engines/hopkins/objects.cpp
Expand Up @@ -461,11 +461,11 @@ void ObjectsManager::AFF_SPRITES() {
v16 = v38;
if (_vm->_fontManager.Txt[v16].field0 == 1) {
if ((uint16)(_vm->_fontManager.Txt[v16].field3FC - 2) > 1)
BOITE(v38,
_vm->_fontManager.BOITE(v38,
_vm->_fontManager.Txt[v16].fieldC, _vm->_fontManager.Txt[v16].field4,
_vm->_eventsManager.start_x + _vm->_fontManager.Txt[v16].field8, _vm->_fontManager.Txt[v16].fieldA);
else
BOITE(
_vm->_fontManager.BOITE(
v38,
_vm->_fontManager.Txt[v16].fieldC,
_vm->_fontManager.Txt[v16].field4,
Expand Down Expand Up @@ -1512,8 +1512,4 @@ void ObjectsManager::AFF_VBOB() {
} while ( idx <= 29 );
}

void ObjectsManager::BOITE(int a1, int a2, int a3, int a4, int a5) {
warning("TODO: BOITE");
}

} // End of namespace Hopkins
2 changes: 0 additions & 2 deletions engines/hopkins/objects.h
Expand Up @@ -111,8 +111,6 @@ class ObjectsManager {
int AvantTri(int a1, int a2, int a3);
void AFF_BOB_ANIM();
void AFF_VBOB();

void BOITE(int a1, int a2, int a3, int a4, int a5);
};

} // End of namespace Hopkins
Expand Down

0 comments on commit ddb4fdc

Please sign in to comment.