diff --git a/src/menu.c b/src/menu.c
index 415b68db2cd5be0acaab2c6c7bee7175bd017ef9..bd225a4acace832a199389b15cec09d546973d9c 100644 (file)
--- a/src/menu.c
+++ b/src/menu.c
#include <stdlib.h>
#include "files.h"
#include "memory.h"
-#include "vga.h"
#include "error.h"
#include "keyb.h"
#include "sound.h"
#include "switch.h"
#include "menu.h"
#include "misc.h"
+#include "render.h"
+#include "config.h"
+#include "game.h"
+#include "player.h"
+#include "sound.h"
+#include "music.h"
#include <SDL.h>
#include <sys/stat.h>
-extern SDL_Surface *screen;
#define QSND_NUM 14
enum{HIT100,ARMOR,JUMP,WPNS,IMMORTAL,SPEED,OPEN,EXIT};
-extern int PL_JUMP,PL_RUN;
-extern byte _warp,cheat,p_fly;
-
-extern char g_music[8];
-
-extern byte savname[7][24],savok[7];
-void load_game(int);
+static byte panim[] = "BBDDAACCDDAABBDDAACCDDAABBDDAACCDDAAEEEEEFEFEFEFEFEFEFEFEFEFEEEEE";
+byte *panimp = panim;
+byte _warp;
-static byte panim[]=
- "BBDDAACCDDAABBDDAACCDDAABBDDAACCDDAAEEEEEFEFEFEFEFEFEFEFEFEFEEEEE";
-byte *panimp=panim;
-
-byte pcolortab[PCOLORN]={
- 0x18,0x20,0x40,0x58,0x60,0x70,0x80,0xB0,0xC0,0xD0
+byte pcolortab[PCOLORN] = {
+ 0x18, 0x20, 0x40, 0x58, 0x60, 0x70, 0x80, 0xB0, 0xC0, 0xD0
};
-int p1color=5,p2color=4;
+int p1color = 5;
+int p2color = 4;
char ibuf[24];
byte input=0;
static snd_t *voc=NULL;
static int voc_ch=0;
-void GMV_stop(void) {
+static void GMV_stop (void) {
if(voc) {
if(voc_ch) {S_stop(voc_ch);voc_ch=0;}
free(voc);voc=NULL;
}
}
-void GMV_say(char *nm) {
+void GMV_say (char *nm) {
int r,len;
snd_t *p;
byte *d;
voc_ch=S_play(voc,-1,1024,255);
}
-void G_code(void) {
+static void GM_set (menu_t *m) {
+ mnu=m;gm_redraw=1;
+ if(g_st==GS_GAME) {
+ //V_setrect(0,SCRW,0,SCRH);V_clr(0,SCRW,0,SCRH,0);//V_setrect(0,320,0,200);V_clr(0,320,0,200,0);
+ //if(_2pl) {V_setrect(SCRW-120,120,0,SCRH);w_o=0;Z_clrst();w_o=SCRH/2;Z_clrst();}//if(_2pl) {V_setrect(200,120,0,200);w_o=0;Z_clrst();w_o=100;Z_clrst();}
+ //else {V_setrect(SCRW-120,120,0,SCRH);w_o=0;Z_clrst();}//else {V_setrect(200,120,50,100);w_o=50;Z_clrst();}
+ //pl1.drawst=pl2.drawst=0xFF;V_setrect(0,SCRW,0,SCRH);//V_setrect(0,320,0,200);
+ }
+}
+
+void G_code (void) {
void *s;
s=csnd2;
if(memcmp(cbuf+32-5,"IDDQD",5)==0) {
Z_sound(s,128);
}
-void GM_set(menu_t *m) {
- mnu=m;gm_redraw=1;
- if(g_st==GS_GAME) {
- //V_setrect(0,SCRW,0,SCRH);V_clr(0,SCRW,0,SCRH,0);//V_setrect(0,320,0,200);V_clr(0,320,0,200,0);
- //if(_2pl) {V_setrect(SCRW-120,120,0,SCRH);w_o=0;Z_clrst();w_o=SCRH/2;Z_clrst();}//if(_2pl) {V_setrect(200,120,0,200);w_o=0;Z_clrst();w_o=100;Z_clrst();}
- //else {V_setrect(SCRW-120,120,0,SCRH);w_o=0;Z_clrst();}//else {V_setrect(200,120,50,100);w_o=50;Z_clrst();}
- //pl1.drawst=pl2.drawst=0xFF;V_setrect(0,SCRW,0,SCRH);//V_setrect(0,320,0,200);
- }
-}
-
-void setgamma(int);
-
-void GM_command(int c) {
+static void GM_command (int c) {
switch(c) {
case CANCEL:
GM_set(NULL);break;
case INTERP:
- fullscreen=!fullscreen;
- V_toggle();
+ R_toggle_fullscreen();
GM_set(mnu);
break;
case MUSIC:
S_volumemusic(mus_vol-8);break;
case MVOLP:
S_volumemusic(mus_vol+8);break;
- case GAMMAM: setgamma(gammaa-1);break;
- case GAMMAP: setgamma(gammaa+1);break;
+ case GAMMAM:
+ R_setgamma(R_getgamma() - 1);
+ break;
+ case GAMMAP:
+ R_setgamma(R_getgamma() + 1);
+ break;
}
}
-/*
-byte keychar[2][128]={{
- 0,0,'1','2','3','4','5','6','7','8','9','0','-','=',0,0,
- 'Q','W','E','R','T','Y','U','I','O','P','[',']','\r',0,'A','S',
- 'D','F','G','H','J','K','L',';','\'',0,0,'\\','Z','X','C','V',
- 'B','N','M',',','.','/',0,'*',0,' ',0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,'-',0,0,0,'+',0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-},{
- 0,0,'!','\"','#','$','%',':','&','*','(',')','_','+',0,0,
- 'x','x','x','x','x','x','x','x','x','x','x','x','\r',0,'x','x',
- 'x','x','x','x','x','x','x','x','x',0,0,0,'x','x','x','x',
- 'x','x','x','x','x','?',0,'*',0,' ',0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,'-',0,0,0,'+',0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
-}};
-*/
-
struct {
int keysym;
byte ch;
{0}
};
-byte get_keychar(int keysym)
-{
+static byte get_keychar (int keysym) {
int i = 0;
while (keychar[i].keysym) {
if (keychar[i].keysym == keysym) return keychar[i].ch;
return 0;
}
-extern vgapal main_pal,std_pal;
-extern byte shot_vga;
-
-static void shot(void) {
+static void shot (void) {
+/*
static int num=1;
char fn[100];//...
#ifndef WIN32
#endif
SDL_SaveBMP(screen, fn);
++num;
+*/
}
-int GM_act(void) {
+int GM_act (void) {
byte c;
if(mnu==&plcolor_mnu) {
return((mnu)?1:0);
}
-void G_keyf(int k, int press) {
+static void G_keyf (int k, int press) {
int i;
lastkey=k;
}
}
-void GM_init(void) {
+void GM_init (void) {
#ifndef DEMO
int i;
static char nm[QSND_NUM][6]={