diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index e9f14e1f7..046d5a5ac 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __funct_h__ #define __funct_h__ +#ifndef __fastcall +#define __fastcall __attribute__((fastcall)) +#endif + extern void sendscore(const char *s); extern void S_SoundStartup(void); extern void S_SoundShutdown(void); @@ -115,7 +119,7 @@ extern int G_GetAngleDelta(int a,int na); extern void A_GetZLimits(int iActor); extern void A_Fall(int iActor); extern void C_Compile(const char *fn); -extern int A_GetFurthestAngle(int iActor,int angs); +extern __fastcall int A_GetFurthestAngle(int iActor,int angs); extern void A_Execute(int iActor,int iPlayer,int lDist); extern void overwritesprite(int thex,int they,int tilenum,int shade,int stat,int dapalnum); extern void gamenumber(int x,int y,int n,int s); @@ -221,8 +225,8 @@ extern void Gv_Init(void); extern void Gv_WriteSave(FILE *fil); extern int Gv_ReadSave(int fil); -extern int Gv_GetVar(int id, int iActor, int iPlayer); -extern void Gv_SetVar(int id, int lValue, int iActor, int iPlayer); +extern int __fastcall Gv_GetVar(int id, int iActor, int iPlayer); +extern void __fastcall Gv_SetVar(int id, int lValue, int iActor, int iPlayer); // extern void SetGameArrayID(int id,int index, int lValue); extern int Gv_NewVar(const char *pszLabel, int lValue, unsigned int dwFlags); diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 35c5f3449..c84dafb3c 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -198,7 +198,7 @@ static char A_Dodge(spritetype *s) return 0; } -int A_GetFurthestAngle(int iActor,int angs) +int __fastcall A_GetFurthestAngle(int iActor,int angs) { spritetype *s = &sprite[iActor]; diff --git a/polymer/eduke32/source/gamevars.c b/polymer/eduke32/source/gamevars.c index 7c562ea40..67111fda9 100644 --- a/polymer/eduke32/source/gamevars.c +++ b/polymer/eduke32/source/gamevars.c @@ -102,6 +102,7 @@ int Gv_ReadSave(int fil) // AddLog("Reading gamevars from savegame"); Gv_Free(); // nuke 'em from orbit, it's the only way to be sure... + HASH_init(&gamevarH); // Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__); // AddLog(g_szBuf); @@ -111,7 +112,7 @@ int Gv_ReadSave(int fil) if (kdfread(&(aGameVars[i]),sizeof(gamevar_t),1,fil) != 1) goto corrupt; aGameVars[i].szLabel=Bcalloc(MAXVARLABEL,sizeof(char)); if (kdfread(aGameVars[i].szLabel,sizeof(char) * MAXVARLABEL, 1, fil) != 1) goto corrupt; - HASH_add(&gamevarH,aGameVars[i].szLabel,i); + HASH_replace(&gamevarH,aGameVars[i].szLabel,i); } // Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__); // AddLog(g_szBuf); @@ -126,6 +127,8 @@ int Gv_ReadSave(int fil) aGameVars[i].plValues=NULL; } + Gv_InitWeaponPointers(); + // Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__); // AddLog(g_szBuf); for (i=0;i= g_gameVarCount) { @@ -715,7 +718,7 @@ int Gv_GetVarByLabel(const char *szGameLabel, int lDefault, int iActor, int iPla static intptr_t *Gv_GetVarDataPtr(const char *szGameLabel) { - int i = HASH_find(&gamevarH,szGameLabel); + int i = HASH_find(&gamevarH, szGameLabel); if (i < 0) return NULL; diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index beb3548fc..02bf8487c 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -2055,6 +2055,7 @@ void P_FireWeapon(DukePlayer_t *p) Gv_SetVar(g_iWeaponVarID,p->curr_weapon,p->i,snum); Gv_SetVar(g_iWorksLikeVarID,aplWeaponWorksLike[p->curr_weapon][snum], p->i, snum); + OSD_Printf("doing %d %d %d\n",aplWeaponShoots[p->curr_weapon][snum],p->curr_weapon,snum); A_Shoot(p->i,aplWeaponShoots[p->curr_weapon][snum]); for (i=1;icurr_weapon][snum];i++) {