Le nouveau Super Mario Bros pour la gamme des fx9860g https://www.planet-casio.com/Fr/forums/topic15994-1-[addin]-SuperCasioBros-v0.1.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
supercasiobros/include/world.h

143 lines
2.0 KiB

#ifndef WORLD_H
#define WORLD_H
#include <stdint.h>
#include <gint/display.h>
#define W_CELL_SIZEPX 8
#define W_SIZE_X 160
#define W_SIZE_Y 16
typedef enum
{
EMPTY=0,
EARTH,
BRICK,
BLOC,
END_LEVEL,
TUYAU,
ARBRE,
GIFT,
COIN,
SPIKES,
NUAGE,
BUISSON,
COLLINE,
CASTLE,
} cell_id;
typedef struct
{
unsigned type :8;
unsigned empty :16;
unsigned x :4;
unsigned y :4;
} earth_t;
typedef struct
{
unsigned type :8;
unsigned time_hit_id :8;
unsigned state :4;
unsigned hidden :4;
unsigned content :4;
unsigned number :4;
} brick_t;
typedef struct
{
unsigned type :8;
unsigned data :24; // raw binary format
} bloc_t;
typedef struct
{
unsigned type :8;
unsigned empty :8;
unsigned avancement :4;
unsigned bonus :4; //*400
unsigned x :4; //=0
unsigned y :4;
} end_level_t;
typedef struct
{
unsigned type :8;
unsigned empty :16;
unsigned x :4;
unsigned y :4;
} tuyau_t;
typedef struct
{
unsigned type :8;
unsigned empty :16;
unsigned x :4;
unsigned y :4;
} arbre_t;
typedef struct
{
unsigned type :8;
unsigned time_hit_id :8;
unsigned state :4;
unsigned hidden :4;
unsigned content :4;
unsigned number :4;
} gift_t;
typedef struct
{
unsigned type :8;
unsigned empty :20;
unsigned taken :4;
} coin_t;
typedef struct
{
unsigned type :8;
unsigned empty :16;
unsigned x :4;
unsigned y :4;
} deco_t;
// Generic container 32 bits
typedef struct
{
unsigned type :8;
unsigned data :24; // raw binary format
} cell_t;
int worldGetWidth();
cell_t* worldGetCell(int x, int y);
void cellDraw(int cx, int cy, int sx, int sy, int plan);
void worldSet(int w, int h, int x, int y, cell_t * a);
void worldDraw();
void worldMove();
void worldReset();
#define CTG_SOIL 1
#define CTG_EMPTY 2
#define CTG_WATER 3
#define CTG_DEATH 4
int worldGetCellCategory(int x, int y);
typedef struct
{
int w;
int h;
int start_x;
int start_y;
cell_t* data;
}map_t;
extern map_t * map_current;
#endif