]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/tileanimation.cpp
Make Lint Happy
[dragonfireclient.git] / src / tileanimation.cpp
index 930fd94731013089bda7a8dde8c243f4c92eba77..f4043f5a0ac94aa04a4d01afb0f4fa10ffd8bb24 100644 (file)
@@ -35,7 +35,7 @@ void TileAnimationParams::serialize(std::ostream &os, u8 tiledef_version) const
 
 void TileAnimationParams::deSerialize(std::istream &is, u8 tiledef_version)
 {
-       type = (TileAnimationType) readU8(is);
+       type = (TileAnimationType)readU8(is);
 
        if (type == TAT_VERTICAL_FRAMES) {
                vertical_frames.aspect_w = readU16(is);
@@ -53,8 +53,8 @@ void TileAnimationParams::determineParams(v2u32 texture_size, int *frame_count,
 {
        if (type == TAT_VERTICAL_FRAMES) {
                int frame_height = (float)texture_size.X /
-                               (float)vertical_frames.aspect_w *
-                               (float)vertical_frames.aspect_h;
+                                  (float)vertical_frames.aspect_w *
+                                  (float)vertical_frames.aspect_h;
                int _frame_count = texture_size.Y / frame_height;
                if (frame_count)
                        *frame_count = _frame_count;
@@ -68,12 +68,14 @@ void TileAnimationParams::determineParams(v2u32 texture_size, int *frame_count,
                if (frame_length_ms)
                        *frame_length_ms = 1000 * sheet_2d.frame_length;
                if (frame_size)
-                       *frame_size = v2u32(texture_size.X / sheet_2d.frames_w, texture_size.Y / sheet_2d.frames_h);
+                       *frame_size = v2u32(texture_size.X / sheet_2d.frames_w,
+                                       texture_size.Y / sheet_2d.frames_h);
        }
        // caller should check for TAT_NONE
 }
 
-void TileAnimationParams::getTextureModifer(std::ostream &os, v2u32 texture_size, int frame) const
+void TileAnimationParams::getTextureModifer(
+               std::ostream &os, v2u32 texture_size, int frame) const
 {
        if (type == TAT_NONE)
                return;
@@ -85,8 +87,8 @@ void TileAnimationParams::getTextureModifer(std::ostream &os, v2u32 texture_size
                int q, r;
                q = frame / sheet_2d.frames_w;
                r = frame % sheet_2d.frames_w;
-               os << "^[sheet:" << sheet_2d.frames_w << "x" << sheet_2d.frames_h
-                       << ":" << r << "," << q;
+               os << "^[sheet:" << sheet_2d.frames_w << "x" << sheet_2d.frames_h << ":"
+                  << r << "," << q;
        }
 }
 
@@ -95,8 +97,8 @@ v2f TileAnimationParams::getTextureCoords(v2u32 texture_size, int frame) const
        v2u32 ret(0, 0);
        if (type == TAT_VERTICAL_FRAMES) {
                int frame_height = (float)texture_size.X /
-                               (float)vertical_frames.aspect_w *
-                               (float)vertical_frames.aspect_h;
+                                  (float)vertical_frames.aspect_w *
+                                  (float)vertical_frames.aspect_h;
                ret = v2u32(0, frame_height * frame);
        } else if (type == TAT_SHEET_2D) {
                v2u32 frame_size;
@@ -106,5 +108,5 @@ v2f TileAnimationParams::getTextureCoords(v2u32 texture_size, int frame) const
                r = frame % sheet_2d.frames_w;
                ret = v2u32(r * frame_size.X, q * frame_size.Y);
        }
-       return v2f(ret.X / (float) texture_size.X, ret.Y / (float) texture_size.Y);
+       return v2f(ret.X / (float)texture_size.X, ret.Y / (float)texture_size.Y);
 }