1 //=============================================================================
2 //
3 // Adventure Game Studio (AGS)
4 //
5 // Copyright (C) 1999-2011 Chris Jones and 2011-20xx others
6 // The full list of copyright holders can be found in the Copyright.txt
7 // file, which is part of this source code distribution.
8 //
9 // The AGS source code is provided under the Artistic License 2.0.
10 // A copy of this license can be found in the file License.txt and at
11 // http://www.opensource.org/licenses/artistic-license-2.0.php
12 //
13 //=============================================================================
14 //
15 //
16 //
17 //=============================================================================
18 #ifndef __AGS_CN_AC__GAMESTRUCTDEFINES_H
19 #define __AGS_CN_AC__GAMESTRUCTDEFINES_H
20 
21 #include "util/geometry.h"
22 
23 #define PAL_GAMEWIDE        0
24 #define PAL_LOCKED          1
25 #define PAL_BACKGROUND      2
26 #define MAXGLOBALMES        500
27 #define MAXLANGUAGE         5
28 #define MAX_FONTS           30
29 #define OPT_DEBUGMODE       0
30 #define OPT_SCORESOUND      1
31 #define OPT_WALKONLOOK      2
32 #define OPT_DIALOGIFACE     3
33 #define OPT_ANTIGLIDE       4
34 #define OPT_TWCUSTOM        5
35 #define OPT_DIALOGGAP       6
36 #define OPT_NOSKIPTEXT      7
37 #define OPT_DISABLEOFF      8
38 #define OPT_ALWAYSSPCH      9
39 #define OPT_SPEECHTYPE      10
40 #define OPT_PIXPERFECT      11
41 #define OPT_NOWALKMODE      12
42 #define OPT_LETTERBOX       13
43 #define OPT_FIXEDINVCURSOR  14
44 #define OPT_NOLOSEINV       15
45 #define OPT_NOSCALEFNT      16
46 #define OPT_SPLITRESOURCES  17
47 #define OPT_ROTATECHARS     18
48 #define OPT_FADETYPE        19
49 #define OPT_HANDLEINVCLICKS 20
50 #define OPT_MOUSEWHEEL      21
51 #define OPT_DIALOGNUMBERED  22
52 #define OPT_DIALOGUPWARDS   23
53 #define OPT_CROSSFADEMUSIC  24
54 #define OPT_ANTIALIASFONTS  25
55 #define OPT_THOUGHTGUI      26
56 #define OPT_TURNTOFACELOC   27
57 #define OPT_RIGHTLEFTWRITE  28  // right-to-left text writing
58 #define OPT_DUPLICATEINV    29  // if they have 2 of the item, draw it twice
59 #define OPT_SAVESCREENSHOT  30
60 #define OPT_PORTRAITSIDE    31
61 #define OPT_STRICTSCRIPTING 32  // don't allow MoveCharacter-style commands
62 #define OPT_LEFTTORIGHTEVAL 33  // left-to-right operator evaluation
63 #define OPT_COMPRESSSPRITES 34
64 #define OPT_STRICTSTRINGS   35  // don't allow old-style strings
65 #define OPT_NEWGUIALPHA     36
66 #define OPT_RUNGAMEDLGOPTS  37
67 #define OPT_NATIVECOORDINATES 38
68 #define OPT_GLOBALTALKANIMSPD 39
69 #define OPT_HIGHESTOPTION_321 39
70 #define OPT_SPRITEALPHA     40
71 #define OPT_HIGHESTOPTION_330 OPT_SPRITEALPHA
72 #define OPT_SAFEFILEPATHS   41
73 #define OPT_HIGHESTOPTION_335 OPT_SAFEFILEPATHS
74 #define OPT_DIALOGOPTIONSAPI 42 // version of dialog options API (-1 for pre-3.4.0 API)
75 #define OPT_BASESCRIPTAPI   43 // version of the Script API used to compile game script
76 #define OPT_SCRIPTCOMPATLEV 44 // level of API compatibility used to compile game script
77 #define OPT_RENDERATSCREENRES 45 // use the legacy D3D scaling that scales sprites at the (final) screen resolution
78 #define OPT_HIGHESTOPTION   OPT_RENDERATSCREENRES
79 #define OPT_NOMODMUSIC      98
80 #define OPT_LIPSYNCTEXT     99
81 #define PORTRAIT_LEFT       0
82 #define PORTRAIT_RIGHT      1
83 #define PORTRAIT_ALTERNATE  2
84 #define PORTRAIT_XPOSITION  3
85 #define FADE_NORMAL         0
86 #define FADE_INSTANT        1
87 #define FADE_DISSOLVE       2
88 #define FADE_BOXOUT         3
89 #define FADE_CROSSFADE      4
90 #define FADE_LAST           4   // this should equal the last one
91 #define SPF_640x400         1
92 #define SPF_HICOLOR         2
93 #define SPF_DYNAMICALLOC    4
94 #define SPF_TRUECOLOR       8
95 #define SPF_ALPHACHANNEL 0x10
96 #define SPF_HADALPHACHANNEL 0x80  // the saved sprite on disk has one
97 //#define FFLG_NOSCALE        1
98 #define FFLG_SIZEMASK 0x003f
99 #define FONT_OUTLINE_AUTO -10
100 #define MAX_FONT_SIZE 63
101 #define DIALOG_OPTIONS_HIGHLIGHT_COLOR_DEFAULT  14 // Yellow
102 
103 #define MAXVIEWNAMELENGTH 15
104 #define MAXLIPSYNCFRAMES  20
105 #define MAX_GUID_LENGTH   40
106 #define MAX_SG_EXT_LENGTH 20
107 #define MAX_SG_FOLDER_LEN 50
108 
109 
110 enum GameResolutionType
111 {
112     kGameResolution_Undefined   = -1,
113     // definition of 320x200 in very old versions of the engine (somewhere pre-2.56)
114     kGameResolution_Default     = 0,
115     kGameResolution_320x200     = 1,
116     kGameResolution_320x240     = 2,
117     kGameResolution_640x400     = 3,
118     kGameResolution_640x480     = 4,
119     kGameResolution_800x600     = 5,
120     kGameResolution_1024x768    = 6,
121     kGameResolution_1280x720    = 7,
122     kGameResolution_Custom      = 8,
123     kNumGameResolutions,
124 
125     kGameResolution_LastLoRes   = kGameResolution_320x240,
126     kGameResolution_FirstHiRes  = kGameResolution_640x400
127 };
128 
IsHiRes(GameResolutionType resolution)129 inline bool IsHiRes(GameResolutionType resolution)
130 {
131     return resolution > kGameResolution_LastLoRes;
132 }
133 
134 Size ResolutionTypeToSize(GameResolutionType resolution, bool letterbox = false);
135 
136 // Automatic numbering of dialog options (OPT_DIALOGNUMBERED)
137 enum DialogOptionNumbering
138 {
139     kDlgOptNoNumbering = -1,
140     kDlgOptKeysOnly    =  0, // implicit key shortcuts
141     kDlgOptNumbering   =  1  // draw option indices and use key shortcuts
142 };
143 
144 // Version of the script api (OPT_BASESCRIPTAPI and OPT_SCRIPTCOMPATLEV).
145 // If the existing script function meaning had changed, that may be
146 // possible to find out which implementation to use by checking one of those
147 // two options.
148 // NOTE: please remember that those values are valid only for games made with
149 // 3.4.0 final and above.
150 enum ScriptAPIVersion
151 {
152     kScriptAPI_v321 = 0,
153     kScriptAPI_v330 = 1,
154     kScriptAPI_v334 = 2,
155     kScriptAPI_v335 = 3,
156     kScriptAPI_v340 = 4,
157     kScriptAPI_v341 = 5,
158     kScriptAPI_Current = kScriptAPI_v341
159 };
160 
161 // Determines whether the graphics renderer should scale sprites at the final
162 // screen resolution, as opposed to native resolution
163 enum RenderAtScreenRes
164 {
165     kRenderAtScreenRes_UserDefined  = 0,
166     kRenderAtScreenRes_Enabled      = 1,
167     kRenderAtScreenRes_Disabled     = 2,
168 };
169 
170 // Method to use when blending two sprites with alpha channel
171 enum GameSpriteAlphaRenderingStyle
172 {
173     kSpriteAlphaRender_Legacy = 0,
174     kSpriteAlphaRender_Proper
175 };
176 
177 // Method to use when blending two GUI elements with alpha channel
178 enum GameGuiAlphaRenderingStyle
179 {
180     kGuiAlphaRender_Legacy = 0,
181     kGuiAlphaRender_AdditiveAlpha,
182     kGuiAlphaRender_Proper
183 };
184 
185 #endif // __AGS_CN_AC__GAMESTRUCTDEFINES_H
186