diff --git a/polymer/eduke32/source/_functio.h b/polymer/eduke32/source/_functio.h index 40be4bcd1..be4235e25 100644 --- a/polymer/eduke32/source/_functio.h +++ b/polymer/eduke32/source/_functio.h @@ -38,7 +38,7 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com) #ifdef __cplusplus extern "C" { #endif -char * gamefunctions[] = +char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = { "Move_Forward", "Move_Backward", @@ -98,25 +98,25 @@ char * gamefunctions[] = #define NUMKEYENTRIES 53 -static char * keydefaults[] = +char keydefaults[NUMGAMEFUNCTIONS*3][MAXGAMEFUNCLEN] = { - "Move_Forward", "Up", "Kpad8", - "Move_Backward", "Down", "Kpad2", + "Move_Forward", "W", "Kpad8", + "Move_Backward", "S", "Kpad2", "Turn_Left", "Left", "Kpad4", "Turn_Right", "Right", "KPad6", "Strafe", "LAlt", "RAlt", - "Fire", "LCtrl", "RCtrl", - "Open", "Space", "", + "Fire", "", "RCtrl", + "Open", "E", "", "Run", "LShift", "RShift", "AutoRun", "CapLck", "", - "Jump", "A", "/", - "Crouch", "Z", "", + "Jump", "Space", "/", + "Crouch", "LCtrl", "", "Look_Up", "PgUp", "Kpad9", "Look_Down", "PgDn", "Kpad3", "Look_Left", "Insert", "Kpad0", "Look_Right", "Delete", "Kpad.", - "Strafe_Left", ",", "", - "Strafe_Right", ".", "", + "Strafe_Left", "A", "", + "Strafe_Right", "D", "", "Aim_Up", "Home", "KPad7", "Aim_Down", "End", "Kpad1", "Weapon_1", "1", "", @@ -143,16 +143,16 @@ static char * keydefaults[] = "Enlarge_Screen", "=", "Kpad+", "Center_View", "KPad5", "", "Holster_Weapon", "ScrLck", "", - "Show_Opponents_Weapon", "W", "", + "Show_Opponents_Weapon", "Y", "", "Map_Follow_Mode", "F", "", "See_Coop_View", "K", "", "Mouse_Aiming", "U", "", "Toggle_Crosshair", "I", "", "Steroids", "R", "", - "Quick_Kick", "`", "", + "Quick_Kick", "Q", "", "Next_Weapon", "'", "", "Previous_Weapon", ";", "", - "Show_Console", "NumLck", "" + "Show_Console", "`", "" }; diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index 9ca47e87a..e694d5c87 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -298,7 +298,7 @@ void hitradius( short i, long r, long hp1, long hp2, long hp3, long hp4 ) walltype *wal; long d, q, x1, y1; long sectcnt, sectend, dasect, startwall, endwall, nextsect; - short j,k,p,x,nextj,sect; + short j,k,p,x,nextj,sect=-1; char statlist[] = {0,1,6,10,12,2,5}; short *tempshort = (short *)tempbuf; diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 572ff1a3d..ff734bbd8 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -82,7 +82,7 @@ int32 JoystickAnalogueSaturate[MAXJOYAXES]; // Screen variables // -int32 ScreenMode = 1; +int32 ScreenMode = 0; int32 ScreenWidth = 800; int32 ScreenHeight = 600; int32 ScreenBPP = 32; @@ -199,10 +199,10 @@ void CONFIG_SetDefaults( void ) FXDevice = -1; MusicDevice = -1; - NumVoices = 8; + NumVoices = 32; NumChannels = 2; - NumBits = 8; - MixRate = 22050; + NumBits = 16; + MixRate = 44100; SoundToggle = 1; MusicToggle = 1; VoiceToggle = 2; @@ -210,15 +210,16 @@ void CONFIG_SetDefaults( void ) FXVolume = 220; MusicVolume = 200; ReverseStereo = 0; - myaimmode = ps[0].aim_mode = 0; + myaimmode = ps[0].aim_mode = 1; ud.mouseaiming = 0; ud.weaponswitch = 3; // new+empty AutoAim = 1; ControllerType = 1; - ud.mouseflip = 0; + ud.mouseflip = 1; ud.runkey_mode = 0; + RunMode = ud.auto_run = 1; ud.statusbarscale = 100; - ud.screen_size = 8; + ud.screen_size = 4; ud.screen_tilting = 1; ud.shadows = 1; ud.detail = 1; @@ -232,7 +233,8 @@ void CONFIG_SetDefaults( void ) ud.brightskins = 0; ud.democams = 1; ud.color = 0; - ud.msgdisptime = 360; + ud.msgdisptime = 640; + ud.brightness = 16; ShowOpponentWeapons = 0; Bstrcpy(ud.rtsname, "DUKE.RTS"); @@ -251,7 +253,7 @@ void CONFIG_SetDefaults( void ) // JBF 20031211 Bmemset(KeyboardKeys, 0xff, sizeof(KeyboardKeys)); - for (i=0; i < (int32)(sizeof(keydefaults)/sizeof(keydefaults[0]))/3; i++) { + for (i=0; i < NUMGAMEFUNCTIONS; i++) { f = CONFIG_FunctionNameToNum( keydefaults[3*i+0] ); if (f == -1) continue; k1 = KB_StringToScanCode( keydefaults[3*i+1] ); @@ -264,9 +266,7 @@ void CONFIG_SetDefaults( void ) Bmemset(MouseFunctions, -1, sizeof(MouseFunctions)); for (i=0; i 1 && current_menu != 20003 && current_menu != 20005) + if( ud.multimode > 1 && current_menu != 20003 && current_menu != 20005 && current_menu != 210) { ControlInfo noshareinfo; CONTROL_GetInput( &noshareinfo ); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 147e072c5..ec89e90ac 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -435,6 +435,7 @@ char *keyw[] = { "save", // 288 "cansee", // 289 "canseespr", // 290 + "definegamefuncname", // 291 "" }; @@ -4375,6 +4376,40 @@ repeatcase: volume_names[j][i] = '\0'; return 0; + case CON_DEFINEGAMEFUNCNAME: + scriptptr--; + transnum(LABEL_DEFINE); + scriptptr--; + j = *scriptptr; + while( *textptr == ' ' ) textptr++; + + if (j < 0 || j > NUMGAMEFUNCTIONS-1) + { + initprintf("%s:%ld: error: function number exceeds number of game functions.\n",compilefile,line_number); + error++; + while( *textptr != 0x0a && *textptr != 0 ) textptr++; + break; + } + + i = 0; + + while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) + { + gamefunctions[j][i] = *textptr; + keydefaults[j*3][i] = *textptr; + textptr++,i++; + if(i >= MAXGAMEFUNCLEN-1) + { + initprintf("%s:%ld: error: function name exceeds limit of %ld characters.\n",compilefile,line_number,MAXGAMEFUNCLEN); + error++; + while( *textptr != 0x0a && *textptr != 0x0d && *textptr != 0 ) textptr++; + break; + } + } + gamefunctions[j][i] = '\0'; + keydefaults[j*3][i] = '\0'; + return 0; + case CON_DEFINESKILLNAME: scriptptr--; transnum(LABEL_DEFINE); diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 1e2a419a5..9901edf04 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -715,5 +715,6 @@ enum keywords { CON_SAVE, // 288 CON_CANSEE, // 289 CON_CANSEESPR, // 290 + CON_DEFINEGAMEFUNCNAME, // 291 END }; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index e2bc18df9..3585491bd 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -597,7 +597,8 @@ void menus(void) if(!(current_menu >= 1000 && current_menu <= 2999 && current_menu >= 300 && current_menu <= 369)) vscrn(); - if(KB_KeyPressed(sc_Q) && current_menu >= 0 && (current_menu > 502 || current_menu < 500)) + if(KB_KeyPressed(sc_Q) && current_menu >= 0 && (current_menu > 502 || current_menu < 500) && current_menu != 20003 && + current_menu != 20005 && current_menu != 210) { last_menu = current_menu; last_probey = probey; @@ -2772,7 +2773,7 @@ cheat_for_port_credits: case 210: { int32 sc; rotatesprite(320<<15,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); - menutext(320>>1,24,0,0,"KEYS SETUP"); + menutext(320>>1,24,0,0,"KEYBOARD SETUP"); gametext(320>>1,90,"PRESS THE KEY TO ASSIGN AS",0,2+8+16); sprintf(tempbuf,"%s FOR \"%s\"", whichkey?"SECONDARY":"PRIMARY", CONFIG_FunctionNumToName(function)); diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 4e299b2f6..2f7196cb1 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -56,18 +56,14 @@ void fadepal(int r, int g, int b, int start, int end, int step) else for (; start >= end; start += step) palto(r,g,b,start); } -void incur_damage(short snum) +void incur_damage(struct player_struct *p) { long damage = 0L, shield_damage = 0L; - struct player_struct *p; + SetGameVarID(g_iReturnVarID,0,p->i,sprite[p->i].yvel); + OnEvent(EVENT_INCURDAMAGE, p->i, sprite[p->i].yvel, -1); - p = &ps[snum]; - - SetGameVarID(g_iReturnVarID,0,p->i,snum); - OnEvent(EVENT_INCURDAMAGE, p->i, snum, -1); - - if(GetGameVarID(g_iReturnVarID,p->i,snum) == 0) + if(GetGameVarID(g_iReturnVarID,p->i,sprite[p->i].yvel) == 0) { sprite[p->i].extra -= p->extra_extra8>>8; @@ -1924,12 +1920,11 @@ char animateknuckles(short gs,short snum) long lastvisinc; -void DoFire(short snum) +void DoFire(struct player_struct *p) { int i; - struct player_struct *p; - p = &ps[snum]; + short snum = sprite[p->i].yvel; SetGameVarID(g_iReturnVarID,0,p->i,snum); OnEvent(EVENT_DOFIRE, p->i, snum, -1); @@ -1980,12 +1975,11 @@ void DoFire(short snum) } } -void DoSpawn(short snum) +void DoSpawn(struct player_struct *p) { int j; - struct player_struct *p; - p = &ps[snum]; + short snum = sprite[p->i].yvel; if(!aplWeaponSpawn[p->curr_weapon][snum]) return; @@ -2972,7 +2966,7 @@ void getinput(short snum) char doincrements(struct player_struct *p) { - long snum; + short snum; snum = sprite[p->i].yvel; // j = sync[snum].avel; @@ -3166,9 +3160,7 @@ short weapon_sprites[MAX_WEAPONS] = { KNEE__STATIC, FIRSTGUNSPRITE__STATIC, SHOT void checkweapons(struct player_struct *p) { short cw; - long snum; - - snum = sprite[p->i].yvel; + short snum = sprite[p->i].yvel; cw = aplWeaponWorksLike[p->curr_weapon][snum]; @@ -3301,7 +3293,7 @@ void processinput(short snum) } - if ( s->extra > 0 ) incur_damage( snum ); + if ( s->extra > 0 ) incur_damage( p ); else { s->extra = 0; @@ -4841,7 +4833,7 @@ SHOOTINCODE: } } if(*kb == aplWeaponSpawnTime[p->curr_weapon][snum]) - DoSpawn(snum); + DoSpawn(p); if ((*kb) >= aplWeaponTotalTime[p->curr_weapon][snum]) { @@ -4897,21 +4889,21 @@ SHOOTINCODE: { if( ((*(kb))%3) == 0 ) { - DoFire(snum); - DoSpawn(snum); + DoFire(p); + DoSpawn(p); } } if( aplWeaponFlags[p->curr_weapon][snum] & WEAPON_FLAG_FIREEVERYOTHER) { - DoFire(snum); - DoSpawn(snum); + DoFire(p); + DoSpawn(p); } } } else if(*kb == aplWeaponFireDelay[p->curr_weapon][snum] && (aplWeaponWorksLike[p->curr_weapon][snum]==KNEE_WEAPON ? 1 : p->ammo_amount[p->curr_weapon] > 0)) { - DoFire(snum); + DoFire(p); } } }