소스 검색

Renaming some SpriteData (aka Tile) attributes. Using src2 attribute when data_page2 != 0

myst6re 11 년 전
부모
커밋
efe48ad7df

+ 11 - 8
QGearsMain/include/data/QGearsBackgroundFile.h

@@ -63,19 +63,22 @@ namespace QGears
         struct SpriteData
         {
             Pixel dst;
-            uint16 unknown_04[2];
+            uint16 unknown_04[2]; // Unused
             Pixel src;
-            uint16 unknown_0C[4];
+            Pixel src2; // used for special effects pages, when data_page2 != 0, it must be used instead of src
+            uint16 width; // Do not use
+            uint16 height; // Do not use
 
             uint16 palette_page;
-            uint16 depth;
-            uint8  flags_18[2];
-            bool   flags_20[2];
-            uint16 unknown_1C; // maybe some 'mode'
+            uint16 depth; // <=> Z
+            uint8  animation_id;
+            uint8  animation_frame;
+            bool   has_blending[2];
+            uint16 blending;
             uint16 data_page;
             uint16 data_page2; // used for special effects pages, when data_page2 != 0, it must be used instead of data_page
-            uint16 colourDepth;
-            Ogre::Vector3 unknown_24;
+            uint16 colour_depth; // Use texture page depth instead
+            Ogre::Vector3 src_big; // For PC use (z = unknown, x = srcX / 16 * 625000, y = srcY / 16 * 625000)
         };
 
 

+ 1 - 1
QGearsMain/include/data/QGearsBackgroundFileSerializer.h

@@ -95,7 +95,7 @@ namespace QGears
         static const String     SECTION_NAME_BACK;
         static const String     SECTION_NAME_TEXTURE;
         static const String     TAG_FILE_END;
-        static const Ogre::Real unknown_24_SCALE;
+        static const Ogre::Real src_big_SCALE;
 
     private:
         Header  m_header;

+ 17 - 11
QGearsMain/src/data/QGearsBackgroundFileSerializer.cpp

@@ -37,7 +37,7 @@ namespace QGears
     const String        BackgroundFileSerializer::SECTION_NAME_BACK   ("BACK");
     const String        BackgroundFileSerializer::SECTION_NAME_TEXTURE("TEXTURE");
     const String        BackgroundFileSerializer::TAG_FILE_END        ("END");
-    const Ogre::Real    BackgroundFileSerializer::unknown_24_SCALE( 10000000.0 );
+    const Ogre::Real    BackgroundFileSerializer::src_big_SCALE( 10000000.0 );
 
     //---------------------------------------------------------------------
     BackgroundFileSerializer::BackgroundFileSerializer() :
@@ -160,28 +160,34 @@ namespace QGears
         readObject( stream, pDest.dst );
         readShorts( stream, pDest.unknown_04, 2 );
         readObject( stream, pDest.src );
-        readShorts( stream, pDest.unknown_0C, 4 );
+        readObject( stream, pDest.src2 );
+        readShort( stream, pDest.width );
+        readShort( stream, pDest.height );
 
         readShort( stream, pDest.palette_page );
         readShort( stream, pDest.depth );
 
-        stream->read( pDest.flags_18, sizeof( pDest.flags_18 ) );
-        uint8 flags[2];
-        stream->read( flags, sizeof( flags ) );
-        pDest.flags_20[0] = flags[0] > 0;
-        pDest.flags_20[1] = flags[1] > 0;
+        uint8 animation[2];
+        stream->read( animation, sizeof( animation ) );
+        pDest.animation_id = animation[0];
+        pDest.animation_frame = animation[1];
+        uint8 has_blending[2];
+        stream->read( has_blending, sizeof( has_blending ) );
+        pDest.has_blending[0] = has_blending[0] > 0;
+        pDest.has_blending[1] = has_blending[1] > 0;
 
-        readShort( stream, pDest.unknown_1C );
+        readShort( stream, pDest.blending );
         readShort( stream, pDest.data_page );
         readShort( stream, pDest.data_page2 );
         // when data_page2 != 0, it must be used instead of data_page
         if ( pDest.data_page2 )
         {
+            pDest.src = pDest.src2;
             pDest.data_page = pDest.data_page2;
         }
-        readShort( stream, pDest.colourDepth );
-        readObject( stream, pDest.unknown_24 );
-        pDest.unknown_24 /= unknown_24_SCALE;
+        readShort( stream, pDest.colour_depth );
+        readObject( stream, pDest.src_big );
+        pDest.src_big /= src_big_SCALE;
         stream->skip( 2 * 2 ); // 2 * uint16 unused
     }