2018-07-08 16:08:53 +02:00
|
|
|
|
|
|
|
#ifndef RESOURCE_H__
|
|
|
|
#define RESOURCE_H__
|
|
|
|
|
|
|
|
#include "intern.h"
|
|
|
|
|
|
|
|
#define TILE_NUM_CRATE 5
|
|
|
|
#define TILE_NUM_BALLOON 8
|
|
|
|
#define TILE_NUM_UMBRELLA 9
|
|
|
|
|
|
|
|
struct trigger_t {
|
|
|
|
int16_t tile_type;
|
|
|
|
int16_t tile_flags;
|
|
|
|
uint8_t op_func;
|
|
|
|
const uint8_t *op_table1; // dy for (x&15)
|
|
|
|
const uint8_t *op_table2; // tile_animation
|
|
|
|
int16_t unk10;
|
|
|
|
const uint8_t *op_table3; // tile_trigger
|
|
|
|
uint8_t unk16; // next_tile_num
|
|
|
|
uint8_t tile_index; // op_table2
|
|
|
|
uint8_t foreground_tile_num;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define MAX_AVT 50
|
|
|
|
#define MAX_SPR_FRAMES 200
|
|
|
|
#define MAX_TRIGGERS 256
|
|
|
|
#define SOUND_SIZE 29376
|
2018-07-12 13:21:15 +02:00
|
|
|
#define SPRITES_COUNT 146
|
2018-07-08 16:08:53 +02:00
|
|
|
|
|
|
|
#define RESOURCE_FLAGS_DEMO (1 << 0)
|
|
|
|
|
|
|
|
struct resource_data_t {
|
|
|
|
uint32_t flags;
|
|
|
|
uint8_t *sql;
|
|
|
|
uint8_t *spr_sqv;
|
|
|
|
uint8_t *avt_sqv;
|
|
|
|
uint8_t *tmp;
|
2018-07-12 13:21:15 +02:00
|
|
|
int avt_count;
|
2018-07-08 16:08:53 +02:00
|
|
|
const uint8_t *avt[MAX_AVT];
|
2018-07-12 13:21:15 +02:00
|
|
|
int spr_count;
|
2018-07-08 16:08:53 +02:00
|
|
|
const uint8_t *spr_frames[MAX_SPR_FRAMES];
|
|
|
|
uint8_t palette[16 * 3];
|
|
|
|
struct trigger_t triggers[MAX_TRIGGERS];
|
|
|
|
uint8_t *vga;
|
|
|
|
uint8_t *tiles;
|
|
|
|
uint8_t *snd;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern struct resource_data_t g_res;
|
|
|
|
|
|
|
|
extern void res_init();
|
|
|
|
extern void res_fini();
|
2018-07-12 15:17:33 +02:00
|
|
|
extern int read_file(const char *filename, uint8_t *dst, int size);
|
2018-07-08 16:08:53 +02:00
|
|
|
extern int read_compressed_file(const char *filename, uint8_t *dst);
|
|
|
|
extern void load_avt(const char *filename, uint8_t *dst, int offset);
|
|
|
|
extern void load_bin(const char *filename);
|
2018-07-13 14:34:11 +02:00
|
|
|
extern void load_blk(const char *filename);
|
2018-07-08 16:08:53 +02:00
|
|
|
extern void load_ck(const char *filename, uint16_t offset);
|
|
|
|
extern void load_img(const char *filename);
|
2018-07-12 15:17:33 +02:00
|
|
|
extern void load_spr(const char *filename, uint8_t *dst, int offset);
|
|
|
|
extern void load_sqv(const char *filename, uint8_t *dst, int offset);
|
2018-07-08 16:08:53 +02:00
|
|
|
extern void load_sql(const char *filename);
|
|
|
|
extern uint8_t * lookup_sql(int x, int y);
|
|
|
|
|
|
|
|
#endif /* RESOURCE_H__ */
|