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

This commit is contained in:
terminx 2008-11-05 11:49:13 +00:00
parent b0ef9c1c2f
commit 4efb91b376
24 changed files with 112 additions and 62 deletions

View file

@ -35,7 +35,7 @@ LINK=link /opt:nowin98 /nologo /opt:ref
MT=mt
CFLAGS= /MD /J /nologo $(flags_cl) \
/I$(INC) /I$(EINC)\ /I$(SRC)\jmact /I$(SRC)\jaudiolib /I$(MSSDKROOT)\include" /I$(PLATFORMSDK)\include" \
/DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W0 $(ENGINEOPTS) \
/DNOCOPYPROTECT /D "_CRT_SECURE_NO_DEPRECATE" -W2 $(ENGINEOPTS) \
/I$(DXROOT)\include /DRENDERTYPEWIN=1
LIBS=user32.lib gdi32.lib shell32.lib dxguid.lib winmm.lib wsock32.lib comctl32.lib \
/NODEFAULTLIB:libFLAC.lib /NODEFAULTLIB:glu32.lib /NODEFAULTLIB:LIBCMT.lib /NODEFAULTLIB:LIBCMTD.lib

View file

@ -79,7 +79,7 @@ EDITOROBJS=$(OBJ)\build.$o \
RENDERTYPE=WIN
LIBS=$(LIBS) user32.lib gdi32.lib shell32.lib dxguid.lib wsock32.lib comctl32.lib
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /D "_CRT_SECURE_NO_DEPRECATE" /W0
CFLAGS=$(CFLAGS) /DRENDERTYPE$(RENDERTYPE)=1 /D "_CRT_SECURE_NO_DEPRECATE" /W2
# RULES
.SUFFIXES: .masm

View file

@ -297,6 +297,8 @@ EXTERN signed char h_xoffs[MAXTILES], h_yoffs[MAXTILES];
extern char *engineerrstr;
extern char noclip;
EXTERN int editorzrange[2];
/*************************************************************************
POSITION VARIABLES:
@ -484,7 +486,7 @@ typedef struct s_equation {
typedef struct s_point2d {
float x, y;
} _point2d;
_equation equation(int x1, int y1, int x2, int y2);
_equation equation(float x1, float y1, float x2, float y2);
int sameside(_equation* eq, _point2d* p1, _point2d* p2);
int wallvisible(short wallnum);

View file

@ -5,6 +5,11 @@
#ifndef __compat_h__
#define __compat_h__
# ifdef _WIN32
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
# endif
#ifndef UNREFERENCED_PARAMETER
#define UNREFERENCED_PARAMETER(x) x=x
#endif

View file

@ -102,6 +102,7 @@ extern void (APIENTRY * bglColor4f)( GLfloat red, GLfloat green, GLfloat blue, G
extern void (APIENTRY * bglColor4ub)( GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha );
extern void (APIENTRY * bglTexCoord2d)( GLdouble s, GLdouble t );
extern void (APIENTRY * bglTexCoord2f)( GLfloat s, GLfloat t );
extern void (APIENTRY * bglTexCoord2i)( GLint s, GLint t );
// Lighting
extern void (APIENTRY * bglShadeModel)( GLenum mode );

View file

@ -622,13 +622,13 @@ void editinput(void)
ldiv_t ld;
if (mlook)
{
ld = ldiv((int)(mousx), (1<<16)/(msens*0.5f)); mousx = ld.quot; mousexsurp = ld.rem;
ld = ldiv((int)(mousy), (1<<16)/(msens*0.25f)); mousy = ld.quot; mouseysurp = ld.rem;
ld = ldiv((int)(mousx), (int)((1<<16)/(msens*0.5f))); mousx = ld.quot; mousexsurp = ld.rem;
ld = ldiv((int)(mousy), (int)((1<<16)/(msens*0.25f))); mousy = ld.quot; mouseysurp = ld.rem;
}
else
{
ld = ldiv((int)(mousx), (1<<16)/msens); mousx = ld.quot; mousexsurp = ld.rem;
ld = ldiv((int)(mousy), (1<<16)/msens); mousy = ld.quot; mouseysurp = ld.rem;
ld = ldiv((int)(mousx), (int)((1<<16)/msens)); mousx = ld.quot; mousexsurp = ld.rem;
ld = ldiv((int)(mousy), (int)((1<<16)/msens)); mousy = ld.quot; mouseysurp = ld.rem;
}
}

View file

@ -183,7 +183,7 @@ int Bstrncmp(const char *s1, const char *s2, bsize_t n)
int Bstrcasecmp(const char *s1, const char *s2)
{
#ifdef _MSC_VER
return stricmp(s1,s2);
return _stricmp(s1,s2);
#else
return strcasecmp(s1,s2);
#endif
@ -192,7 +192,7 @@ int Bstrcasecmp(const char *s1, const char *s2)
int Bstrncasecmp(const char *s1, const char *s2, bsize_t n)
{
#ifdef _MSC_VER
return strnicmp(s1,s2,n);
return _strnicmp(s1,s2,n);
#else
return strncasecmp(s1,s2,n);
#endif

View file

@ -6029,7 +6029,7 @@ typedef struct s_maskleaf
_maskleaf maskleaves[MAXWALLSB];
// returns equation of a line given two points
_equation equation(int x1, int y1, int x2, int y2)
_equation equation(float x1, float y1, float x2, float y2)
{
_equation ret;
@ -6160,11 +6160,11 @@ void drawpeel(int peel)
bglBegin(GL_QUADS);
bglTexCoord2f(0.0f, 0.0f);
bglVertex2f(-1.0f, -1.0f);
bglTexCoord2f(xdim, 0.0f);
bglTexCoord2i(xdim, 0);
bglVertex2f(1.0f, -1.0f);
bglTexCoord2f(xdim, ydim);
bglTexCoord2i(xdim, ydim);
bglVertex2f(1.0f, 1.0f);
bglTexCoord2f(0.0f, ydim);
bglTexCoord2i(0, ydim);
bglVertex2f(-1.0f, 1.0f);
bglEnd();
}

View file

@ -69,6 +69,7 @@ void (APIENTRY * bglColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat a
void (APIENTRY * bglColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
void (APIENTRY * bglTexCoord2d)(GLdouble s, GLdouble t);
void (APIENTRY * bglTexCoord2f)(GLfloat s, GLfloat t);
void (APIENTRY * bglTexCoord2i)(GLint s, GLint t);
// Lighting
void (APIENTRY * bglShadeModel)(GLenum mode);
@ -321,6 +322,7 @@ int loadgldriver(const char *driver)
bglColor4ub = GETPROC("glColor4ub");
bglTexCoord2d = GETPROC("glTexCoord2d");
bglTexCoord2f = GETPROC("glTexCoord2f");
bglTexCoord2i = GETPROC("glTexCoord2i");
// Lighting
bglShadeModel = GETPROC("glShadeModel");
@ -503,6 +505,7 @@ int unloadgldriver(void)
bglColor4ub = NULL;
bglTexCoord2d = NULL;
bglTexCoord2f = NULL;
bglTexCoord2i = NULL;
// Lighting
bglShadeModel = NULL;

View file

@ -1450,7 +1450,7 @@ static void invdct8x8(int *dc, unsigned char dcflag)
static void yrbrend(int x, int y)
{
int i, j, ox, oy, xx, yy, xxx, yyy, xxxend, yyyend, yv, cr, cb, *odc, *dc, *dc2;
int i, j, ox, oy, xx, yy, xxx, yyy, xxxend, yyyend, yv, cr = 0, cb = 0, *odc, *dc, *dc2;
intptr_t p,pp;
odc = dct[0]; dc2 = dct[10];

View file

@ -585,14 +585,14 @@ void gltexapplyprops(void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
if (r_fullbrights && pth->flags & 16)
{
bglBindTexture(GL_TEXTURE_2D,pth->ofb->glpic);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
}
}
@ -613,7 +613,7 @@ void gltexapplyprops(void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
for (sk=m->skinmap;sk;sk=sk->next)
@ -624,7 +624,7 @@ void gltexapplyprops(void)
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,glfiltermodes[gltexfiltermode].mag);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,glfiltermodes[gltexfiltermode].min);
if (glinfo.maxanisotropy > 1.0)
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
}
}
@ -1182,7 +1182,7 @@ int gloadtile_art(int dapic, int dapal, int dameth, pthtyp *pth, int doalloc)
if (glinfo.maxanisotropy > 1.0)
{
if (glanisotropy <= 0 || glanisotropy > glinfo.maxanisotropy) glanisotropy = (int)glinfo.maxanisotropy;
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
if (!(dameth&4))
@ -1696,7 +1696,7 @@ int gloadtile_hi(int dapic,int dapalnum, int facen, hicreplctyp *hicr, int damet
if (glinfo.maxanisotropy > 1.0)
{
if (glanisotropy <= 0 || glanisotropy > glinfo.maxanisotropy) glanisotropy = (int)glinfo.maxanisotropy;
bglTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
bglTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAX_ANISOTROPY_EXT,glanisotropy);
}
if (!(dameth&4))

View file

@ -10,7 +10,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#ifndef _WIN32_IE
#define _WIN32_IE 0x0300
#endif
#include <commctrl.h>
#include <stdio.h>

View file

@ -831,7 +831,7 @@ void setmousepresscallback(void (*callback)(int, int)) { mousepresscallback = ca
void setjoypresscallback(void (*callback)(int, int)) { joypresscallback = callback; }
DWORD WINAPI ProcessMouse()
DWORD WINAPI ProcessMouse(LPVOID lpThreadParameter)
{
while (moustat && lpDID[MOUSE])
{
@ -1372,7 +1372,7 @@ static BOOL InitDirectInput(void)
*devicedef[devn].did = NULL;
// initprintf(" - Creating %s device\n", devicedef[devn].name);
result = IDirectInput7_CreateDevice(lpDI, &guidDevs[devn], &dev, NULL);
result = IDirectInput7_CreateDeviceEx(lpDI, &guidDevs[devn], &IID_IDirectInputDevice7, &dev, NULL);
if FAILED(result) { HorribleDInputDeath("Failed creating device", result); }
else if (result != DI_OK) initprintf(" Created device with warning: %s\n",GetDInputError(result));
@ -2739,7 +2739,7 @@ static int setgammaramp(WORD gt[3][256])
int setgamma(void)
{
int i;
WORD gammaTable[768];
WORD gammaTable[3][256];
float gamma = max(0.1f,min(4.f,vid_gamma));
float contrast = max(0.1f,min(3.f,vid_contrast));
float bright = max(-0.8f,min(0.8f,vid_brightness));
@ -2757,7 +2757,7 @@ int setgamma(void)
if (gamma != 1) val = pow(val, invgamma) / norm;
val += bright * 128;
gammaTable[i] = gammaTable[i + 256] = gammaTable[i + 512] = (WORD)max(0.f,(double)min(0xffff,val*256));
gammaTable[0][i] = gammaTable[1][i] = gammaTable[2][i] = (WORD)max(0.f,(double)min(0xffff,val*256));
}
return setgammaramp(gammaTable);
}

View file

@ -3000,12 +3000,12 @@ void drawtileinfo(char *title,int x,int y,int picnum,int shade,int pal,int cstat
x1=x+80;
if (j)x1/=2;
x1*=320./xdimgame;
scale/=max(tilesizx[picnum],tilesizy[picnum])/24.;
x1=(int)(x1*(320./xdimgame));
scale=(int)(scale/(max(tilesizx[picnum],tilesizy[picnum])/24.));
rotatesprite((x1+13)<<16,(y+11)<<16,scale,0,picnum,shade,pal,2,0L,0L,xdim-1L,ydim-1L);
x*=xdimgame/320.;
y*=ydimgame/200.;
x=(int)(x*(xdimgame/320.));
y=(int)(y*(ydimgame/200.));
begindrawing();
printext256(x+2,y+2,0,-1,title,j);
printext256(x,y,255-13,-1,title,j);
@ -3667,8 +3667,8 @@ static void Keys3d(void)
}
}
x=WIND1X;y=WIND1Y;
x*=xdimgame/320.;
y*=ydimgame/200.;
x=(int)(x*(xdimgame/320.));
y=(int)(y*(ydimgame/200.));
y+=(ydimgame>>6)*8;
if (getmessageleng)
{
@ -5761,7 +5761,7 @@ static void Keys3d(void)
{
mouseaction=1;
mouseax+=mousex;
updownunits=klabs(mouseax/2.);
updownunits=klabs((int)(mouseax/2.));
if (updownunits) {mouseax=0;}
}
}
@ -5869,7 +5869,7 @@ static void Keys3d(void)
updownunits=klabs(mousey);
if (searchstat != 3)
{
updownunits=klabs(mousey*128./tilesizy[wall[searchwall].picnum]);
updownunits=klabs((int)(mousey*128./tilesizy[wall[searchwall].picnum]));
}
}
}
@ -6667,6 +6667,15 @@ static void Keys2d(void)
}
enddrawing();
if (keystatus[KEYSC_QUOTE] && keystatus[KEYSC_Z]) // ' z
{
keystatus[KEYSC_Z] = 0;
editorzrange[0]=getnumber16("Upper Z range: ",editorzrange[0],INT32_MAX,1);
editorzrange[1]=getnumber16("Lower Z range: ",editorzrange[1],INT32_MAX,1);
printmessage16("");
}
if (keystatus[0x14]) // T (tag)
{
char buffer[80];
@ -10548,25 +10557,25 @@ static void FuncMenu(void)
for (i = 0; i < highlightsectorcnt; i++)
{
currsector = highlightsector[i];
sector[currsector].ceilingz *= size;
sector[currsector].floorz *= size;
sector[currsector].ceilingz = (int)(sector[currsector].ceilingz*size);
sector[currsector].floorz = (int)(sector[currsector].floorz*size);
// Do all the walls in the sector
start_wall = sector[currsector].wallptr;
end_wall = start_wall + sector[currsector].wallnum;
for (w = start_wall; w < end_wall; w++)
{
wall[w].x *= size;
wall[w].y *= size;
wall[w].yrepeat = min(wall[w].yrepeat/size,255);
wall[w].x = (int)(wall[w].x*size);
wall[w].y = (int)(wall[w].y*size);
wall[w].yrepeat = min((int)(wall[w].yrepeat/size),255);
}
w = headspritesect[highlightsector[i]];
while (w >= 0)
{
sprite[w].x *= size;
sprite[w].y *= size;
sprite[w].z *= size;
sprite[w].xrepeat = min(max(sprite[w].xrepeat*size,1),255);
sprite[w].yrepeat = min(max(sprite[w].yrepeat*size,1),255);
sprite[w].x = (int)(sprite[w].x*size);
sprite[w].y = (int)(sprite[w].y*size);
sprite[w].z = (int)(sprite[w].z*size);
sprite[w].xrepeat = min(max((int)(sprite[w].xrepeat*size),1),255);
sprite[w].yrepeat = min(max((int)(sprite[w].yrepeat*size),1),255);
w = nextspritesect[w];
}
}

View file

@ -47,6 +47,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#undef UNREFERENCED_PARAMETER
#include <windows.h>
#include <shellapi.h>
extern int getversionfromwebsite(char *buffer);
@ -4369,7 +4370,7 @@ void displayrooms(int snum,int smoothratio)
smoothratio = min(max(smoothratio,0),65536);
visibility = p->visibility*(numplayers>1?1:r_ambientlightrecip);
visibility = (int)(p->visibility*(numplayers>1?1.f:r_ambientlightrecip));
if (ud.pause_on || g_player[snum].ps->on_crane > -1) smoothratio = 65536;

View file

@ -1862,7 +1862,7 @@ static int parsecommand(void)
{
int i, j=0, k=0, done, tw;
char *temptextptr;
intptr_t *tempscrptr;
intptr_t *tempscrptr = NULL;
if (quitevent)
{
@ -4372,7 +4372,7 @@ static int parsecommand(void)
case CON_CASE:
{
intptr_t tempoffset;
intptr_t tempoffset = 0;
//AddLog("Found Case");
repeatcase:
scriptptr--; // don't save in code

View file

@ -111,21 +111,21 @@ extern "C" {
(\
((x)>31) ?\
(CONTROL_ButtonState2 |= (value<<((x)-32))) :\
(CONTROL_ButtonState1 |= (value<<(x)))\
(CONTROL_ButtonState1 |= (value<<((x)&31)))\
)
#define BUTTONCLEAR(x) \
(\
((x)>31) ?\
(CONTROL_ButtonState2 &= (~(1<<((x)-32)))) :\
(CONTROL_ButtonState1 &= (~(1<<(x))))\
(CONTROL_ButtonState1 &= (~(1<<((x)&31))))\
)
#define BUTTONHELDSET(x,value)\
(\
((x)>31) ?\
(CONTROL_ButtonHeldState2 |= value<<((x)-32)) :\
(CONTROL_ButtonHeldState1 |= value<<(x))\
(CONTROL_ButtonHeldState1 |= value<<((x)&31))\
)
#define LIMITCONTROL(x)\

View file

@ -50,13 +50,13 @@ extern "C" {
( \
((x)>31) ? \
((CONTROL_ButtonState2>>( (x) - 32) ) & 1) :\
((CONTROL_ButtonState1>> (x) ) & 1) \
((CONTROL_ButtonState1>> ((x) & 31) ) & 1) \
)
#define BUTTONHELD(x) \
( \
((x)>31) ? \
((CONTROL_ButtonHeldState2>>((x)-32)) & 1) :\
((CONTROL_ButtonHeldState1>>(x)) & 1)\
((CONTROL_ButtonHeldState1>>((x) & 31)) & 1)\
)
#define BUTTONJUSTPRESSED(x) \
( BUTTON( x ) && !BUTTONHELD( x ) )

View file

@ -57,6 +57,7 @@ typedef double float64;
//typedef int double float128;
typedef float64 appfloat;
#ifndef _MSC_VER
#define MAXINT32 0x7fffffff
#define MININT32 -0x80000000
#define MAXUINT32 0xffffffff
@ -66,6 +67,7 @@ typedef float64 appfloat;
#define MININT16 -0x8000
#define MAXUINT16 0xffff
#define MINUINT16 0
#endif
//***************************************************************************
//

View file

@ -2504,13 +2504,13 @@ cheat_for_port_credits:
case 1:
{
int dummy = glanisotropy;
modval(0,glinfo.maxanisotropy+1,(int *)&dummy,1,probey==io);
modval(0,(int)glinfo.maxanisotropy+1,(int *)&dummy,1,probey==io);
if (dummy > glanisotropy) glanisotropy *= 2;
else if (dummy < glanisotropy) glanisotropy /= 2;
if (x==io)
glanisotropy *= 2;
if (glanisotropy > glinfo.maxanisotropy) glanisotropy = 1;
else if (glanisotropy < 1) glanisotropy = glinfo.maxanisotropy;
else if (glanisotropy < 1) glanisotropy = (int)glinfo.maxanisotropy;
gltexapplyprops();
if (glanisotropy == 1) strcpy(tempbuf,"NONE");
else sprintf(tempbuf,"%dx",glanisotropy);
@ -2529,7 +2529,7 @@ cheat_for_port_credits:
}
case 3:
{
int i = (float)r_ambientlight*1024.f;
int i = (int)(r_ambientlight*1024.f);
int j = i;
_bar(1,d+8,yy+7, &i,128,x==io,MENUHIGHLIGHT(io),0,128,4096);
Bsprintf(tempbuf,"%.2f",r_ambientlight);
@ -2670,18 +2670,18 @@ cheat_for_port_credits:
rotatesprite(160<<16,27<<16,24576,0,3290,0,0,2+8+16,0,scale(ydim,35,200),xdim-1,scale(ydim,80,200)-1);
{
int b = (double)(vid_gamma*40960.f);
int b = (int)(vid_gamma*40960.f);
_bar(0,c+177,98,&b,4096,x==0,MENUHIGHLIGHT(0),0,8192,163840);
if (b != (double)(vid_gamma*40960.f))
{
vid_gamma = (double)b/40960.f;
ud.brightness = min(max((double)((vid_gamma-1.0)*10.0),0),15);
ud.brightness = (int)(min(max((double)((vid_gamma-1.0)*10.0),0),15));
ud.brightness <<= 2;
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
}
b = (vid_contrast*40960.f);
b = (int)(vid_contrast*40960.f);
_bar(0,c+177,98+16,&b,2048,x==1,MENUHIGHLIGHT(1),0,4096,110592);
if (b != (vid_contrast*40960.f))
@ -2690,7 +2690,7 @@ cheat_for_port_credits:
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
}
b = (vid_brightness*40960.f);
b = (int)(vid_brightness*40960.f);
_bar(0,c+177,98+16+16,&b,2048,x==2,MENUHIGHLIGHT(2),0,-32768,32768);
if (b != (vid_brightness*40960.f))
@ -3440,7 +3440,7 @@ cheat_for_port_credits:
*/
if (!getrendermode())
{
int i = (float)r_ambientlight*1024.f;
int i = (int)(r_ambientlight*1024.f);
int j = i;
menutext(c,50+62+16+16,MENUHIGHLIGHT(5),0,"PIXEL DOUBLING");
menutext(c+168,50+62+16+16,MENUHIGHLIGHT(5),0,ud.detail?"OFF":"ON");

View file

@ -1333,7 +1333,7 @@ static int osdcmd_vid_gamma(const osdfuncparm_t *parm)
return OSDCMD_SHOWHELP;
}
vid_gamma = atof(parm->parms[0]);
ud.brightness = min(max((float)((vid_gamma-1.0)*10.0),0),15);
ud.brightness = (int)(min(max((float)((vid_gamma-1.0)*10.0),0),15));
ud.brightness <<= 2;
OSD_Printf("%s\n",parm->raw);
setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0);
@ -1432,6 +1432,28 @@ static int osdcmd_maxfps(const osdfuncparm_t *parm)
return OSDCMD_OK;
}
static int osdcmd_inittimer(const osdfuncparm_t *parm)
{
int j;
if (parm->numparms != 1)
{
OSD_Printf("%dHz timer\n",timer);
return OSDCMD_SHOWHELP;
}
j = atol(parm->parms[0]);
if (timer == j)
return OSDCMD_OK;
uninittimer();
inittimer(j);
timer = j;
OSD_Printf("%s\n",parm->raw);
return OSDCMD_OK;
}
int registerosdcommands(void)
{
unsigned int i;
@ -1485,6 +1507,7 @@ int registerosdcommands(void)
OSD_RegisterFunction("in_joystick","in_joystick: enables input from the joystick if it is present",osdcmd_usemousejoy);
OSD_RegisterFunction("in_mouse","in_mouse: enables input from the mouse if it is present",osdcmd_usemousejoy);
OSD_RegisterFunction("initgroupfile","initgroupfile <path>: adds a grp file into the game filesystem", osdcmd_initgroupfile);
OSD_RegisterFunction("inittimer","debug", osdcmd_inittimer);
OSD_RegisterFunction("name","name: change your multiplayer nickname", osdcmd_name);
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);

View file

@ -4419,7 +4419,7 @@ void processinput(int snum)
p->posxv += ((g_player[snum].sync->fvel*doubvel)<<6);
p->posyv += ((g_player[snum].sync->svel*doubvel)<<6);
if ((aplWeaponWorksLike[p->curr_weapon] == KNEE_WEAPON && *kb > 10 && p->on_ground) || (p->on_ground && (sb_snum&2)))
if ((aplWeaponWorksLike[p->curr_weapon][snum] == KNEE_WEAPON && *kb > 10 && p->on_ground) || (p->on_ground && (sb_snum&2)))
{
p->posxv = mulscale(p->posxv,p->runspeed-0x2000,16);
p->posyv = mulscale(p->posyv,p->runspeed-0x2000,16);

View file

@ -642,8 +642,8 @@ void testcallback(unsigned int num)
if ((int)num < 0)
{
if (lumplockbyte[-num] >= 200)
lumplockbyte[-num]--;
if (lumplockbyte[num] >= 200)
lumplockbyte[num]--;
return;
}

View file

@ -14,7 +14,9 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <windowsx.h>
#ifndef _WIN32_IE
#define _WIN32_IE 0x0300
#endif
#include <commctrl.h>
#include <stdio.h>