blues/bb/resource.h

71 lines
2.0 KiB
C
Raw Normal View History

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;
2018-12-16 13:34:03 +01:00
const uint8_t *op_table1; // tile_yoffset
2018-07-08 16:08:53 +02:00
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
2018-07-20 15:51:02 +02:00
#define SPRITE_SIZE 35566
2018-07-08 16:08:53 +02:00
#define SOUND_SIZE 29376
2018-07-12 13:21:15 +02:00
#define SPRITES_COUNT 146
2018-07-08 16:08:53 +02:00
struct resource_data_t {
2019-06-01 16:25:06 +02:00
const char *datapath;
2018-07-08 16:08:53 +02:00
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;
2018-07-27 16:02:05 +02:00
int vga_size;
2018-07-08 16:08:53 +02:00
uint8_t *tiles;
uint8_t *snd;
2018-08-12 14:27:20 +02:00
bool dos_demo;
bool amiga_data;
2018-08-12 16:55:27 +02:00
uint8_t cga_lut_avt[16 * 2];
uint8_t cga_lut_sqv[16 * 2];
2018-07-08 16:08:53 +02:00
};
extern struct resource_data_t g_res;
2018-12-16 13:34:03 +01:00
extern void res_init(const char *datapath, int vga_size);
2018-07-08 16:08:53 +02:00
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);
2018-08-12 16:55:27 +02:00
extern void load_avt(const char *filename, uint8_t *dst, int offset, int dither_pattern);
2018-07-08 16:08:53 +02:00
extern void load_bin(const char *filename);
2018-07-13 14:34:11 +02:00
extern void load_blk(const char *filename);
2018-08-12 15:44:16 +02:00
extern void load_ck(const char *filename, uint16_t offset, int dither_pattern);
extern void load_img(const char *filename, int screen_w, int dither_pattern);
2018-07-20 15:51:02 +02:00
extern void load_m(const char *filename);
2018-07-12 15:17:33 +02:00
extern void load_spr(const char *filename, uint8_t *dst, int offset);
2018-08-12 16:55:27 +02:00
extern void load_sqv(const char *filename, uint8_t *dst, int offset, int dither_pattern);
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__ */