chuyiwen_gmsv/map/map_util.c
chuyiwen bea5ac05b3 sq_gmsv_chuyiwen
sa_sever
2016-12-24 09:45:52 +09:00

36 lines
850 B
C

#include "version.h"
#include "common.h"
#include "char.h"
#include "readmap.h"
#define MAP_CHARFLOOR(x) CHAR_getInt(x,CHAR_FLOOR)
#define MAP_CHARX(x) CHAR_getInt(x,CHAR_X)
#define MAP_CHARY(x) CHAR_getInt(x,CHAR_Y)
BOOL MAP_getMapDataFromCharIndex( int index , int* map )
{
int mapdata[2];
int ret;
ret = MAP_getTileAndObjData(MAP_CHARFLOOR(index),
MAP_CHARX(index),
MAP_CHARY(index),
&mapdata[0],&mapdata[1] );
map[0] = mapdata[0];
map[1] = mapdata[1];
return ret;
}
BOOL MAP_getMapDataFromFXY( int f , int x , int y, int* map )
{
int mapdata[2];
int ret;
ret = MAP_getTileAndObjData(f,x,y,&mapdata[0],&mapdata[1] );
map[0] = mapdata[0];
map[1] = mapdata[1];
return ret;
}