|
13 | 13 | #include "window/building/common.h"
|
14 | 14 | #include "window/building/figures.h"
|
15 | 15 | #include "sound/sound_building.h"
|
| 16 | +#include "graphics/animation.h" |
16 | 17 | #include "game/game.h"
|
| 18 | +#include "city/labor.h" |
| 19 | +#include "widget/city/ornaments.h" |
| 20 | + |
| 21 | +namespace model { |
| 22 | + |
| 23 | +struct building_temple_t { |
| 24 | + const e_building_type type; |
| 25 | + const pcstr name; |
| 26 | + bstring64 meta_id; |
| 27 | + e_labor_category labor_category; |
| 28 | + animations_t anim; |
| 29 | +}; |
| 30 | + |
| 31 | +building_temple_t temple_osiris{BUILDING_TEMPLE_OSIRIS, "building_temple_osiris"}; |
| 32 | +building_temple_t temple_ra{BUILDING_TEMPLE_RA, "building_temple_ra"}; |
| 33 | +building_temple_t temple_ptah{BUILDING_TEMPLE_PTAH, "building_temple_ptah"}; |
| 34 | +building_temple_t temple_seth{BUILDING_TEMPLE_SETH, "building_temple_seth"}; |
| 35 | +building_temple_t temple_bast{BUILDING_TEMPLE_BAST, "building_temple_bast"}; |
| 36 | +building_temple_t temple_dummy{BUILDING_NONE, "unknown"}; |
| 37 | + |
| 38 | +} |
| 39 | + |
| 40 | +ANK_REGISTER_CONFIG_ITERATOR(config_load_building_temples); |
| 41 | +void config_load_building_temples() { |
| 42 | + auto load_temple_model = [] (model::building_temple_t &model) { |
| 43 | + g_config_arch.r_section(model.name, [&model] (archive arch) { |
| 44 | + model.labor_category = arch.r_type<e_labor_category>("labor_category"); |
| 45 | + model.meta_id = arch.r_string("meta_id"); |
| 46 | + model.anim.load(arch); |
| 47 | + city_labor_set_category(model); |
| 48 | + }); |
| 49 | + |
| 50 | + }; |
| 51 | + |
| 52 | + load_temple_model(model::temple_osiris); |
| 53 | + load_temple_model(model::temple_ra); |
| 54 | + load_temple_model(model::temple_ptah); |
| 55 | + load_temple_model(model::temple_seth); |
| 56 | + load_temple_model(model::temple_bast); |
| 57 | +} |
17 | 58 |
|
18 | 59 | static void building_temple_draw_temple(object_info& c, const char* type, int group_id, int image_offset) {
|
19 | 60 | c.help_id = 67;
|
@@ -83,3 +124,23 @@ void building_temple::spawn_figure() {
|
83 | 124 | common_spawn_roamer(FIGURE_PRIEST, 50, FIGURE_ACTION_125_ROAMING);
|
84 | 125 | }
|
85 | 126 | }
|
| 127 | + |
| 128 | +bool building_temple::draw_ornaments_and_animations_height(painter &ctx, vec2i point, tile2i tile, color color_mask) { |
| 129 | + const animation_t &anim = params().anim["work"]; |
| 130 | + building_draw_normal_anim(ctx, point, &base, tile, anim, color_mask); |
| 131 | + |
| 132 | + return true; |
| 133 | +} |
| 134 | + |
| 135 | +const model::building_temple_t &building_temple::params() const { |
| 136 | + switch (type()) { |
| 137 | + case BUILDING_TEMPLE_OSIRIS: return model::temple_osiris; |
| 138 | + case BUILDING_TEMPLE_RA: return model::temple_ra; |
| 139 | + case BUILDING_TEMPLE_PTAH: return model::temple_ptah; |
| 140 | + case BUILDING_TEMPLE_SETH: return model::temple_seth; |
| 141 | + case BUILDING_TEMPLE_BAST: return model::temple_bast; |
| 142 | + } |
| 143 | + |
| 144 | + assert(false); |
| 145 | + return model::temple_dummy; |
| 146 | +} |
0 commit comments