A few minor tweaks to the voting system and some more fixes for building without Polymost

git-svn-id: https://svn.eduke32.com/eduke32@188 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-06-09 01:28:39 +00:00
parent 62b15f204f
commit cc7e9897ed
3 changed files with 31 additions and 10 deletions

View file

@ -85,9 +85,16 @@ int32 JoystickAnalogueSaturate[MAXJOYAXES];
// //
int32 ScreenMode = 1; int32 ScreenMode = 1;
#if defined(POLYMOST) && defined(USE_OPENGL)
int32 ScreenWidth = 1024; int32 ScreenWidth = 1024;
int32 ScreenHeight = 768; int32 ScreenHeight = 768;
int32 ScreenBPP = 32; int32 ScreenBPP = 32;
#else
int32 ScreenWidth = 800;
int32 ScreenHeight = 600;
int32 ScreenBPP = 8;
#endif
static char setupfilename[256]={SETUPFILENAME}; static char setupfilename[256]={SETUPFILENAME};
int32 scripthandle = -1; int32 scripthandle = -1;
@ -595,8 +602,10 @@ void CONFIG_ReadSetup( void )
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size); SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenSize",&ud.screen_size);
SCRIPT_GetNumber( scripthandle, "Screen Setup", "Out",&ud.lockout); SCRIPT_GetNumber( scripthandle, "Screen Setup", "Out",&ud.lockout);
#if defined(POLYMOST) && defined(USE_OPENGL)
SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenBPP", &ScreenBPP); SCRIPT_GetNumber( scripthandle, "Screen Setup", "ScreenBPP", &ScreenBPP);
if (ScreenBPP < 8) ScreenBPP = 32; if (ScreenBPP < 8) ScreenBPP = 32;
#endif
#ifdef RENDERTYPEWIN #ifdef RENDERTYPEWIN
SCRIPT_GetNumber( scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq); SCRIPT_GetNumber( scripthandle, "Screen Setup", "MaxRefreshFreq", (int32*)&maxrefreshfreq);

View file

@ -7117,8 +7117,6 @@ void nonsharedkeys(void)
if(gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) if(gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex)
{ {
gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2);
if(KB_KeyPressed(sc_F1) || KB_KeyPressed(sc_F2) || ud.autovote) if(KB_KeyPressed(sc_F1) || KB_KeyPressed(sc_F2) || ud.autovote)
{ {
tempbuf[0] = 18; tempbuf[0] = 18;
@ -7163,7 +7161,7 @@ void nonsharedkeys(void)
CONTROL_ClearButton( gamefunc_Shrink_Screen ); CONTROL_ClearButton( gamefunc_Shrink_Screen );
if(ud.screen_size < 64) sound(THUD); if(ud.screen_size < 64) sound(THUD);
if(ud.screen_size == 4 && ud.statusbarscale == 100 && ud.statusbarmode == 1) if(ud.screen_size == 4 && ud.statusbarscale == 100 && ud.statusbarmode == 1)
ud.statusbarmode == 0; ud.statusbarmode = 0;
if(ud.screen_size == 8 && ud.statusbarmode == 1 && bpp > 8) if(ud.screen_size == 8 && ud.statusbarmode == 1 && bpp > 8)
ud.statusbarmode = 0; ud.statusbarmode = 0;
else ud.screen_size += 4; else ud.screen_size += 4;
@ -8933,16 +8931,21 @@ void app_main(int argc,char **argv)
int xres[] = {800,640,320}; int xres[] = {800,640,320};
int yres[] = {600,480,240}; int yres[] = {600,480,240};
int bpp[] = {32,16,8}; int bpp[] = {32,16,8};
initprintf("Failure setting video mode %dx%dx%d %s! Attempting safer mode...\n", initprintf("Failure setting video mode %dx%dx%d %s! Attempting safer mode...\n",
ScreenWidth,ScreenHeight,ScreenBPP,ScreenMode?"fullscreen":"windowed"); ScreenWidth,ScreenHeight,ScreenBPP,ScreenMode?"fullscreen":"windowed");
/* ScreenMode = 0; // JBF: was 2
ScreenWidth = 800; #if defined(POLYMOST) && defined(USE_OPENGL)
ScreenHeight = 600; // JBF: was 200
ScreenBPP = 32; */
while(setgamemode(0,xres[i],yres[i],bpp[i]) < 0) { while(setgamemode(0,xres[i],yres[i],bpp[i]) < 0) {
initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],bpp[i]); initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],bpp[i]);
i++; i++;
} }
#else
while(setgamemode(0,xres[i],yres[i],8) < 0) {
initprintf("Failure setting video mode %dx%dx%d windowed! Attempting safer mode...\n",xres[i],yres[i],8);
i++;
}
#endif
ScreenWidth = xres[i]; ScreenWidth = xres[i];
ScreenHeight = yres[i]; ScreenHeight = yres[i];
ScreenBPP = bpp[i]; ScreenBPP = bpp[i];
@ -9117,6 +9120,9 @@ MAIN_LOOP_RESTART:
displayrooms(screenpeek,i); displayrooms(screenpeek,i);
displayrest(i); displayrest(i);
if(gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex)
gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16);
// if( KB_KeyPressed(sc_F) ) // if( KB_KeyPressed(sc_F) )
// { // {
// KB_ClearKeyDown(sc_F); // KB_ClearKeyDown(sc_F);
@ -9464,6 +9470,9 @@ RECHECK:
if(ud.multimode > 1 && ps[myconnectindex].gm ) if(ud.multimode > 1 && ps[myconnectindex].gm )
getpackets(); getpackets();
if(gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex)
gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16);
} }
if( (ps[myconnectindex].gm&MODE_MENU) && (ps[myconnectindex].gm&MODE_EOL) ) if( (ps[myconnectindex].gm&MODE_MENU) && (ps[myconnectindex].gm&MODE_EOL) )

View file

@ -3995,8 +3995,11 @@ VOLUME_ALL_40x:
x = probe(186,124,0,0); x = probe(186,124,0,0);
if(voting != myconnectindex)
ps[myconnectindex].gm &= ~MODE_MENU;
if (x == -1) { if (x == -1) {
if(voting != -1) if(voting == myconnectindex)
{ {
Bmemset(votes,0,sizeof(votes)); Bmemset(votes,0,sizeof(votes));
Bmemset(gotvote,0,sizeof(gotvote)); Bmemset(gotvote,0,sizeof(gotvote));
@ -4058,7 +4061,7 @@ VOLUME_ALL_40x:
if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master
} }
if(voting != -1) if(voting == myconnectindex)
adduserquote("VOTE SUCCEEDED"); adduserquote("VOTE SUCCEEDED");
newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1); newgame(ud.m_volume_number,ud.m_level_number,ud.m_player_skill+1);