Subversion Repositories plumbers

Rev

Rev 12 | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. /*
  2.  * Plumbers Don't Wear Ties - Structure of GAME.BIN
  3.  * Copyright 2017 - 2020 Daniel Marschall, ViaThinkSoft
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *     http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17.  
  18. #ifndef PLUMBERS_GAMESTRUCT_HEADER
  19. #define PLUMBERS_GAMESTRUCT_HEADER
  20.  
  21. #include <stdint.h>
  22.  
  23. #define SCENEID_PREVDECISION 32767
  24. #define SCENEID_ENDGAME      -1
  25.  
  26. #define SEGMENT_BEGINNING 0
  27. #define SEGMENT_DECISION  1
  28.  
  29. #pragma pack(push, 1)
  30.  
  31. struct _coord {
  32.         int16_t     x;
  33.         int16_t     y;
  34. };
  35.  
  36. struct _actionDef {
  37.         int32_t     scoreDelta;
  38.         int16_t     nextSceneID;       // will jump to the scene with the name "SCxx", where xx stands for nextSceneID (2 digits at least)
  39.                                        // SCENEID_PREVDECISION (0x7FFF) = end game
  40.                                        // SCENEID_ENDGAME (0xFFFF)      = go back to the last decision
  41.         int16_t     sceneSegment;      // SEGMENT_BEGINNING (0) = start scene from beginning
  42.                                        // SEGMENT_DECISION (1)  = go to decision page
  43.         _coord      cHotspotTopLeft;
  44.         _coord      cHotspotBottomRight;
  45. };
  46.  
  47. struct _sceneDef {
  48.         int16_t     numPics;
  49.         int16_t     pictureIndex;
  50.         int16_t     numActions;
  51.         char        szSceneFolder[14]; // Foldername *must* be "SCxx" (case sensitive) where xx stands for a 2 digit ID
  52.         char        szDialogWav[14];
  53.         char        szDecisionBmp[14];
  54.         _actionDef  actions[3];
  55. };
  56.  
  57. struct _pictureDef {
  58.         int16_t     duration;          // deciseconds
  59.         char        szBitmapFile[14];
  60. };
  61.  
  62. struct _gameBinFile {
  63.         int16_t     unknown1[7];
  64.         int16_t     numScenes;
  65.         int16_t     numPics;
  66.         int16_t     unknown2[2];
  67.         _sceneDef   scenes[100];       // Scenes start at file position 0x0016
  68.         _pictureDef pictures[2000];    // Pictures start at file position 0x2596
  69. };
  70.  
  71. #pragma pack(pop)
  72.  
  73. #endif // PLUMBERS_GAMESTRUCT_HEADER
  74.