m_animation_frame_offsets[i] = 0;
}
// Replace tile texture with the first animation frame
- FrameSpec animation_frame = p.tile.frames.find(0)->second;
+ FrameSpec animation_frame = p.tile.frames[0];
p.tile.texture = animation_frame.texture;
}
scene::IMeshBuffer *buf = m_mesh->getMeshBuffer(i->first);
ITextureSource *tsrc = m_gamedef->getTextureSource();
- FrameSpec animation_frame = tile.frames.find(frame)->second;
+ FrameSpec animation_frame = tile.frames[frame];
buf->getMaterial().setTexture(0, animation_frame.texture);
if (m_enable_shaders) {
if (animation_frame.normal_texture) {
tile->material_flags &= ~MATERIAL_FLAG_ANIMATION_VERTICAL_FRAMES;
} else {
std::ostringstream os(std::ios::binary);
+ tile->frames.resize(frame_count);
+
for (int i = 0; i < frame_count; i++) {
+
FrameSpec frame;
os.str("");
#include <IrrlichtDevice.h>
#include "threads.h"
#include <string>
-#include <map>
+#include <vector>
class IGameDef;
// Animation parameters
u8 animation_frame_count;
u16 animation_frame_length_ms;
- std::map<u32, FrameSpec> frames;
+ std::vector<FrameSpec> frames;
u8 rotation;
};
if (tiles[i].animation_frame_count == 1) {
material.setTexture(0, tiles[i].texture);
} else {
- FrameSpec animation_frame = tiles[i].frames.find(0)->second;
+ FrameSpec animation_frame = tiles[i].frames[0];
material.setTexture(0, animation_frame.texture);
}
tiles[i].applyMaterialOptions(material);
material.setFlag(video::EMF_TRILINEAR_FILTER, m_trilinear_filter);
bool animated = (f.tiles[i].animation_frame_count > 1);
if (animated) {
- FrameSpec animation_frame = f.tiles[i].frames.find(0)->second;
+ FrameSpec animation_frame = f.tiles[i].frames[0];
material.setTexture(0, animation_frame.texture);
} else {
material.setTexture(0, f.tiles[i].texture);
if (m_enable_shaders) {
if (f.tiles[i].normal_texture) {
if (animated) {
- FrameSpec animation_frame = f.tiles[i].frames.find(0)->second;
+ FrameSpec animation_frame = f.tiles[i].frames[0];
material.setTexture(1, animation_frame.normal_texture);
} else {
material.setTexture(1, f.tiles[i].normal_texture);