Mercurial > hg > index.fcgi > lj > lj046
diff src/ljpc.h @ 0:c84446dfb3f5
initial add
author | paulo@localhost |
---|---|
date | Fri, 13 Mar 2009 00:39:12 -0700 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/src/ljpc.h Fri Mar 13 00:39:12 2009 -0700 1.3 @@ -0,0 +1,119 @@ 1.4 +/* Header for PC frontend for LOCKJAW, an implementation of the Soviet Mind Game 1.5 + 1.6 +Copyright (C) 2006 Damian Yerrick <tepples+lj@spamcop.net> 1.7 + 1.8 +This work is free software; you can redistribute it and/or modify 1.9 +it under the terms of the GNU General Public License as published by 1.10 +the Free Software Foundation; either version 2 of the License, or 1.11 +(at your option) any later version. 1.12 + 1.13 +This program is distributed in the hope that it will be useful, 1.14 +but WITHOUT ANY WARRANTY; without even the implied warranty of 1.15 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1.16 +GNU General Public License for more details. 1.17 + 1.18 +You should have received a copy of the GNU General Public License 1.19 +along with this program; if not, write to the Free Software 1.20 +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 1.21 + 1.22 +Original game concept and design by Alexey Pajitnov. 1.23 +The Software is not sponsored or endorsed by Alexey Pajitnov, Elorg, 1.24 +or The Tetris Company LLC. 1.25 + 1.26 +*/ 1.27 + 1.28 +#ifndef LJPC_H 1.29 +#define LJPC_H 1.30 +#include <allegro.h> 1.31 +#include "ljmusic.h" 1.32 +#include "ljplay.h" 1.33 +#include "pcjoy.h" 1.34 +#include "ljvorbis.h" 1.35 +#include "options.h" 1.36 + 1.37 +typedef struct LJPCSkin { 1.38 + BITMAP *bg; 1.39 + BITMAP *blocks; 1.40 + BITMAP *connBlocks; 1.41 + BITMAP *fullback; 1.42 + unsigned short blkW, blkH; 1.43 + unsigned short baseX, baseY; 1.44 + unsigned short pfElev; 1.45 + unsigned char transparentPF; 1.46 + unsigned char nextPos; 1.47 + unsigned char shiftScale; 1.48 + LJMusic *bgm; 1.49 +} LJPCSkin; 1.50 + 1.51 +typedef struct LJPCView 1.52 +{ 1.53 + BITMAP *back; 1.54 + LJPCSkin *skin; 1.55 + unsigned short baseX; 1.56 + unsigned char nextAbove; // number of next pieces above shadow 1.57 + 1.58 + // Platform-dependent sound 1.59 + unsigned char b2bcd1, b2bcd2; 1.60 + 1.61 + unsigned char wantRecord; 1.62 +} LJPCView; 1.63 + 1.64 +extern char skinName[PATH_MAX]; 1.65 +extern char ljblocksSRSName[PATH_MAX]; 1.66 +extern char ljblocksSegaName[PATH_MAX]; 1.67 +extern char ljconnSRSName[PATH_MAX]; 1.68 +extern char ljconnSegaName[PATH_MAX]; 1.69 +extern char ljbgName[PATH_MAX]; 1.70 +extern char bgmName[PATH_MAX]; 1.71 + 1.72 + 1.73 +#define N_GIMMICKS LJGM_N_GIMMICKS 1.74 + 1.75 + 1.76 +enum { 1.77 + LJNEXT_RIGHT = 0, 1.78 + LJNEXT_RIGHT_TAPER, 1.79 + LJNEXT_TOP, 1.80 + LJNEXT_N_STYLES 1.81 +}; 1.82 + 1.83 +/** 1.84 + * The number of persistent preferences. Must match the number of 1.85 + * fields in struct LJPrefsNamed. 1.86 + */ 1.87 + 1.88 +/** 1.89 + * Names of persistent preferences. 1.90 + * Order must be exactly the same as in 1.91 + * optionsMenu[] (options.c) 1.92 + */ 1.93 +enum { 1.94 + OPTIONS_NEXT_ABOVE = OPTIONS_MENU_LEN, 1.95 + OPTIONS_TRAILS, 1.96 + OPTIONS_AUTO_PAUSE, 1.97 + OPTIONS_AUTO_RECORD, 1.98 + OPTIONS_WINDOWED, 1.99 + PC_OPTIONS_MENU_LEN 1.100 +}; 1.101 +struct LJPrefs { 1.102 + unsigned char number[PC_OPTIONS_MENU_LEN]; 1.103 +}; 1.104 + 1.105 + 1.106 +/* set by display mode */ 1.107 +extern int pfBgColor, pfFgColor, bgColor, fgColor, hiliteColor; 1.108 +extern const FONT *aver32, *aver16; 1.109 +extern volatile char redrawWholeScreen; 1.110 +extern char autoPause; 1.111 + 1.112 +void saveScreen(int n); 1.113 +void ezPlaySample(const char *filename, int vol); 1.114 +int parse_ini_line(const char *in, char *key, char *var, char *val); 1.115 +int loadOptions(struct LJPrefs *prefs); 1.116 +void saveOptions(const struct LJPrefs *prefs); 1.117 +void options(LJView *v, unsigned char *prefs); 1.118 +void unpackOptions(LJView *v, const struct LJPrefs *prefs); 1.119 +void debrief(LJView *v); 1.120 + 1.121 + 1.122 +#endif