Subversion Repositories plumbers

Rev

Rev 12 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12 Rev 25
-
 
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
 
1
#ifndef PLUMBERS_GAMESTRUCT_HEADER
18
#ifndef PLUMBERS_GAMESTRUCT_HEADER
2
#define PLUMBERS_GAMESTRUCT_HEADER
19
#define PLUMBERS_GAMESTRUCT_HEADER
3
 
20
 
4
#include <stdint.h>
21
#include <stdint.h>
5
 
22
 
6
#define SCENEID_PREVDECISION 32767
23
#define SCENEID_PREVDECISION 32767
7
#define SCENEID_ENDGAME      -1
24
#define SCENEID_ENDGAME      -1
8
 
25
 
9
#define SEGMENT_BEGINNING 0
26
#define SEGMENT_BEGINNING 0
10
#define SEGMENT_DECISION  1
27
#define SEGMENT_DECISION  1
11
 
28
 
12
#pragma pack(push, 1)
29
#pragma pack(push, 1)
13
 
30
 
14
struct _coord {
31
struct _coord {
15
        int16_t     x;
32
        int16_t     x;
16
        int16_t     y;
33
        int16_t     y;
17
};
34
};
18
 
35
 
19
struct _actionDef {
36
struct _actionDef {
20
        int32_t     scoreDelta;
37
        int32_t     scoreDelta;
21
        int16_t     nextSceneID;       // will jump to the scene with the name "SCxx", where xx stands for nextSceneID (2 digits at least)
38
        int16_t     nextSceneID;       // will jump to the scene with the name "SCxx", where xx stands for nextSceneID (2 digits at least)
22
                                       // 7FFF (32767) = end game
39
                                       // SCENEID_PREVDECISION (0x7FFF) = end game
23
                                       // FFFF (   -1) = go back to the last decision
40
                                       // SCENEID_ENDGAME (0xFFFF)      = go back to the last decision
24
        int16_t     sceneSegment;      // 0 = scene from beginning, 1 = decision page
41
        int16_t     sceneSegment;      // SEGMENT_BEGINNING (0) = start scene from beginning
-
 
42
                                       // SEGMENT_DECISION (1)  = go to decision page
25
        _coord      cHotspotTopLeft;
43
        _coord      cHotspotTopLeft;
26
        _coord      cHotspotBottomRigh;
44
        _coord      cHotspotBottomRight;
27
};
45
};
28
 
46
 
29
struct _sceneDef {
47
struct _sceneDef {
30
        int16_t     numPics;
48
        int16_t     numPics;
31
        int16_t     pictureIndex;
49
        int16_t     pictureIndex;
32
        int16_t     numActions;
50
        int16_t     numActions;
33
        char        szSceneFolder[14]; // Foldername *must* be "SCxx" (case sensitive) where xx stands for a 2 digit ID
51
        char        szSceneFolder[14]; // Foldername *must* be "SCxx" (case sensitive) where xx stands for a 2 digit ID
34
        char        szDialogWav[14];
52
        char        szDialogWav[14];
35
        char        szDecisionBmp[14];
53
        char        szDecisionBmp[14];
36
        _actionDef  actions[3];
54
        _actionDef  actions[3];
37
};
55
};
38
 
56
 
39
struct _pictureDef {
57
struct _pictureDef {
40
        int16_t     duration;          // deciseconds
58
        int16_t     duration;          // deciseconds
41
        char        szBitmapFile[14];
59
        char        szBitmapFile[14];
42
};
60
};
43
 
61
 
44
struct _gameBinFile {
62
struct _gameBinFile {
45
        int16_t     unknown1[7];
63
        int16_t     unknown1[7];
46
        int16_t     numScenes;
64
        int16_t     numScenes;
47
        int16_t     numPics;
65
        int16_t     numPics;
48
        int16_t     unknown2[2];
66
        int16_t     unknown2[2];
49
        _sceneDef   scenes[100];       // Scenes start at file position 0x0016
67
        _sceneDef   scenes[100];       // Scenes start at file position 0x0016
50
        _pictureDef pictures[2000];    // Pictures start at file position 0x2596
68
        _pictureDef pictures[2000];    // Pictures start at file position 0x2596
51
};
69
};
52
 
70
 
53
#pragma pack(pop)
71
#pragma pack(pop)
54
 
72
 
55
#endif // PLUMBERS_GAMESTRUCT_HEADER
73
#endif // PLUMBERS_GAMESTRUCT_HEADER
56
 
74