HOPKINS: Added new LinesManager class with lots of line methods

This commit is contained in:
Paul Gilbert 2012-10-02 21:44:23 +10:00
parent 0cd848b9a5
commit 28099ee00d
10 changed files with 2517 additions and 897 deletions

View file

@ -235,16 +235,16 @@ void Globals::clearAll() {
chemin = PTRNUL;
for (int idx = 0; idx < 400; ++idx) {
Ligne[idx].field0 = 0;
Ligne[idx].field2 = 0;
Ligne[idx].field4 = 0;
Ligne[idx].field6 = 0;
Ligne[idx].field8 = 0;
Ligne[idx].field12 = PTRNUL;
_vm->_linesManager.Ligne[idx].field0 = 0;
_vm->_linesManager.Ligne[idx].field2 = 0;
_vm->_linesManager.Ligne[idx].field4 = 0;
_vm->_linesManager.Ligne[idx].field6 = 0;
_vm->_linesManager.Ligne[idx].field8 = 0;
_vm->_linesManager.Ligne[idx].field12 = PTRNUL;
LigneZone[idx].field0 = 0;
LigneZone[idx].field2 = 0;
LigneZone[idx].field4 = PTRNUL;
_vm->_linesManager.LigneZone[idx].field0 = 0;
_vm->_linesManager.LigneZone[idx].field2 = 0;
_vm->_linesManager.LigneZone[idx].field4 = PTRNUL;
}
for (int idx = 0; idx < 100; ++idx) {

View file

@ -47,22 +47,6 @@ struct ZonePItem {
int field16;
};
struct LigneItem {
int field0;
int field2;
int field4;
int field6;
int field8;
byte *fieldC;
byte *field12;
};
struct LigneZoneItem {
int field0;
int field2;
byte *field4;
};
struct CarreZoneItem {
int field0;
int field2;
@ -332,8 +316,6 @@ public:
byte *BUF_ZONE;
byte *CACHE_BANQUE[6];
ZonePItem ZONEP[106];
LigneItem Ligne[400];
LigneZoneItem LigneZone[401];
CarreZoneItem CarreZone[101];
BqeAnimItem Bqe_Anim[35];
BankItem Bank[8];
@ -432,6 +414,8 @@ public:
int ACTION_SENS;
int STOP_BUG;
int SegmentEnCours;
int NVPX;
int NVPY;
int force_to_data_0;
int oldzone_46;

View file

@ -2403,9 +2403,4 @@ void GraphicsManager::NB_SCREEN() {
DD_VBL();
}
int GraphicsManager::colision2_ligne(int a1, int a2, int *a3, int *a4, int a5, int a6) {
warning("TODO: colision2_ligne");
return 0;
}
} // End of namespace Hopkins

View file

@ -177,7 +177,6 @@ public:
void INI_ECRAN2(const Common::String &file);
void OPTI_INI(const Common::String &file, int a2);
void NB_SCREEN();
int colision2_ligne(int a1, int a2, int *a3, int *a4, int a5, int a6);
};
} // End of namespace Hopkins

View file

@ -36,6 +36,7 @@
#include "hopkins/font.h"
#include "hopkins/globals.h"
#include "hopkins/graphics.h"
#include "hopkins/lines.h"
#include "hopkins/menu.h"
#include "hopkins/objects.h"
#include "hopkins/sound.h"
@ -101,6 +102,7 @@ public:
FontManager _fontManager;
Globals _globals;
GraphicsManager _graphicsManager;
LinesManager _linesManager;
MenuManager _menuManager;
ObjectsManager _objectsManager;
SoundManager _soundManager;

2363
engines/hopkins/lines.cpp Normal file

File diff suppressed because it is too large Load diff

82
engines/hopkins/lines.h Normal file
View file

@ -0,0 +1,82 @@
/* ScummVM - Graphic Adventure Engine
*
* ScummVM is the legal property of its developers, whose names
* are too numerous to list here. Please refer to the COPYRIGHT
* file distributed with this source distribution.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef HOPKINS_LINES_H
#define HOPKINS_LINES_H
#include "common/scummsys.h"
#include "common/str.h"
namespace Hopkins {
class HopkinsEngine;
struct LigneZoneItem {
int field0;
int field2;
byte *field4;
};
struct LigneItem {
int field0;
int field2;
int field4;
int field6;
int field8;
byte *fieldC;
byte *field12;
};
class LinesManager {
private:
HopkinsEngine *_vm;
public:
LigneZoneItem LigneZone[401];
LigneItem Ligne[400];
int next_ligne;
int TOTAL_LIGNES;
int NV_LIGNEDEP;
int NV_LIGNEOFS;
int NV_POSI;
public:
void setParent(HopkinsEngine *vm);
void CLEAR_ZONE();
void RETIRE_LIGNE_ZONE(int idx);
void AJOUTE_LIGNE_ZONE(int idx, int a2, int a3, int a4, int a5, int a6);
void RESET_OBSTACLE();
void RETIRE_LIGNE(int idx);
void AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6, int a7);
int colision2_ligne(int a1, int a2, int *a3, int *a4, int a5, int a6);
int Scolision2_ligne(int a1, int a2, int *a3, int *a4, int a5, int a6);
void INIPARCOURS();
int CONTOURNE1(int a1, int a2, int a3, int a4, int a5, byte *a6, int a7, int a8, int a9);
int CONTOURNE(int a1, int a2, int a3, int a4, int a5, byte *a6, int a7);
int MIRACLE(int a1, int a2, int a3, int a4, int a5);
int GENIAL(int a1, int a2, int a3, int a4, int a5, int a6, int a7, byte *a8, int a9);
byte *PARCOURS2(int a1, int a2, int a3, int a4);
int PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
};
} // End of namespace Hopkins
#endif /* HOPKINS_FONT_H */

View file

@ -10,6 +10,7 @@ MODULE_OBJS := \
graphics.o \
globals.o \
hopkins.o \
lines.o \
menu.o \
objects.o \
sound.o \

File diff suppressed because it is too large Load diff

View file

@ -93,7 +93,6 @@ public:
int CHANGEVERBE;
int verbe;
int Vold_taille;
int TOTAL_LIGNES;
bool SPEED_FLAG;
int SPEED_X, SPEED_Y;
int SPEED_IMAGE;
@ -122,11 +121,6 @@ public:
int OBSSEUL;
int NVVERBE;
int NVZONE;
int NV_LIGNEDEP;
int NV_LIGNEOFS;
int NV_POSI;
int NVPX;
int NVPY;
public:
ObjectsManager();
void setParent(HopkinsEngine *vm);
@ -202,14 +196,12 @@ public:
void INVENT();
void CHANGE_TETE(int a1, int a2);
byte *PARCOURS2(int a1, int a2, int a3, int a4);
void VERIFTAILLE();
void PACOURS_PROPRE(byte *a1);
byte *PARC_VOITURE(int a1, int a2, int a3, int a4);
void VERBEPLUS();
void BTDROITE();
int MZONE();
void CLEAR_ZONE();
void RESET_OBSTACLE();
int ZONE_OBJET(int a1, int a2);
void PARAMCADRE(int a1);
@ -242,8 +234,6 @@ public:
int Control_If(const byte *dataP, int a2);
void VERBE_OFF(int a1, int a2);
void VERBE_ON(int a1, int a2);
int PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int MIRACLE(int a1, int a2, int a3, int a4, int a5);
int GENIAL(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int16 *a8, int a9);
int CALC_PROPRE(int idx);
int PLAN_TEST(byte *a1, int a2, int a3, int a4, int a5, int a6);