00001
00016
00017
00018 #ifndef ADIKT_DRAWMAP_H
00019 #define ADIKT_DRAWMAP_H
00020
00021 #include "globals.h"
00022
00023 #define ERR_DRAW_BADTXTR -33
00024 #define ERR_DRAW_BADCUBE -34
00025
00026 enum BMFONT_OPTIONS {
00027 BMFONT_DONT_LOAD = 0x00,
00028 BMFONT_LOAD_SMALL = 0x01,
00029 BMFONT_LOAD_LARGE = 0x02,
00030 };
00031
00032 enum TNGFLG_OPTIONS {
00033 TNGFLG_NONE = 0x00,
00034 TNGFLG_SHOW_CIRCLES = 0x01,
00035 };
00036
00037 struct LEVEL;
00038 struct CUBES_DATA;
00039 struct IMAGELIST;
00040
00041 #define SIN_ACOS_SIZE 1024
00042
00043 struct PALETTE_ENTRY {
00044 unsigned char r;
00045 unsigned char g;
00046 unsigned char b;
00047 unsigned char o;
00048 };
00049
00050 struct MAPDRAW_DATA {
00051
00052 struct UPOINT_2D subsize;
00053
00054 struct CUBES_DATA *cubes;
00055 unsigned char *texture;
00056 struct PALETTE_ENTRY *palette;
00057 struct PALETTE_ENTRY *ownerpal;
00058 struct PALETTE_ENTRY *intnspal;
00059
00060 short tngflags;
00061
00062 struct IMAGELIST *images;
00063
00064 struct IMAGELIST *font0;
00065 struct IMAGELIST *font1;
00066
00067 struct IPOINT_2D start;
00068 struct IPOINT_2D end;
00069 short rescale;
00070 unsigned int dest_scanln;
00071
00072 unsigned char *rand_pool;
00073 struct IPOINT_2D rand_subtl;
00074 unsigned int rand_count;
00075 unsigned int rand_size;
00076 unsigned long sin_acos[SIN_ACOS_SIZE];
00077 };
00078
00079
00080
00081 DLLIMPORT short generate_map_bitmap(const char *bmpfname,const struct LEVEL *lvl,
00082 const struct MAPDRAW_OPTIONS *opts);
00083 DLLIMPORT short generate_map_bitmap_mapfname(struct LEVEL *lvl);
00084
00085
00086
00087 DLLIMPORT short load_draw_data(struct MAPDRAW_DATA **draw_data,const struct MAPDRAW_OPTIONS *opts,
00088 const struct UPOINT_2D *subtl,const struct IPOINT_2D bmp_size,int textr_idx);
00089 DLLIMPORT short free_draw_data(struct MAPDRAW_DATA *draw_data);
00090 DLLIMPORT short draw_map_on_buffer(char *dest,const struct LEVEL *lvl,
00091 struct MAPDRAW_DATA *draw_datam,unsigned int anim);
00092 DLLIMPORT short draw_map_on_buffer_fast(char *dest,const struct LEVEL *lvl,
00093 struct MAPDRAW_DATA *draw_data,unsigned int anim);
00094 DLLIMPORT short draw_things_on_buffer(char *dest,const struct LEVEL *lvl,
00095 struct MAPDRAW_DATA *draw_data);
00096 DLLIMPORT short draw_text_on_buffer(char *dest,const int px,const int py,
00097 const char *text,struct MAPDRAW_DATA *draw_data,short font);
00098
00099
00100
00101 DLLIMPORT short change_draw_data_texture(struct MAPDRAW_DATA *draw_data,
00102 const struct MAPDRAW_OPTIONS *opts,const int textr_idx);
00103 DLLIMPORT short set_draw_data_rect(struct MAPDRAW_DATA *draw_data,
00104 const int startx,const int starty,const int endx,const int endy,
00105 const unsigned int scanline,const short rescale);
00106 inline short set_draw_data_rect_ip(struct MAPDRAW_DATA *draw_data,
00107 const struct IPOINT_2D start,const struct IPOINT_2D end,
00108 const unsigned int scanline,const short rescale);
00109 inline short set_draw_data_rect_sl4(struct MAPDRAW_DATA *draw_data,
00110 const int startx,const int starty,const int endx,const int endy,
00111 const short dest_sizex,const short rescale);
00112
00113 DLLIMPORT short get_draw_tile_rect(struct IPOINT_2D *tstart,
00114 struct IPOINT_2D *tdim, const struct MAPDRAW_DATA *draw_data,
00115 unsigned int tx,unsigned int ty);
00116 DLLIMPORT short get_draw_subtile_rect(struct IPOINT_2D *sstart,
00117 struct IPOINT_2D *sdim, const struct MAPDRAW_DATA *draw_data,
00118 unsigned int sx,unsigned int sy);
00119 DLLIMPORT short get_subtile_from_draw_coords(unsigned int *sx,unsigned int *sy,
00120 const struct MAPDRAW_DATA *draw_data,
00121 unsigned int px,unsigned int py);
00122 DLLIMPORT short get_subtile_from_draw_coords_ip(struct IPOINT_2D *subtl,
00123 struct IPOINT_2D *subpos,const struct MAPDRAW_DATA *draw_data,
00124 unsigned int px,unsigned int py);
00125 DLLIMPORT short get_subtile_from_draw_coords_adv(unsigned int *ssx,unsigned int *ssy,
00126 const struct MAPDRAW_DATA *draw_data,unsigned int px,unsigned int py);
00127 inline short get_subtile_from_draw_coords_adv_fast(unsigned int *ssx,unsigned int *ssy,
00128 const struct IPOINT_2D scaled_txtr_size,const struct IPOINT_2D start,
00129 unsigned int px,unsigned int py);
00130 DLLIMPORT short get_full_draw_dimensions(struct IPOINT_2D *gdim,
00131 const struct MAPDRAW_DATA *draw_data);
00132 DLLIMPORT short get_full_draw_dimensions_opt(struct IPOINT_2D *gdim,
00133 const struct UPOINT_2D *subtl,const struct MAPDRAW_OPTIONS *opts);
00134 DLLIMPORT short get_thing_with_circle_at(unsigned int *sx,unsigned int *sy,unsigned int *num,
00135 const struct MAPDRAW_DATA *draw_data,const struct LEVEL *lvl,
00136 unsigned int px,unsigned int py);
00137 DLLIMPORT short get_object_with_circle_at(unsigned int *sx,unsigned int *sy,unsigned int *z,
00138 const struct MAPDRAW_DATA *draw_data,const struct LEVEL *lvl,
00139 unsigned int px,unsigned int py);
00140 #endif // ADIKT_DRAWMAP_H