22 #ifndef QDENGINE_QDCORE_QD_INVENTORY_CELL_H 23 #define QDENGINE_QDCORE_QD_INVENTORY_CELL_H 25 #include "qdengine/parser/xml_fwd.h" 26 #include "qdengine/qdcore/qd_sprite.h" 34 class qdGameObjectAnimated;
48 void set_type(
int tp) {
53 _sprite.set_file(fname);
56 return _sprite.file();
63 bool load_resources()
const;
64 void free_resources()
const;
69 const Vect2i &size()
const {
70 return _sprite.size();
81 return ((f.type() == s.type()) && (f.sprite() == s.sprite()));
85 return f.type() == type;
103 void set_type(
int tp) {
110 void set_sprite(
const qdSprite *spr) {
119 bool is_empty()
const {
120 if (!_object)
return true;
124 const Vect2i &size()
const {
126 return sprite()->size();
133 if (sprite())
return sprite()->size_x();
137 if (sprite())
return sprite()->size_y();
141 void redraw(
int x,
int y,
bool inactive_mode =
false)
const;
143 bool load_resources();
144 bool free_resources();
151 static void set_shadow(uint32 color,
int alpha) {
152 _shadow_color = color;
153 _shadow_alpha = alpha;
169 static uint32 _shadow_color;
170 static int _shadow_alpha;
185 const Vect2s screen_pos()
const {
186 return _screen_pos +
g_engine->screen_offset();
188 void set_screen_pos(
const Vect2s &pos) {
194 return _last_screen_region;
198 Vect2s cell_position(
int cell_idx)
const;
200 const Vect2s &size()
const {
203 void set_size(
const Vect2s &sz) {
204 assert(sz.x && sz.y);
209 _cells.resize((sz.x + _additional_cells.x) * (sz.y + _additional_cells.y));
217 bool hit(
const Vect2s &pos)
const;
220 void pre_redraw()
const;
221 void redraw(
int offs_x = 0,
int offs_y = 0,
bool inactive_mode =
false)
const;
230 bool load_script(
const xml::tag *p);
238 bool init(
const qdInventoryCellTypeVector &tp);
240 const qdInventoryCellVector &cells()
const {
243 int num_cells()
const {
244 return _cells.size();
247 bool load_resources();
248 bool free_resources();
250 void objects_quant(
float dt);
252 Vect2s additional_cells()
const {
253 return _additional_cells;
255 void set_additional_cells(
Vect2s val) {
256 _additional_cells = val;
267 void debug_log()
const;
271 bool has_rect_objects(
int left,
int top,
int right,
int bottom)
const;
283 qdInventoryCellVector _cells;
294 #endif // QDENGINE_QDCORE_QD_INVENTORY_CELL_H
Спрайт.
Definition: qd_sprite.h:39
Группа ячеек инвентори.
Definition: qd_inventory_cell.h:176
Dynamic object.
Definition: qd_game_object_animated.h:37
XML тег.
Definition: xml_tag.h:33
Базовый класс для игровых ресурсов.
Definition: console.h:28
Definition: algorithm.h:29
Описание ячейки инвентори.
Definition: qd_inventory_cell.h:37
signed char * fill(signed char *first, signed char *last, Value val)
Definition: algorithm.h:168
Ячейка инвентори.
Definition: qd_inventory_cell.h:91
Прямоугольная область на экране.
Definition: gr_screen_region.h:31