00001
00002
00003
00004
00005 #ifdef USE_TILE
00006 #ifndef TILEDGNBUF_H
00007 #define TILEDGNBUF_H
00008
00009 #include "tilebuf.h"
00010
00011 struct packed_cell
00012 {
00013
00014
00015 enum { MAX_DNGN_OVERLAY = 20 };
00016 int num_dngn_overlay;
00017 FixedVector<int, MAX_DNGN_OVERLAY> dngn_overlay;
00018
00019 tileidx_t fg;
00020 tileidx_t bg;
00021 tile_flavour flv;
00022
00023 bool is_bloody;
00024 bool is_silenced;
00025 bool is_haloed;
00026 bool is_moldy;
00027 bool is_sanctuary;
00028 bool swamp_tree_water;
00029
00030 packed_cell() : num_dngn_overlay(0), is_bloody(false), is_silenced(false),
00031 is_haloed(false), is_moldy(false), is_sanctuary(false),
00032 swamp_tree_water (false) {}
00033
00034 packed_cell(const packed_cell* c) : num_dngn_overlay(c->num_dngn_overlay),
00035 fg(c->fg), bg(c->bg), flv(c->flv),
00036 is_bloody(c->is_bloody),
00037 is_silenced(c->is_silenced),
00038 is_haloed(c->is_haloed),
00039 is_moldy(c->is_moldy),
00040 is_sanctuary(c->is_sanctuary),
00041 swamp_tree_water(c->swamp_tree_water) {}
00042
00043 void clear();
00044 };
00045
00046
00047
00048 void pack_cell_overlays(const coord_def &gc, packed_cell *cell);
00049
00050 struct dolls_data;
00051 class mcache_entry;
00052 class ImageManager;
00053
00054
00055
00056
00057
00058
00059
00060
00061 class DungeonCellBuffer
00062 {
00063 public:
00064 DungeonCellBuffer(ImageManager *im);
00065
00066 void add(const packed_cell &cell, int x, int y);
00067 void add_dngn_tile(int tileidx, int x, int y, bool in_water = false);
00068 void add_main_tile(int tileidx, int x, int y);
00069 void add_main_tile(int tileidx, int x, int y, int ox, int oy);
00070 void add_spell_tile(int tileidx, int x, int y);
00071 void add_skill_tile(int tileidx, int x, int y);
00072 void add_command_tile(int tileidx, int x, int y);
00073 void add_icons_tile(int tileidx, int x, int y);
00074 void add_icons_tile(int tileidx, int x, int y, int ox, int oy);
00075
00076 void clear();
00077 void draw();
00078
00079 protected:
00080 void add_blood_overlay(int x, int y, const packed_cell &cell);
00081 void pack_background(int x, int y, const packed_cell &cell);
00082 void pack_foreground(int x, int y, const packed_cell &cell);
00083
00084 void pack_mcache(mcache_entry *entry, int x, int y, bool submerged);
00085 void pack_player(int x, int y, bool submerged);
00086 void pack_doll(const dolls_data &doll, int x, int y,
00087 bool submerged, bool ghost);
00088
00089 TileBuffer m_buf_floor;
00090 TileBuffer m_buf_wall;
00091 TileBuffer m_buf_feat;
00092 SubmergedTileBuffer m_buf_feat_trans;
00093 SubmergedTileBuffer m_buf_doll;
00094 SubmergedTileBuffer m_buf_main_trans;
00095 TileBuffer m_buf_main;
00096 TileBuffer m_buf_spells;
00097 TileBuffer m_buf_skills;
00098 TileBuffer m_buf_commands;
00099 TileBuffer m_buf_icons;
00100 };
00101
00102 #endif
00103 #endif