Housekeeping.

This commit is contained in:
Andrei Drexler 2009-07-03 18:51:22 +00:00
parent 15fdbffbe7
commit b3bc436778
16 changed files with 9850 additions and 9621 deletions

View file

@ -114,8 +114,13 @@ gentity_t *PlayerToTrack(gentity_t * ent, gentity_t * target1st);
#ifndef Q3_VM
#ifndef acosf
#define acosf(x) ((float)acos(x))
#endif
#ifndef asinf
#define asinf(x) ((float)asin(x))
#endif
#else

View file

@ -41,7 +41,7 @@ BASIC MATH
RotatePoint
================
*/
void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // FIXME
static void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // FIXME
vec3_t tvec;
VectorCopy(point, tvec);
@ -55,7 +55,7 @@ void RotatePoint(vec3_t point, /*const*/ vec3_t matrix[3]) { // FIXME
TransposeMatrix
================
*/
void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // FIXME
static void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // FIXME
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
@ -69,7 +69,7 @@ void TransposeMatrix(/*const*/ vec3_t matrix[3], vec3_t transpose[3]) { // FIXME
CreateRotationMatrix
================
*/
void CreateRotationMatrix(const vec3_t angles, vec3_t matrix[3]) {
static void CreateRotationMatrix(const vec3_t angles, vec3_t matrix[3]) {
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}

View file

@ -184,28 +184,15 @@ signed short ClampShort( int i ) {
// this isn't a real cheap function to call!
int DirToByte( vec3_t dir ) {
int i, best;
float d, bestd;
// Makro - a lot cheaper now
int DirToByte(vec3_t dir)
{
vec3_t angles;
vectoangles(dir, angles);
return ((int) (angles[YAW] * 16 / 360.0f) & 15) | ((((int) (angles[PITCH] * 16 / 360.0f)) & 15) << 4);
}
if ( !dir ) {
return 0;
}
bestd = 0;
best = 0;
for (i=0 ; i<NUMVERTEXNORMALS ; i++)
{
d = DotProduct (dir, bytedirs[i]);
if (d > bestd)
{
bestd = d;
best = i;
}
}
return best;
}
void ByteToDir( int b, vec3_t dir ) {
if ( b < 0 || b >= NUMVERTEXNORMALS ) {
@ -1307,3 +1294,132 @@ int Q_isnan( float x )
return (int)( (unsigned int)fi.ui >> 31 );
}
// By NiceAss. Used for reflection of sparks on metal surfaces
int ReflectVectorByte(vec3_t dir, vec3_t plane)
{
vec3_t final;
float dot;
dot = DotProduct(dir, plane);
VectorMA(dir, -2 * dot, plane, final);
return DirToByte(final);
}
//Makro - moved from g_mover.c
/*
================
CreateRotationMatrix
================
*/
void CreateRotationMatrix(vec3_t angles, vec3_t matrix[3])
{
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}
/*
================
TransposeMatrix
================
*/
void TransposeMatrix(vec3_t matrix[3], vec3_t transpose[3])
{
int i, j;
for (i = 0; i < 3; i++) {
for (j = 0; j < 3; j++) {
transpose[i][j] = matrix[j][i];
}
}
}
/*
================
RotatePoint
================
*/
void RotatePoint(vec3_t point, vec3_t matrix[3])
{
vec3_t tvec;
VectorCopy(point, tvec);
point[0] = DotProduct(matrix[0], tvec);
point[1] = DotProduct(matrix[1], tvec);
point[2] = DotProduct(matrix[2], tvec);
}
//Makro - added
void ChangeRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
VectorScale(newaxis[0], in[0], result);
VectorMA(result, in[1], newaxis[1], result);
VectorMA(result, in[2], newaxis[2], result);
if (neworg)
VectorAdd(result, neworg, result);
VectorCopy(result, out);
}
//Makro - added
void ChangeBackRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out)
{
vec3_t dif;
if (neworg)
VectorSubtract(in, neworg, dif);
else
VectorCopy(in, dif);
out[0] = DotProduct(dif, newaxis[0]);
out[1] = DotProduct(dif, newaxis[1]);
out[2] = DotProduct(dif, newaxis[2]);
}
void ChangeAngleRefSystem(vec3_t in, vec3_t newaxis[], vec3_t out)
{
vec3_t result;
/*
result[YAW_AXIS] = in[YAW];
result[PITCH_AXIS] = in[PITCH];
result[ROLL_AXIS] = in[ROLL];
VectorCopy(result, in);
*/
VectorMA(vec3_origin, in[YAW], newaxis[YAW_AXIS], result);
VectorMA(result, in[PITCH], newaxis[PITCH_AXIS], result);
VectorMA(result, in[ROLL], newaxis[ROLL_AXIS], result);
//VectorCopy(result, out);
out[YAW] = result[YAW_AXIS];
out[PITCH] = result[PITCH_AXIS];
out[ROLL] = result[ROLL_AXIS];
//VectorCopy(in, out);
}
void ToAxisAngles(vec3_t in, vec3_t out)
{
vec3_t angles, result, forward;
VectorClear(result);
//yaw - around the Z axis
result[YAW_AXIS] = in[YAW];
//pitch - around the new Y axis
angles[YAW] = in[YAW];
angles[PITCH] = angles[ROLL] = 0;
AngleVectors(angles, NULL, forward, NULL);
VectorMA(result, -in[PITCH], forward, result);
result[PITCH_AXIS] = in[PITCH];
//roll - around the new X axis
angles[PITCH] = in[PITCH];
AngleVectors(angles, forward, NULL, NULL);
VectorMA(result, in[ROLL], forward, result);
VectorCopy(result, out);
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -92,7 +92,7 @@
#ifndef __UI_LOCAL_H__
#define __UI_LOCAL_H__
#include "../game/q_shared.h"
#include "../qcommon/q_shared.h"
#include "../cgame/tr_types.h"
#include "ui_public.h"
#include "keycodes.h"

View file

@ -8103,7 +8103,7 @@ static void UI_BuildQ3Model_List(void)
for (j = 0; j < numfiles && uiInfo.q3HeadCount < MAX_PLAYERMODELS; j++, fileptr += filelen + 1) {
filelen = strlen(fileptr);
COM_StripExtension(fileptr, skinname);
COM_StripExtension(fileptr, skinname, sizeof(skinname));
// look for icon_????
if (Q_stricmpn(skinname, "icon_", 5) == 0

View file

@ -104,7 +104,7 @@ static void UI_PlayerInfo_SetWeapon(playerInfo_t * pi, weapon_t weaponNum)
} */
strcpy(path, item->world_model[0]);
COM_StripExtension(path, path);
COM_StripExtensionInPlace(path);
strcat(path, "_flash.md3");
pi->flashModel = trap_R_RegisterModel(path);

View file

@ -1185,7 +1185,7 @@ itemDef_t *Menu_ClearFocus(menuDef_t * menu)
return ret;
}
qboolean IsVisible(int flags)
static qboolean IsVisible(int flags)
{
return (flags & WINDOW_VISIBLE && !(flags & WINDOW_FADINGOUT));
}

View file

@ -73,7 +73,7 @@
#ifndef __UI_SHARED_H
#define __UI_SHARED_H
#include "../game/q_shared.h"
#include "../qcommon/q_shared.h"
#include "../cgame/tr_types.h"
#include "keycodes.h"

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,11 +1,9 @@
Microsoft Visual Studio Solution File, Format Version 9.00
# Visual C++ Express 2005
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual C++ Express 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cgame", "cgame.vcproj", "{C878E295-CB82-4B40-8ECF-5CE5525466FA}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "game", "game.vcproj", "{F9EE10DA-2404-4154-B904-F93C936C040A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "q3_ui", "q3_ui.vcproj", "{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quake3", "quake3.vcproj", "{81CB51C4-B434-4E12-B69B-BAEE102F2852}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ui", "ui.vcproj", "{A8EAC38E-C7DA-42F8-811D-77FD092B9D19}"
@ -34,12 +32,6 @@ Global
{F9EE10DA-2404-4154-B904-F93C936C040A}.Release TA|Win32.Build.0 = Release TA|Win32
{F9EE10DA-2404-4154-B904-F93C936C040A}.Release|Win32.ActiveCfg = Release|Win32
{F9EE10DA-2404-4154-B904-F93C936C040A}.Release|Win32.Build.0 = Release|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug TA|Win32.ActiveCfg = Debug TA|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug|Win32.ActiveCfg = Debug|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Debug|Win32.Build.0 = Debug|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release TA|Win32.ActiveCfg = Release TA|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release|Win32.ActiveCfg = Release|Win32
{D454C4C7-7765-4149-ABAD-05FDEB9D94F8}.Release|Win32.Build.0 = Release|Win32
{81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug TA|Win32.ActiveCfg = Debug TA|Win32
{81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug TA|Win32.Build.0 = Debug TA|Win32
{81CB51C4-B434-4E12-B69B-BAEE102F2852}.Debug|Win32.ActiveCfg = Debug|Win32

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="quake3"
ProjectGUID="{81CB51C4-B434-4E12-B69B-BAEE102F2852}"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -83,6 +84,8 @@
MapFileName="$(IntDir)\quake3.map"
SubSystem="2"
StackReserveSize="8388608"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -103,9 +106,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Post build processing.."
@ -184,6 +184,8 @@
MapFileName="$(IntDir)\quake3.map"
SubSystem="2"
StackReserveSize="8388608"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -204,9 +206,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Post build processing.."
@ -283,6 +282,8 @@
MapFileName="$(IntDir)\quake3.map"
SubSystem="2"
StackReserveSize="8388608"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -303,9 +304,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -343,7 +341,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="..\..\code\libcurl; ..\..\code\AL; ..\..\code\libspeex\include"
PreprocessorDefinitions="_WIN32; WIN32; _DEBUG; _WINDOWS; _CRT_SECURE_NO_DEPRECATE; BOTLIB; USE_ICON; USE_CURL; USE_CURL_DLOPEN; USE_OPENAL; USE_OPENAL_DLOPEN; USE_VOIP; HAVE_CONFIG_H; MISSIONPACK"
PreprocessorDefinitions="_WIN32;WIN32;_DEBUG;_WINDOWS;_CRT_SECURE_NO_DEPRECATE;BOTLIB;USE_ICON;USE_CURL;USE_CURL_DLOPEN;USE_OPENAL;USE_OPENAL_DLOPEN;USE_VOIP;HAVE_CONFIG_H;MISSIONPACK;STANDALONE;USE_INTERNAL_SPEEX;USE_LOCAL_HEADERS"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile="$(IntDir)\quake3.pch"
@ -381,6 +379,8 @@
MapFileName="$(IntDir)\quake3.map"
SubSystem="2"
StackReserveSize="8388608"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -401,9 +401,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="Post build processing.."

File diff suppressed because it is too large Load diff