diff options
author | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
---|---|---|
committer | Elias Fleckenstein <eliasfleckenstein@web.de> | 2020-11-04 16:19:54 +0100 |
commit | ad148587dcf5244c2d2011dba339786c765c54c4 (patch) | |
tree | bdd914121cd326da2ed26679838878e3edffc841 /src/tileanimation.cpp | |
parent | 1145b05ea0bda87dc0827821385810eced08f774 (diff) | |
download | dragonfireclient-ad148587dcf5244c2d2011dba339786c765c54c4.tar.xz |
Make Lint Happy
Diffstat (limited to 'src/tileanimation.cpp')
-rw-r--r-- | src/tileanimation.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/tileanimation.cpp b/src/tileanimation.cpp index 930fd9473..f4043f5a0 100644 --- a/src/tileanimation.cpp +++ b/src/tileanimation.cpp @@ -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); } |