Changes

Jump to navigation Jump to search
757 bytes added ,  10:00, 22 August 2022
consistent indenting by 4 spaces
Line 381: Line 381:  
  uint32 version
 
  uint32 version
 
  if version >= 5:
 
  if version >= 5:
    uint32 frames  // If version < 5 then frames = 1
+
    uint32 frames  // If version < 5 then frames = 1
 
  if version >= 2:
 
  if version >= 2:
    for each frame:
+
    for each frame:
      uint32 size
+
        uint32 size
      byte image[size]  // Image is JPEG/JFIF or WEBP/RIFF file format
+
        byte image[size]  // Image is JPEG/JFIF or WEBP/RIFF file format
      if version >= 3:
+
        if version >= 3:
          uint32 size
+
            uint32 size
          byte image[size]
+
            byte image[size]
      if version >= 6:
+
        if version >= 6:
          uint32 size
+
            uint32 size
          byte image[size]
+
            byte image[size]
    if size != 0:
+
    if size != 0:
      uint32 uncompressedSize
+
        uint32 uncompressedSize
      uint32 compressedSize
+
        uint32 compressedSize
      byte compressedData[compressedSize] // ZLIB compressed lightmap cache node
+
        byte compressedData[compressedSize] // ZLIB compressed lightmap cache node
    
'''03043040''' (skippable) ''"items"''
 
'''03043040''' (skippable) ''"items"''
Line 437: Line 437:  
  uint32 version
 
  uint32 version
 
  if version >= 2:
 
  if version >= 2:
  uint32 count (number of metadata records)
+
    uint32 count (number of metadata records)
  for each count:
+
    for each count:
    string varName
+
        string varName
    uint32 varType
+
        uint32 varType
    switch varType:
+
        switch varType:
      case EType_Boolean:
  −
        bool
  −
      case EType_Integer:
  −
        int32
  −
      case EType_Real:
  −
        float
  −
      case EType_Text:
  −
        string
  −
      case EType_Int2:
  −
        int32
  −
        int32
  −
      case EType_Int3:
  −
        int32
  −
        int32
  −
        int32
  −
      case EType_Vec2:
  −
        float
  −
        float
  −
      case EType_Vec3:
  −
        float
  −
        float
  −
        float
  −
      case EType_Array:
  −
        uint32 typeKey
  −
        uint32 typeValue
  −
        uint32 arrayElements
  −
        for each arrayElements
  −
          switch typeKey:
   
             case EType_Boolean:
 
             case EType_Boolean:
              bool
+
                bool
 
             case EType_Integer:
 
             case EType_Integer:
              int32
+
                int32
 
             case EType_Real:
 
             case EType_Real:
              float
+
                float
 
             case EType_Text:
 
             case EType_Text:
              string
+
                string
          switch typeValue:
  −
            case EType_Boolean:
  −
              bool
  −
            case EType_Integer:
  −
              int32
  −
            case EType_Real:
  −
              float
  −
            case EType_Text:
  −
              string
   
             case EType_Int2:
 
             case EType_Int2:
              int32
+
                int32
              int32
+
                int32
 
             case EType_Int3:
 
             case EType_Int3:
              int32
+
                int32
              int32
+
                int32
              int32
+
                int32
 
             case EType_Vec2:
 
             case EType_Vec2:
              float
+
                float
              float
+
                float
 
             case EType_Vec3:
 
             case EType_Vec3:
              float
+
                float
              float
+
                float
              float
+
                float
 
             case EType_Array:
 
             case EType_Array:
              recursively read multidimensional arrays
+
                uint32 typeKey
 +
                uint32 typeValue
 +
                uint32 arrayElements
 +
                for each arrayElements
 +
                    switch typeKey:
 +
                        case EType_Boolean:
 +
                            bool
 +
                        case EType_Integer:
 +
                            int32
 +
                        case EType_Real:
 +
                            float
 +
                        case EType_Text:
 +
                            string
 +
                    switch typeValue:
 +
                        case EType_Boolean:
 +
                            bool
 +
                        case EType_Integer:
 +
                            int32
 +
                        case EType_Real:
 +
                            float
 +
                        case EType_Text:
 +
                            string
 +
                        case EType_Int2:
 +
                            int32
 +
                            int32
 +
                        case EType_Int3:
 +
                            int32
 +
                            int32
 +
                            int32
 +
                        case EType_Vec2:
 +
                            float
 +
                            float
 +
                        case EType_Vec3:
 +
                            float
 +
                            float
 +
                            float
 +
                        case EType_Array:
 +
                            recursively read multidimensional arrays
    
The variable type is to be interpreted as follows:
 
The variable type is to be interpreted as follows:
 
  enum eScriptType
 
  enum eScriptType
 
  {
 
  {
  EType_Void = 0,
+
    EType_Void = 0,
  EType_Boolean,
+
    EType_Boolean,
  EType_Integer,
+
    EType_Integer,
  EType_Real,
+
    EType_Real,
  EType_Class,
+
    EType_Class,
  EType_Text,
+
    EType_Text,
  EType_Enum,
+
    EType_Enum,
  EType_Array,
+
    EType_Array,
  EType_ParamArray,
+
    EType_ParamArray,
  EType_Vec2,
+
    EType_Vec2,
  EType_Vec3,
+
    EType_Vec3,
  EType_Int3,
+
    EType_Int3,
  EType_Iso4,
+
    EType_Iso4,
  EType_Ident,
+
    EType_Ident,
  EType_Int2,
+
    EType_Int2,
  EType_Struct
+
    EType_Struct
 
  };
 
  };
 
Maniaplanet 4.1 has changed the way script types and values are written. The code now does the following:
 
Maniaplanet 4.1 has changed the way script types and values are written. The code now does the following:
Line 753: Line 753:  
  CGameWaypointSpecialProperty waypointSpecialProperty (-1 if not a waypoint, otherwise direct node)
 
  CGameWaypointSpecialProperty waypointSpecialProperty (-1 if not a waypoint, otherwise direct node)
 
  if version >= 4:
 
  if version >= 4:
  uint16 flags
+
    uint16 flags
  if version >= 5:
+
    if version >= 5:
    vec3 pivotPosition
+
        vec3 pivotPosition
    if version >= 6:
+
        if version >= 6:
      float scale
+
            float scale
      if version >= 8: // TM 2020
+
            if version >= 8: // TM 2020
        vec3
+
                vec3
        vec3
+
                vec3
    
===CGameCtnReplayRecord (03 093 000)===
 
===CGameCtnReplayRecord (03 093 000)===

Navigation menu