22 #ifndef QDENGINE_QDCORE_QD_GAME_DISPATCHER_BASE_H 23 #define QDENGINE_QDCORE_QD_GAME_DISPATCHER_BASE_H 25 #include "qdengine/qdcore/qd_conditional_object.h" 26 #include "qdengine/qdcore/qd_object_map_container.h" 27 #include "qdengine/qdcore/qd_scale_info.h" 29 #include "qdengine/qd_fwd.h" 30 #include "qdengine/parser/xml_fwd.h" 32 #ifdef __QD_DEBUG_ENABLE__ 33 #include "qdengine/qdcore/qd_resource.h" 38 typedef void (*qdLoadingProgressFnc)(
int percents_loaded,
void *data);
44 qdLoadingProgressFnc _progress_fnc;
48 qdLoadingProgressFnc set_callback_fnc(qdLoadingProgressFnc p,
void *dp) {
49 qdLoadingProgressFnc old_fnc = _progress_fnc;
56 void set_total_size(
int sz) {
60 int total_size()
const {
64 void show_progress(
int sz) {
65 if (!_total_size || !_progress_fnc)
return;
67 uint32 percents = round(
float(_loaded_size) /
float(_total_size) * 100.0f);
68 (*_progress_fnc)(percents, _data);
73 _total_size = _loaded_size = 0;
84 void set_resources_size(
int sz) {
85 _loading_progress.set_total_size(sz);
88 qdLoadingProgressFnc set_loading_progress_callback(qdLoadingProgressFnc p,
void *dp = 0) {
89 return _loading_progress.set_callback_fnc(p, dp);
92 void show_loading_progress(
int sz = 0);
95 bool remove_sound(
const char *name);
97 virtual qdSound *get_sound(
const char *name);
98 bool is_sound_in_list(
const char *name);
99 bool is_sound_in_list(
qdSound *p);
102 bool remove_animation(
const char *name);
104 virtual qdAnimation *get_animation(
const char *name);
105 bool is_animation_in_list(
const char *name);
109 bool remove_animation_set(
const char *name);
112 bool is_animation_set_in_list(
const char *name);
116 return _sounds.get_list();
119 return _animations.get_list();
122 return _animation_sets.get_list();
125 virtual void load_script_body(
const xml::tag *p);
128 virtual int load_resources();
129 void free_resources();
131 virtual void quant(
float dt) { };
134 _scale_infos.push_back(*p);
136 bool get_object_scale(
const char *p,
float &sc);
137 bool set_object_scale(
const char *p,
float sc);
139 virtual qdScaleInfo *get_scale_info(
const char *p);
141 virtual int get_resources_size();
147 #ifdef __QD_DEBUG_ENABLE__ 148 virtual bool get_resources_info(qdResourceInfoContainer &infos)
const;
158 scale_info_container_t _scale_infos;
165 #endif // QDENGINE_QDCORE_QD_GAME_DISPATCHER_BASE_H
Definition: qd_animation_set.h:34
Звук.
Definition: qd_sound.h:35
Объект с условиями.
Definition: qd_conditional_object.h:37
запуск не удался
Definition: qd_conditional_object.h:124
XML тег.
Definition: xml_tag.h:33
Базовый класс для игровых ресурсов.
Definition: console.h:28
qdConditionalObject::trigger_start_mode trigger_start()
Активация триггера.
Definition: qd_game_dispatcher_base.h:143
Анимация.
Definition: qd_animation.h:57
trigger_start_mode
Варианты старта триггера.
Definition: qd_conditional_object.h:122
Definition: qd_game_dispatcher_base.h:40
Definition: qd_scale_info.h:31
Definition: qd_object_map_container.h:33
Definition: qd_game_dispatcher_base.h:79