From dcf5805440ab116df9918d63de4ef8a6300b7268 Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 2 Aug 2004 15:44:18 +0000 Subject: create objectMap class svn-id: r14440 --- saga/objectmap.h | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) (limited to 'saga/objectmap.h') diff --git a/saga/objectmap.h b/saga/objectmap.h index b24af2c06a..3205809c28 100644 --- a/saga/objectmap.h +++ b/saga/objectmap.h @@ -28,6 +28,10 @@ namespace Saga { +enum R_OBJECT_FLAGS { + R_OBJECT_NORMAL = 0x02 +}; + struct R_CLICKAREA { int n_points; R_POINT *points; @@ -44,19 +48,35 @@ struct R_OBJECTMAP_ENTRY { R_CLICKAREA *clickareas; }; -struct R_OBJECTMAP_INFO { - int initialized; +class Gfx; - int objects_loaded; - int n_objects; - R_OBJECTMAP_ENTRY *object_maps; +class ObjectMap{ +public: + int reg(void); + ObjectMap(Gfx *gfx); + ~ObjectMap(void); + int load(const byte *om_res, size_t om_res_len); + int freeMem(void); + int loadNames(const byte *onl_res, size_t onl_res_len); + int freeNames(); + int getName(int object, const char **name); + int getFlags(int object, uint16 *flags); + int getEPNum(int object, int *ep_num); + int draw(R_SURFACE *draw_surface, R_POINT *imouse_pt, int color, int color2); + int hitTest(R_POINT *imouse_pt, int *object_num); + void objectInfo(int argc, char *argv[]); +private: + int _initialized; - int names_loaded; - int n_names; - const char **names; -}; + int _objects_loaded; + int _n_objects; + R_OBJECTMAP_ENTRY *_object_maps; -static void CF_object_info(int argc, char *argv[], void *refCon); + int _names_loaded; + int _n_names; + const char **_names; + Gfx *_gfx; +}; } // End of namespace Saga -- cgit v1.2.3