mirror of
https://bitbucket.org/CPMADevs/cnq3
synced 2024-11-10 06:31:48 +00:00
fixes for VC++ platform toolsets v140 and v141
This commit is contained in:
parent
d0878f3807
commit
04ebdc63f6
25 changed files with 123 additions and 127 deletions
|
@ -390,9 +390,9 @@ int AAS_NearestEntity(vec3_t origin, int modelindex)
|
|||
ent = &aasworld.entities[i];
|
||||
if (ent->i.modelindex != modelindex) continue;
|
||||
VectorSubtract(ent->i.origin, origin, dir);
|
||||
if (abs(dir[0]) < 40)
|
||||
if (fabsf(dir[0]) < 40)
|
||||
{
|
||||
if (abs(dir[1]) < 40)
|
||||
if (fabsf(dir[1]) < 40)
|
||||
{
|
||||
dist = VectorLength(dir);
|
||||
if (dist < bestdist)
|
||||
|
|
|
@ -168,7 +168,7 @@ int AAS_AgainstLadder(vec3_t origin)
|
|||
//get the plane the face is in
|
||||
plane = &aasworld.planes[face->planenum ^ side];
|
||||
//if the origin is pretty close to the plane
|
||||
if (abs(DotProduct(plane->normal, origin) - plane->dist) < 3)
|
||||
if (fabsf(DotProduct(plane->normal, origin) - plane->dist) < 3)
|
||||
{
|
||||
if (AAS_PointInsideFace(abs(facenum), origin, 0.1f)) return qtrue;
|
||||
} //end if
|
||||
|
|
|
@ -2468,16 +2468,16 @@ int AAS_Reachability_Ladder(int area1num, int area2num)
|
|||
VectorMA(area1point, -32, dir, area1point);
|
||||
VectorMA(area2point, 32, dir, area2point);
|
||||
//
|
||||
ladderface1vertical = abs(DotProduct(plane1->normal, up)) < 0.1;
|
||||
ladderface2vertical = abs(DotProduct(plane2->normal, up)) < 0.1;
|
||||
ladderface1vertical = fabsf(DotProduct(plane1->normal, up)) < 0.1f;
|
||||
ladderface2vertical = fabsf(DotProduct(plane2->normal, up)) < 0.1f;
|
||||
//there's only reachability between vertical ladder faces
|
||||
if (!ladderface1vertical && !ladderface2vertical) return qfalse;
|
||||
//if both vertical ladder faces
|
||||
if (ladderface1vertical && ladderface2vertical
|
||||
//and the ladder faces do not make a sharp corner
|
||||
&& DotProduct(plane1->normal, plane2->normal) > 0.7
|
||||
&& DotProduct(plane1->normal, plane2->normal) > 0.7f
|
||||
//and the shared edge is not too vertical
|
||||
&& abs(DotProduct(sharededgevec, up)) < 0.7)
|
||||
&& fabsf(DotProduct(sharededgevec, up)) < 0.7f)
|
||||
{
|
||||
//create a new reachability link
|
||||
lreach = AAS_AllocReachability();
|
||||
|
@ -2602,7 +2602,7 @@ int AAS_Reachability_Ladder(int area1num, int area2num)
|
|||
if (face2->faceflags & FACE_LADDER)
|
||||
{
|
||||
plane2 = &aasworld.planes[face2->planenum];
|
||||
if (abs(DotProduct(plane2->normal, up)) < 0.1) break;
|
||||
if (fabsf(DotProduct(plane2->normal, up)) < 0.1f) break;
|
||||
} //end if
|
||||
} //end for
|
||||
//if from another area without vertical ladder faces
|
||||
|
|
|
@ -1012,7 +1012,6 @@ bot_randomlist_t *BotLoadRandomStrings(char *filename)
|
|||
} //end if
|
||||
while(!PC_CheckTokenString(source, "}"))
|
||||
{
|
||||
size_t len;
|
||||
if (!BotLoadChatMessage(source, chatmessagestring))
|
||||
{
|
||||
FreeSource(source);
|
||||
|
|
|
@ -2059,7 +2059,7 @@ bot_moveresult_t BotTravel_Elevator(bot_movestate_t *ms, aas_reachability_t *rea
|
|||
botimport.Print(PRT_MESSAGE, "bot on elevator\n");
|
||||
#endif //DEBUG_ELEVATOR
|
||||
//if vertically not too far from the end point
|
||||
if (abs(ms->origin[2] - reach->end[2]) < sv_maxbarrier->value)
|
||||
if (fabsf(ms->origin[2] - reach->end[2]) < sv_maxbarrier->value)
|
||||
{
|
||||
#ifdef DEBUG_ELEVATOR
|
||||
botimport.Print(PRT_MESSAGE, "bot moving to end\n");
|
||||
|
|
|
@ -79,9 +79,9 @@ static int bufIndex;
|
|||
SafeFS_Write
|
||||
===============
|
||||
*/
|
||||
static ID_INLINE void SafeFS_Write( const void *buffer, int len, fileHandle_t f )
|
||||
static ID_INLINE void SafeFS_Write( const void *buff, int len, fileHandle_t f )
|
||||
{
|
||||
if( FS_Write( buffer, len, f ) < len )
|
||||
if( FS_Write( buff, len, f ) < len )
|
||||
Com_Error( ERR_DROP, "Failed to write avi file\n" );
|
||||
}
|
||||
|
||||
|
|
|
@ -601,17 +601,17 @@ static void Con_DrawSolidConsole( float frac )
|
|||
const short* text = con.text + (row % con.totallines)*con.linewidth;
|
||||
|
||||
re.SetColor( colorBlack );
|
||||
for (int i = 0; i < con.linewidth; ++i) {
|
||||
SCR_DrawChar( 1 + con.xadjust + i * con.cw, 1 + y, con.cw, con.ch, (text[i] & 0xFF) );
|
||||
for (int j = 0; j < con.linewidth; ++j) {
|
||||
SCR_DrawChar( 1 + con.xadjust + j * con.cw, 1 + y, con.cw, con.ch, (text[j] & 0xFF) );
|
||||
}
|
||||
|
||||
re.SetColor( colorWhite );
|
||||
for (int i = 0; i < con.linewidth; ++i) {
|
||||
if ((text[i] >> 8) != color) {
|
||||
color = (text[i] >> 8);
|
||||
for (int j = 0; j < con.linewidth; ++j) {
|
||||
if ((text[j] >> 8) != color) {
|
||||
color = (text[j] >> 8);
|
||||
re.SetColor( ColorFromChar( color ) );
|
||||
}
|
||||
SCR_DrawChar( con.xadjust + i * con.cw, y, con.cw, con.ch, (text[i] & 0xFF) );
|
||||
SCR_DrawChar( con.xadjust + j * con.cw, y, con.cw, con.ch, (text[j] & 0xFF) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -495,9 +495,9 @@ static qbool ParseHeader( unsigned int* headerLength, mapDownload_t* dl )
|
|||
for (;;) {
|
||||
qbool httpHeader = qfalse;
|
||||
int bytesRead = 0;
|
||||
if (sscanf(s, "HTTP/1.1 %"WSPEC"[^\r]\r\n%n", httpHeaderValue, &bytesRead) == 1)
|
||||
if (sscanf(s, "HTTP/1.1 %" WSPEC "[^\r]\r\n%n", httpHeaderValue, &bytesRead) == 1)
|
||||
httpHeader = qtrue;
|
||||
else if (sscanf(s, "%"WSPEC"[^:]: %"WSPEC"[^\r]\r\n%n", header, value, &bytesRead) != 2)
|
||||
else if (sscanf(s, "%" WSPEC "[^:]: %" WSPEC "[^\r]\r\n%n", header, value, &bytesRead) != 2)
|
||||
break;
|
||||
|
||||
s += bytesRead;
|
||||
|
@ -521,7 +521,7 @@ static qbool ParseHeader( unsigned int* headerLength, mapDownload_t* dl )
|
|||
if (*valueFileName == '\"')
|
||||
valueFileName++;
|
||||
|
||||
if (sscanf(valueFileName, "%"WSPEC"[^\";\r]", fileName) == 1)
|
||||
if (sscanf(valueFileName, "%" WSPEC "[^\";\r]", fileName) == 1)
|
||||
Q_strncpyz(dl->finalName, fileName, sizeof(dl->finalName));
|
||||
}
|
||||
} else if (Q_stricmp(header, "X-CNQ3-CRC32") == 0) {
|
||||
|
|
|
@ -619,7 +619,7 @@ static void S_AddLoopSounds()
|
|||
|
||||
// music streaming
|
||||
|
||||
static void S_Base_RawSamples( int samples, int rate, int width, int s_channels, const byte *data, float volume )
|
||||
static void S_Base_RawSamples( int samples, int rate, int width, int channels, const byte *data, float volume )
|
||||
{
|
||||
int i;
|
||||
int src, dst;
|
||||
|
@ -640,7 +640,7 @@ static void S_Base_RawSamples( int samples, int rate, int width, int s_channels,
|
|||
scale = (float)rate / dma.speed;
|
||||
|
||||
//Com_Printf ("%i < %i < %i\n", s_soundtime, s_paintedtime, s_rawend);
|
||||
if (s_channels == 2 && width == 2)
|
||||
if (channels == 2 && width == 2)
|
||||
{
|
||||
if (scale == 1.0)
|
||||
{ // optimized case
|
||||
|
@ -666,7 +666,7 @@ static void S_Base_RawSamples( int samples, int rate, int width, int s_channels,
|
|||
}
|
||||
}
|
||||
}
|
||||
else if (s_channels == 1 && width == 2)
|
||||
else if (channels == 1 && width == 2)
|
||||
{
|
||||
for (i=0 ; ; i++)
|
||||
{
|
||||
|
@ -679,7 +679,7 @@ static void S_Base_RawSamples( int samples, int rate, int width, int s_channels,
|
|||
s_rawsamples[dst].right = ((short *)data)[src] * intVolume;
|
||||
}
|
||||
}
|
||||
else if (s_channels == 2 && width == 1)
|
||||
else if (channels == 2 && width == 1)
|
||||
{
|
||||
intVolume *= 256;
|
||||
|
||||
|
@ -694,7 +694,7 @@ static void S_Base_RawSamples( int samples, int rate, int width, int s_channels,
|
|||
s_rawsamples[dst].right = ((char *)data)[src*2+1] * intVolume;
|
||||
}
|
||||
}
|
||||
else if (s_channels == 1 && width == 1)
|
||||
else if (channels == 1 && width == 1)
|
||||
{
|
||||
intVolume *= 256;
|
||||
|
||||
|
|
|
@ -104,7 +104,6 @@ static void S_TransferPaintBuffer( int endtime )
|
|||
|
||||
if ( s_testsound->integer ) {
|
||||
int i;
|
||||
int count;
|
||||
|
||||
// write a fixed sine wave
|
||||
count = (endtime - s_paintedtime);
|
||||
|
|
|
@ -1214,7 +1214,7 @@ static void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patc
|
|||
qbool frontFacing[MAX_PATCH_PLANES];
|
||||
float intersection[MAX_PATCH_PLANES];
|
||||
float intersect;
|
||||
const patchPlane_t *planes;
|
||||
const patchPlane_t *lplanes;
|
||||
const facet_t *facet;
|
||||
int i, j, k;
|
||||
float offset;
|
||||
|
@ -1230,11 +1230,11 @@ static void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patc
|
|||
#endif
|
||||
|
||||
// determine the trace's relationship to all planes
|
||||
planes = pc->planes;
|
||||
for ( i = 0 ; i < pc->numPlanes ; i++, planes++ ) {
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], planes->plane );
|
||||
d1 = DotProduct( tw->start, planes->plane ) - planes->plane[3] + offset;
|
||||
d2 = DotProduct( tw->end, planes->plane ) - planes->plane[3] + offset;
|
||||
lplanes = pc->planes;
|
||||
for ( i = 0 ; i < pc->numPlanes ; i++, lplanes++ ) {
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], lplanes->plane );
|
||||
d1 = DotProduct( tw->start, lplanes->plane ) - lplanes->plane[3] + offset;
|
||||
d2 = DotProduct( tw->end, lplanes->plane ) - lplanes->plane[3] + offset;
|
||||
if ( d1 <= 0 ) {
|
||||
frontFacing[i] = qfalse;
|
||||
} else {
|
||||
|
@ -1287,20 +1287,20 @@ static void CM_TracePointThroughPatchCollide( traceWork_t *tw, const struct patc
|
|||
debugFacet = facet;
|
||||
}
|
||||
#endif //BSPC
|
||||
planes = &pc->planes[facet->surfacePlane];
|
||||
lplanes = &pc->planes[facet->surfacePlane];
|
||||
|
||||
// calculate intersection with a slight pushoff
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], planes->plane );
|
||||
d1 = DotProduct( tw->start, planes->plane ) - planes->plane[3] + offset;
|
||||
d2 = DotProduct( tw->end, planes->plane ) - planes->plane[3] + offset;
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], lplanes->plane );
|
||||
d1 = DotProduct( tw->start, lplanes->plane ) - lplanes->plane[3] + offset;
|
||||
d2 = DotProduct( tw->end, lplanes->plane ) - lplanes->plane[3] + offset;
|
||||
tw->trace.fraction = ( d1 - SURFACE_CLIP_EPSILON ) / ( d1 - d2 );
|
||||
|
||||
if ( tw->trace.fraction < 0 ) {
|
||||
tw->trace.fraction = 0;
|
||||
}
|
||||
|
||||
VectorCopy( planes->plane, tw->trace.plane.normal );
|
||||
tw->trace.plane.dist = planes->plane[3];
|
||||
VectorCopy( lplanes->plane, tw->trace.plane.normal );
|
||||
tw->trace.plane.dist = lplanes->plane[3];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1359,7 +1359,7 @@ CM_TraceThroughPatchCollide
|
|||
void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *pc ) {
|
||||
int i, j, hit, hitnum;
|
||||
float offset, enterFrac, leaveFrac, t;
|
||||
patchPlane_t *planes;
|
||||
patchPlane_t *lplanes;
|
||||
facet_t *facet;
|
||||
float plane[4] = {0, 0, 0, 0}, bestplane[4] = {0, 0, 0, 0};
|
||||
vec3_t startp, endp;
|
||||
|
@ -1381,9 +1381,9 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
leaveFrac = 1.0;
|
||||
hitnum = -1;
|
||||
//
|
||||
planes = &pc->planes[ facet->surfacePlane ];
|
||||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
lplanes = &pc->planes[ facet->surfacePlane ];
|
||||
VectorCopy(lplanes->plane, plane);
|
||||
plane[3] = lplanes->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
@ -1400,7 +1400,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
}
|
||||
}
|
||||
else {
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], plane);
|
||||
plane[3] -= offset;
|
||||
VectorCopy( tw->start, startp );
|
||||
VectorCopy( tw->end, endp );
|
||||
|
@ -1414,14 +1414,14 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
}
|
||||
|
||||
for ( j = 0; j < facet->numBorders; j++ ) {
|
||||
planes = &pc->planes[ facet->borderPlanes[j] ];
|
||||
lplanes = &pc->planes[ facet->borderPlanes[j] ];
|
||||
if (facet->borderInward[j]) {
|
||||
VectorNegate(planes->plane, plane);
|
||||
plane[3] = -planes->plane[3];
|
||||
VectorNegate(lplanes->plane, plane);
|
||||
plane[3] = -lplanes->plane[3];
|
||||
}
|
||||
else {
|
||||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
VectorCopy(lplanes->plane, plane);
|
||||
plane[3] = lplanes->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
|
@ -1440,7 +1440,7 @@ void CM_TraceThroughPatchCollide( traceWork_t *tw, const struct patchCollide_s *
|
|||
}
|
||||
else {
|
||||
// NOTE: this works even though the plane might be flipped because the bbox is centered
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], plane);
|
||||
plane[3] += fabs(offset);
|
||||
VectorCopy( tw->start, startp );
|
||||
VectorCopy( tw->end, endp );
|
||||
|
@ -1498,7 +1498,7 @@ CM_PositionTestInPatchCollide
|
|||
qbool CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_s *pc ) {
|
||||
int i, j;
|
||||
float offset, t;
|
||||
patchPlane_t *planes;
|
||||
patchPlane_t *lplanes;
|
||||
facet_t *facet;
|
||||
float plane[4];
|
||||
vec3_t startp;
|
||||
|
@ -1509,9 +1509,9 @@ qbool CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_
|
|||
|
||||
facet = pc->facets;
|
||||
for ( i = 0 ; i < pc->numFacets ; i++, facet++ ) {
|
||||
planes = &pc->planes[ facet->surfacePlane ];
|
||||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
lplanes = &pc->planes[ facet->surfacePlane ];
|
||||
VectorCopy(lplanes->plane, plane);
|
||||
plane[3] = lplanes->plane[3];
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
plane[3] += tw->sphere.radius;
|
||||
|
@ -1526,7 +1526,7 @@ qbool CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_
|
|||
}
|
||||
}
|
||||
else {
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], plane);
|
||||
plane[3] -= offset;
|
||||
VectorCopy( tw->start, startp );
|
||||
}
|
||||
|
@ -1536,14 +1536,14 @@ qbool CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_
|
|||
}
|
||||
|
||||
for ( j = 0; j < facet->numBorders; j++ ) {
|
||||
planes = &pc->planes[ facet->borderPlanes[j] ];
|
||||
lplanes = &pc->planes[ facet->borderPlanes[j] ];
|
||||
if (facet->borderInward[j]) {
|
||||
VectorNegate(planes->plane, plane);
|
||||
plane[3] = -planes->plane[3];
|
||||
VectorNegate(lplanes->plane, plane);
|
||||
plane[3] = -lplanes->plane[3];
|
||||
}
|
||||
else {
|
||||
VectorCopy(planes->plane, plane);
|
||||
plane[3] = planes->plane[3];
|
||||
VectorCopy(lplanes->plane, plane);
|
||||
plane[3] = lplanes->plane[3];
|
||||
}
|
||||
if ( tw->sphere.use ) {
|
||||
// adjust the plane distance apropriately for radius
|
||||
|
@ -1560,7 +1560,7 @@ qbool CM_PositionTestInPatchCollide( traceWork_t *tw, const struct patchCollide_
|
|||
}
|
||||
else {
|
||||
// NOTE: this works even though the plane might be flipped because the bbox is centered
|
||||
offset = DotProduct( tw->offsets[ planes->signbits ], plane);
|
||||
offset = DotProduct( tw->offsets[ lplanes->signbits ], plane);
|
||||
plane[3] += fabs(offset);
|
||||
VectorCopy( tw->start, startp );
|
||||
}
|
||||
|
|
|
@ -222,11 +222,11 @@ CopyWinding
|
|||
*/
|
||||
winding_t *CopyWinding (winding_t *w)
|
||||
{
|
||||
unsigned long size;
|
||||
size_t size;
|
||||
winding_t *c;
|
||||
|
||||
c = AllocWinding (w->numpoints);
|
||||
size = (long)((winding_t *)0)->p[w->numpoints];
|
||||
size = size_t(((winding_t *)0)->p[w->numpoints]);
|
||||
Com_Memcpy (c, w, size);
|
||||
return c;
|
||||
}
|
||||
|
|
|
@ -2272,7 +2272,7 @@ void Com_Init( char *commandLine )
|
|||
|
||||
Cmd_RegisterArray( com_cmds, MODULE_COMMON );
|
||||
|
||||
const char* s = Q3_VERSION" "PLATFORM_STRING" "__DATE__;
|
||||
const char* s = Q3_VERSION " " PLATFORM_STRING " " __DATE__;
|
||||
com_version = Cvar_Get( "version", s, CVAR_ROM | CVAR_SERVERINFO );
|
||||
|
||||
Cvar_Get( "sys_cpustring", "detect", 0 );
|
||||
|
@ -2729,9 +2729,9 @@ static void PrintCmdMatches( const char *s )
|
|||
const char h = help != NULL ? 'h' : ' ';
|
||||
|
||||
if ( desc )
|
||||
Com_sprintf( msg, sizeof(msg), " %c "COLOR_CMD"%s - "COLOR_HELP"%s\n", h, s, desc );
|
||||
Com_sprintf( msg, sizeof(msg), " %c " COLOR_CMD "%s - " COLOR_HELP "%s\n", h, s, desc );
|
||||
else
|
||||
Com_sprintf( msg, sizeof(msg), " %c "COLOR_CMD"%s\n", h, s );
|
||||
Com_sprintf( msg, sizeof(msg), " %c " COLOR_CMD "%s\n", h, s );
|
||||
|
||||
Com_TruncatePrintString( msg, sizeof(msg), CONSOLE_WIDTH );
|
||||
Com_Printf( msg );
|
||||
|
@ -2751,9 +2751,9 @@ static void PrintCvarMatches( const char *s )
|
|||
const char u = ( Cvar_Flags(s) & CVAR_USER_CREATED ) != 0 ? '?' : h;
|
||||
|
||||
if ( desc )
|
||||
Com_sprintf( msg, sizeof(msg), " %c "COLOR_CVAR"%s^7 = \""COLOR_VAL"%s^7\" - "COLOR_HELP"%s\n", u, s, Cvar_VariableString( s ), desc );
|
||||
Com_sprintf( msg, sizeof(msg), " %c " COLOR_CVAR "%s^7 = \"" COLOR_VAL "%s^7\" - " COLOR_HELP "%s\n", u, s, Cvar_VariableString( s ), desc );
|
||||
else
|
||||
Com_sprintf( msg, sizeof(msg), " %c "COLOR_CVAR"%s^7 = \""COLOR_VAL"%s^7\"\n", u, s, Cvar_VariableString( s ) );
|
||||
Com_sprintf( msg, sizeof(msg), " %c " COLOR_CVAR "%s^7 = \"" COLOR_VAL "%s^7\"\n", u, s, Cvar_VariableString( s ) );
|
||||
|
||||
Com_TruncatePrintString( msg, sizeof(msg), CONSOLE_WIDTH );
|
||||
Com_Printf( msg );
|
||||
|
|
|
@ -452,7 +452,7 @@ static const int kbitmask[32] = {
|
|||
0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF,
|
||||
0x001FFFFf, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF,
|
||||
0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF,
|
||||
0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF,
|
||||
0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, int(0xFFFFFFFF),
|
||||
};
|
||||
|
||||
static void MSG_WriteDeltaKey( msg_t *msg, int key, int oldV, int newV, int bits )
|
||||
|
|
|
@ -86,12 +86,12 @@ Netchan_Setup
|
|||
called to open a channel to a remote system
|
||||
==============
|
||||
*/
|
||||
void Netchan_Setup( netsrc_t sock, netchan_t *chan, netadr_t adr, int qport ) {
|
||||
void Netchan_Setup( netsrc_t sock, netchan_t *chan, netadr_t adr, int port ) {
|
||||
Com_Memset (chan, 0, sizeof(*chan));
|
||||
|
||||
chan->sock = sock;
|
||||
chan->remoteAddress = adr;
|
||||
chan->qport = qport;
|
||||
chan->qport = port;
|
||||
chan->incomingSequence = 0;
|
||||
chan->outgoingSequence = 1;
|
||||
}
|
||||
|
@ -218,7 +218,6 @@ copied out.
|
|||
qbool Netchan_Process( netchan_t *chan, msg_t *msg )
|
||||
{
|
||||
int sequence;
|
||||
int qport;
|
||||
int fragmentStart, fragmentLength;
|
||||
qbool fragmented;
|
||||
|
||||
|
@ -234,9 +233,9 @@ qbool Netchan_Process( netchan_t *chan, msg_t *msg )
|
|||
fragmented = qfalse;
|
||||
}
|
||||
|
||||
// read the qport if we are a server
|
||||
// read the port if we are a server
|
||||
if ( chan->sock == NS_SERVER ) {
|
||||
qport = MSG_ReadShort( msg );
|
||||
MSG_ReadShort( msg );
|
||||
}
|
||||
|
||||
// read the fragment information
|
||||
|
|
|
@ -27,10 +27,18 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|||
#include <winsock.h>
|
||||
|
||||
typedef int socklen_t;
|
||||
#ifndef EAGAIN
|
||||
#define EAGAIN WSAEWOULDBLOCK
|
||||
#endif
|
||||
#ifndef EADDRNOTAVAIL
|
||||
#define EADDRNOTAVAIL WSAEADDRNOTAVAIL
|
||||
#endif
|
||||
#ifndef EAFNOSUPPORT
|
||||
#define EAFNOSUPPORT WSAEAFNOSUPPORT
|
||||
#endif
|
||||
#ifndef ECONNRESET
|
||||
#define ECONNRESET WSAECONNRESET
|
||||
#endif
|
||||
#define socketError WSAGetLastError()
|
||||
|
||||
static WSADATA winsockdata;
|
||||
|
|
|
@ -506,7 +506,7 @@ const char *VM_LoadInstructions( const vmHeader_t *header, instruction_t *buf )
|
|||
for ( i = 0; i < header->instructionCount; i++, ci++, op1 = op0 ) {
|
||||
op0 = *code_pos;
|
||||
if ( op0 < 0 || op0 >= OP_MAX ) {
|
||||
sprintf( errBuf, "bad opcode %02X at offset %ld", op0, code_pos - code_start );
|
||||
sprintf( errBuf, "bad opcode %02X at offset %lld", (unsigned int)op0, (long long)(code_pos - code_start) );
|
||||
return errBuf;
|
||||
}
|
||||
n = ops[ op0 ].size;
|
||||
|
|
|
@ -1373,49 +1373,49 @@ Search for known macro-op sequences
|
|||
static void VM_FindMOps(instruction_t *buf, int instructionCount)
|
||||
{
|
||||
int i, v, op0;
|
||||
instruction_t *ci;
|
||||
instruction_t *lci;
|
||||
|
||||
ci = buf;
|
||||
lci = buf;
|
||||
i = 0;
|
||||
|
||||
while ( i < instructionCount )
|
||||
{
|
||||
op0 = ci->op;
|
||||
op0 = lci->op;
|
||||
if ( op0 == OP_LOCAL ) {
|
||||
// OP_LOCAL + OP_LOCAL + OP_LOAD4 + OP_CONST + OP_XXX + OP_STORE4
|
||||
if ( (ci+1)->op == OP_LOCAL && ci->value == (ci+1)->value && (ci+2)->op == OP_LOAD4 && (ci+3)->op == OP_CONST && (ci+4)->op != OP_UNDEF && (ci+5)->op == OP_STORE4 ) {
|
||||
v = (ci+4)->op;
|
||||
if ( (lci+1)->op == OP_LOCAL && lci->value == (lci+1)->value && (lci+2)->op == OP_LOAD4 && (lci+3)->op == OP_CONST && (lci+4)->op != OP_UNDEF && (lci+5)->op == OP_STORE4 ) {
|
||||
v = (lci+4)->op;
|
||||
if ( v == OP_ADD ) {
|
||||
ci->op = MOP_ADD4;
|
||||
ci += 6; i += 6;
|
||||
lci->op = MOP_ADD4;
|
||||
lci += 6; i += 6;
|
||||
continue;
|
||||
}
|
||||
if ( v == OP_SUB ) {
|
||||
ci->op = MOP_SUB4;
|
||||
ci += 6; i += 6;
|
||||
lci->op = MOP_SUB4;
|
||||
lci += 6; i += 6;
|
||||
continue;
|
||||
}
|
||||
if ( v == OP_BAND ) {
|
||||
ci->op = MOP_BAND4;
|
||||
ci += 6; i += 6;
|
||||
lci->op = MOP_BAND4;
|
||||
lci += 6; i += 6;
|
||||
continue;
|
||||
}
|
||||
if ( v == OP_BOR ) {
|
||||
ci->op = MOP_BOR4;
|
||||
ci += 6; i += 6;
|
||||
lci->op = MOP_BOR4;
|
||||
lci += 6; i += 6;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// skip useless sequences
|
||||
if ( (ci+1)->op == OP_LOCAL && (ci+0)->value == (ci+1)->value && (ci+2)->op == OP_LOAD4 && (ci+3)->op == OP_STORE4 ) {
|
||||
ci->op = MOP_IGNORE4;
|
||||
ci += 4; i += 4;
|
||||
if ( (lci+1)->op == OP_LOCAL && (lci+0)->value == (lci+1)->value && (lci+2)->op == OP_LOAD4 && (lci+3)->op == OP_STORE4 ) {
|
||||
lci->op = MOP_IGNORE4;
|
||||
lci += 4; i += 4;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
ci++;
|
||||
lci++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#if defined(_MSC_VER)
|
||||
# pragma warning(disable: 4505) // unreferenced local function
|
||||
# pragma warning(disable: 4459) // declaration of 'ri' hides global declaration
|
||||
#endif
|
||||
|
||||
static void* q_malloc( size_t );
|
||||
|
|
|
@ -1203,7 +1203,7 @@ static infoParm_t infoParms[] = {
|
|||
{"lava", 1, 0, CONTENTS_LAVA }, // very damaging
|
||||
{"playerclip", 1, 0, CONTENTS_PLAYERCLIP },
|
||||
{"monsterclip", 1, 0, CONTENTS_MONSTERCLIP },
|
||||
{"nodrop", 1, 0, CONTENTS_NODROP }, // don't drop items or leave bodies (death fog, lava, etc)
|
||||
{"nodrop", 1, 0, int(CONTENTS_NODROP) }, // don't drop items or leave bodies (death fog, lava, etc)
|
||||
{"nonsolid", 1, SURF_NONSOLID, 0}, // clears the solid flag
|
||||
|
||||
// utility relevant attributes
|
||||
|
@ -2106,7 +2106,7 @@ shader_t* R_FindShader( const char *name, int lightmapIndex, qbool mipRawImage )
|
|||
{
|
||||
char strippedName[MAX_QPATH];
|
||||
char fileName[MAX_QPATH];
|
||||
int i, hash;
|
||||
int hash;
|
||||
shader_t *sh;
|
||||
|
||||
if ( name[0] == 0 ) {
|
||||
|
@ -2156,7 +2156,7 @@ shader_t* R_FindShader( const char *name, int lightmapIndex, qbool mipRawImage )
|
|||
Com_Memset( &stages, 0, sizeof( stages ) );
|
||||
Q_strncpyz(shader.name, strippedName, sizeof(shader.name));
|
||||
shader.lightmapIndex = lightmapIndex;
|
||||
for ( i = 0 ; i < MAX_SHADER_STAGES ; i++ ) {
|
||||
for ( int i = 0 ; i < MAX_SHADER_STAGES ; i++ ) {
|
||||
stages[i].texMods = texMods[i];
|
||||
}
|
||||
|
||||
|
@ -2346,39 +2346,39 @@ void R_ShaderList_f( void )
|
|||
|
||||
int count = 0;
|
||||
for ( i = 0 ; i < tr.numShaders ; i++ ) {
|
||||
const shader_t* shader = (ri.Cmd_Argc() > 1) ? tr.sortedShaders[i] : tr.shaders[i];
|
||||
const shader_t* sh = (ri.Cmd_Argc() > 1) ? tr.sortedShaders[i] : tr.shaders[i];
|
||||
|
||||
int passes = shader->numStages;
|
||||
for ( int s = 0; s < shader->numStages; ++s )
|
||||
passes -= shader->stages[s]->mtStages;
|
||||
int passes = sh->numStages;
|
||||
for ( int s = 0; s < sh->numStages; ++s )
|
||||
passes -= sh->stages[s]->mtStages;
|
||||
|
||||
ri.Printf( PRINT_ALL, "%i %i ", shader->numStages, passes );
|
||||
ri.Printf( PRINT_ALL, "%i %i ", sh->numStages, passes );
|
||||
|
||||
if (shader->lightmapIndex >= 0 ) {
|
||||
if (sh->lightmapIndex >= 0 ) {
|
||||
ri.Printf( PRINT_ALL, "L " );
|
||||
//} else if (shader->lightmapIndex == LIGHTMAP_WHITE ) {
|
||||
//} else if (sh->lightmapIndex == LIGHTMAP_WHITE ) {
|
||||
// ri.Printf( PRINT_ALL, "W " );
|
||||
} else {
|
||||
ri.Printf( PRINT_ALL, " " );
|
||||
}
|
||||
if ( shader->explicitlyDefined ) {
|
||||
if ( sh->explicitlyDefined ) {
|
||||
ri.Printf( PRINT_ALL, "E " );
|
||||
} else {
|
||||
ri.Printf( PRINT_ALL, " " );
|
||||
}
|
||||
|
||||
if ( shader->siFunc == GL2_StageIterator ) {
|
||||
if ( sh->siFunc == GL2_StageIterator ) {
|
||||
ri.Printf( PRINT_ALL, " " );
|
||||
} else if ( shader->siFunc == RB_StageIteratorSky ) {
|
||||
} else if ( sh->siFunc == RB_StageIteratorSky ) {
|
||||
ri.Printf( PRINT_ALL, "sky " );
|
||||
} else {
|
||||
ri.Printf( PRINT_ALL, "??? " );
|
||||
}
|
||||
|
||||
if ( shader->defaultShader ) {
|
||||
ri.Printf( PRINT_ALL, ": %s (DEFAULTED)\n", shader->name );
|
||||
if ( sh->defaultShader ) {
|
||||
ri.Printf( PRINT_ALL, ": %s (DEFAULTED)\n", sh->name );
|
||||
} else {
|
||||
ri.Printf( PRINT_ALL, ": %s\n", shader->name );
|
||||
ri.Printf( PRINT_ALL, ": %s\n", sh->name );
|
||||
}
|
||||
count++;
|
||||
}
|
||||
|
|
|
@ -251,10 +251,8 @@ void SV_LinkEntity( sharedEntity_t *gEnt ) {
|
|||
// set the abs box
|
||||
if ( gEnt->r.bmodel && (angles[0] || angles[1] || angles[2]) ) {
|
||||
// expand for rotation
|
||||
float max;
|
||||
int i;
|
||||
float max = RadiusFromBounds( gEnt->r.mins, gEnt->r.maxs );
|
||||
|
||||
max = RadiusFromBounds( gEnt->r.mins, gEnt->r.maxs );
|
||||
for (i=0 ; i<3 ; i++) {
|
||||
gEnt->r.absmin[i] = origin[i] - max;
|
||||
gEnt->r.absmax[i] = origin[i] + max;
|
||||
|
|
|
@ -413,7 +413,7 @@ static qbool GLW_CreateWindow()
|
|||
const int x = monRect.left + dx;
|
||||
const int y = monRect.top + dy;
|
||||
|
||||
g_wv.hWnd = CreateWindowEx( exstyle, CLIENT_WINDOW_TITLE, " "CLIENT_WINDOW_TITLE, style,
|
||||
g_wv.hWnd = CreateWindowEx( exstyle, CLIENT_WINDOW_TITLE, " " CLIENT_WINDOW_TITLE, style,
|
||||
x, y, w, h, NULL, NULL, g_wv.hInstance, NULL );
|
||||
|
||||
if ( !g_wv.hWnd )
|
||||
|
@ -575,7 +575,6 @@ static qbool GLW_SetMode()
|
|||
dm.dmBitsPerPel = 32;
|
||||
dm.dmFields |= DM_BITSPERPEL;
|
||||
|
||||
const RECT& monRect = g_wv.monitorRects[g_wv.monitor];
|
||||
dm.dmPosition.x = monRect.left;
|
||||
dm.dmPosition.y = monRect.top;
|
||||
dm.dmFields |= DM_POSITION;
|
||||
|
@ -633,10 +632,6 @@ void Sys_GL_Init()
|
|||
{
|
||||
ri.Printf( PRINT_DEVELOPER, "Initializing OpenGL subsystem\n" );
|
||||
|
||||
// save off hInstance for the subsystems
|
||||
const cvar_t* cv = ri.Cvar_Get( "win_hinstance", "", 0 );
|
||||
sscanf( cv->string, "%i", (int *)&g_wv.hInstance );
|
||||
|
||||
// load appropriate DLL and initialize subsystem
|
||||
if (!GLW_LoadOpenGL())
|
||||
ri.Error( ERR_FATAL, "Sys_GL_Init - could not load OpenGL subsystem\n" );
|
||||
|
|
|
@ -34,7 +34,7 @@ struct Mouse {
|
|||
qbool IsActive() const { return active; }
|
||||
|
||||
virtual qbool Init() { return qfalse; } // qtrue if successful
|
||||
virtual qbool Activate( qbool active ) { return qfalse; } // qtrue if successful
|
||||
virtual qbool Activate( qbool _active ) { return qfalse; } // qtrue if successful
|
||||
virtual void Shutdown() {}
|
||||
virtual qbool ProcessMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return qfalse; } // qtrue if the event was handled
|
||||
|
||||
|
@ -826,9 +826,9 @@ static void IN_StartupMIDI()
|
|||
// open the MIDI IN port
|
||||
//
|
||||
if ( midiInOpen( &s_midiInfo.hMidiIn,
|
||||
in_mididevice->integer,
|
||||
( unsigned long ) MidiInProc,
|
||||
( unsigned long ) NULL,
|
||||
( UINT ) in_mididevice->integer,
|
||||
( DWORD_PTR ) MidiInProc,
|
||||
( DWORD_PTR ) NULL,
|
||||
CALLBACK_FUNCTION ) != MMSYSERR_NOERROR )
|
||||
{
|
||||
Com_Printf( "WARNING: could not open MIDI device %d: '%s'\n", in_mididevice->integer , s_midiInfo.caps[( int ) in_mididevice->value] );
|
||||
|
|
|
@ -538,9 +538,6 @@ void Sys_Init()
|
|||
Sys_Error( "%s requires Windows Vista or later", Q3_VERSION );
|
||||
|
||||
Cvar_Set( "arch", "winnt" );
|
||||
|
||||
// save out a couple things in rom cvars for the renderer to access
|
||||
Cvar_Get( "win_hinstance", va("%i", (int)g_wv.hInstance), CVAR_ROM );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -156,7 +156,7 @@ static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
DeleteDC( hdcScaled );
|
||||
}
|
||||
#endif
|
||||
return ( long ) s_wcd.hbrEditBackground;
|
||||
return ( INT_PTR ) s_wcd.hbrEditBackground;
|
||||
}
|
||||
else if ( ( HWND ) lParam == s_wcd.hwndErrorBox )
|
||||
{
|
||||
|
@ -170,7 +170,7 @@ static LONG WINAPI ConWndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||
SetBkColor( ( HDC ) wParam, RGB( 0x80, 0x80, 0x80 ) );
|
||||
SetTextColor( ( HDC ) wParam, RGB( 0x00, 0x0, 0x00 ) );
|
||||
}
|
||||
return ( long ) s_wcd.hbrErrorBackground;
|
||||
return ( INT_PTR ) s_wcd.hbrErrorBackground;
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -402,7 +402,7 @@ void WIN_CreateConsole( void )
|
|||
|
||||
s_wcd.hWnd = CreateWindowEx( 0,
|
||||
DEDCLASS,
|
||||
" "CONSOLE_WINDOW_TITLE,
|
||||
" " CONSOLE_WINDOW_TITLE,
|
||||
DEDSTYLE,
|
||||
x, y,
|
||||
w, h,
|
||||
|
|
Loading…
Reference in a new issue