annotate src/ljpc.h @ 0:c84446dfb3f5

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