2019-12-15 19:17:00 +00:00
|
|
|
#include "defconv.h"
|
|
|
|
|
2019-11-27 20:58:11 +00:00
|
|
|
#if GAME == 5
|
|
|
|
# define PI_COUNT 8
|
|
|
|
#else
|
|
|
|
# define PI_COUNT 6
|
|
|
|
#endif
|
|
|
|
|
2019-12-15 19:17:00 +00:00
|
|
|
// Global PI file slots.
|
2019-11-27 20:58:11 +00:00
|
|
|
extern PiHeader pi_slot_headers[PI_COUNT];
|
|
|
|
extern void far *pi_slot_buffers[PI_COUNT];
|
2019-12-15 19:17:00 +00:00
|
|
|
|
|
|
|
// ≥TH03 free any previously loaded PI in the given slot before loading [fn].
|
|
|
|
int DEFCONV pi_slot_load(int slot, const char *fn);
|
|
|
|
|
|
|
|
void DEFCONV pi_slot_palette_apply(int slot);
|
|
|
|
|
2020-07-25 17:26:34 +00:00
|
|
|
// Displays the PI image in slot #[slot] at ([left], [top]). Horizontally, the
|
2020-06-18 18:01:29 +00:00
|
|
|
// image is cut off at 640 pixels; vertically, it is wrapped if it exceeds the
|
|
|
|
// clipping frame defined via grc_setclip().
|
2020-08-20 19:59:45 +00:00
|
|
|
void DEFCONV pi_slot_put(screen_x_t left, vram_y_t top, int slot);
|
2019-12-15 19:17:00 +00:00
|
|
|
|
|
|
|
#define pi_load_put_free(slot, fn) \
|
|
|
|
pi_slot_load(slot, (fn)); \
|
|
|
|
pi_slot_palette_apply(slot); \
|
|
|
|
pi_slot_put(0, 0, slot); \
|
|
|
|
graph_pi_free(&pi_slot_headers[slot], pi_slot_buffers[slot]);
|