2004-04-12 21:40:49 +00:00
|
|
|
/* ScummVM - Scumm Interpreter
|
|
|
|
* Copyright (C) 2004 The ScummVM project
|
|
|
|
*
|
|
|
|
* The ReInherit Engine is (C)2000-2003 by Daniel Balsom.
|
|
|
|
*
|
|
|
|
* 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*
|
|
|
|
* $Header$
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2004-05-01 13:48:01 +00:00
|
|
|
// Scene management module private header file
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
#ifndef SAGA_SCENE_H
|
|
|
|
#define SAGA_SCENE_H
|
|
|
|
|
2004-08-04 20:28:57 +00:00
|
|
|
#include "saga/text.h"
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
namespace Saga {
|
|
|
|
|
2004-08-04 20:28:57 +00:00
|
|
|
enum R_SCENE_MODES {
|
|
|
|
R_SCENE_MODE_INVALID,
|
|
|
|
R_SCENE_MODE_NORMAL,
|
|
|
|
R_SCENE_MODE_ISO
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SCENE_ZINFO {
|
|
|
|
int begin_slope;
|
|
|
|
int end_slope;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
struct SCENE_BGINFO {
|
|
|
|
int bg_x;
|
|
|
|
int bg_y;
|
|
|
|
int bg_w;
|
|
|
|
int bg_h;
|
|
|
|
int bg_p;
|
|
|
|
byte *bg_buf;
|
|
|
|
size_t bg_buflen;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct R_SCENE_INFO {
|
|
|
|
SCENE_ZINFO z_info;
|
|
|
|
SCENE_BGINFO bg_info;
|
|
|
|
R_TEXTLIST *text_list;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef int (R_SCENE_PROC) (int, R_SCENE_INFO *);
|
|
|
|
|
2004-08-01 09:15:12 +00:00
|
|
|
#define PALETTE_FADE_DURATION 1000
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
enum SCENE_LOAD_FLAGS {
|
|
|
|
BY_RESOURCE = 0,
|
|
|
|
BY_SCENE,
|
|
|
|
BY_DESC
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SCENE_PROC_PARAMS {
|
|
|
|
SCENE_BEGIN = 0,
|
|
|
|
SCENE_END
|
|
|
|
};
|
|
|
|
|
2004-05-01 13:48:01 +00:00
|
|
|
// Resource type numbers
|
2004-04-12 21:40:49 +00:00
|
|
|
enum SAGA_RESOURCE_TYPES {
|
|
|
|
SAGA_BG_IMAGE = 2,
|
|
|
|
SAGA_BG_MASK = 3,
|
|
|
|
SAGA_OBJECT_NAME_LIST = 5,
|
|
|
|
SAGA_OBJECT_MAP = 6,
|
|
|
|
SAGA_ACTION_MAP = 7,
|
|
|
|
SAGA_ISO_TILESET = 8,
|
|
|
|
SAGA_ISO_METAMAP = 9,
|
|
|
|
SAGA_ISO_METATILESET = 10,
|
|
|
|
SAGA_ANIM_1 = 14,
|
|
|
|
SAGA_ANIM_2,
|
|
|
|
SAGA_ANIM_3,
|
|
|
|
SAGA_ANIM_4,
|
|
|
|
SAGA_ANIM_5,
|
|
|
|
SAGA_ANIM_6,
|
|
|
|
SAGA_ANIM_7,
|
|
|
|
SAGA_PAL_ANIM = 23
|
|
|
|
};
|
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
#define SAGA_RESLIST_ENTRY_LEN 4
|
|
|
|
|
|
|
|
struct R_SCENE_RESLIST {
|
2004-04-30 23:02:23 +00:00
|
|
|
uint32 res_number;
|
2004-04-25 14:42:14 +00:00
|
|
|
int res_type;
|
2004-04-30 23:02:23 +00:00
|
|
|
byte *res_data;
|
2004-04-25 14:42:14 +00:00
|
|
|
size_t res_data_len;
|
|
|
|
};
|
|
|
|
|
2004-04-12 21:40:49 +00:00
|
|
|
#define SAGA_SCENE_DESC_LEN 16
|
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_SCENE_DESC {
|
2004-04-12 21:40:49 +00:00
|
|
|
int unknown0;
|
|
|
|
int res_list_rn;
|
|
|
|
int end_slope;
|
|
|
|
int begin_slope;
|
|
|
|
int script_num;
|
|
|
|
int scene_scriptnum;
|
|
|
|
int start_scriptnum;
|
|
|
|
int music_rn;
|
2004-04-25 14:42:14 +00:00
|
|
|
R_SCENE_RESLIST *res_list;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t res_list_ct;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct SCENE_IMAGE {
|
2004-04-12 21:40:49 +00:00
|
|
|
int loaded;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
int p;
|
2004-04-30 23:02:23 +00:00
|
|
|
byte *buf;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t buf_len;
|
2004-04-30 23:02:23 +00:00
|
|
|
byte *res_buf;
|
2004-04-12 21:40:49 +00:00
|
|
|
size_t res_len;
|
|
|
|
PALENTRY pal[256];
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct SCENE_ANIMINFO {
|
2004-04-12 21:40:49 +00:00
|
|
|
int anim_res_number;
|
|
|
|
int anim_handle;
|
2004-04-25 14:42:14 +00:00
|
|
|
SCENE_ANIMINFO *next;
|
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-04-25 14:42:14 +00:00
|
|
|
struct R_SCENE_QUEUE {
|
2004-04-30 23:02:23 +00:00
|
|
|
uint32 scene_n;
|
2004-04-12 21:40:49 +00:00
|
|
|
R_SCENE_DESC *scene_desc;
|
|
|
|
int load_flag;
|
|
|
|
R_SCENE_PROC *scene_proc;
|
|
|
|
int scene_skiptarget;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
2004-08-04 20:28:57 +00:00
|
|
|
class Scene {
|
|
|
|
public:
|
|
|
|
Scene(SagaEngine *vm);
|
|
|
|
~Scene();
|
|
|
|
int reg();
|
|
|
|
|
|
|
|
int startScene();
|
|
|
|
int nextScene();
|
|
|
|
int skipScene();
|
|
|
|
int endScene();
|
|
|
|
int queueScene(R_SCENE_QUEUE *scene_queue);
|
|
|
|
int draw(R_SURFACE *);
|
|
|
|
int getMode();
|
|
|
|
int getBGMaskInfo(int *w, int *h, byte **buf, size_t *buf_len);
|
|
|
|
int isBGMaskPresent(void);
|
|
|
|
int getBGInfo(SCENE_BGINFO *bginfo);
|
|
|
|
int getZInfo(SCENE_ZINFO *zinfo);
|
|
|
|
int getBGPal(PALENTRY **pal);
|
|
|
|
int getInfo(R_SCENE_INFO *si);
|
|
|
|
|
|
|
|
int clearSceneQueue(void);
|
|
|
|
int changeScene(int scene_num);
|
|
|
|
|
|
|
|
bool initialized() { return _initialized; }
|
|
|
|
|
|
|
|
void sceneInfoCmd(int argc, char *argv[]);
|
|
|
|
void sceneChangeCmd(int argc, char *argv[]);
|
|
|
|
|
|
|
|
private:
|
|
|
|
int loadScene(int scene, int load_flag, R_SCENE_PROC scene_proc, R_SCENE_DESC *);
|
|
|
|
int loadSceneDescriptor(uint32 res_number);
|
|
|
|
int loadSceneResourceList(uint32 res_number);
|
|
|
|
int processSceneResources();
|
|
|
|
|
|
|
|
private:
|
|
|
|
SagaEngine *_vm;
|
|
|
|
bool _initialized;
|
|
|
|
|
|
|
|
R_RSCFILE_CONTEXT *_sceneContext;
|
|
|
|
int *_sceneLUT;
|
|
|
|
int _sceneCount;
|
|
|
|
int _sceneMax;
|
|
|
|
YS_DL_LIST *_sceneQueue;
|
|
|
|
int _firstScene;
|
|
|
|
bool _sceneLoaded;
|
|
|
|
int _sceneMode;
|
|
|
|
int _sceneNumber;
|
|
|
|
int _sceneResNum;
|
|
|
|
bool _inGame;
|
|
|
|
bool _loadDesc;
|
|
|
|
R_SCENE_DESC _desc;
|
|
|
|
int _resListEntries;
|
|
|
|
R_SCENE_RESLIST *_resList;
|
|
|
|
int _animEntries;
|
|
|
|
YS_DL_LIST *_animList;
|
|
|
|
R_SCENE_PROC *_sceneProc;
|
|
|
|
R_TEXTLIST *_textList;
|
|
|
|
SCENE_IMAGE _bg;
|
|
|
|
SCENE_IMAGE _bgMask;
|
2004-04-25 14:42:14 +00:00
|
|
|
};
|
2004-04-12 21:40:49 +00:00
|
|
|
|
|
|
|
} // End of namespace Saga
|
|
|
|
|
2004-05-01 13:48:01 +00:00
|
|
|
#endif
|