diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index 2300cab64..1ed2b819d 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -551,7 +551,7 @@ void editinput(void) ld = ldiv((long)(mousy), (1<<16)); mousy = ld.quot; mouseysurp = ld.rem; } - if (mlook == 1) + if (mlook) { ang += (mousx>>1)*msens; horiz -= (mousy>>2)*msens; @@ -564,8 +564,11 @@ void editinput(void) horiz = 299; if (horiz < -99) horiz = -99; - searchx = xdim>>1; - searchy = ydim>>1; + if (mlook == 1) + { + searchx = xdim>>1; + searchy = ydim>>1; + } osearchx = searchx-mousx; osearchy = searchy-mousy; } diff --git a/polymer/eduke32/source/_functio.h b/polymer/eduke32/source/_functio.h index 017ee770c..292c846ea 100644 --- a/polymer/eduke32/source/_functio.h +++ b/polymer/eduke32/source/_functio.h @@ -92,7 +92,7 @@ char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = "Show_Console" }; -char defaultgamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = +const char defaultgamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = { "Move_Forward", "Move_Backward", @@ -210,7 +210,7 @@ char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] = "Show_Console", "`", "" }; -static char oldkeydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] = +const char oldkeydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] = { "Move_Forward", "Up", "Kpad8", "Move_Backward", "Down", "Kpad2", diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 701c9c76b..9bfb61dc7 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -2237,87 +2237,14 @@ static void Keys3d(void) smooshyalign = keystatus[0x4c]; repeatpanalign = (keystatus[0x2a]|keystatus[0x36]|(bstatus&2)); + if (mlook == 2) + mlook = 0; + if (bstatus&4) { if (bstatus&1) { - searchit = 0; - if (searchx != osearchx) - { - if ((repeatcountx == 0) || (repeatcountx > 16)) - { - changedir = 0; - if (osearchx > searchx) changedir = -1; - if (searchx > osearchx) changedir = 1; - - if ((searchstat == 0) || (searchstat == 4)) - { - if (!(wall[searchwall].cstat&8)) changedir = -changedir; - if (repeatpanalign == 0) - wall[searchwall].xrepeat = changechar(wall[searchwall].xrepeat,changedir,smooshyalign,1); - else - wall[searchwall].xpanning = changechar(wall[searchwall].xpanning,changedir,smooshyalign,0); - } - if ((searchstat == 1) || (searchstat == 2)) - { - if (searchstat == 1) - sector[searchsector].ceilingxpanning = changechar(sector[searchsector].ceilingxpanning,changedir,smooshyalign,0); - else - sector[searchsector].floorxpanning = changechar(sector[searchsector].floorxpanning,changedir,smooshyalign,0); - } - if (searchstat == 3) - { - sprite[searchwall].xrepeat = changechar(sprite[searchwall].xrepeat,changedir,smooshyalign,1); - if (sprite[searchwall].xrepeat < 4) - sprite[searchwall].xrepeat = 4; - } - asksave = 1; - repeatcountx = max(1,repeatcountx); - } - repeatcountx += (synctics>>1); - searchx = osearchx; - } - else - repeatcountx = 0; - - if (searchy != osearchy) - { - if ((repeatcounty == 0) || (repeatcounty > 16)) - { - changedir = 0; - if (osearchy < searchy) changedir = -1; - if (searchy < osearchy) changedir = 1; - - if ((searchstat == 0) || (searchstat == 4)) - { - if (wall[searchwall].cstat&4) changedir = -changedir; - if (repeatpanalign == 0) - wall[searchwall].yrepeat = changechar(wall[searchwall].yrepeat,changedir,smooshyalign,1); - else - wall[searchwall].ypanning = changechar(wall[searchwall].ypanning,changedir,smooshyalign,0); - } - if ((searchstat == 1) || (searchstat == 2)) - { - if (searchstat == 1) - sector[searchsector].ceilingypanning = changechar(sector[searchsector].ceilingypanning,changedir,smooshyalign,0); - else - sector[searchsector].floorypanning = changechar(sector[searchsector].floorypanning,changedir,smooshyalign,0); - } - if (searchstat == 3) - { - sprite[searchwall].yrepeat = changechar(sprite[searchwall].yrepeat,changedir,smooshyalign,1); - if (sprite[searchwall].yrepeat < 4) - sprite[searchwall].yrepeat = 4; - } - asksave = 1; - repeatcounty = max(1,repeatcounty); - } - searchy = osearchy; - repeatcounty += (synctics>>1); - //} - } - else - repeatcounty = 0; + mlook = 2; } if (bstatus&32) // - { @@ -2905,7 +2832,7 @@ static void Keys3d(void) } asksave = 1; keystatus[0xc9] = 0; - mouseb &= ~32; + mouseb &= ~16; } if ((keystatus[0xd1] > 0) || ((bstatus&2) && (bstatus&32))) // PGDN { @@ -3038,7 +2965,7 @@ static void Keys3d(void) } asksave = 1; keystatus[0xd1] = 0; - mouseb &= ~16; + mouseb &= ~32; } /* end Mapster32 */ @@ -3077,7 +3004,10 @@ static void Keys3d(void) if ((bstatus&4) && (bstatus&2)) Bsprintf(tempbuf,"PAN"); else if (bstatus&4) - Bsprintf(tempbuf,"SHADE/SIZE"); + { + if (bstatus&1) Bsprintf(tempbuf,"VIEW"); + else Bsprintf(tempbuf,"SHADE"); + } else if (bstatus&2) Bsprintf(tempbuf,"Z"); else if (bstatus&1) diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 92208e1b3..7d4005ba3 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -217,10 +217,10 @@ void CONFIG_SetDefaultKeys(int type) { for (i=0; i < (int32)(sizeof(oldkeydefaults)/sizeof(oldkeydefaults[0])); i+=3) { - f = CONFIG_FunctionNameToNum(oldkeydefaults[i+0]); + f = CONFIG_FunctionNameToNum((char *)oldkeydefaults[i+0]); if (f == -1) continue; - KeyboardKeys[f][0] = KB_StringToScanCode(oldkeydefaults[i+1]); - KeyboardKeys[f][1] = KB_StringToScanCode(oldkeydefaults[i+2]); + KeyboardKeys[f][0] = KB_StringToScanCode((char *)oldkeydefaults[i+1]); + KeyboardKeys[f][1] = KB_StringToScanCode((char *)oldkeydefaults[i+2]); if (f == gamefunc_Show_Console) OSD_CaptureKey(KeyboardKeys[f][0]); else CONTROL_MapKey(f, KeyboardKeys[f][0], KeyboardKeys[f][1]); diff --git a/polymer/eduke32/source/function.h b/polymer/eduke32/source/function.h index c94c73fad..509c78b41 100644 --- a/polymer/eduke32/source/function.h +++ b/polymer/eduke32/source/function.h @@ -40,7 +40,8 @@ extern "C" { #define NUMGAMEFUNCTIONS 53 #define MAXGAMEFUNCLEN 32 -extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN], defaultgamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; +extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; +extern const char defaultgamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; extern char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN]; enum diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 1d8191fbe..ea13e2ebf 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -1891,7 +1891,7 @@ static void coolgaugetext(int snum) { struct player_struct *p = &ps[snum]; long i, j, o, ss, u; - int permbit; + int permbit = 0; if (ps[snum].gm&MODE_MENU) if ((current_menu >= 400 && current_menu <= 405)) @@ -2227,7 +2227,7 @@ static void coolgaugetext(int snum) if (p->inven_icon) { o = 0; - permbit = 128; +// permbit = 128; if (u&(2048+4096)) { @@ -2333,7 +2333,12 @@ static void tics(void) k += 8; } Bsprintf(b,"%ld",max(j,0)); - minitext(320-strlen(b)*4,k+1,b,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); +// minitext(scale(windowx1,320,xdim)+1,scale(windowy1,200,ydim)+1,b,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?2:0,26); + + + ii = scale(k,ydim,200)+windowy1; + printext256(windowx1+2,ii+2,0,-1,b,!(xdim > 640)); + printext256(windowx1+1,ii+1,(timer*AVERAGEFRAMES)/(i-frameval[framecnt]) < 40?248:31,-1,b,!(xdim > 640)); if (numplayers > 1) if ((totalclock - lastpackettime) > 1) @@ -3559,7 +3564,7 @@ void drawbackground(void) y1 = 0; y2 = ydim; - if ((ready2send && ps[myconnectindex].gm == MODE_GAME) || ud.recstat == 2) + if (ps[myconnectindex].gm & MODE_GAME || ud.recstat == 2) //if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717 { if (ud.screen_size == 8) @@ -3624,7 +3629,7 @@ void drawbackground(void) } } - if (ud.screen_size > 8 && (ready2send || ud.recstat == 2)) + if (ud.screen_size > 8) { y = 0; if (gametype_flags[ud.coop] & GAMETYPE_FLAG_FRAGBAR) @@ -8185,7 +8190,7 @@ static char rancid_ip_strings[MAXPLAYERS][32], rancid_local_port_string[8]; extern int getexternaladdress(char *buffer); -static int load_rancid_net(char *fn) +static int load_rancid_net(const char *fn) { int tokn; char *cmdtokptr; @@ -8199,7 +8204,7 @@ static int load_rancid_net(char *fn) scriptfile *script; - script = scriptfile_fromfile(fn); + script = scriptfile_fromfile((char *)fn); if (!script) return -1; while (1) @@ -8260,7 +8265,7 @@ static inline int stringsort(const char *p1, const char *p2) return Bstrcmp(&p1[0],&p2[0]); } -static void setup_rancid_net(char *fn) +static void setup_rancid_net(const char *fn) { int i; @@ -8360,7 +8365,7 @@ static void setup_rancid_net(char *fn) } } -static int loadgroupfiles(char *fn) +static int loadgroupfiles(const char *fn) { int tokn; char *cmdtokptr; @@ -8372,7 +8377,7 @@ static int loadgroupfiles(char *fn) { "cachesize", T_CACHESIZE }, }; - script = scriptfile_fromfile(fn); + script = scriptfile_fromfile((char *)fn); if (!script) return -1; while (1) diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 0b3467f61..1b59d3d28 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -2384,7 +2384,7 @@ cheat_for_port_credits: case 230: #if defined(POLYMOST) && defined(USE_OPENGL) rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); - menutext(320>>1,24,0,0,"ADVANCED VIDEO"); + menutext(320>>1,24,0,0,"VIDEO SETUP"); c = (320>>1)-120; @@ -2393,6 +2393,8 @@ cheat_for_port_credits: char *opts[] = { "Widescreen", "-", + "Anisotropic filtering", + "-", "Hightile textures", "Precache textures", "GL texture compression", @@ -2405,9 +2407,6 @@ cheat_for_port_credits: "-", "-", "-", - "-", - "-", - "-", NULL }; @@ -2429,7 +2428,7 @@ cheat_for_port_credits: if (x == -1) { cmenu(203); - probey = 7; + probey = 6; break; } @@ -2450,47 +2449,59 @@ cheat_for_port_credits: gametextpal(d,yy, glwidescreen ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; case 1: + if (x==io) + { + glanisotropy *= 2; + if (glanisotropy > glinfo.maxanisotropy) glanisotropy = 1; + gltexapplyprops(); + } + if (glanisotropy == 1) strcpy(tempbuf,"NONE"); + else sprintf(tempbuf,"%ldx",glanisotropy); + gametextpal(d,yy, tempbuf, MENUHIGHLIGHT(io), 0); + break; + + case 2: if (x==io) usehightile = 1-usehightile; modval(0,1,(int *)&usehightile,1,probey==io); gametextpal(d,yy, usehightile ? "On" : "Off", MENUHIGHLIGHT(io), 0); break; - case 2: + case 3: enabled = usehightile; if (enabled && x==io) useprecache = !useprecache; if (enabled) modval(0,1,(int *)&useprecache,1,probey==io); gametextpal(d,yy, useprecache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 3: + case 4: enabled = usehightile; if (enabled && x==io) glusetexcompr = !glusetexcompr; if (enabled) modval(0,1,(int *)&glusetexcompr,1,probey==io); gametextpal(d,yy, glusetexcompr && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 4: + case 5: enabled = (glusetexcompr && usehightile && useprecache); if (enabled && x==io) glusetexcache = !glusetexcache; if (enabled) modval(0,1,(int *)&glusetexcache,1,probey==io); gametextpal(d,yy, glusetexcache && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 5: + case 6: enabled = (glusetexcompr && usehightile && useprecache && glusetexcache); if (enabled && x==io) glusetexcachecompression = !glusetexcachecompression; if (enabled) modval(0,1,(int *)&glusetexcachecompression,1,probey==io); gametextpal(d,yy, glusetexcachecompression && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 6: + case 7: enabled = usehightile; if (enabled && x==io) r_detailmapping = !r_detailmapping; if (enabled) modval(0,1,(int *)&r_detailmapping,1,probey==io); gametextpal(d,yy, r_detailmapping && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 7: + case 8: enabled = usehightile; if (enabled && x==io) r_glowmapping = !r_glowmapping; if (enabled) modval(0,1,(int *)&r_glowmapping,1,probey==io); gametextpal(d,yy, r_glowmapping && enabled ? "On" : "Off", enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 0); break; - case 8: + case 9: if (x==io) usemodels = 1-usemodels; modval(0,1,(int *)&usemodels,1,probey==io); gametextpal(d,yy, usemodels ? "On" : "Off", MENUHIGHLIGHT(io), 0); @@ -2907,7 +2918,7 @@ cheat_for_port_credits: c = (320>>1)-120; #if defined(POLYMOST) && defined(USE_OPENGL) - x = (bpp>8?8:6); + x = (6+(bpp>8)); #else x = 6; #endif @@ -3163,12 +3174,6 @@ cheat_for_port_credits: gltexapplyprops(); break; case 6: - if (bpp==8) break; - glanisotropy *= 2; - if (glanisotropy > glinfo.maxanisotropy) glanisotropy = 1; - gltexapplyprops(); - break; - case 7: if (bpp==8) break; cmenu(230); break; @@ -3207,11 +3212,10 @@ cheat_for_port_credits: menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"HIGH":"LOW"); modval(0,1,(int *)&ud.detail,1,probey==5); } - #if defined(POLYMOST) && defined(USE_OPENGL) - if (bpp > 8) + else { - menutext(c,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,"FILTERING"); + menutext(c,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,"TEX FILTERING"); switch (gltexfiltermode) { case 0: @@ -3236,14 +3240,8 @@ cheat_for_port_credits: strcpy(tempbuf,"OTHER"); break; } - // menutext(c+154,50+62+16+16,MENUHIGHLIGHT(5),bpp==8,tempbuf); gametextpal(c+154,50+62+16+16-8,tempbuf,MENUHIGHLIGHT(5),bpp==8); - - menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,"ANISOTROPY"); - if (glanisotropy == 1) strcpy(tempbuf,"NONE"); - else sprintf(tempbuf,"%ld-tap",glanisotropy); - menutext(c+154,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,tempbuf); - menutext(c,50+62+16+16+16+16,MENUHIGHLIGHT(7),bpp==8,"ADVANCED VIDEO"); + menutext(c,50+62+16+16+16,MENUHIGHLIGHT(6),bpp==8,"MORE SETTINGS"); } #endif break; diff --git a/polymer/eduke32/source/osdfuncs.c b/polymer/eduke32/source/osdfuncs.c index 0282ca1c0..5e6908a8f 100644 --- a/polymer/eduke32/source/osdfuncs.c +++ b/polymer/eduke32/source/osdfuncs.c @@ -56,6 +56,7 @@ int GAME_getrowheight(int w) void GAME_onshowosd(int shown) { + vscrn(); if (numplayers == 1) if ((shown && !ud.pause_on) || (!shown && ud.pause_on)) KB_KeyDown[sc_Pause] = 1;