git-svn-id: https://svn.eduke32.com/eduke32@1183 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2008-12-15 08:38:16 +00:00
parent 2563deb562
commit 5b08f05476
4 changed files with 21 additions and 13 deletions

View file

@ -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);

View file

@ -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];

View file

@ -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;i++)
@ -147,7 +150,6 @@ int Gv_ReadSave(int fil)
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
// AddLog(g_szBuf);
Gv_InitWeaponPointers();
Gv_RefreshPointers();
if (kdfread(&g_gameArrayCount,sizeof(g_gameArrayCount),1,fil) != 1) goto corrupt;
@ -156,7 +158,7 @@ int Gv_ReadSave(int fil)
if (kdfread(&(aGameArrays[i]),sizeof(gamearray_t),1,fil) != 1) goto corrupt;
aGameArrays[i].szLabel=Bcalloc(MAXARRAYLABEL,sizeof(char));
if (kdfread(aGameArrays[i].szLabel,sizeof(char) * MAXARRAYLABEL, 1, fil) != 1) goto corrupt;
HASH_add(&arrayH,aGameArrays[i].szLabel,i);
HASH_replace(&arrayH,aGameArrays[i].szLabel,i);
}
// Bsprintf(g_szBuf,"CP:%s %d",__FILE__,__LINE__);
// AddLog(g_szBuf);
@ -449,7 +451,7 @@ int Gv_NewArray(const char *pszLabel, int asize)
aGameArrays[i].size=asize;
aGameVars[i].bReset=0;
g_gameArrayCount++;
HASH_add(&arrayH,aGameArrays[i].szLabel,i);
HASH_replace(&arrayH,aGameArrays[i].szLabel,i);
return 1;
}
@ -525,7 +527,8 @@ int Gv_NewVar(const char *pszLabel, int lValue, unsigned int dwFlags)
if (i == g_gameVarCount)
{
// we're adding a new one.
HASH_add(&gamevarH, aGameVars[i].szLabel, g_gameVarCount++);
HASH_add(&gamevarH, aGameVars[i].szLabel, i);
g_gameVarCount++;
}
if (aGameVars[i].dwFlags & GAMEVAR_PERPLAYER)
@ -557,12 +560,12 @@ void A_ResetVars(int iActor)
}
}
inline static int Gv_GetVarIndex(const char *szGameLabel)
static inline int Gv_GetVarIndex(const char *szGameLabel)
{
return HASH_find(&gamevarH,szGameLabel);
}
int Gv_GetVar(int id, int iActor, int iPlayer)
int __fastcall Gv_GetVar(int id, int iActor, int iPlayer)
{
if (id == MAXGAMEVARS)
return(*insptr++);
@ -642,7 +645,7 @@ int Gv_GetVar(int id, int iActor, int iPlayer)
}
}
void Gv_SetVar(int id, int lValue, int iActor, int iPlayer)
void __fastcall Gv_SetVar(int id, int lValue, int iActor, int iPlayer)
{
if (id<0 || id >= 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;

View file

@ -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;i<aplWeaponShotsPerBurst[p->curr_weapon][snum];i++)
{