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

This commit is contained in:
terminx 2008-12-08 02:04:20 +00:00
parent fbb3f390d0
commit 6f514cf91e
7 changed files with 53 additions and 21 deletions

View file

@ -166,6 +166,9 @@ ifeq ($(PLATFORM),LINUX)
NASMFLAGS += -f elf
LIBS += -lvorbisfile -lvorbis -logg
USE_OPENAL = 0
ifeq ($(RELEASE),0)
OURCFLAGS += -D_FORTIFY_SOURCE=2
endif
endif
ifeq ($(PLATFORM),DARWIN)

View file

@ -145,6 +145,9 @@ EDITOROBJS=$(OBJ)/build.$o \
ifeq ($(PLATFORM),LINUX)
ASFLAGS+= -f elf
LIBS+= -lm
ifeq ($(RELEASE),0)
OURCFLAGS += -D_FORTIFY_SOURCE=2
endif
endif
ifeq ($(PLATFORM),DARWIN)
ENGINEOBJS += $(OBJ)/StartupWinController.editor.$o \

View file

@ -12167,7 +12167,20 @@ void HASH_free(struct HASH_table *t)
t->items = 0;
}
inline int HASH_getcode(const char *s)
#if 1
// djb3 algorithm
inline unsigned int HASH_getcode(const char *s)
{
unsigned int h = 5381;
int ch;
while ((ch = *s++) != '\0')
h = ((h << 5) + h) ^ ch;
return h;
}
#else
inline unsigned int HASH_getcode(const char *s)
{
int i=0, fact=1;
while (*s)
@ -12178,6 +12191,7 @@ inline int HASH_getcode(const char *s)
}
return i;
}
#endif
void HASH_add(struct HASH_table *t, const char *s, int key)
{
@ -12262,11 +12276,16 @@ int HASH_find(struct HASH_table *t, const char *s)
{
struct HASH_item *cur;
if (t->items==NULL) {initprintf("HASH_find: not initalized\n");return -1;}
if (t->items==NULL)
{
initprintf("HASH_find: not initalized\n");
return -1;
}
cur=t->items[HASH_getcode(s)%t->size];
while (cur)
{
if (Bstrcmp(s,cur->string)==0)return cur->key;
if (Bstrcmp(s,cur->string) == 0)
return cur->key;
cur=cur->next;
}
return -1;
@ -12276,11 +12295,16 @@ int HASH_findcase(struct HASH_table *t, const char *s)
{
struct HASH_item *cur;
if (t->items==NULL) {initprintf("HASH_findcase: not initalized\n");return -1;}
if (t->items==NULL)
{
initprintf("HASH_findcase: not initalized\n");
return -1;
}
cur=t->items[HASH_getcode(s)%t->size];
while (cur)
{
if (Bstrcasecmp(s,cur->string)==0)return cur->key;
if (Bstrcasecmp(s,cur->string) == 0)
return cur->key;
cur=cur->next;
}
return -1;

View file

@ -1855,7 +1855,7 @@ static symbol_t *findexactsymbol(const char *name)
for (i=Bstrlen(lname);i>=0;i--)
lname[i] = Btolower(lname[i]);
i = HASH_findcase(&osdsymbolsH,lname);
i = HASH_find(&osdsymbolsH,lname);
if (i > -1)
{
// if ((symbol_t *)osdsymbptrs[i]->func == (void *)OSD_UNALIASED)

View file

@ -896,7 +896,7 @@ extern intptr_t *aplWeaponReloadSound1[MAX_WEAPONS]; // Sound of magazine bei
extern intptr_t *aplWeaponReloadSound2[MAX_WEAPONS]; // Sound of magazine being inserted
extern intptr_t *aplWeaponSelectSound[MAX_WEAPONS]; // Sound for weapon selection
extern short g_timerTicsPerSecond;
extern int g_timerTicsPerSecond;
enum WeaponFlags_t {
WEAPON_HOLSTER_CLEARS_CLIP = 1, // 'holstering' clears the current clip

View file

@ -2576,8 +2576,10 @@ static void G_PrintFrameRate(void)
int chars = Bsprintf(tempbuf, "%2u ms (%3u fps)", howlong, LastCount);
printext256(windowx2-(chars<<(3-x))+1,windowy1+2,0,-1,tempbuf,x);
printext256(windowx2-(chars<<(3-x)),windowy1+1,(LastCount < LOW_FPS) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x);
printext256(windowx2-(chars<<(3-x)),windowy1+1,
(LastCount < LOW_FPS) ? COLOR_RED : COLOR_WHITE,-1,tempbuf,x);
// lag meter
if (numplayers > 1 && (totalclock - lastpackettime) > 1)
{
for (howlong = (totalclock - lastpackettime);howlong>0 && howlong<(xdim>>2);howlong--)
@ -7562,7 +7564,7 @@ enum cheats
CHEAT_SCREAMFORME,
};
void CheatGetInventory(void)
void G_CheatGetInv(void)
{
Gv_SetVar(g_iReturnVarID, 400, g_player[myconnectindex].ps->i, myconnectindex);
X_OnEvent(EVENT_CHEATGETSTEROIDS, g_player[myconnectindex].ps->i, myconnectindex, -1);
@ -7631,7 +7633,7 @@ void CheatGetInventory(void)
signed char cheatbuf[MAXCHEATLEN],cheatbuflen;
static void DoCheats(void)
static void G_DoCheats(void)
{
short ch, i, j, k=0, weapon;
static int z=0;
@ -7722,7 +7724,7 @@ FOUNDCHEAT:
case CHEAT_INVENTORY:
KB_FlushKeyBoardQueue();
g_player[myconnectindex].ps->cheat_phase = 0;
CheatGetInventory();
G_CheatGetInv();
P_DoQuote(120,g_player[myconnectindex].ps);
g_player[myconnectindex].ps->cheat_phase = 0;
return;
@ -7824,7 +7826,7 @@ FOUNDCHEAT:
sprite[g_player[myconnectindex].ps->i].pal = g_player[myconnectindex].ps->palookup;
Bstrcpy(ScriptQuotes[122],"Scream for me, Long Beach!");
P_DoQuote(122,g_player[myconnectindex].ps);
CheatGetInventory();
G_CheatGetInv();
for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++)
g_player[myconnectindex].ps->gotweapon[weapon] = 1;
@ -7862,7 +7864,7 @@ FOUNDCHEAT:
weapon < (MAX_WEAPONS-j);
weapon++)
P_AddAmmo(weapon, g_player[myconnectindex].ps, g_player[myconnectindex].ps->max_ammo_amount[weapon]);
CheatGetInventory();
G_CheatGetInv();
g_player[myconnectindex].ps->got_access = 7;
P_DoQuote(5,g_player[myconnectindex].ps);
g_player[myconnectindex].ps->cheat_phase = 0;
@ -7982,7 +7984,7 @@ FOUNDCHEAT:
return;
case CHEAT_ITEMS:
CheatGetInventory();
G_CheatGetInv();
g_player[myconnectindex].ps->got_access = 7;
P_DoQuote(5,g_player[myconnectindex].ps);
g_player[myconnectindex].ps->cheat_phase = 0;
@ -8099,7 +8101,7 @@ FOUNDCHEAT:
}
}
static void ShowScores(void)
static void G_ShowScores(void)
{
int t, i, y,xfragtotal,yfragtotal;
@ -8174,7 +8176,7 @@ static void ShowScores(void)
}
}
static void HandleLocalKeys(void)
static void G_HandleLocalKeys(void)
{
int i,ch;
int j;
@ -11504,8 +11506,8 @@ MAIN_LOOP_RESTART:
continue;
}
DoCheats();
HandleLocalKeys();
G_DoCheats();
G_HandleLocalKeys();
if ((ud.show_help == 0 && ud.multimode < 2 && !(g_player[myconnectindex].ps->gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2)
i = min(max((totalclock-ototalclock)*(65536L/TICSPERFRAME),0),65536);
@ -11543,7 +11545,7 @@ MAIN_LOOP_RESTART:
gametext(160,70,"PRESS F1 TO ACCEPT, F2 TO DECLINE",0,2+8+16);
}
if (BUTTON(gamefunc_Show_DukeMatch_Scores)) ShowScores();
if (BUTTON(gamefunc_Show_DukeMatch_Scores)) G_ShowScores();
if (debug_on) G_ShowCacheLocks();
@ -11860,7 +11862,7 @@ RECHECK:
G_DrawBackground();
else
{
HandleLocalKeys();
G_HandleLocalKeys();
j = min(max((totalclock-lockclock)*(65536/TICSPERFRAME),0),65536);
G_DrawRooms(screenpeek,j);

View file

@ -71,7 +71,7 @@ int g_currentFrameRate;
char g_numVolumes = 3;
short g_timerTicsPerSecond=120;
int g_timerTicsPerSecond=120;
//fx_device device;
sound_t g_sounds[ MAXSOUNDS ];