maptransform.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef _MAPTRANSFORM_H_
00029 #define _MAPTRANSFORM_H_
00030
00031 #include <sys/types.h>
00032 #include <netinet/in.h>
00033 #include <stdlib.h>
00034 #include <string.h>
00035 #include <math.h>
00036
00037 #include <libplayercore/playercore.h>
00038
00039
00040 #define MAP_IDX(mf, i, j) ((mf.width) * (j) + (i))
00041
00042
00043 #define MAP_VALID(mf, i, j) ((i >= 0) && (i < mf.width) && (j >= 0) && (j < mf.height))
00044
00045 class MapTransform : public Driver
00046 {
00047 protected:
00048 player_map_info_t source_map;
00049 player_devaddr_t source_map_addr;
00050 char* source_data;
00051
00052 player_map_info_t new_map;
00053 char* new_data;
00054
00055
00056 int GetMap();
00057
00058 virtual int Transform() = 0;
00059
00060 public:
00061 MapTransform(ConfigFile* cf, int section);
00062 virtual ~MapTransform();
00063
00064
00065 public: virtual int ProcessMessage(MessageQueue * resp_queue,
00066 player_msghdr * hdr,
00067 void * data);
00068
00069 int Setup();
00070 int Shutdown();
00071 };
00072
00073 #endif
Last updated 12 September 2005 21:38:45
|