rnd-20100624-3-src
[rocksndiamonds.git] / src / game_sp / main_sp.h
1 #ifndef MAIN_SP_H
2 #define MAIN_SP_H
3
4 /* ========================================================================= */
5 /* external functions and definitions imported from main program to game_sp  */
6 /* ========================================================================= */
7
8 #include "../engines.h"
9 #include "../conf_gfx.h"
10
11
12 /* ========================================================================= */
13 /* functions and definitions that are exported from game_sp to main program  */
14 /* ========================================================================= */
15
16 #include "export.h"
17
18
19 /* ========================================================================= */
20 /* internal functions and definitions that are not exported to main program  */
21 /* ========================================================================= */
22
23
24 /* ------------------------------------------------------------------------- */
25 /* constant definitions                                                      */
26 /* ------------------------------------------------------------------------- */
27
28 /* screen sizes and positions for SP engine */
29
30 #define NEW_TILESIZE            1
31
32 #define ORIG_TILESIZE           16
33
34 #if NEW_TILESIZE
35 #define ZOOM_FACTOR             (2 * TILESIZE_VAR / TILESIZE)
36 #else
37 #define ZOOM_FACTOR             2
38 #endif
39
40 #if NEW_TILESIZE
41 extern int                      TILESIZE_VAR;
42 #define TILESIZE                32
43 #define TILEX                   TILESIZE
44 #define TILEY                   TILESIZE
45 #define TILEX_VAR               TILESIZE_VAR
46 #define TILEY_VAR               TILESIZE_VAR
47 #else
48 #define TILESIZE                (ORIG_TILESIZE * ZOOM_FACTOR)
49 #define TILEX                   TILESIZE
50 #define TILEY                   TILESIZE
51 #endif
52
53 #define ORIG_SCR_MENUX          20
54 #define ORIG_SCR_MENUY          12
55 #define SCR_MENUX               17
56 #define SCR_MENUY               12
57 #if 1
58 extern int                      SCR_FIELDX, SCR_FIELDY;
59 #else
60 #define SCR_FIELDX              17
61 #define SCR_FIELDY              17
62 #endif
63 #define MAX_BUF_XSIZE           (2 + SCR_FIELDX + 2)
64 #define MAX_BUF_YSIZE           (2 + SCR_FIELDY + 2)
65
66 /* often used screen positions */
67 #if 1
68 extern int                      SX, SY;
69 #else
70 #define SX                      8
71 #define SY                      8
72 #endif
73
74 #if NEW_TILESIZE
75 #define SXSIZE                  (SCR_FIELDX * TILEX_VAR)
76 #define SYSIZE                  (SCR_FIELDY * TILEY_VAR)
77 #define FXSIZE                  (MAX_BUF_XSIZE * TILEX_VAR)
78 #define FYSIZE                  (MAX_BUF_YSIZE * TILEY_VAR)
79 #else
80 #define SXSIZE                  (SCR_FIELDX * TILEX)
81 #define SYSIZE                  (SCR_FIELDY * TILEY)
82 #define FXSIZE                  (MAX_BUF_XSIZE * TILEX)
83 #define FYSIZE                  (MAX_BUF_YSIZE * TILEY)
84 #endif
85
86 #if 1
87 extern int                      REAL_SX, REAL_SY;
88 #else
89 #define REAL_SX                 (SX - 2)
90 #define REAL_SY                 (SY - 2)
91 #endif
92 #define FULL_SXSIZE             (2 + SXSIZE + 2)
93 #define FULL_SYSIZE             (2 + SYSIZE + 2)
94
95
96 /* ------------------------------------------------------------------------- */
97 /* data structure definitions                                                */
98 /* ------------------------------------------------------------------------- */
99
100 /* ------------------------------------------------------------------------- */
101 /* exported variables                                                        */
102 /* ------------------------------------------------------------------------- */
103
104 extern struct LevelInfo_SP native_sp_level;
105
106 extern Bitmap *bitmap_db_field_sp;
107
108 extern int GfxElementLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
109 extern int GfxGraphicLast[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
110 extern int GfxGraphic[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
111 extern int GfxFrame[SP_MAX_PLAYFIELD_WIDTH][SP_MAX_PLAYFIELD_HEIGHT];
112
113
114 /* ------------------------------------------------------------------------- */
115 /* exported functions                                                        */
116 /* ------------------------------------------------------------------------- */
117
118 #endif  /* MAIN_SP_H */