Clarify animated textures.

This commit is contained in:
lzwdgc 2020-12-09 18:45:55 +03:00
parent 2ce251997d
commit d6e290855c
2 changed files with 25 additions and 8 deletions

View file

@ -535,11 +535,7 @@ void block::loadPayload(const buffer &data)
break; break;
} }
// unk READ(data, atex);
// seen: 0,2,3,4,8,9,516
READ(data, unk7);
// seen: 0.0, 0.0222222, 0.0444444, 0.0555556, 0.03125, 0.0375, 0.0625, 0.1, 0.125, 100, inf
READ(data, unk9); // scale? probably no
READ(data, unk10); READ(data, unk10);
READ(data, auto_animation); READ(data, auto_animation);
READ(data, animation_cycle); READ(data, animation_cycle);
@ -594,7 +590,7 @@ void block::loadPayload(const buffer &data)
read_more_faces(); read_more_faces();
} }
if (unk7 != 0) if (atex.is_present())
return; return;
std::string s = "extraction error: block: " + std::string(h.name); std::string s = "extraction error: block: " + std::string(h.name);

View file

@ -329,6 +329,28 @@ struct block
aim_vector4 max; aim_vector4 max;
}; };
struct animated_texture
{
uint16_t zeros0;
uint8_t multiplier_of_number_of_gradations;
uint8_t number_of_gradations;
float time_of_full_cycle;
float get_actual_number_of_gradations() const
{
if (!multiplier_of_number_of_gradations)
return multiplier_of_number_of_gradations * number_of_gradations;
return number_of_gradations * number_of_gradations;
}
float get_actual_time_of_full_cycle() const
{
return get_actual_number_of_gradations() * time_of_full_cycle;
}
bool is_present() const { return number_of_gradations; }
};
header h; header h;
// data // data
@ -349,10 +371,9 @@ struct block
// animations // animations
std::vector<animation> animations; std::vector<animation> animations;
std::vector<damage_model> damage_models; std::vector<damage_model> damage_models;
animated_texture atex;
// unk // unk
uint32_t unk7;
float unk9;
uint32_t unk10; uint32_t unk10;
float unk8; float unk8;
uint32_t unk11; uint32_t unk11;