comparison src/ljpc.h @ 0:c84446dfb3f5

initial add
author paulo@localhost
date Fri, 13 Mar 2009 00:39:12 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:796af66129ff
1 /* Header for PC frontend for LOCKJAW, an implementation of the Soviet Mind Game
2
3 Copyright (C) 2006 Damian Yerrick <tepples+lj@spamcop.net>
4
5 This work is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 Original game concept and design by Alexey Pajitnov.
20 The Software is not sponsored or endorsed by Alexey Pajitnov, Elorg,
21 or The Tetris Company LLC.
22
23 */
24
25 #ifndef LJPC_H
26 #define LJPC_H
27 #include <allegro.h>
28 #include "ljmusic.h"
29 #include "ljplay.h"
30 #include "pcjoy.h"
31 #include "ljvorbis.h"
32 #include "options.h"
33
34 typedef struct LJPCSkin {
35 BITMAP *bg;
36 BITMAP *blocks;
37 BITMAP *connBlocks;
38 BITMAP *fullback;
39 unsigned short blkW, blkH;
40 unsigned short baseX, baseY;
41 unsigned short pfElev;
42 unsigned char transparentPF;
43 unsigned char nextPos;
44 unsigned char shiftScale;
45 LJMusic *bgm;
46 } LJPCSkin;
47
48 typedef struct LJPCView
49 {
50 BITMAP *back;
51 LJPCSkin *skin;
52 unsigned short baseX;
53 unsigned char nextAbove; // number of next pieces above shadow
54
55 // Platform-dependent sound
56 unsigned char b2bcd1, b2bcd2;
57
58 unsigned char wantRecord;
59 } LJPCView;
60
61 extern char skinName[PATH_MAX];
62 extern char ljblocksSRSName[PATH_MAX];
63 extern char ljblocksSegaName[PATH_MAX];
64 extern char ljconnSRSName[PATH_MAX];
65 extern char ljconnSegaName[PATH_MAX];
66 extern char ljbgName[PATH_MAX];
67 extern char bgmName[PATH_MAX];
68
69
70 #define N_GIMMICKS LJGM_N_GIMMICKS
71
72
73 enum {
74 LJNEXT_RIGHT = 0,
75 LJNEXT_RIGHT_TAPER,
76 LJNEXT_TOP,
77 LJNEXT_N_STYLES
78 };
79
80 /**
81 * The number of persistent preferences. Must match the number of
82 * fields in struct LJPrefsNamed.
83 */
84
85 /**
86 * Names of persistent preferences.
87 * Order must be exactly the same as in
88 * optionsMenu[] (options.c)
89 */
90 enum {
91 OPTIONS_NEXT_ABOVE = OPTIONS_MENU_LEN,
92 OPTIONS_TRAILS,
93 OPTIONS_AUTO_PAUSE,
94 OPTIONS_AUTO_RECORD,
95 OPTIONS_WINDOWED,
96 PC_OPTIONS_MENU_LEN
97 };
98 struct LJPrefs {
99 unsigned char number[PC_OPTIONS_MENU_LEN];
100 };
101
102
103 /* set by display mode */
104 extern int pfBgColor, pfFgColor, bgColor, fgColor, hiliteColor;
105 extern const FONT *aver32, *aver16;
106 extern volatile char redrawWholeScreen;
107 extern char autoPause;
108
109 void saveScreen(int n);
110 void ezPlaySample(const char *filename, int vol);
111 int parse_ini_line(const char *in, char *key, char *var, char *val);
112 int loadOptions(struct LJPrefs *prefs);
113 void saveOptions(const struct LJPrefs *prefs);
114 void options(LJView *v, unsigned char *prefs);
115 void unpackOptions(LJView *v, const struct LJPrefs *prefs);
116 void debrief(LJView *v);
117
118
119 #endif