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

This commit is contained in:
terminx 2008-12-31 09:07:49 +00:00
parent 695829d357
commit ac7607a8bb
12 changed files with 73 additions and 40 deletions

View file

@ -102,6 +102,7 @@ void setmousepresscallback(void (*callback)(int,int));
void setjoypresscallback(void (*callback)(int,int));
const unsigned char *getkeyname(int num);
const unsigned char *getjoyname(int what, int num); // what: 0=axis, 1=button, 2=hat
char *strtolower(char *str, int len);
unsigned char bgetchar(void);
int bkbhit(void);

View file

@ -47,6 +47,19 @@ struct glinfo glinfo =
};
#endif
char *strtolower(char *str, int len)
{
int i = 0;
if (len <= 0) return str;
do
{
*(str+i) = Btolower(*(str+i));
i++;
}
while (--len);
return str;
}
static void onvideomodechange(int newmode) { UNREFERENCED_PARAMETER(newmode); }
void (*baselayer_onvideomodechange)(int) = onvideomodechange;

View file

@ -3072,7 +3072,8 @@ SKIP:
posx = mousxplc;
posy = mousyplc;
}
_printmessage16("Zoom: %d",zoom);
if (zoom > 16384) zoom = 16384;
printmessage16("Zoom: %d",zoom);
}
if ((keystatus[buildkeys[BK_MOVEDOWN]] || (bstatus&32)) && (zoom > 8))
{
@ -3084,10 +3085,9 @@ SKIP:
posx = mousxplc;
posy = mousyplc;
}
_printmessage16("Zoom: %d",zoom);
}
if (zoom < 8) zoom = 8;
if (zoom > 16384) zoom = 16384;
printmessage16("Zoom: %d",zoom);
}
if (keystatus[0x22]) // G (grid on/off)
{

View file

@ -65,6 +65,7 @@ extern int remapinit;
extern double msens;
extern int editorgridextent;
extern int showheightindicators;
extern int graphicsmode;
/*
* SETUP.DAT
@ -228,6 +229,9 @@ int loadsetup(const char *fn)
if (readconfig(fp, "showheightindicators", val, VL) > 0)
showheightindicators = min(max(Batoi(val),0),2);
if (readconfig(fp, "graphicsmode", val, VL) > 0)
graphicsmode = min(max(Batoi(val),0),2);
#ifdef _WIN32
{
extern char map_dik_code(int);
@ -373,6 +377,9 @@ int writesetup(const char *fn)
"\n"
"; Height indicators (0:none, 1:only 2-sided&different, 2:all)\n"
"showheightindicators = %d\n\n"
"\n"
"; 2D mode display type (0:classic, 1:textured, 2:textured/animated)\n"
"graphicsmode = %d\n\n"
#if 1
"; Key Settings\n"
"; Here's a map of all the keyboard scan codes: NOTE: values are listed in hex!\n"
@ -434,7 +441,7 @@ int writesetup(const char *fn)
#endif
option[3], msens, unrealedlook, pk_uedaccel, quickmapcycling,
revertCTRL,scrollamount,pk_turnaccel,pk_turndecel,autosave,
showheightindicators,
showheightindicators,graphicsmode,
#if 1
keys[0], keys[1], keys[2], keys[3], keys[4], keys[5],
keys[6], keys[7], keys[8], keys[9], keys[10], keys[11],

View file

@ -1790,6 +1790,7 @@ void OSD_SetVersionString(const char *version, int shade, int pal)
static symbol_t *addnewsymbol(const char *name)
{
symbol_t *newsymb, *s, *t;
char *lname;
if (osdnumsymbols >= MAXSYMBOLS) return NULL;
newsymb = (symbol_t *)Bmalloc(sizeof(symbol_t));
@ -1823,6 +1824,9 @@ static symbol_t *addnewsymbol(const char *name)
}
}
HASH_add(&osdsymbolsH, name, osdnumsymbols);
lname = strtolower(Bstrdup(name),Bstrlen(name));
HASH_add(&osdsymbolsH, lname, osdnumsymbols);
Bfree(lname);
osdsymbptrs[osdnumsymbols++] = newsymb;
return newsymb;
}
@ -1842,7 +1846,6 @@ static symbol_t *findsymbol(const char *name, symbol_t *startingat)
return NULL;
}
//
// findexactsymbol() -- Finds a symbol, complete named
//
@ -1852,9 +1855,6 @@ static symbol_t *findexactsymbol(const char *name)
char *lname = Bstrdup(name);
if (!symbols) return NULL;
for (i=Bstrlen(lname);i>=0;i--)
lname[i] = Btolower(lname[i]);
i = HASH_find(&osdsymbolsH,lname);
if (i > -1)
{
@ -1863,7 +1863,14 @@ static symbol_t *findexactsymbol(const char *name)
Bfree(lname);
return osdsymbptrs[i];
}
// try it again
lname = strtolower(lname, Bstrlen(name));
i = HASH_find(&osdsymbolsH,lname);
Bfree(lname);
if (i > -1)
return osdsymbptrs[i];
return NULL;
}

View file

@ -4152,7 +4152,7 @@ static LRESULT CALLBACK WndProcCallback(HWND hWnd, UINT uMsg, WPARAM wParam, LPA
grabmouse(1);
regrabmouse = 0;
}
ShowWindow(hWindow, SW_SHOWNORMAL);
ShowWindow(hWindow, SW_RESTORE);
SetForegroundWindow(hWindow);
SetFocus(hWindow);
setgamemode(realfs,xdim,ydim,bpp);

View file

@ -44,7 +44,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <shellapi.h>
#endif
#define BUILDDATE " 20081228"
#define BUILDDATE " 20081230"
#define VERSION " 1.2.0devel"
static int floor_over_floor;

View file

@ -57,10 +57,18 @@ int32 CONFIG_FunctionNameToNum(char * func)
{
int32 i;
i = HASH_findcase(&gamefuncH,func);
if (i > -1)
i = HASH_find(&gamefuncH,func);
if (i < 0)
{
char *str = strtolower(Bstrdup(func),Bstrlen(func));
i = HASH_find(&gamefuncH,str);
Bfree(str);
return i;
}
return i;
return -1;
}
/*

View file

@ -10926,7 +10926,12 @@ void app_main(int argc,const char **argv)
HASH_init(&gamefuncH);
for (i=NUMGAMEFUNCTIONS-1;i>=0;i--)
{
char *str = strtolower(Bstrdup(gamefunctions[i]),Bstrlen(gamefunctions[i]));
HASH_add(&gamefuncH,gamefunctions[i],i);
HASH_add(&gamefuncH,str,i);
Bfree(str);
}
i = CONFIG_ReadSetup();
if (getenv("DUKE3DGRP")) duke3dgrp = getenv("DUKE3DGRP");

View file

@ -1410,20 +1410,6 @@ static inline int isaltok(char c)
return (isalnum(c) || c == '{' || c == '}' || c == '/' || c == '*' || c == '-' || c == '_' || c == '.');
}
// strlower -- makes a string in memory lowercase and returns a pointer
static char *strtolower(char *str, int len)
{
int i = 0;
if (len <= 0) return str;
do
{
*(str+i) = Btolower(*(str+i));
i++;
}
while (--len);
return str;
}
static inline int GetLabelNameid(const memberlabel_t *pLabel, struct HASH_table *tH, const char *psz)
{
// find the label psz in the table pLabel.
@ -4736,6 +4722,12 @@ repeatcase:
gamefunctions[j][i] = '\0';
keydefaults[j*3][i] = '\0';
HASH_add(&gamefuncH,gamefunctions[j],j);
{
char *str = strtolower(Bstrdup(gamefunctions[j]),Bstrlen(gamefunctions[j]));
HASH_add(&gamefuncH,str,j);
Bfree(str);
}
return 0;
case CON_DEFINESKILLNAME:

View file

@ -440,7 +440,7 @@ static void X_Move(void)
intptr_t *moveptr;
int a = g_sp->hitag, goalang, angdif;
int daxvel;
int dead = (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0);
int deadflag = (A_CheckEnemySprite(g_sp) && g_sp->extra <= 0);
if (a == -1) a = 0;
@ -448,7 +448,7 @@ static void X_Move(void)
if (g_t[1] == 0 || a == 0)
{
if ((ActorExtra[g_i].bposx != g_sp->x) || (ActorExtra[g_i].bposy != g_sp->y))
if (deadflag || (ActorExtra[g_i].bposx != g_sp->x) || (ActorExtra[g_i].bposy != g_sp->y))
{
ActorExtra[g_i].bposx = g_sp->x;
ActorExtra[g_i].bposy = g_sp->y;
@ -457,7 +457,7 @@ static void X_Move(void)
return;
}
if (a&face_player && !dead)
if (a&face_player && !deadflag)
{
if (g_player[g_p].ps->newowner >= 0)
goalang = getangle(g_player[g_p].ps->oposx-g_sp->x,g_player[g_p].ps->oposy-g_sp->y);
@ -468,10 +468,10 @@ static void X_Move(void)
g_sp->ang += angdif;
}
if (a&spin && !dead)
if (a&spin && !deadflag)
g_sp->ang += sintable[((g_t[0]<<3)&2047)]>>6;
if (a&face_player_slow && !dead)
if (a&face_player_slow && !deadflag)
{
if (g_player[g_p].ps->newowner >= 0)
goalang = getangle(g_player[g_p].ps->oposx-g_sp->x,g_player[g_p].ps->oposy-g_sp->y);
@ -482,13 +482,13 @@ static void X_Move(void)
g_sp->ang += angdif;
}
if (((a&jumptoplayer) == jumptoplayer) && !dead)
if (((a&jumptoplayer) == jumptoplayer) && !deadflag)
{
if (g_t[0] < 16)
g_sp->zvel -= (sintable[(512+(g_t[0]<<4))&2047]>>5);
}
if (a&face_player_smart && !dead)
if (a&face_player_smart && !deadflag)
{
int newx = g_player[g_p].ps->posx+(g_player[g_p].ps->posxv/768);
int newy = g_player[g_p].ps->posy+(g_player[g_p].ps->posyv/768);
@ -505,10 +505,10 @@ static void X_Move(void)
if (a&geth) g_sp->xvel += (*moveptr-g_sp->xvel)>>1;
if (a&getv) g_sp->zvel += ((*(moveptr+1)<<4)-g_sp->zvel)>>1;
if (a&dodgebullet && !dead)
if (a&dodgebullet && !deadflag)
A_Dodge(g_sp);
if (g_sp->picnum != APLAYER && !dead)
if (g_sp->picnum != APLAYER)
X_AlterAng(a);
if (g_sp->xvel > -6 && g_sp->xvel < 6) g_sp->xvel = 0;

View file

@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//-------------------------------------------------------------------------
#include "duke3d.h"
const char *s_buildDate = "20081228";
const char *s_buildDate = "20081230";
char *MusicPtr = NULL;
int g_musicSize;