瀏覽代碼

fixes all ~300 MSVC warnings at current level

Paul 11 年之前
父節點
當前提交
c3e7082f94
共有 34 個文件被更改,包括 124 次插入114 次删除
  1. 2 0
      CMakeLists.txt
  2. 2 2
      Tests/QGearsMain/src/test_QGearsAFileSerializer.cpp
  3. 4 4
      Tests/QGearsMain/src/test_QGearsHRCSerializer.cpp
  4. 3 3
      Tests/QGearsMain/src/test_QGearsMapFileXMLSerializer.cpp
  5. 4 4
      utilities/common/FontFile.cpp
  6. 5 5
      utilities/common/OgreGenUtilites.cpp
  7. 1 1
      utilities/ffix_model_exporter/src/AnimationExtractor.cpp
  8. 2 2
      utilities/ffix_script_dumper/src/ScriptFile.cpp
  9. 1 1
      utilities/ffix_script_dumper/src/TextFile.cpp
  10. 10 10
      utilities/ffvii_battle_model_exporter/src/AnimationExtractor.cpp
  11. 2 2
      utilities/ffvii_battle_model_exporter/src/EnemyFile.cpp
  12. 3 3
      utilities/ffvii_battle_model_exporter/src/Main.cpp
  13. 1 1
      utilities/ffvii_battle_model_exporter/src/StageFile.cpp
  14. 2 2
      utilities/ffvii_battle_scene_dumper/src/FFVIIString.cpp
  15. 7 7
      utilities/ffvii_field_model_exporter/src/AnimationFile.cpp
  16. 4 4
      utilities/ffvii_field_model_exporter/src/Main.cpp
  17. 20 20
      utilities/ffvii_field_model_exporter/src/MeshFile.cpp
  18. 1 1
      utilities/ffvii_field_model_exporter/src/SkeletonFile.cpp
  19. 2 2
      utilities/ffvii_field_model_exporter/src/TdbFile.cpp
  20. 2 0
      utilities/ffvii_sound_dumper/src/engine/SoundManager.h
  21. 6 6
      utilities/ffvii_sound_dumper_psf/src/main.cc
  22. 1 1
      utilities/xeno_model_exporter/src/AnimatedModel.cpp
  23. 1 1
      utilities/xeno_model_exporter/src/AnimationExtractor.cpp
  24. 1 1
      utilities/xeno_model_exporter/src/FieldModel.cpp
  25. 1 1
      utilities/xeno_model_exporter/src/ModelFile.cpp
  26. 3 0
      utilities/xeno_script_dumper/src/common/utilites/StdString.h
  27. 2 2
      utilities/xeno_script_dumper/src/game/field/ScriptFile.cpp
  28. 3 3
      utilities/xeno_walkmesh_exporter/src/Main.cpp
  29. 3 0
      utilities/xeno_walkmesh_exporter/src/common/utilites/StdString.h
  30. 9 9
      utilities/xeno_walkmesh_exporter/src/game/field/Walkmesh.cpp
  31. 3 3
      utilities/xeno_walkmesh_exporter/src/game/field/WalkmeshFile.cpp
  32. 10 10
      utilities/xeno_walkmesh_exporter/src/game/filetypes/FontFile.cpp
  33. 1 1
      utilities/xeno_walkmesh_exporter/src/game/filetypes/LzsFile.cpp
  34. 2 2
      utilities/xeno_walkmesh_exporter/src/game/filetypes/TimFile.cpp

+ 2 - 0
CMakeLists.txt

@@ -205,6 +205,8 @@ set(QGears_INCLUDE_DIRS
 if (MSVC)
 if (MSVC)
 # Build cpp files on all cores, up virtual mem for PCH's as cotire really makes the compiler scream
 # Build cpp files on all cores, up virtual mem for PCH's as cotire really makes the compiler scream
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Zm193")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /Zm193")
+# Shut up about insecure functions, as this is cross platform code we can't use the Win32 specifc functions
+add_definitions( -D_CRT_SECURE_NO_WARNINGS )
 else()
 else()
 # Enable C++11, you may need to use -std=c++0x if using an older gcc compiler
 # Enable C++11, you may need to use -std=c++0x if using an older gcc compiler
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")
 SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC")

+ 2 - 2
Tests/QGearsMain/src/test_QGearsAFileSerializer.cpp

@@ -66,8 +66,8 @@ BOOST_AUTO_TEST_CASE( read_file )
 
 
     QGears::AFile::FrameList &frames( f.getFrames() );
     QGears::AFile::FrameList &frames( f.getFrames() );
     BOOST_CHECK_EQUAL( 80, frames.size() );
     BOOST_CHECK_EQUAL( 80, frames.size() );
-    BOOST_CHECK( Ogre::Vector3( -63.86031, 71.90821, -10.97811    ).positionEquals( frames.front().root_translation ) );
-    BOOST_CHECK( Ogre::Vector3(   0      , 13.53528,   0.07706928 ).positionEquals( frames.back ().root_translation ) );
+    BOOST_CHECK( Ogre::Vector3( -63.86031f, 71.90821f, -10.97811f    ).positionEquals( frames.front().root_translation ) );
+    BOOST_CHECK( Ogre::Vector3(   0.0f      , 13.53528f,   0.07706928f ).positionEquals( frames.back ().root_translation ) );
 
 
     logMgr.destroyLog( "Default Log" );
     logMgr.destroyLog( "Default Log" );
 
 

+ 4 - 4
Tests/QGearsMain/src/test_QGearsHRCSerializer.cpp

@@ -60,19 +60,19 @@ BOOST_AUTO_TEST_CASE( simple_hrc )
     BOOST_CHECK_EQUAL( 3, bones.size() );
     BOOST_CHECK_EQUAL( 3, bones.size() );
     BOOST_CHECK_EQUAL( "bone.1", bones.at(0).name );
     BOOST_CHECK_EQUAL( "bone.1", bones.at(0).name );
     BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
     BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
-    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001 );
+    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001f );
     BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
     BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
     BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
     BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
 
 
     BOOST_CHECK_EQUAL( "bone.1.1", bones.at(1).name );
     BOOST_CHECK_EQUAL( "bone.1.1", bones.at(1).name );
     BOOST_CHECK_EQUAL( bones.at(0).name, bones.at(1).parent );
     BOOST_CHECK_EQUAL( bones.at(0).name, bones.at(1).parent );
-    BOOST_CHECK_CLOSE( 2.0f, bones.at(1).length, 0.0001 );
+    BOOST_CHECK_CLOSE( 2.0f, bones.at(1).length, 0.0001f );
     BOOST_CHECK_EQUAL( 1, bones.at(1).rsd_names.size() );
     BOOST_CHECK_EQUAL( 1, bones.at(1).rsd_names.size() );
     BOOST_CHECK_EQUAL( "model.1.1", bones.at(1).rsd_names.at(0) );
     BOOST_CHECK_EQUAL( "model.1.1", bones.at(1).rsd_names.at(0) );
 
 
     BOOST_CHECK_EQUAL( "bone.2", bones.at(2).name );
     BOOST_CHECK_EQUAL( "bone.2", bones.at(2).name );
     BOOST_CHECK_EQUAL( bones.at(0).parent, bones.at(2).parent );
     BOOST_CHECK_EQUAL( bones.at(0).parent, bones.at(2).parent );
-    BOOST_CHECK_CLOSE( 3.125f, bones.at(2).length, 0.0001 );
+    BOOST_CHECK_CLOSE( 3.125f, bones.at(2).length, 0.0001f );
     BOOST_CHECK_EQUAL( 3, bones.at(2).rsd_names.size() );
     BOOST_CHECK_EQUAL( 3, bones.at(2).rsd_names.size() );
     BOOST_CHECK_EQUAL( "model.2-1", bones.at(2).rsd_names.at(0) );
     BOOST_CHECK_EQUAL( "model.2-1", bones.at(2).rsd_names.at(0) );
     BOOST_CHECK_EQUAL( "model.2-2", bones.at(2).rsd_names.at(1) );
     BOOST_CHECK_EQUAL( "model.2-2", bones.at(2).rsd_names.at(1) );
@@ -107,7 +107,7 @@ BOOST_AUTO_TEST_CASE( empty_hrc )
     BOOST_CHECK_EQUAL( 1, bones.size() );
     BOOST_CHECK_EQUAL( 1, bones.size() );
     BOOST_CHECK_EQUAL( "null", bones.at(0).name );
     BOOST_CHECK_EQUAL( "null", bones.at(0).name );
     BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
     BOOST_CHECK_EQUAL( "root", bones.at(0).parent );
-    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001 );
+    BOOST_CHECK_CLOSE( 1.5f, bones.at(0).length, 0.0001f );
     BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
     BOOST_CHECK_EQUAL( 1, bones.at(0).rsd_names.size() );
     BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
     BOOST_CHECK_EQUAL( "model.1", bones.at(0).rsd_names.at(0) );
 
 

+ 3 - 3
Tests/QGearsMain/src/test_QGearsMapFileXMLSerializer.cpp

@@ -53,15 +53,15 @@ BOOST_AUTO_TEST_CASE( read_file )
     BOOST_REQUIRE_EQUAL( 1, points.size() );
     BOOST_REQUIRE_EQUAL( 1, points.size() );
     QGears::MapFile::PointList::value_type    &point( points.at(0) );
     QGears::MapFile::PointList::value_type    &point( points.at(0) );
     BOOST_CHECK_EQUAL( "Spawn_md1_1", point.GetName() );
     BOOST_CHECK_EQUAL( "Spawn_md1_1", point.GetName() );
-    BOOST_CHECK( Ogre::Vector3( 29.0547, 229.234, 2.56082 ).positionEquals( point.GetPosition() ) );
+    BOOST_CHECK( Ogre::Vector3( 29.0547f, 229.234f, 2.56082f ).positionEquals( point.GetPosition() ) );
     BOOST_CHECK_CLOSE( 67.7647, point.GetRotation(), 0.001 );
     BOOST_CHECK_CLOSE( 67.7647, point.GetRotation(), 0.001 );
 
 
     QGears::MapFile::TriggerList   &triggers( f.getTriggers() );
     QGears::MapFile::TriggerList   &triggers( f.getTriggers() );
     BOOST_REQUIRE_EQUAL( 1, triggers.size() );
     BOOST_REQUIRE_EQUAL( 1, triggers.size() );
     QGears::MapFile::TriggerList::value_type    &trigger( triggers.at(0) );
     QGears::MapFile::TriggerList::value_type    &trigger( triggers.at(0) );
     BOOST_CHECK_EQUAL( "Gateway0", trigger.GetName() );
     BOOST_CHECK_EQUAL( "Gateway0", trigger.GetName() );
-    BOOST_CHECK( Ogre::Vector3( 28.6016, 228.562, 2.75781 ).positionEquals( trigger.GetPoint1() ) );
-    BOOST_CHECK( Ogre::Vector3( 28.6641, 229.438, 2.75781 ).positionEquals( trigger.GetPoint2() ) );
+    BOOST_CHECK( Ogre::Vector3( 28.6016f, 228.562f, 2.75781f ).positionEquals( trigger.GetPoint1() ) );
+    BOOST_CHECK( Ogre::Vector3( 28.6641f, 229.438f, 2.75781f ).positionEquals( trigger.GetPoint2() ) );
     BOOST_CHECK_EQUAL( true, trigger.IsEnabled() );
     BOOST_CHECK_EQUAL( true, trigger.IsEnabled() );
 
 
     logMgr.destroyLog( "Default Log" );
     logMgr.destroyLog( "Default Log" );

+ 4 - 4
utilities/common/FontFile.cpp

@@ -96,10 +96,10 @@ FontFile::GetSurface(void)
             //LOGGER->Log(LOGGER_INFO, "%02x", data);
             //LOGGER->Log(LOGGER_INFO, "%02x", data);
             for (int i = 7; i >= 0; --i)
             for (int i = 7; i >= 0; --i)
             {
             {
-                color.r = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.g = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.b = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.a = ((data >> i) & 0x01 == 1) ? 255 : 255;
+                color.r = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.g = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.b = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.a = (((data >> i) & 0x01) == 1) ? 255 : 255;
                 memcpy(glyth->pixels.data() + 64 * y + j, &color, sizeof(ClutColor));
                 memcpy(glyth->pixels.data() + 64 * y + j, &color, sizeof(ClutColor));
                 j += 4;
                 j += 4;
             }
             }

+ 5 - 5
utilities/common/OgreGenUtilites.cpp

@@ -23,12 +23,12 @@ CreateTextureFromVram( const Ogre::PixelBox& pb, Vram* vram, const int start_x,
                 u32 ogre_pixel1 = ( ( ( clut1 & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut1 >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut1 >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
                 u32 ogre_pixel1 = ( ( ( clut1 & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut1 >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut1 >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
 
 
                 u8 stp = ( clut1 & 0x8000 ) >> 15;
                 u8 stp = ( clut1 & 0x8000 ) >> 15;
-                AddTransparency( ogre_pixel1, transparency, stp );
+                AddTransparency( ogre_pixel1, transparency, stp > 0 );
 
 
                 u32 ogre_pixel2 = ( ( ( clut2 & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut2 >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut2 >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
                 u32 ogre_pixel2 = ( ( ( clut2 & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut2 >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut2 >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
 
 
                 stp = ( clut2 & 0x8000 ) >> 15;
                 stp = ( clut2 & 0x8000 ) >> 15;
-                AddTransparency( ogre_pixel2, transparency, stp );
+                AddTransparency( ogre_pixel2, transparency, stp > 0 );
 
 
                 data[ start_x + x ] = ogre_pixel1;
                 data[ start_x + x ] = ogre_pixel1;
                 ++x;
                 ++x;
@@ -42,7 +42,7 @@ CreateTextureFromVram( const Ogre::PixelBox& pb, Vram* vram, const int start_x,
                 u32 ogre_pixel = ( ( ( clut & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
                 u32 ogre_pixel = ( ( ( clut & 0x1f ) * 255 / 31 ) << 0x18 ) | ( ( ( ( clut >>  5 ) & 0x1f ) * 255 / 31 ) << 0x10 ) | ( ( ( ( clut >> 10 ) & 0x1f ) * 255 / 31 ) << 0x8 ) | 0;
 
 
                 u8 stp = ( clut & 0x8000 ) >> 15;
                 u8 stp = ( clut & 0x8000 ) >> 15;
-                AddTransparency( ogre_pixel, transparency, stp );
+                AddTransparency( ogre_pixel, transparency, stp > 0 );
 
 
                 data[ start_x + x ] = ogre_pixel;
                 data[ start_x + x ] = ogre_pixel;
             }
             }
@@ -161,8 +161,8 @@ AddTexture( TexForGen& texture, const MeshData& data, VectorTexForGen& textures,
             start_x += 256;
             start_x += 256;
         }
         }
     }
     }
-    texture.start_x = start_x;
-    texture.start_y = start_y;
+    texture.start_x = static_cast<int>(start_x);
+    texture.start_y = static_cast<int>(start_y);
     textures.push_back( texture );
     textures.push_back( texture );
 
 
     if( logger != NULL )
     if( logger != NULL )

+ 1 - 1
utilities/ffix_model_exporter/src/AnimationExtractor.cpp

@@ -75,7 +75,7 @@ AnimationExtractor( const Ogre::SkeletonPtr& skeleton, const ModelInfo& info, Sk
             u32 high_angle_offset = file->GetU32LE( 0xc );
             u32 high_angle_offset = file->GetU32LE( 0xc );
             u32 low_angle_offset = file->GetU32LE( 0x10 );
             u32 low_angle_offset = file->GetU32LE( 0x10 );
 
 
-            for( int bone = 0; bone < skeleton_data.size(); ++bone )
+            for( size_t bone = 0; bone < skeleton_data.size(); ++bone )
             {
             {
                 tx = 0; ty = 0; tz = 0;
                 tx = 0; ty = 0; tz = 0;
                 rx = 0; ry = 0; rz = 0;
                 rx = 0; ry = 0; rz = 0;

+ 2 - 2
utilities/ffix_script_dumper/src/ScriptFile.cpp

@@ -53,7 +53,7 @@ ScriptFile::DumpScripts()
     export_script = new Logger("scripts.txt");
     export_script = new Logger("scripts.txt");
 
 
     u32 number_of_entity = GetU8( 0x03 );
     u32 number_of_entity = GetU8( 0x03 );
-    for ( int entity = 0; entity < number_of_entity; ++entity )
+    for (u32 entity = 0; entity < number_of_entity; ++entity)
     {
     {
         if ( GetU16LE( 0x80 + entity * 0x8 + 0x2) == 0 )
         if ( GetU16LE( 0x80 + entity * 0x8 + 0x2) == 0 )
         {
         {
@@ -66,7 +66,7 @@ ScriptFile::DumpScripts()
 
 
         u32 number_of_scripts = GetU8(script_offset + 1);
         u32 number_of_scripts = GetU8(script_offset + 1);
 
 
-        for ( int i = 0; i < number_of_scripts; ++i )
+        for (u32 i = 0; i < number_of_scripts; ++i)
         {
         {
             raw_script = "";
             raw_script = "";
             u16 script_type = GetU16LE( script_offset + 2 + i * 0x4 );
             u16 script_type = GetU16LE( script_offset + 2 + i * 0x4 );

+ 1 - 1
utilities/ffix_script_dumper/src/TextFile.cpp

@@ -205,7 +205,7 @@ TextFile::DumpTexts()
 
 
 
 
 
 
-    for( int i = 0; i < number_of_texts; ++i )
+    for( u32 i = 0; i < number_of_texts; ++i )
     {
     {
         u32 pointer_to_text = 0x04 + GetU16LE( 0x04 +  i * 0x04 );
         u32 pointer_to_text = 0x04 + GetU16LE( 0x04 +  i * 0x04 );
 
 

+ 10 - 10
utilities/ffvii_battle_model_exporter/src/AnimationExtractor.cpp

@@ -74,24 +74,24 @@ ReadEncryptedRotationBits(File* file, const int offset, int &readed_bits, const
 {
 {
     int ret = 0;
     int ret = 0;
 
 
-    int control_bit = ReadBitStream(file, offset, readed_bits, 1, 1);
+    int control_bit = static_cast<int>(ReadBitStream(file, offset, readed_bits, 1, 1));
     //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits control_bit = %x", control_bit);
     //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits control_bit = %x", control_bit);
     if (control_bit != 0)
     if (control_bit != 0)
     {
     {
-        control_bit = ReadBitStream(file, offset, readed_bits, 3, 3);
+        control_bit = static_cast<int>(ReadBitStream(file, offset, readed_bits, 3, 3));
         control_bit &= 7;
         control_bit &= 7;
         //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits control_bit = %x", control_bit);
         //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits control_bit = %x", control_bit);
         if (control_bit == 0)
         if (control_bit == 0)
         {
         {
-            ret = -1.0f;
+            ret = -1;
         }
         }
         else if (control_bit == 7)
         else if (control_bit == 7)
         {
         {
-            ret = ReadBitStream(file, offset, readed_bits, 12 - compression, 12);
+            ret = static_cast<int>(ReadBitStream(file, offset, readed_bits, 12 - compression, 12));
         }
         }
         else
         else
         {
         {
-            int data = ReadBitStream(file, offset, readed_bits, control_bit, control_bit);
+            int data = static_cast<int>(ReadBitStream(file, offset, readed_bits, control_bit, control_bit));
             //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits data = %x", data);
             //LOGGER->Log(LOGGER_INFO, "ReadEncryptedRotationBits data = %x", data);
             if (data >= 0)
             if (data >= 0)
             {
             {
@@ -118,7 +118,7 @@ AnimationExtractor(File* file, const Ogre::SkeletonPtr& skeleton, const EnemyInf
 {
 {
     float weapon_tx, weapon_ty, weapon_tz, weapon_rx, weapon_ry, weapon_rz = 0;
     float weapon_tx, weapon_ty, weapon_tz, weapon_rx, weapon_ry, weapon_rz = 0;
 
 
-    for (int i = 0; i < info.animations.size(); ++i)
+    for (size_t i = 0; i < info.animations.size(); ++i)
     {
     {
         if (info.animations[i] == "")
         if (info.animations[i] == "")
         {
         {
@@ -180,7 +180,7 @@ AnimationExtractor(File* file, const Ogre::SkeletonPtr& skeleton, const EnemyInf
                 frame2 = track2->createNodeKeyFrame(time);
                 frame2 = track2->createNodeKeyFrame(time);
                 frame2->setTranslate(Ogre::Vector3(tx, ty, tz) / 512);
                 frame2->setTranslate(Ogre::Vector3(tx, ty, tz) / 512);
 
 
-                for (int bone = 0; bone < skeleton_data.size(); ++bone)
+                for (size_t bone = 0; bone < skeleton_data.size(); ++bone)
                 {
                 {
                     skeleton_data[bone].rx = (ReadBitStream(file, offset_to_animation + 5, readed_bits, 12 - compression, 12) / 4096.0f) * 360;
                     skeleton_data[bone].rx = (ReadBitStream(file, offset_to_animation + 5, readed_bits, 12 - compression, 12) / 4096.0f) * 360;
                     skeleton_data[bone].ry = (ReadBitStream(file, offset_to_animation + 5, readed_bits, 12 - compression, 12) / 4096.0f) * 360;
                     skeleton_data[bone].ry = (ReadBitStream(file, offset_to_animation + 5, readed_bits, 12 - compression, 12) / 4096.0f) * 360;
@@ -194,7 +194,7 @@ AnimationExtractor(File* file, const Ogre::SkeletonPtr& skeleton, const EnemyInf
                     track2->removeAllKeyFrames();
                     track2->removeAllKeyFrames();
                     frame1 = track1->createNodeKeyFrame(time);
                     frame1 = track1->createNodeKeyFrame(time);
                     frame2 = track2->createNodeKeyFrame(time);
                     frame2 = track2->createNodeKeyFrame(time);
-                    frame2->setTranslate(Ogre::Vector3(0, 0, skeleton_data[bone].length) / 512);
+                    frame2->setTranslate(Ogre::Vector3(0.0f, 0.0f, static_cast<float>(skeleton_data[bone].length) / 512));
                     mat.FromEulerAnglesYXZ(Ogre::Radian(Ogre::Degree(skeleton_data[bone].ry)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rx)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rz)));
                     mat.FromEulerAnglesYXZ(Ogre::Radian(Ogre::Degree(skeleton_data[bone].ry)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rx)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rz)));
                     rot.FromRotationMatrix(mat);
                     rot.FromRotationMatrix(mat);
                     frame1->setRotation(rot);
                     frame1->setRotation(rot);
@@ -245,7 +245,7 @@ AnimationExtractor(File* file, const Ogre::SkeletonPtr& skeleton, const EnemyInf
                 frame2 = track2->createNodeKeyFrame(time);
                 frame2 = track2->createNodeKeyFrame(time);
                 frame2->setTranslate(Ogre::Vector3(tx, ty, tz) / 512);
                 frame2->setTranslate(Ogre::Vector3(tx, ty, tz) / 512);
 
 
-                for (int bone = 0; bone < skeleton_data.size(); ++bone)
+                for (size_t bone = 0; bone < skeleton_data.size(); ++bone)
                 {
                 {
                     skeleton_data[bone].rx += (ReadEncryptedRotationBits(file, offset_to_animation + 5, readed_bits, compression) / 4096.0f) * 360;
                     skeleton_data[bone].rx += (ReadEncryptedRotationBits(file, offset_to_animation + 5, readed_bits, compression) / 4096.0f) * 360;
                     skeleton_data[bone].ry += (ReadEncryptedRotationBits(file, offset_to_animation + 5, readed_bits, compression) / 4096.0f) * 360;
                     skeleton_data[bone].ry += (ReadEncryptedRotationBits(file, offset_to_animation + 5, readed_bits, compression) / 4096.0f) * 360;
@@ -256,7 +256,7 @@ AnimationExtractor(File* file, const Ogre::SkeletonPtr& skeleton, const EnemyInf
                     track2 = anim->getNodeTrack(bone * 2 + 3);
                     track2 = anim->getNodeTrack(bone * 2 + 3);
                     frame1 = track1->createNodeKeyFrame(time);
                     frame1 = track1->createNodeKeyFrame(time);
                     frame2 = track2->createNodeKeyFrame(time);
                     frame2 = track2->createNodeKeyFrame(time);
-                    frame2->setTranslate(Ogre::Vector3(0, 0, skeleton_data[bone].length) / 512);
+                    frame2->setTranslate(Ogre::Vector3(0.0f, 0.0f, static_cast<float>(skeleton_data[bone].length) / 512));
                     mat.FromEulerAnglesYXZ(Ogre::Radian(Ogre::Degree(skeleton_data[bone].ry)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rx)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rz)));
                     mat.FromEulerAnglesYXZ(Ogre::Radian(Ogre::Degree(skeleton_data[bone].ry)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rx)), Ogre::Radian(Ogre::Degree(skeleton_data[bone].rz)));
                     rot.FromRotationMatrix(mat);
                     rot.FromRotationMatrix(mat);
                     frame1->setRotation(rot);
                     frame1->setRotation(rot);

+ 2 - 2
utilities/ffvii_battle_model_exporter/src/EnemyFile.cpp

@@ -94,7 +94,7 @@ EnemyFile::GetModel( const EnemyInfo& info )
 
 
 
 
 
 
-    for (int bone = 0; bone < m_Skeleton.size(); ++bone)
+    for (size_t bone = 0; bone < m_Skeleton.size(); ++bone)
     {
     {
         int offset = m_Skeleton[bone].offset;
         int offset = m_Skeleton[bone].offset;
         if (offset != 0)
         if (offset != 0)
@@ -181,7 +181,7 @@ EnemyFile::DumpSettings(const Ogre::String& file)
 
 
     int model_settings_offset = GetU32LE(0x08);
     int model_settings_offset = GetU32LE(0x08);
 
 
-    m_WithWeapon = GetU8( model_settings_offset + 2 ) & 0x80;
+    m_WithWeapon = (GetU8( model_settings_offset + 2 ) & 0x80) > 0;
     LOGGER->Log( "Model With Weapon '" + Ogre::StringConverter::toString(m_WithWeapon) + "'\n" );
     LOGGER->Log( "Model With Weapon '" + Ogre::StringConverter::toString(m_WithWeapon) + "'\n" );
 
 
     settings->Log("// animation scripts\n");
     settings->Log("// animation scripts\n");

+ 3 - 3
utilities/ffvii_battle_model_exporter/src/Main.cpp

@@ -136,7 +136,7 @@ main(int argc, char *argv[])
 
 
 
 
 
 
-    for (int i = 0; i < models_all.size(); ++i)
+    for (size_t i = 0; i < models_all.size(); ++i)
     {
     {
         EnemyFile model("data/" + models_all[i].file_name + ".LZS");
         EnemyFile model("data/" + models_all[i].file_name + ".LZS");
 
 
@@ -149,7 +149,7 @@ main(int argc, char *argv[])
         }
         }
     }
     }
 
 
-    for (int i = 0; i < effects_all.size(); ++i)
+    for (size_t i = 0; i < effects_all.size(); ++i)
     {
     {
         RamEffectFile effect("data/ram.bin");
         RamEffectFile effect("data/ram.bin");
         Ogre::Entity* exported_entity = effect.GetModel(effects_all[i]);
         Ogre::Entity* exported_entity = effect.GetModel(effects_all[i]);
@@ -159,7 +159,7 @@ main(int argc, char *argv[])
         }
         }
     }
     }
 
 
-    for (int i = 0; i < stages_all.size(); ++i)
+    for (size_t i = 0; i < stages_all.size(); ++i)
     {
     {
         StageFile model("data/" + stages_all[i].file_name + ".LZS");
         StageFile model("data/" + stages_all[i].file_name + ".LZS");
 
 

+ 1 - 1
utilities/ffvii_battle_model_exporter/src/StageFile.cpp

@@ -72,7 +72,7 @@ StageFile::GetModel( const StageInfo& info )
 
 
 
 
 
 
-    for (int i = 1; i < number_of_files - 1; ++i)
+    for (u32 i = 1; i < number_of_files - 1; ++i)
     {
     {
         int offset_to_vertex = GetU32LE(0x04 + i * 0x04);
         int offset_to_vertex = GetU32LE(0x04 + i * 0x04);
         MeshExtractor(info.data, "ffvii/battle_stage/" + info.data.name, this, offset_to_vertex, textures, mesh, Ogre::StringConverter::toString(i), 1);
         MeshExtractor(info.data, "ffvii/battle_stage/" + info.data.name, this, offset_to_vertex, textures, mesh, Ogre::StringConverter::toString(i), 1);

+ 2 - 2
utilities/ffvii_battle_scene_dumper/src/FFVIIString.cpp

@@ -32,7 +32,7 @@ StringToFFVIIString( const Ogre::String& string )
 {
 {
     FFVIIString ret;
     FFVIIString ret;
 
 
-    for( int i = 0; i < string.size(); ++i )
+    for( size_t i = 0; i < string.size(); ++i )
     {
     {
         ret.push_back( ascii[ string[ i ] ] );
         ret.push_back( ascii[ string[ i ] ] );
     }
     }
@@ -47,7 +47,7 @@ FFVIIStringToString( const FFVIIString& string )
 {
 {
     Ogre::String ret;
     Ogre::String ret;
 
 
-    for( int i = 0; i < string.size(); ++i )
+    for( size_t i = 0; i < string.size(); ++i )
     {
     {
         Ogre::String l = "";
         Ogre::String l = "";
 
 

+ 7 - 7
utilities/ffvii_field_model_exporter/src/AnimationFile.cpp

@@ -61,7 +61,7 @@ AnimationFile::GetData( std::vector< s16 >& skeleton_length, const Unit& unit, c
         m_AnimationHeaders.push_back(header);
         m_AnimationHeaders.push_back(header);
     }
     }
 
 
-    for (u32 i = 0; (i < number_of_animation) && (start_animation + i < unit.animations.size()); ++i)
+    for (size_t i = 0; (i < static_cast<size_t>(number_of_animation)) && (start_animation + i < unit.animations.size()); ++i)
     {
     {
         if (unit.animations[start_animation + i] == "" || unit.animations[start_animation + i] == " ")
         if (unit.animations[start_animation + i] == "" || unit.animations[start_animation + i] == " ")
         {
         {
@@ -149,29 +149,29 @@ AnimationFile::GetData( std::vector< s16 >& skeleton_length, const Unit& unit, c
 
 
                 if (flag & 0x10)
                 if (flag & 0x10)
                 {
                 {
-                    position.translation_x = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + tx * m_AnimationHeaders[i].number_of_frames * 2 + j * 2);
+                    position.translation_x = static_cast<float>( -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + tx * m_AnimationHeaders[i].number_of_frames * 2 + j * 2));
                 }
                 }
                 else if (tx != 0xFF)
                 else if (tx != 0xFF)
                 {
                 {
-                    position.translation_x = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + tx * 2);
+                    position.translation_x = static_cast<float>(-(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + tx * 2));
                 }
                 }
 
 
                 if (flag & 0x20)
                 if (flag & 0x20)
                 {
                 {
-                    position.translation_y = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + ty * m_AnimationHeaders[i].number_of_frames * 2 + j * 2);
+                    position.translation_y = static_cast<float>(-(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + ty * m_AnimationHeaders[i].number_of_frames * 2 + j * 2));
                 }
                 }
                 else if (ty != 0xFF)
                 else if (ty != 0xFF)
                 {
                 {
-                    position.translation_y = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + ty * 2);
+                    position.translation_y = static_cast<float>(-(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + ty * 2));
                 }
                 }
 
 
                 if (flag & 0x40)
                 if (flag & 0x40)
                 {
                 {
-                    position.translation_z = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + tz * m_AnimationHeaders[i].number_of_frames * 2 + j * 2);
+                    position.translation_z = static_cast<float>(-(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_frames_translation_data + tz * m_AnimationHeaders[i].number_of_frames * 2 + j * 2));
                 }
                 }
                 else if (tz != 0xFF)
                 else if (tz != 0xFF)
                 {
                 {
-                    position.translation_z = -(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + tz * 2);
+                    position.translation_z = static_cast<float>(-(s16)GetU16LE(m_AnimationHeaders[i].offset_to_animation_data + m_AnimationHeaders[i].offset_to_static_translation_data + tz * 2));
                 }
                 }
 
 
                 //LOGGER->Log(LOGGER_INFO, "%d %d", m_AnimationHeaders[i].number_of_frames, j);
                 //LOGGER->Log(LOGGER_INFO, "%d %d", m_AnimationHeaders[i].number_of_frames, j);

+ 4 - 4
utilities/ffvii_field_model_exporter/src/Main.cpp

@@ -42,7 +42,7 @@ fill_names()
 
 
                     Ogre::StringVector animations = Ogre::StringUtil::split( export_data[ 1 ], ",", 0 );
                     Ogre::StringVector animations = Ogre::StringUtil::split( export_data[ 1 ], ",", 0 );
                     //LOGGER->Log(LOGGER_INFO, "Export %s: %s", field.name.c_str(), unit.name.c_str());
                     //LOGGER->Log(LOGGER_INFO, "Export %s: %s", field.name.c_str(), unit.name.c_str());
-                    for( int i = 0; i < animations.size(); ++i )
+                    for( size_t i = 0; i < animations.size(); ++i )
                     {
                     {
                         unit.animations.push_back( animations[ i ] );
                         unit.animations.push_back( animations[ i ] );
                     }
                     }
@@ -73,17 +73,17 @@ main( int argc, char *argv[] )
 
 
 
 
 
 
-    for( int f = 0; f < fields.size(); ++f )
+    for( size_t f = 0; f < fields.size(); ++f )
     {
     {
         BsxFile model( "data/field/" + fields[ f ].name + ".bsx" );
         BsxFile model( "data/field/" + fields[ f ].name + ".bsx" );
         DatFile dat( "data/field/" + fields[ f ].name + ".dat" );
         DatFile dat( "data/field/" + fields[ f ].name + ".dat" );
 
 
-        for( int i = 0; i < fields[ f ].units.size(); ++i )
+        for( size_t i = 0; i < fields[ f ].units.size(); ++i )
         {
         {
             if( fields[ f ].units[ i ].name != "" )
             if( fields[ f ].units[ i ].name != "" )
             {
             {
                 Ogre::Entity* entity = NULL;
                 Ogre::Entity* entity = NULL;
-                for( int j = 0; j < entitys.size(); ++j )
+                for( size_t j = 0; j < entitys.size(); ++j )
                 {
                 {
                     if( fields[ f ].units[ i ].name == entitys[ j ]->getName() )
                     if( fields[ f ].units[ i ].name == entitys[ j ]->getName() )
                     {
                     {

+ 20 - 20
utilities/ffvii_field_model_exporter/src/MeshFile.cpp

@@ -142,9 +142,9 @@ MeshFile::readPart( const Ogre::String& name, const u32 i, const u32 offset_to_p
         u16 offset_to_vertex = offset_to_vertexes + j * 0x08;
         u16 offset_to_vertex = offset_to_vertexes + j * 0x08;
 
 
         Ogre::Vector3 point;
         Ogre::Vector3 point;
-        point.x = -( s16 )GetU16LE( offset_to_vertex + 4 + 0x00 );
-        point.z = -( s16 )GetU16LE( offset_to_vertex + 4 + 0x02 );
-        point.y = -( s16 )GetU16LE( offset_to_vertex + 4 + 0x04 );
+        point.x = static_cast<float>(-( s16 )GetU16LE( offset_to_vertex + 4 + 0x00 ));
+        point.z = static_cast<float>(-(s16)GetU16LE(offset_to_vertex + 4 + 0x02));
+        point.y = static_cast<float>(-(s16)GetU16LE(offset_to_vertex + 4 + 0x04));
         point /= 1024.0f;
         point /= 1024.0f;
         vertexes.push_back( point );
         vertexes.push_back( point );
     }
     }
@@ -402,9 +402,9 @@ MeshFile::readPart( const Ogre::String& name, const u32 i, const u32 offset_to_p
     {
     {
         readTriangle( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, false );
         readTriangle( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, false );
 
 
-        Ogre::Vector2 at(0.99, 0.99);
-        Ogre::Vector2 bt(0.99, 0.99);
-        Ogre::Vector2 ct(0.99, 0.99);
+        Ogre::Vector2 at(0.99f, 0.99f);
+        Ogre::Vector2 bt(0.99f, 0.99f);
+        Ogre::Vector2 ct(0.99f, 0.99f);
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
@@ -417,10 +417,10 @@ MeshFile::readPart( const Ogre::String& name, const u32 i, const u32 offset_to_p
     {
     {
         readQuad( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, false );
         readQuad( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, false );
 
 
-        Ogre::Vector2 at(0.99, 0.99);
-        Ogre::Vector2 bt(0.99, 0.99);
-        Ogre::Vector2 ct(0.99, 0.99);
-        Ogre::Vector2 dt(0.99, 0.99);
+        Ogre::Vector2 at(0.99f, 0.99f);
+        Ogre::Vector2 bt(0.99f, 0.99f);
+        Ogre::Vector2 ct(0.99f, 0.99f);
+        Ogre::Vector2 dt(0.99f, 0.99f);
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
@@ -434,9 +434,9 @@ MeshFile::readPart( const Ogre::String& name, const u32 i, const u32 offset_to_p
     {
     {
         readTriangle( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, true );
         readTriangle( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, true );
 
 
-        Ogre::Vector2 at(0.99, 0.99);
-        Ogre::Vector2 bt(0.99, 0.99);
-        Ogre::Vector2 ct(0.99, 0.99);
+        Ogre::Vector2 at(0.99f, 0.99f);
+        Ogre::Vector2 bt(0.99f, 0.99f);
+        Ogre::Vector2 ct(0.99f, 0.99f);
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = at.x; *tPos++ = at.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = bt.x; *tPos++ = bt.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
         *tPos++ = ct.x; *tPos++ = ct.y;
@@ -449,10 +449,10 @@ MeshFile::readPart( const Ogre::String& name, const u32 i, const u32 offset_to_p
     {
     {
         readQuad( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, true );
         readQuad( offset_to_poly, vertexes, pPos, cur_index, cur_vertex, cur_colour, true );
 
 
-        Ogre::Vector2 a(0.99, 0.99);
-        Ogre::Vector2 b(0.99, 0.99);
-        Ogre::Vector2 c(0.99, 0.99);
-        Ogre::Vector2 d(0.99, 0.99);
+        Ogre::Vector2 a(0.99f, 0.99f);
+        Ogre::Vector2 b(0.99f, 0.99f);
+        Ogre::Vector2 c(0.99f, 0.99f);
+        Ogre::Vector2 d(0.99f, 0.99f);
         *tPos++ = a.x; *tPos++ = a.y;
         *tPos++ = a.x; *tPos++ = a.y;
         *tPos++ = b.x; *tPos++ = b.y;
         *tPos++ = b.x; *tPos++ = b.y;
         *tPos++ = c.x; *tPos++ = c.y;
         *tPos++ = c.x; *tPos++ = c.y;
@@ -489,7 +489,7 @@ MeshFile::GetData(const Ogre::String& name, const int offset_to_parts, const int
     int part_end( number_of_parts );
     int part_end( number_of_parts );
     int part_begin = 0;
     int part_begin = 0;
 
 
-    for (u32 i = part_begin; i < number_of_parts && i < part_end; ++i)
+    for (int i = part_begin; i < number_of_parts && i < part_end; ++i)
     {
     {
         u32 offset_to_part   = offset_to_parts + i * 0x20;
         u32 offset_to_part   = offset_to_parts + i * 0x20;
         readPart( name, i, offset_to_part, mesh, textures );
         readPart( name, i, offset_to_part, mesh, textures );
@@ -521,7 +521,7 @@ MeshFile::AddTexture( TexForGenBsx& texture, VectorTexForGenBsx& textures )
     texture.bpp = ( BPP )bpp;
     texture.bpp = ( BPP )bpp;
     texture.type = type;
     texture.type = type;
 
 
-    for( int i = 0; i < textures.size(); i++ )
+    for( size_t i = 0; i < textures.size(); i++ )
     {
     {
         if( texture == textures[ i ] )
         if( texture == textures[ i ] )
         {
         {
@@ -535,7 +535,7 @@ MeshFile::AddTexture( TexForGenBsx& texture, VectorTexForGenBsx& textures )
 
 
     texture.start_x = 0;
     texture.start_x = 0;
     texture.start_y = 0;
     texture.start_y = 0;
-    for (int i = 0; i < textures.size(); i++)
+    for (size_t i = 0; i < textures.size(); i++)
     {
     {
         if (texture.start_x <= textures[i].start_x)
         if (texture.start_x <= textures[i].start_x)
         {
         {

+ 1 - 1
utilities/ffvii_field_model_exporter/src/SkeletonFile.cpp

@@ -45,7 +45,7 @@ SkeletonFile::GetData( std::vector< s16 >& skeleton_length, const int offset_to_
         Ogre::Bone* root = skeleton->createBone( "0", 0 );
         Ogre::Bone* root = skeleton->createBone( "0", 0 );
     }
     }
 
 
-    for( u32 i = 0; i < number_of_bones; ++i )
+    for( int i = 0; i < number_of_bones; ++i )
     {
     {
         s16 length    = GetU16LE(offset_to_bones + i * 0x04 + 0x00);
         s16 length    = GetU16LE(offset_to_bones + i * 0x04 + 0x00);
         s8  parent_id = GetU8(offset_to_bones + i * 0x04 + 0x02);
         s8  parent_id = GetU8(offset_to_bones + i * 0x04 + 0x02);

+ 2 - 2
utilities/ffvii_field_model_exporter/src/TdbFile.cpp

@@ -183,7 +183,7 @@ TdbFile::CreateTexture( const Ogre::PixelBox& pb, const int face_id, const int s
 */
 */
 
 
 
 
-    if( face_id >= face_row.size() || face_row[ face_id ].size() == 0 )
+    if( face_id >= static_cast<int>(face_row.size()) || face_row[ face_id ].size() == 0 )
     {
     {
         LOGGER->Log( "[ERROR] There is no data for face id: 0x" + HexToString( face_id, 2, '0' ) );
         LOGGER->Log( "[ERROR] There is no data for face id: 0x" + HexToString( face_id, 2, '0' ) );
         return;
         return;
@@ -197,7 +197,7 @@ TdbFile::CreateTexture( const Ogre::PixelBox& pb, const int face_id, const int s
     // eyes should be created twice
     // eyes should be created twice
     bool second_eye = false;
     bool second_eye = false;
 
 
-    for( int i = 1; i < face_row[ face_id ].size(); ++i )
+    for( size_t i = 1; i < face_row[ face_id ].size(); ++i )
     {
     {
         int offset_to_image = GetU32LE( 0x8 ) + face_row[ face_id ][ i ] * 512;
         int offset_to_image = GetU32LE( 0x8 ) + face_row[ face_id ][ i ] * 512;
 
 

+ 2 - 0
utilities/ffvii_sound_dumper/src/engine/SoundManager.h

@@ -209,6 +209,7 @@ extern const int gauss[];
 #define SUSTAIN_MS     441L
 #define SUSTAIN_MS     441L
 #define RELEASE_MS     437L
 #define RELEASE_MS     437L
 
 
+#ifndef _MSC_VER
 #ifndef LOWORD
 #ifndef LOWORD
 #define LOWORD(l)    ((unsigned short)(l))
 #define LOWORD(l)    ((unsigned short)(l))
 #endif
 #endif
@@ -216,6 +217,7 @@ extern const int gauss[];
 #ifndef HIWORD
 #ifndef HIWORD
 #define HIWORD(l)    ((unsigned short)(((unsigned long)(l) >> 16) & 0xFFFF))
 #define HIWORD(l)    ((unsigned short)(((unsigned long)(l) >> 16) & 0xFFFF))
 #endif
 #endif
+#endif
 
 
 extern int bSPUIsOpen;
 extern int bSPUIsOpen;
 
 

+ 6 - 6
utilities/ffvii_sound_dumper_psf/src/main.cc

@@ -331,7 +331,7 @@ int main(int argc, char *argv[])
 		ifstream iF(argument.c_str(), ios::binary);
 		ifstream iF(argument.c_str(), ios::binary);
 		if(iF.is_open())
 		if(iF.is_open())
 		{
 		{
-			u32 frame_size = file_get_size(iF);
+			u32 frame_size = static_cast<u32>(file_get_size(iF));
 			u8 *frame = new u8[frame_size];
 			u8 *frame = new u8[frame_size];
 			iF.read((char *)frame, frame_size);
 			iF.read((char *)frame, frame_size);
 			iF.close();
 			iF.close();
@@ -368,7 +368,7 @@ int main(int argc, char *argv[])
 			// create audio tracks
 			// create audio tracks
 			int dump_psf = 0;
 			int dump_psf = 0;
 			int dump_pcm = 0;
 			int dump_pcm = 0;
-			float ogg_quality = 0.4;
+			float ogg_quality = 0.4f;
 			if(config_node->QueryIntAttribute("dump_psf", &dump_psf) != TIXML_SUCCESS)
 			if(config_node->QueryIntAttribute("dump_psf", &dump_psf) != TIXML_SUCCESS)
 				cout << "error: dump_psf isn't integer" << endl;
 				cout << "error: dump_psf isn't integer" << endl;
 			if(config_node->QueryIntAttribute("dump_pcm", &dump_pcm) != TIXML_SUCCESS)
 			if(config_node->QueryIntAttribute("dump_pcm", &dump_pcm) != TIXML_SUCCESS)
@@ -381,7 +381,7 @@ int main(int argc, char *argv[])
 				config_node->Attribute("music_xml"),
 				config_node->Attribute("music_xml"),
 				config_node->Attribute("music_directory"),
 				config_node->Attribute("music_directory"),
 				config_node->Attribute("custom_bios"),
 				config_node->Attribute("custom_bios"),
-				ogg_quality, dump_psf, dump_pcm);
+				ogg_quality, dump_psf > 0, dump_pcm > 0);
 			cout << endl;
 			cout << endl;
 		}
 		}
 		else
 		else
@@ -557,7 +557,7 @@ void akao_extract_cb(void *a_data, path a_file)
 	}
 	}
 
 
 	// read full file to memory
 	// read full file to memory
-	u32 buffer_size = file_get_size(iF);
+	u32 buffer_size = static_cast<u32>(file_get_size(iF));
 	u8 *buffer = new u8[buffer_size];
 	u8 *buffer = new u8[buffer_size];
 	iF.read((char *)buffer, buffer_size);
 	iF.read((char *)buffer, buffer_size);
 	iF.close();
 	iF.close();
@@ -662,7 +662,7 @@ void files_delete_duplicates(list<path> &r_file_list)
 			continue;
 			continue;
 		}
 		}
 
 
-		u32 buffer1_size = file_get_size(iF1);
+		u32 buffer1_size = static_cast<u32>(file_get_size(iF1));
 		u8 *buffer1 = new u8[buffer1_size];
 		u8 *buffer1 = new u8[buffer1_size];
 		iF1.read((char *)buffer1, buffer1_size);
 		iF1.read((char *)buffer1, buffer1_size);
 		iF1.close();
 		iF1.close();
@@ -676,7 +676,7 @@ void files_delete_duplicates(list<path> &r_file_list)
 			ifstream iF2(jt->string().c_str(), ios::binary);
 			ifstream iF2(jt->string().c_str(), ios::binary);
 			if(iF2.is_open())
 			if(iF2.is_open())
 			{
 			{
-				u32 buffer2_size = file_get_size(iF2);
+				u32 buffer2_size = static_cast<u32>(file_get_size(iF2));
 				if(buffer1_size == buffer2_size)
 				if(buffer1_size == buffer2_size)
 				{
 				{
 					u8 *buffer2 = new u8[buffer2_size];
 					u8 *buffer2 = new u8[buffer2_size];

+ 1 - 1
utilities/xeno_model_exporter/src/AnimatedModel.cpp

@@ -112,7 +112,7 @@ AnimatedModel::Export( const ModelInfo& info )
     {
     {
         Vram* vram = Vram::MakeInstance().release();
         Vram* vram = Vram::MakeInstance().release();
 
 
-        for( int i = 0; i < texture->GetU32LE( 0 ); ++i )
+        for( u32 i = 0; i < texture->GetU32LE( 0 ); ++i )
         {
         {
             int offset_to_tex = texture->GetU32LE( 0x04 + i * 0x04 );
             int offset_to_tex = texture->GetU32LE( 0x04 + i * 0x04 );
 
 

+ 1 - 1
utilities/xeno_model_exporter/src/AnimationExtractor.cpp

@@ -96,7 +96,7 @@ AnimationExtractor( const Ogre::SkeletonPtr& skeleton, const ModelInfo& info, Sk
             u16 rot_num = 0;
             u16 rot_num = 0;
             u16 trans_num = 0;
             u16 trans_num = 0;
 
 
-            for( int bone = 0; bone < skeleton_data.size(); ++bone )
+            for( size_t bone = 0; bone < skeleton_data.size(); ++bone )
             {
             {
                 tx = 0; ty = 0; tz = 0;
                 tx = 0; ty = 0; tz = 0;
                 rx = 0; ry = 0; rz = 0;
                 rx = 0; ry = 0; rz = 0;

+ 1 - 1
utilities/xeno_model_exporter/src/FieldModel.cpp

@@ -147,7 +147,7 @@ FieldModel::Export( const Ogre::String& model_file, const Ogre::String& texture_
                 }
                 }
 
 
                 // move pointer to start of next texture
                 // move pointer to start of next texture
-                i += ceil( ( float )( texture_header_width * 2 * height) / 0x0800 ) * 0x0800;
+                i += static_cast<u32>(ceil( ( float )( texture_header_width * 2 * height) / 0x0800 ) * 0x0800);
                 // update height
                 // update height
                 texture_header_height += height;
                 texture_header_height += height;
                 vram_y += height;
                 vram_y += height;

+ 1 - 1
utilities/xeno_model_exporter/src/ModelFile.cpp

@@ -111,7 +111,7 @@ ModelFile::GetModelPart( const int part_id, Ogre::MeshPtr mesh, const MeshData&
         sub_mesh->indexData->indexCount = sub_mesh->vertexData->vertexCount;
         sub_mesh->indexData->indexCount = sub_mesh->vertexData->vertexCount;
         sub_mesh->indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer(Ogre::HardwareIndexBuffer::IT_16BIT, sub_mesh->indexData->indexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY);
         sub_mesh->indexData->indexBuffer = Ogre::HardwareBufferManager::getSingleton().createIndexBuffer(Ogre::HardwareIndexBuffer::IT_16BIT, sub_mesh->indexData->indexCount, Ogre::HardwareBuffer::HBU_STATIC_WRITE_ONLY);
         u16* idata = static_cast<u16*>(sub_mesh->indexData->indexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
         u16* idata = static_cast<u16*>(sub_mesh->indexData->indexBuffer->lock(Ogre::HardwareBuffer::HBL_DISCARD));
-        for( int i = 0; i < sub_mesh->vertexData->vertexCount; ++i )
+        for( unsigned int i = 0; i < sub_mesh->vertexData->vertexCount; ++i )
         {
         {
             idata[ i ] = i;
             idata[ i ] = i;
         }
         }

+ 3 - 0
utilities/xeno_script_dumper/src/common/utilites/StdString.h

@@ -31,6 +31,9 @@
 #include <cstdarg>
 #include <cstdarg>
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
+#ifdef va_copy
+#undef va_copy
+#endif
 #define va_copy(a,b) (a=b)
 #define va_copy(a,b) (a=b)
 #define snprintf _snprintf
 #define snprintf _snprintf
 #endif
 #endif

+ 2 - 2
utilities/xeno_script_dumper/src/game/field/ScriptFile.cpp

@@ -47,7 +47,7 @@ ScriptFile::GetScripts()
     u32 number_of_entity = GetU8(0x80);
     u32 number_of_entity = GetU8(0x80);
     u32 offset_to_script = 0x84 + number_of_entity * 0x40;
     u32 offset_to_script = 0x84 + number_of_entity * 0x40;
 
 
-    for (int i = 0; i < number_of_entity; ++i)
+    for (u32 i = 0; i < number_of_entity; ++i)
     {
     {
         LOGGER->Log("Entity: 0x%02x\n", i);
         LOGGER->Log("Entity: 0x%02x\n", i);
 
 
@@ -64,7 +64,7 @@ ScriptFile::GetScripts()
 
 
 
 
             u32 script_pointer_end = 0;
             u32 script_pointer_end = 0;
-            for (int l = i; l < number_of_entity; ++l)
+            for (u32 l = i; l < number_of_entity; ++l)
             {
             {
                 u32 offset_in_next_script = 0;
                 u32 offset_in_next_script = 0;
                 for (int script_id = 0; script_id < 0x20; ++script_id)
                 for (int script_id = 0; script_id < 0x20; ++script_id)

+ 3 - 3
utilities/xeno_walkmesh_exporter/src/Main.cpp

@@ -104,7 +104,7 @@ public:
         input_event_array.clear();
         input_event_array.clear();
         m_InputFilter.GetInputEvents(input_event_array);
         m_InputFilter.GetInputEvents(input_event_array);
 
 
-        for (int i = 0; i < input_event_array.size(); ++i)
+        for (size_t i = 0; i < input_event_array.size(); ++i)
         {
         {
             if (input_event_array[i].name == "quit" && input_event_array[i].type == IE_PRESSED)
             if (input_event_array[i].name == "quit" && input_event_array[i].type == IE_PRESSED)
             {
             {
@@ -141,8 +141,8 @@ public:
 
 
             if (m_CameraFreeRotate && input_event_array[i].name == "mouse_move")
             if (m_CameraFreeRotate && input_event_array[i].name == "mouse_move")
             {
             {
-                scene_manager->getCamera("Camera")->rotate(Ogre::Vector3::UNIT_Y, Ogre::Radian(Ogre::Degree(input_event_array[i].x * 0.13)));
-                scene_manager->getCamera("Camera")->pitch(Ogre::Degree(-input_event_array[i].y * 0.13));
+                scene_manager->getCamera("Camera")->rotate(Ogre::Vector3::UNIT_Y, Ogre::Radian(Ogre::Degree(input_event_array[i].x * 0.13f)));
+                scene_manager->getCamera("Camera")->pitch(Ogre::Degree(-input_event_array[i].y * 0.13f));
             }
             }
 
 
 
 

+ 3 - 0
utilities/xeno_walkmesh_exporter/src/common/utilites/StdString.h

@@ -31,6 +31,9 @@
 #include <cstdarg>
 #include <cstdarg>
 
 
 #ifdef _MSC_VER
 #ifdef _MSC_VER
+#ifdef va_copy
+#undef va_copy
+#endif
 #define va_copy(a,b) (a=b)
 #define va_copy(a,b) (a=b)
 #define snprintf _snprintf
 #define snprintf _snprintf
 #endif
 #endif

+ 9 - 9
utilities/xeno_walkmesh_exporter/src/game/field/Walkmesh.cpp

@@ -27,7 +27,7 @@ Walkmesh::Walkmesh(void)
 
 
 Walkmesh::~Walkmesh(void)
 Walkmesh::~Walkmesh(void)
 {
 {
-    for (int i = 0; i < m_TriangleTexts.size(); ++i)
+    for (size_t i = 0; i < m_TriangleTexts.size(); ++i)
     {
     {
         m_Overlay->remove2D((Ogre::OverlayContainer*)m_TriangleTexts[i]);
         m_Overlay->remove2D((Ogre::OverlayContainer*)m_TriangleTexts[i]);
         delete m_TriangleTexts[i];
         delete m_TriangleTexts[i];
@@ -52,7 +52,7 @@ Walkmesh::AddTriangle(const WalkmeshTriangle& triangle)
 const int
 const int
 Walkmesh::GetAccessSide(const int triangle_id, const unsigned char side) const
 Walkmesh::GetAccessSide(const int triangle_id, const unsigned char side) const
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetAccessSide: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetAccessSide: triangle_id greater than number of triangles in walkmesh or less than zero.");
         return -1;
         return -1;
@@ -72,7 +72,7 @@ Walkmesh::GetAccessSide(const int triangle_id, const unsigned char side) const
 const Ogre::Vector3&
 const Ogre::Vector3&
 Walkmesh::GetA(const int triangle_id) const
 Walkmesh::GetA(const int triangle_id) const
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetA: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetA: triangle_id greater than number of triangles in walkmesh or less than zero.");
         return Ogre::Vector3::ZERO;
         return Ogre::Vector3::ZERO;
@@ -86,7 +86,7 @@ Walkmesh::GetA(const int triangle_id) const
 const Ogre::Vector3&
 const Ogre::Vector3&
 Walkmesh::GetB(const int triangle_id) const
 Walkmesh::GetB(const int triangle_id) const
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetB: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetB: triangle_id greater than number of triangles in walkmesh or less than zero.");
         return Ogre::Vector3::ZERO;
         return Ogre::Vector3::ZERO;
@@ -100,7 +100,7 @@ Walkmesh::GetB(const int triangle_id) const
 const Ogre::Vector3&
 const Ogre::Vector3&
 Walkmesh::GetC(const int triangle_id) const
 Walkmesh::GetC(const int triangle_id) const
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetC: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::GetC: triangle_id greater than number of triangles in walkmesh or less than zero.");
         return Ogre::Vector3::ZERO;
         return Ogre::Vector3::ZERO;
@@ -114,7 +114,7 @@ Walkmesh::GetC(const int triangle_id) const
 void
 void
 Walkmesh::LockWalkmesh(const int triangle_id, const bool lock)
 Walkmesh::LockWalkmesh(const int triangle_id, const bool lock)
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::SetAccessible: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::SetAccessible: triangle_id greater than number of triangles in walkmesh or less than zero.");
         return;
         return;
@@ -160,10 +160,10 @@ Walkmesh::LockWalkmesh(const int triangle_id, const bool lock)
 const bool
 const bool
 Walkmesh::IsLocked(const int triangle_id) const
 Walkmesh::IsLocked(const int triangle_id) const
 {
 {
-    if (triangle_id >= m_Triangles.size() || triangle_id < 0)
+    if (triangle_id >= static_cast<int>(m_Triangles.size()) || triangle_id < 0)
     {
     {
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::IsAccessible: triangle_id greater than number of triangles in walkmesh or less than zero.");
         Ogre::LogManager::getSingletonPtr()->logMessage("Walkmesh::IsAccessible: triangle_id greater than number of triangles in walkmesh or less than zero.");
-        return -1;
+        return true;
     }
     }
 
 
     return m_Triangles[triangle_id].locked;
     return m_Triangles[triangle_id].locked;
@@ -228,7 +228,7 @@ Walkmesh::SetUpWalkmeshVertices(void)
     Ogre::ColourValue c_access = Ogre::ColourValue(1, 1, 1);
     Ogre::ColourValue c_access = Ogre::ColourValue(1, 1, 1);
     Ogre::ColourValue c_deny   = Ogre::ColourValue(1, 0, 0);
     Ogre::ColourValue c_deny   = Ogre::ColourValue(1, 0, 0);
 
 
-    for (int i = 0; i < m_Triangles.size(); ++i)
+    for (size_t i = 0; i < m_Triangles.size(); ++i)
     {
     {
         // line 0
         // line 0
         *pPos++ = m_Triangles[i].a.x; *pPos++ = m_Triangles[i].a.y; *pPos++ = m_Triangles[i].a.z;
         *pPos++ = m_Triangles[i].a.x; *pPos++ = m_Triangles[i].a.y; *pPos++ = m_Triangles[i].a.z;

+ 3 - 3
utilities/xeno_walkmesh_exporter/src/game/field/WalkmeshFile.cpp

@@ -37,9 +37,9 @@ WalkmeshFile::GetWalkmesh(Walkmesh* walkmesh)
 
 
         for (u32 i = 0; i < block_size;)
         for (u32 i = 0; i < block_size;)
         {
         {
-            u16 a_offset = block_vertex + GetU16LE(block_start + i + 0x00) * 0x08;
-            u16 b_offset = block_vertex + GetU16LE(block_start + i + 0x02) * 0x08;
-            u16 c_offset = block_vertex + GetU16LE(block_start + i + 0x04) * 0x08;
+            u16 a_offset = static_cast<u16>(block_vertex + GetU16LE(block_start + i + 0x00) * 0x08);
+            u16 b_offset = static_cast<u16>(block_vertex + GetU16LE(block_start + i + 0x02) * 0x08);
+            u16 c_offset = static_cast<u16>(block_vertex + GetU16LE(block_start + i + 0x04) * 0x08);
 
 
             WalkmeshTriangle triangle;
             WalkmeshTriangle triangle;
             triangle.a = Ogre::Vector3((s16)GetU16LE(0x00 + a_offset),
             triangle.a = Ogre::Vector3((s16)GetU16LE(0x00 + a_offset),

+ 10 - 10
utilities/xeno_walkmesh_exporter/src/game/filetypes/FontFile.cpp

@@ -83,10 +83,10 @@ FontFile::GetSurface(void)
             int j = 0;
             int j = 0;
             for (int i = 7; i >= 0; --i)
             for (int i = 7; i >= 0; --i)
             {
             {
-                color.r = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.g = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.b = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.a = ((data >> i) & 0x01 == 1) ? 255 : 255;
+                color.r = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.g = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.b = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.a = (((data >> i) & 0x01) == 1) ? 255 : 255;
                 memcpy(glyth->pixels + 64 * y + j, &color, sizeof(ClutColor));
                 memcpy(glyth->pixels + 64 * y + j, &color, sizeof(ClutColor));
                 j += 4;
                 j += 4;
             }
             }
@@ -95,10 +95,10 @@ FontFile::GetSurface(void)
             //LOGGER->Log(LOGGER_INFO, "%02x", data);
             //LOGGER->Log(LOGGER_INFO, "%02x", data);
             for (int i = 7; i >= 0; --i)
             for (int i = 7; i >= 0; --i)
             {
             {
-                color.r = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.g = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.b = ((data >> i) & 0x01 == 1) ? 0 : 255;
-                color.a = ((data >> i) & 0x01 == 1) ? 255 : 255;
+                color.r = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.g = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.b = (((data >> i) & 0x01) == 1) ? 0 : 255;
+                color.a = (((data >> i) & 0x01) == 1) ? 255 : 255;
                 memcpy(glyth->pixels + 64 * y + j, &color, sizeof(ClutColor));
                 memcpy(glyth->pixels + 64 * y + j, &color, sizeof(ClutColor));
                 j += 4;
                 j += 4;
             }
             }
@@ -123,11 +123,11 @@ FontFile::GetSurface(void)
     buffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
     buffer->lock(Ogre::HardwareBuffer::HBL_DISCARD);
     const Ogre::PixelBox& pb = buffer->getCurrentLock();
     const Ogre::PixelBox& pb = buffer->getCurrentLock();
 
 
-    for (Uint32 y = 0; y < ret->height; ++y)
+    for (int y = 0; y < ret->height; ++y)
     {
     {
         Uint32* data = static_cast<Uint32*>(pb.data) + y * pb.rowPitch;
         Uint32* data = static_cast<Uint32*>(pb.data) + y * pb.rowPitch;
 
 
-        for (Uint32 x = 0; x < ret->width; ++x)
+        for (int x = 0; x < ret->width; ++x)
         {
         {
             Uint32 clut = ret->pixels[y * ret->width * 4 + x * 4 + 3] | (ret->pixels[y * ret->width * 4 + x * 4 + 2] << 8) | (ret->pixels[y * ret->width * 4 + x * 4 + 1] << 16) | (ret->pixels[y * ret->width * 4 + x * 4 + 0] << 24);
             Uint32 clut = ret->pixels[y * ret->width * 4 + x * 4 + 3] | (ret->pixels[y * ret->width * 4 + x * 4 + 2] << 8) | (ret->pixels[y * ret->width * 4 + x * 4 + 1] << 16) | (ret->pixels[y * ret->width * 4 + x * 4 + 0] << 24);
             data[x] = clut;
             data[x] = clut;

+ 1 - 1
utilities/xeno_walkmesh_exporter/src/game/filetypes/LzsFile.cpp

@@ -63,7 +63,7 @@ LzsFile::ExtractLzs(void)
 
 
 
 
 
 
-    int input_offset = 4;
+    u32 input_offset = 4;
     int output_offset = 0;
     int output_offset = 0;
     u8 control_byte = 0;
     u8 control_byte = 0;
     u8 control_bit = 0;
     u8 control_bit = 0;

+ 2 - 2
utilities/xeno_walkmesh_exporter/src/game/filetypes/TimFile.cpp

@@ -71,7 +71,7 @@ TimFile::GetSurface(const u32& clutNumber)
             {
             {
                 u16 real_x = mImageVramPositionX + x;
                 u16 real_x = mImageVramPositionX + x;
                 u16 real_y = mImageVramPositionY + y;
                 u16 real_y = mImageVramPositionY + y;
-                u16 clut_y = clutNumber + mClutVramPositionY;
+                u16 clut_y = static_cast<u16>(clutNumber + mClutVramPositionY);
 
 
                 u8 data = mVram.GetU8(real_x, real_y) & 0x0F;
                 u8 data = mVram.GetU8(real_x, real_y) & 0x0F;
                 u16 col = mVram.GetU16(data * 2 + mClutVramPositionX, clut_y);
                 u16 col = mVram.GetU16(data * 2 + mClutVramPositionX, clut_y);
@@ -141,7 +141,7 @@ TimFile::GetSurface(const u32& clutNumber)
             {
             {
                 u16 real_x = mImageVramPositionX + x;
                 u16 real_x = mImageVramPositionX + x;
                 u16 real_y = mImageVramPositionY + y;
                 u16 real_y = mImageVramPositionY + y;
-                u16 clut_y = clutNumber + mClutVramPositionY;
+                u16 clut_y = static_cast<u16>(clutNumber + mClutVramPositionY);
 
 
                 u8 data = mVram.GetU8(real_x, real_y);
                 u8 data = mVram.GetU8(real_x, real_y);
                 u16 col = mVram.GetU16(data * 2 + mClutVramPositionX, clut_y);
                 u16 col = mVram.GetU16(data * 2 + mClutVramPositionX, clut_y);