2012-09-17 08:03:25 +00:00
|
|
|
/* 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_OBJECTS_H
|
|
|
|
#define HOPKINS_OBJECTS_H
|
|
|
|
|
|
|
|
#include "common/scummsys.h"
|
|
|
|
#include "common/endian.h"
|
|
|
|
#include "common/str.h"
|
2012-10-21 11:24:11 +00:00
|
|
|
#include "hopkins/globals.h"
|
2012-09-17 08:03:25 +00:00
|
|
|
|
2012-12-16 23:16:49 +00:00
|
|
|
#define MAX_SPRITE 5
|
2012-09-17 08:03:25 +00:00
|
|
|
namespace Hopkins {
|
|
|
|
|
2012-09-23 00:59:52 +00:00
|
|
|
struct SpriteItem {
|
2012-12-18 20:50:50 +00:00
|
|
|
int _animationType;
|
2012-12-16 01:11:36 +00:00
|
|
|
const byte *_spriteData;
|
|
|
|
Common::Point _spritePos;
|
2012-09-24 11:10:50 +00:00
|
|
|
int fieldC;
|
2012-09-23 12:52:12 +00:00
|
|
|
int fieldE;
|
2012-12-16 01:11:36 +00:00
|
|
|
int _spriteIndex;
|
2012-09-24 11:10:50 +00:00
|
|
|
int field12;
|
|
|
|
int field14;
|
2012-09-28 12:15:59 +00:00
|
|
|
byte *field1C;
|
|
|
|
int field20;
|
|
|
|
int field22;
|
|
|
|
int field24;
|
|
|
|
int field26;
|
2012-12-29 22:57:50 +00:00
|
|
|
bool _rleFl;
|
|
|
|
bool field2A;
|
2012-09-23 12:52:12 +00:00
|
|
|
int field2C;
|
2012-09-23 00:59:52 +00:00
|
|
|
int field2E;
|
2012-12-29 22:57:50 +00:00
|
|
|
int _width;
|
|
|
|
int _height;
|
|
|
|
int _zoomPct;
|
|
|
|
int _reducePct;
|
2012-09-23 00:59:52 +00:00
|
|
|
};
|
|
|
|
|
2012-09-17 08:53:29 +00:00
|
|
|
class HopkinsEngine;
|
|
|
|
|
2012-09-17 08:03:25 +00:00
|
|
|
class ObjectsManager {
|
2012-09-17 08:53:29 +00:00
|
|
|
private:
|
|
|
|
HopkinsEngine *_vm;
|
2012-09-20 12:02:55 +00:00
|
|
|
|
2012-09-23 00:59:52 +00:00
|
|
|
public:
|
2012-12-16 08:56:50 +00:00
|
|
|
SpriteItem _sprite[6];
|
|
|
|
bool _priorityFl;
|
|
|
|
Common::Point _oldBorderPos;
|
|
|
|
int _oldBorderSpriteIndex;
|
|
|
|
Common::Point _borderPos;
|
|
|
|
int _borderSpriteIndex;
|
2012-09-23 00:59:52 +00:00
|
|
|
int SL_X, SL_Y;
|
2012-09-23 12:52:12 +00:00
|
|
|
int I_old_x, I_old_y;
|
2012-09-28 23:33:42 +00:00
|
|
|
int g_old_x, g_old_y;
|
2012-09-23 12:52:12 +00:00
|
|
|
int FLAG_VISIBLE_EFFACE;
|
2012-09-23 00:59:52 +00:00
|
|
|
byte *SL_SPR;
|
|
|
|
byte *SL_SPR2;
|
2012-12-16 08:56:50 +00:00
|
|
|
byte *_spritePtr;
|
2012-12-14 00:49:22 +00:00
|
|
|
const byte *S_old_spr;
|
2012-09-23 00:59:52 +00:00
|
|
|
bool PERSO_ON;
|
|
|
|
bool SL_FLAG;
|
2012-10-05 14:45:07 +00:00
|
|
|
int SL_MODE;
|
2012-12-16 08:56:50 +00:00
|
|
|
bool _visibleFl;
|
|
|
|
bool _disableCursorFl;
|
2012-09-24 12:21:04 +00:00
|
|
|
bool BOBTOUS;
|
2012-09-28 12:15:59 +00:00
|
|
|
int my_anim;
|
2012-09-28 23:33:42 +00:00
|
|
|
int NUMZONE;
|
|
|
|
int ARRET_PERSO_FLAG;
|
|
|
|
int ARRET_PERSO_NUM;
|
2012-12-16 08:56:50 +00:00
|
|
|
bool _forceZoneFl;
|
|
|
|
bool _changeVerbFl;
|
|
|
|
int _verb;
|
2012-09-28 23:33:42 +00:00
|
|
|
int Vold_taille;
|
|
|
|
int SPEED_X, SPEED_Y;
|
|
|
|
int SPEED_IMAGE;
|
|
|
|
byte *SPEED_PTR;
|
|
|
|
int DERLIGNE;
|
|
|
|
int A_ANIM;
|
|
|
|
int MA_ANIM;
|
|
|
|
int MA_ANIM1;
|
|
|
|
int A_DEPA;
|
|
|
|
int MAX_DEPA;
|
|
|
|
int MAX_DEPA1;
|
2012-12-31 00:09:06 +00:00
|
|
|
bool CH_TETE;
|
2012-09-30 11:02:39 +00:00
|
|
|
int T_RECTIF;
|
2012-12-24 17:43:49 +00:00
|
|
|
bool _disableFl;
|
|
|
|
bool _twoCharactersFl;
|
2012-12-26 06:56:26 +00:00
|
|
|
Common::Point _characterPos;
|
2012-09-30 11:02:39 +00:00
|
|
|
int PERI;
|
|
|
|
int RECALL;
|
|
|
|
int PTAILLE;
|
|
|
|
int PEROFX;
|
|
|
|
int PEROFY;
|
|
|
|
int OBSSEUL;
|
|
|
|
int NVVERBE;
|
|
|
|
int NVZONE;
|
2012-12-14 00:49:22 +00:00
|
|
|
int S_old_ani;
|
2012-10-04 14:55:25 +00:00
|
|
|
int S_old_ret;
|
2012-10-13 04:19:54 +00:00
|
|
|
int nouveau_x, nouveau_y;
|
|
|
|
int nouveau_sens;
|
|
|
|
int nouveau_anim;
|
2012-09-17 08:03:25 +00:00
|
|
|
public:
|
2012-09-20 12:02:55 +00:00
|
|
|
ObjectsManager();
|
2012-09-17 08:53:29 +00:00
|
|
|
void setParent(HopkinsEngine *vm);
|
|
|
|
|
2012-12-16 13:22:24 +00:00
|
|
|
void changeObject(int objIndex);
|
2012-09-17 08:03:25 +00:00
|
|
|
byte *CAPTURE_OBJET(int objIndex, int mode);
|
2012-12-16 13:22:24 +00:00
|
|
|
void removeObject(int objIndex);
|
2012-09-17 08:03:25 +00:00
|
|
|
|
2012-12-10 06:54:03 +00:00
|
|
|
int getWidth(const byte *objectData, int idx);
|
|
|
|
int getHeight(const byte *objectData, int idx);
|
2012-09-17 08:03:25 +00:00
|
|
|
int sprite_alone(const byte *objectData, byte *sprite, int objIndex);
|
2012-12-16 23:16:49 +00:00
|
|
|
void DEL_FICHIER_OBJ();
|
2012-09-17 08:03:25 +00:00
|
|
|
|
2012-12-16 13:22:24 +00:00
|
|
|
byte *loadSprite(const Common::String &file);
|
2012-09-19 11:34:23 +00:00
|
|
|
void set_offsetxy(byte *data, int idx, int xp, int yp, bool isSize);
|
2012-12-29 22:57:50 +00:00
|
|
|
int getOffsetX(const byte *spriteData, int spriteIndex, bool isSize);
|
|
|
|
int getOffsetY(const byte *spriteData, int spriteIndex, bool isSize);
|
2012-12-16 13:22:24 +00:00
|
|
|
void displaySprite();
|
2012-09-19 11:34:23 +00:00
|
|
|
|
2012-09-17 08:03:25 +00:00
|
|
|
int capture_mem_sprite(const byte *objectData, byte *sprite, int objIndex);
|
2012-12-16 13:22:24 +00:00
|
|
|
int addObject(int objIndex);
|
2012-09-20 12:02:55 +00:00
|
|
|
|
|
|
|
void INIT_BOB();
|
|
|
|
void BOB_ZERO(int idx);
|
2012-09-23 00:59:52 +00:00
|
|
|
void DEF_BOB(int idx);
|
2012-09-20 12:02:55 +00:00
|
|
|
void BOB_VISU(int idx);
|
|
|
|
void BOB_OFF(int idx);
|
2012-09-30 11:02:39 +00:00
|
|
|
void BOB_OFFSET(int idx, int v);
|
|
|
|
void BOB_ADJUST(int idx, int v);
|
|
|
|
void BOB_OFFSETY(int idx, int v);
|
2012-09-23 12:52:12 +00:00
|
|
|
void SCBOB(int idx);
|
2012-09-24 12:21:04 +00:00
|
|
|
void CALCUL_BOB(int idx);
|
2012-09-23 00:59:52 +00:00
|
|
|
|
|
|
|
void VERIFCACHE();
|
|
|
|
void DEF_SPRITE(int idx);
|
|
|
|
void DEF_CACHE(int idx);
|
2012-12-29 22:57:50 +00:00
|
|
|
void computeSprite(int idx);
|
2012-10-29 21:57:47 +00:00
|
|
|
int AvantTri(TriMode triMode, int index, int priority);
|
2012-09-23 00:59:52 +00:00
|
|
|
void AFF_BOB_ANIM();
|
|
|
|
void AFF_VBOB();
|
2012-09-28 12:15:59 +00:00
|
|
|
|
2012-12-16 23:16:49 +00:00
|
|
|
int getSpriteX(int idx);
|
|
|
|
int getSpriteY(int idx);
|
2012-09-28 12:15:59 +00:00
|
|
|
void SPRITE_NOW(const byte *spriteData, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
|
|
|
|
|
2012-12-18 20:50:50 +00:00
|
|
|
void clearSprite();
|
2012-09-28 12:15:59 +00:00
|
|
|
void SPRITE_ON(int idx);
|
2012-12-16 01:11:36 +00:00
|
|
|
void SPRITE(const byte *spriteData, Common::Point pos, int idx, int spriteIndex, int a6, int a7, int a8, int a9);
|
2012-09-28 12:15:59 +00:00
|
|
|
void SPRITE2(const byte *spriteData, int idx, byte *a3, int a4, int a5);
|
2012-12-18 20:50:50 +00:00
|
|
|
void removeSprite(int idx);
|
2012-12-16 23:16:49 +00:00
|
|
|
void setSpriteX(int idx, int xp);
|
|
|
|
void setSpriteIndex(int idx, int spriteIndex);
|
|
|
|
void setSpriteY(int idx, int yp);
|
2012-09-28 12:15:59 +00:00
|
|
|
void SETTAILLESPR(int idx, int a2);
|
2012-12-19 01:15:32 +00:00
|
|
|
void setFlipSprite(int idx, bool flip);
|
2012-09-28 12:15:59 +00:00
|
|
|
|
2012-12-26 06:56:26 +00:00
|
|
|
void checkZone();
|
2012-09-30 11:02:39 +00:00
|
|
|
void GOHOME();
|
2012-09-28 12:15:59 +00:00
|
|
|
void GOHOME2();
|
|
|
|
void CHARGE_OBSTACLE(const Common::String &file);
|
2012-12-19 01:15:32 +00:00
|
|
|
void loadZone(const Common::String &file);
|
2012-10-03 21:27:34 +00:00
|
|
|
void CARRE_ZONE();
|
2012-09-28 12:15:59 +00:00
|
|
|
void PLAN_BETA();
|
2012-12-19 01:15:32 +00:00
|
|
|
void handleLeftButton();
|
2012-09-28 12:15:59 +00:00
|
|
|
void PARADISE();
|
|
|
|
void CLEAR_ECRAN();
|
2012-12-14 00:49:22 +00:00
|
|
|
|
2012-11-24 20:08:13 +00:00
|
|
|
/**
|
|
|
|
* Change the currently active player
|
|
|
|
* @param oldCharacter Previously played character
|
|
|
|
* @param newCharacter New character to play
|
|
|
|
*/
|
2012-12-16 23:16:49 +00:00
|
|
|
void changeCharacterHead(PlayerCharacter oldCharacter, PlayerCharacter newCharacter);
|
2012-11-24 20:08:13 +00:00
|
|
|
|
2012-09-28 23:33:42 +00:00
|
|
|
void VERIFTAILLE();
|
2012-10-20 06:47:57 +00:00
|
|
|
void PACOURS_PROPRE(int16 *a1);
|
|
|
|
int16 *PARC_VOITURE(int a1, int a2, int a3, int a4);
|
2012-09-28 23:33:42 +00:00
|
|
|
void VERBEPLUS();
|
2012-12-19 01:15:32 +00:00
|
|
|
void handleRightButton();
|
2012-09-28 23:33:42 +00:00
|
|
|
int MZONE();
|
2012-12-16 08:56:50 +00:00
|
|
|
void initBorder(int a1);
|
2012-09-30 11:02:39 +00:00
|
|
|
void OBJETPLUS(int a1);
|
|
|
|
void VALID_OBJET(int a1);
|
|
|
|
void OPTI_OBJET();
|
2012-10-03 12:15:39 +00:00
|
|
|
void SPECIAL_JEU();
|
2012-09-30 11:02:39 +00:00
|
|
|
void BOB_VIVANT(int a1);
|
2012-10-24 23:43:31 +00:00
|
|
|
void VBOB(byte *src, int idx, int xp, int yp, int frameIndex);
|
2012-09-30 11:02:39 +00:00
|
|
|
void VBOB_OFF(int idx);
|
|
|
|
void ACTION_DOS(int idx);
|
|
|
|
void ACTION_DROITE(int idx);
|
|
|
|
void Q_DROITE(int idx);
|
|
|
|
void ACTION_FACE(int idx);
|
|
|
|
void Q_GAUCHE(int idx);
|
|
|
|
void ACTION_GAUCHE(int idx);
|
|
|
|
|
|
|
|
void ZONE_ON(int idx);
|
2012-12-26 06:56:26 +00:00
|
|
|
void disableZone(int idx);
|
2012-09-30 11:02:39 +00:00
|
|
|
void OPTI_ONE(int a1, int a2, int a3, int a4);
|
|
|
|
void AFFICHE_SPEED1(byte *speedData, int xp, int yp, int img);
|
2012-10-03 12:15:39 +00:00
|
|
|
int BOBPOSI(int idx);
|
2012-12-20 07:35:11 +00:00
|
|
|
void setBobAnimation(int idx);
|
|
|
|
void stopBobAnimation(int idx);
|
2012-10-03 12:15:39 +00:00
|
|
|
void SET_BOBPOSI(int idx, int a2);
|
2012-12-20 07:35:11 +00:00
|
|
|
int getBobPosX(int idx);
|
2012-10-03 12:15:39 +00:00
|
|
|
int BOBY(int idx);
|
|
|
|
int BOBA(int idx);
|
|
|
|
|
2012-09-30 11:02:39 +00:00
|
|
|
void INILINK(const Common::String &file);
|
2012-12-29 18:58:37 +00:00
|
|
|
void SPECIAL_INI();
|
2012-12-29 13:20:34 +00:00
|
|
|
void OPTI_BOBON(int idx1, int idx2, int idx3, int a4, int a5, int a6, int a7);
|
|
|
|
void SCI_OPTI_ONE(int idx, int a2, int a3, int a4);
|
2012-12-29 18:58:37 +00:00
|
|
|
void disableVerb(int idx, int a2);
|
|
|
|
void enableVerb(int idx, int a2);
|
2012-09-30 13:28:21 +00:00
|
|
|
int CALC_PROPRE(int idx);
|
2012-10-13 23:20:10 +00:00
|
|
|
int colision(int xp, int yp);
|
2012-10-03 12:15:39 +00:00
|
|
|
|
2012-10-03 21:27:34 +00:00
|
|
|
void ACTION(const byte *spriteData, const Common::String &a2, int a3, int a4, int a5, int a6);
|
2012-11-17 10:57:02 +00:00
|
|
|
void SPACTION(byte *a1, const Common::String &animationSeq, int a3, int a4, int a5, int a6);
|
2012-12-31 16:03:43 +00:00
|
|
|
void SPACTION1(byte *spriteData, const Common::String &animString, int a3, int a4, int a5);
|
2012-12-29 18:58:37 +00:00
|
|
|
void TEST_FORET(int screenId, int minX, int maxX, int minY, int maxY, int idx);
|
2012-12-29 13:20:34 +00:00
|
|
|
void lockAnimX(int idx, int a2);
|
2012-11-17 11:00:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Game scene control method
|
|
|
|
*/
|
2012-12-14 00:49:22 +00:00
|
|
|
void PERSONAGE(const Common::String &backgroundFile, const Common::String &linkFile,
|
2012-11-17 11:00:54 +00:00
|
|
|
const Common::String &animFile, const Common::String &s4, int v);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Game scene control method
|
|
|
|
*/
|
2012-12-14 00:49:22 +00:00
|
|
|
void PERSONAGE2(const Common::String &backgroundFile, const Common::String &linkFile,
|
2012-11-17 11:00:54 +00:00
|
|
|
const Common::String &animFile, const Common::String &s4, int v);
|
2012-09-17 08:03:25 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // End of namespace Hopkins
|
|
|
|
|
|
|
|
#endif /* HOPKINS_OBJECTS_H */
|