Questionable CON changes and optimizations. <3

git-svn-id: https://svn.eduke32.com/eduke32@4902 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2015-01-11 04:56:10 +00:00
parent 2928a9dfa9
commit 364cf15c4f
5 changed files with 629 additions and 803 deletions

View file

@ -124,55 +124,10 @@ int32_t g_numQuoteRedefinitions = 0;
#ifdef LUNATIC
weapondata_t g_playerWeapon[MAXPLAYERS][MAX_WEAPONS];
#else
// pointers to weapon gamevar data
intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in magazine
intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
intptr_t *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire
intptr_t *aplWeaponHoldDelay[MAX_WEAPONS]; // delay after release fire button to fire (0 for none)
intptr_t *aplWeaponTotalTime[MAX_WEAPONS]; // The total time the weapon is cycling before next fire.
intptr_t *aplWeaponFlags[MAX_WEAPONS]; // Flags for weapon
intptr_t *aplWeaponShoots[MAX_WEAPONS]; // what the weapon shoots
intptr_t *aplWeaponSpawnTime[MAX_WEAPONS]; // the frame at which to spawn an item
intptr_t *aplWeaponSpawn[MAX_WEAPONS]; // the item to spawn
intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS]; // number of shots per 'burst' (one ammo per 'burst')
intptr_t *aplWeaponWorksLike[MAX_WEAPONS]; // What original the weapon works like
intptr_t *aplWeaponInitialSound[MAX_WEAPONS]; // Sound made when weapon starts firing. zero for no sound
intptr_t *aplWeaponFireSound[MAX_WEAPONS]; // Sound made when firing (each time for automatic)
intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
intptr_t *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
intptr_t *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
intptr_t *aplWeaponSelectSound[MAX_WEAPONS]; // Sound of weapon being selected
intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Muzzle flash color
#endif
int32_t g_iReturnVarID=-1; // var ID of "RETURN"
int32_t g_iWeaponVarID=-1; // var ID of "WEAPON"
int32_t g_iWorksLikeVarID=-1; // var ID of "WORKSLIKE"
int32_t g_iZRangeVarID=-1; // var ID of "ZRANGE"
int32_t g_iAngRangeVarID=-1; // var ID of "ANGRANGE"
int32_t g_iAimAngleVarID=-1; // var ID of "AUTOAIMANGLE"
int32_t g_iLoTagID=-1; // var ID of "LOTAG"
int32_t g_iHiTagID=-1; // var ID of "HITAG"
int32_t g_iTextureID=-1; // var ID of "TEXTURE"
int32_t g_iThisActorID=-1; // var ID of "THISACTOR"
int32_t g_iSpriteVarID=-1;
int32_t g_iSectorVarID=-1;
int32_t g_iWallVarID=-1;
int32_t g_iPlayerVarID=-1;
int32_t g_iActorVarID=-1;
intptr_t *apScriptGameEvent[MAXGAMEEVENTS];
#if !defined LUNATIC
static intptr_t *g_parsingEventPtr=NULL;
gamevar_t aGameVars[MAXGAMEVARS];
gamearray_t aGameArrays[MAXGAMEARRAYS];
int32_t g_gameVarCount=0;
int32_t g_gameArrayCount=0;
static char *textptr;
#endif
@ -2348,24 +2303,24 @@ int32_t C_AllocQuote(int32_t qnum)
void C_InitQuotes(void)
{
int32_t i;
for (int i = 0; i < 128; i++) C_AllocQuote(i);
for (i=127; i>=0; i--)
C_AllocQuote(i);
for (i=MAXQUOTELEN-7; i>=0; i--)
#if defined(__ANDROID__)
Bsprintf(ScriptQuotes[13], "TOUCH ANYWHERE TO CONTINUE");
#else
for (int i = MAXQUOTELEN - 7; i >= 0; i--)
if (Bstrncmp(&ScriptQuotes[13][i], "SPACE", 5) == 0)
{
Bmemset(tempbuf, 0, sizeof(tempbuf));
Bstrncpy(tempbuf, ScriptQuotes[13], i);
Bstrcat(tempbuf,"OPEN");
Bstrcat(tempbuf, "USE");
Bstrcat(tempbuf, &ScriptQuotes[13][i + 5]);
Bstrncpy(ScriptQuotes[13], tempbuf, MAXQUOTELEN - 1);
i = MAXQUOTELEN - 7;
}
#endif
// most of these are based on Blood, obviously
{
const char *PlayerObituaries[] =
{
"^02%s^02 beat %s^02 like a cur",
@ -2432,20 +2387,19 @@ void C_InitQuotes(void)
EDUKE32_STATIC_ASSERT(SUICIDEQUOTEINDEX + ARRAY_SIZE(PlayerSelfObituaries)-1 < MAXQUOTES);
g_numObituaries = ARRAY_SIZE(PlayerObituaries);
for (i=g_numObituaries-1; i>=0; i--)
for (int i = g_numObituaries - 1; i >= 0; i--)
{
if (C_AllocQuote(i + OBITQUOTEINDEX))
Bstrcpy(ScriptQuotes[i + OBITQUOTEINDEX], PlayerObituaries[i]);
}
g_numSelfObituaries = ARRAY_SIZE(PlayerSelfObituaries);
for (i=g_numSelfObituaries-1; i>=0; i--)
for (int i = g_numSelfObituaries - 1; i >= 0; i--)
{
if (C_AllocQuote(i + SUICIDEQUOTEINDEX))
Bstrcpy(ScriptQuotes[i + SUICIDEQUOTEINDEX], PlayerSelfObituaries[i]);
}
}
}
LUNATIC_EXTERN void C_SetCfgName(const char *cfgname)
{

View file

@ -37,6 +37,7 @@ extern "C" {
#define MAXCHEATLEN 20
#define NUMCHEATCODES (int32_t)ARRAY_SIZE(CheatStrings)
extern intptr_t *insptr;
extern hashtable_t h_gamefuncs;
#if !defined LUNATIC
@ -101,6 +102,7 @@ typedef struct {
int g_i, g_p, g_x;
int32_t *g_t;
spritetype *g_sp;
DukePlayer_t *g_pp;
int g_flags;
} vmstate_t;

File diff suppressed because it is too large Load diff

View file

@ -34,6 +34,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
int32_t g_noResetVars;
LUNATIC_CB void (*A_ResetVars)(int32_t iActor);
#else
gamevar_t aGameVars[MAXGAMEVARS];
gamearray_t aGameArrays[MAXGAMEARRAYS];
int32_t g_gameVarCount=0;
int32_t g_gameArrayCount=0;
// pointers to weapon gamevar data
intptr_t *aplWeaponClip[MAX_WEAPONS]; // number of items in magazine
intptr_t *aplWeaponReload[MAX_WEAPONS]; // delay to reload (include fire)
intptr_t *aplWeaponFireDelay[MAX_WEAPONS]; // delay to fire
intptr_t *aplWeaponHoldDelay[MAX_WEAPONS]; // delay after release fire button to fire (0 for none)
intptr_t *aplWeaponTotalTime[MAX_WEAPONS]; // The total time the weapon is cycling before next fire.
intptr_t *aplWeaponFlags[MAX_WEAPONS]; // Flags for weapon
intptr_t *aplWeaponShoots[MAX_WEAPONS]; // what the weapon shoots
intptr_t *aplWeaponSpawnTime[MAX_WEAPONS]; // the frame at which to spawn an item
intptr_t *aplWeaponSpawn[MAX_WEAPONS]; // the item to spawn
intptr_t *aplWeaponShotsPerBurst[MAX_WEAPONS]; // number of shots per 'burst' (one ammo per 'burst')
intptr_t *aplWeaponWorksLike[MAX_WEAPONS]; // What original the weapon works like
intptr_t *aplWeaponInitialSound[MAX_WEAPONS]; // Sound made when weapon starts firing. zero for no sound
intptr_t *aplWeaponFireSound[MAX_WEAPONS]; // Sound made when firing (each time for automatic)
intptr_t *aplWeaponSound2Time[MAX_WEAPONS]; // Alternate sound time
intptr_t *aplWeaponSound2Sound[MAX_WEAPONS]; // Alternate sound sound ID
intptr_t *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine being removed
intptr_t *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
intptr_t *aplWeaponSelectSound[MAX_WEAPONS]; // Sound of weapon being selected
intptr_t *aplWeaponFlashColor[MAX_WEAPONS]; // Muzzle flash color
# include "gamestructures.c"
// Frees the memory for the *values* of game variables and arrays. Resets their

View file

@ -108,7 +108,7 @@ G_EXTERN int32_t screenpeek;
G_EXTERN int32_t startofdynamicinterpolations;
G_EXTERN int32_t ototalclock;
G_EXTERN intptr_t *g_parsingActorPtr;
G_EXTERN intptr_t *g_scriptPtr,*insptr;
G_EXTERN intptr_t *g_scriptPtr;
G_EXTERN int32_t *labelcode,*labeltype;
G_EXTERN intptr_t *script;
G_EXTERN map_t MapInfo[(MAXVOLUMES+1)*MAXLEVELS]; // +1 volume for "intro", "briefing" and "loading" music