supercasiobros/src/world.h

56 lines
1.2 KiB
C
Raw Normal View History

2019-11-16 11:44:09 +01:00
#ifndef WORLD_H
#define WORLD_H
#include <stdint.h>
#include <gint/display.h>
2019-11-16 11:44:09 +01:00
#define W_CELL_SIZEPX 8
#define W_SIZE_X 160
#define W_SIZE_Y 16
2019-11-20 15:33:34 +01:00
// p1 p2 p3
#define DEATH -1
#define EMPTY 0 // _, _, _
#define EARTH 1 // X, Y, _ (XY tileset)
#define BRICK 2
2019-11-16 11:44:09 +01:00
2019-11-20 15:33:34 +01:00
#define PLATEFORM 4
#define TUYAU 5 // X, Y, _ (XY tileset)
#define GIFT 6 // s, t, n (state, type, number) [if number=0 state=1]
#define COIN 7 // s, _, _ (state)
2019-11-16 11:44:09 +01:00
typedef struct
{
char type;
2019-11-20 15:33:34 +01:00
char p1; // numéro de tile
char p2; // visible, invisible, téléporteur/en train de tirer (canon par exemple)
char p3;
2019-11-16 11:44:09 +01:00
} world_t;
int world_get_width();
2019-11-20 18:31:20 +01:00
world_t* world_get(int x, int y);
2019-11-16 11:44:09 +01:00
void display_cell(int cx, int cy, int sx, int sy);
2019-11-20 15:33:34 +01:00
void world_set(world_t * w);
2019-11-16 11:44:09 +01:00
2019-11-16 12:02:30 +01:00
void world_draw(int x, int y);
2019-11-20 15:33:34 +01:00
int world_get_real_x0(int x);
int world_get_real_y0(int y);
void world_reset();
2019-11-20 15:33:34 +01:00
#define CTG_SOIL 1
#define CTG_EMPTY 2
#define CTG_DEATH 3
int world_get_ctg(int x, int y);
extern world_t * w_current;
extern image_t * w_fond;
extern int w_current_x;
extern int w_current_y;
extern int w_mario_startx;
extern int w_mario_starty;
2019-11-16 11:44:09 +01:00
#endif