Tons of updates (entity tree attachment system, UI vectors)

This commit is contained in:
Andrei Drexler 2005-02-15 16:33:39 +00:00
parent bb985bf7cc
commit d5552a2a10
81 changed files with 5187 additions and 2421 deletions

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.78 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.77 2004/01/26 21:26:08 makro // Revision 1.77 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -477,11 +480,10 @@ CG_DrawStatusBar
*/ */
static void CG_DrawStatusBar(void) static void CG_DrawStatusBar(void)
{ {
int color;
int style; int style;
centity_t *cent; centity_t *cent;
playerState_t *ps; playerState_t *ps;
int value; int value, max;
vec4_t hcolor; vec4_t hcolor;
qhandle_t hicon; qhandle_t hicon;
qhandle_t icon; qhandle_t icon;
@ -497,6 +499,7 @@ static void CG_DrawStatusBar(void)
{0.8f, 0.0f, 0.0f, 1.0f} {0.8f, 0.0f, 0.0f, 1.0f}
}; // out of ammo }; // out of ammo
*/ */
//Makro - now using the same colors for both health and ammo
static float colors[5][4] = { static float colors[5][4] = {
{1.0f, 1.0f, 1.0f, 1.0f}, // full green {1.0f, 1.0f, 1.0f, 1.0f}, // full green
{1.0f, 1.0f, 0.0f, 1.0f}, // firing {1.0f, 1.0f, 0.0f, 1.0f}, // firing
@ -591,6 +594,8 @@ static void CG_DrawStatusBar(void)
value = ps->ammo[cent->currentState.weapon]; value = ps->ammo[cent->currentState.weapon];
// Select colour // Select colour
//Makro - change from white to yellow to red now, just like health display
#if 0
if (cg.predictedPlayerState.weaponstate == WEAPON_FIRING && cg.predictedPlayerState.weaponTime > 100) if (cg.predictedPlayerState.weaponstate == WEAPON_FIRING && cg.predictedPlayerState.weaponTime > 100)
color = 1; color = 1;
//Makro - added reloading check //Makro - added reloading check
@ -605,13 +610,35 @@ static void CG_DrawStatusBar(void)
if (value >= 0) if (value >= 0)
UI_DrawProportionalString(188, 444, va("%d", value), style, colors[color]); UI_DrawProportionalString(188, 444, va("%d", value), style, colors[color]);
#else
//Makro - new code
max = ClipAmountForAmmo(cent->currentState.weapon);
if (value > (max / 2))
{
float frac = (value - (max / 2.0f)) / (max / 2.0f), ifrac = (1.0f - frac);
hcolor[0] = frac * hcolors[0][0] + ifrac * hcolors[1][0];
hcolor[1] = frac * hcolors[0][1] + ifrac * hcolors[1][1];
hcolor[2] = frac * hcolors[0][2] + ifrac * hcolors[1][2];
hcolor[3] = frac * hcolors[0][3] + ifrac * hcolors[1][3];
} else {
float frac = value / (max/2.0f), ifrac = (1.0f - frac);
hcolor[0] = frac * hcolors[1][0] + ifrac * hcolors[2][0];
hcolor[1] = frac * hcolors[1][1] + ifrac * hcolors[2][1];
hcolor[2] = frac * hcolors[1][2] + ifrac * hcolors[2][2];
hcolor[3] = frac * hcolors[1][3] + ifrac * hcolors[2][3];
}
if (value >= 0)
UI_DrawProportionalString(188, 444, va("%d", value), style, hcolor);
#endif
//UI_DrawProportionalString(188, 444, "/"), style, colors[0]); //UI_DrawProportionalString(188, 444, "/"), style, colors[0]);
value = ps->stats[STAT_CLIPS]; value = ps->stats[STAT_CLIPS];
if (value > -1 && if (value > -1 &&
cg.predictedPlayerState.weapon != WP_KNIFE && cg.predictedPlayerState.weapon != WP_GRENADE) cg.predictedPlayerState.weapon != WP_KNIFE && cg.predictedPlayerState.weapon != WP_GRENADE)
UI_DrawProportionalString(288, 444, va("%d", value), style, colors[0]); //Makro - pretty colours !
UI_DrawProportionalString(288, 444, va("%d", value), style, (value != 0) ? colors[0] : colors[3]);
} }
// Elder: temporary // Elder: temporary
//if (cg.snap->ps.stats[STAT_RELOADTIME] > 0) //if (cg.snap->ps.stats[STAT_RELOADTIME] > 0)
@ -913,7 +940,8 @@ static float CG_DrawFPSandPing(float y)
} }
// Draw ping here: // Draw ping here:
if (cg_drawPing.integer) { //Makro - not during demo playback
if (cg_drawPing.integer && !cg.demoPlayback) {
for (i = 0; i < (LAG_SAMPLES / 2); i++) { for (i = 0; i < (LAG_SAMPLES / 2); i++) {
l = (lagometer.frameCount & (LAG_SAMPLES - 1)) - i; l = (lagometer.frameCount & (LAG_SAMPLES - 1)) - i;
if (l < 0) l += LAG_SAMPLES; if (l < 0) l += LAG_SAMPLES;
@ -954,7 +982,7 @@ static float CG_DrawFPSandPing(float y)
CG_DrawStringExt(631 - x, y + 2, s, Color, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 0); CG_DrawStringExt(631 - x, y + 2, s, Color, qfalse, qfalse, SMALLCHAR_WIDTH, SMALLCHAR_HEIGHT, 0);
} }
if (!cg_drawFPS.integer && !cg_drawPing.integer) if (!cg_drawFPS.integer && (!cg_drawPing.integer || cg.demoPlayback))
return y; return y;
return y + SMALLCHAR_HEIGHT + 4; return y + SMALLCHAR_HEIGHT + 4;
@ -1897,25 +1925,8 @@ static void CG_DrawCrosshair(void)
if (cg.renderingThirdPerson) { if (cg.renderingThirdPerson) {
return; return;
} }
// set color based on health
if (cg_crosshairHealth.integer) {
vec4_t hcolor;
CG_ColorForHealth(hcolor); //Makro - moved some code below to prevent some variables from getting overwritten by the ssg code
trap_R_SetColor(hcolor);
} else {
trap_R_SetColor(NULL);
}
w = h = cg_crosshairSize.value;
// pulse the size of the crosshair when picking up items
f = cg.time - cg.itemPickupBlendTime;
if (f > 0 && f < ITEM_BLOB_TIME) {
f /= ITEM_BLOB_TIME;
w *= (1 + f);
h *= (1 + f);
}
//Elder: Sniper crosshairs - lots of hardcoded values :/ //Elder: Sniper crosshairs - lots of hardcoded values :/
//if ( cg.snap->ps.weapon==WP_SSG3000 && cg.zoomLevel > 0 && cg.zoomLevel < 4) { //if ( cg.snap->ps.weapon==WP_SSG3000 && cg.zoomLevel > 0 && cg.zoomLevel < 4) {
@ -1960,7 +1971,13 @@ static void CG_DrawCrosshair(void)
trap_R_SetColor(crosshairColor); trap_R_SetColor(crosshairColor);
//I can probably scale the zoom with the screen width -/+ keys //I can probably scale the zoom with the screen width -/+ keys
//But I'll do it later. //But I'll do it later.
CG_DrawPic(x - 128, y - 128, 256, 256, cgs.media.ssgCrosshair[zoomMag]); //Makro - h = half width, w = width
h = cg_RQ3_ssgCrosshairSize.integer >> 1;
w = cg_RQ3_ssgCrosshairSize.integer;
if ( (hShader = cgs.media.ssgCrosshair[zoomMag]) )
{
CG_DrawPic(x - h, y - h, w, w, hShader);
}
trap_R_SetColor(NULL); trap_R_SetColor(NULL);
drawSSG = 1; drawSSG = 1;
@ -1970,32 +1987,54 @@ static void CG_DrawCrosshair(void)
//Slicer if no crosshair, and not using SSG, dont draw crosshair //Slicer if no crosshair, and not using SSG, dont draw crosshair
if(!cg_drawCrosshair.integer) if(!cg_drawCrosshair.integer)
return; return;
//Makro - this was above the SSG code
// set color based on health
if (cg_crosshairHealth.integer) {
vec4_t hcolor;
CG_ColorForHealth(hcolor);
trap_R_SetColor(hcolor);
} else {
trap_R_SetColor(NULL);
}
w = h = cg_crosshairSize.value;
// pulse the size of the crosshair when picking up items
f = cg.time - cg.itemPickupBlendTime;
if (f > 0 && f < ITEM_BLOB_TIME) {
f /= ITEM_BLOB_TIME;
w *= (1 + f);
h *= (1 + f);
}
if (drawSSG == 0 || (drawSSG == 1 && cg_RQ3_overlaycrosshair.integer == 1)) { if (drawSSG == 0 || (drawSSG == 1 && cg_RQ3_overlaycrosshair.integer == 1)) {
x = cg_crosshairX.integer; x = cg_crosshairX.integer;
y = cg_crosshairY.integer; y = cg_crosshairY.integer;
CG_AdjustFrom640(&x, &y, &w, &h); CG_AdjustFrom640(&x, &y, &w, &h);
ca = cg_drawCrosshair.integer; ca = cg_drawCrosshair.integer;
if (ca < 0) { if (ca < 0) {
ca = 0; ca = 0;
} }
hShader = cgs.media.crosshairShader[ca % NUM_CROSSHAIRS]; hShader = cgs.media.crosshairShader[ca % NUM_CROSSHAIRS];
crosshairColor[0] = cg_RQ3_crosshairColorR.value; crosshairColor[0] = cg_RQ3_crosshairColorR.value;
crosshairColor[1] = cg_RQ3_crosshairColorG.value; crosshairColor[1] = cg_RQ3_crosshairColorG.value;
crosshairColor[2] = cg_RQ3_crosshairColorB.value; crosshairColor[2] = cg_RQ3_crosshairColorB.value;
crosshairColor[3] = cg_RQ3_crosshairColorA.value; crosshairColor[3] = cg_RQ3_crosshairColorA.value;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (crosshairColor[i] > 1.0f) if (crosshairColor[i] > 1.0f)
crosshairColor[i] = 1.0f; crosshairColor[i] = 1.0f;
else if (crosshairColor[i] < 0) else if (crosshairColor[i] < 0)
crosshairColor[i] = 0; crosshairColor[i] = 0;
} }
trap_R_SetColor(crosshairColor); trap_R_SetColor(crosshairColor);
trap_R_DrawStretchPic(x + cg.refdef.x + 0.5 * (cg.refdef.width - w), trap_R_DrawStretchPic(x + cg.refdef.x + 0.5 * (cg.refdef.width - w),
y + cg.refdef.y + 0.5 * (cg.refdef.height - h), w, h, 0, 0, 1, 1, hShader); y + cg.refdef.y + 0.5 * (cg.refdef.height - h), w, h, 0, 0, 1, 1, hShader);
trap_R_SetColor(NULL); trap_R_SetColor(NULL);
} }
} }
@ -2248,6 +2287,12 @@ CG_DrawFollow
*/ */
static qboolean CG_DrawFollow(void) static qboolean CG_DrawFollow(void)
{ {
//Makro - char size
#define DF_WIDTH 8
#define DF_HEIGHT 12
static unsigned int df_effect_time = 0;
int time;
static qboolean df_showmark = qfalse;
float x; float x;
vec4_t color; vec4_t color;
const char *name; const char *name;
@ -2257,14 +2302,16 @@ static qboolean CG_DrawFollow(void)
if (!(cg.snap->ps.pm_flags & PMF_FOLLOW)) { if (!(cg.snap->ps.pm_flags & PMF_FOLLOW)) {
return qfalse; return qfalse;
} }
color[0] = 1; color[0] = 0.75f;
color[1] = 1; color[1] = 0.75f;
color[2] = 1; color[2] = 0.75f;
color[3] = 1; color[3] = 1.0f;
// JBravo: if gametype >= team, append teamname to his name. // JBravo: if gametype >= team, append teamname to his name.
if (cgs.gametype >= GT_TEAM) { if (cgs.gametype >= GT_TEAM) {
team = cgs.clientinfo[cg.snap->ps.clientNum].team; team = cgs.clientinfo[cg.snap->ps.clientNum].team;
//Makro - different look
/*
if (team == TEAM_RED) { if (team == TEAM_RED) {
Com_sprintf(combinedName, sizeof(combinedName), "%sFollowing%s %s%s/%s%s", S_COLOR_RED, Com_sprintf(combinedName, sizeof(combinedName), "%sFollowing%s %s%s/%s%s", S_COLOR_RED,
S_COLOR_WHITE, cgs.clientinfo[cg.snap->ps.clientNum].name, S_COLOR_RED, S_COLOR_WHITE, cgs.clientinfo[cg.snap->ps.clientNum].name, S_COLOR_RED,
@ -2276,6 +2323,33 @@ static qboolean CG_DrawFollow(void)
} }
x = 0.5 * (640 - BIGCHAR_WIDTH * CG_DrawStrlen(combinedName)); x = 0.5 * (640 - BIGCHAR_WIDTH * CG_DrawStrlen(combinedName));
CG_DrawStringExt(x, 372, combinedName, color, qfalse, qtrue, BIGCHAR_WIDTH, BIGCHAR_HEIGHT, 0); CG_DrawStringExt(x, 372, combinedName, color, qfalse, qtrue, BIGCHAR_WIDTH, BIGCHAR_HEIGHT, 0);
*/
time = trap_Milliseconds();
if (time > df_effect_time)
{
df_effect_time = time + 500;
df_showmark ^= qtrue;
}
if (df_showmark)
{
if (team == TEAM_RED) {
Com_sprintf(combinedName, sizeof(combinedName), S_COLOR_YELLOW">"S_COLOR_RESET" Following ^7%s^* (^7%s^*) "S_COLOR_YELLOW"<",
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team1name.string);
} else {
Com_sprintf(combinedName, sizeof(combinedName), S_COLOR_YELLOW">"S_COLOR_RESET" Following ^7%s^* (^7%s^*) "S_COLOR_YELLOW"<",
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team2name.string);
}
} else {
if (team == TEAM_RED) {
Com_sprintf(combinedName, sizeof(combinedName), "Following ^7%s ^*(^7%s^*)",
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team1name.string);
} else {
Com_sprintf(combinedName, sizeof(combinedName), "Following ^7%s ^*(^7%s^*)",
cgs.clientinfo[cg.snap->ps.clientNum].name, cg_RQ3_team2name.string);
}
}
x = 0.5 * (640 - DF_WIDTH * CG_DrawStrlen(combinedName));
CG_DrawStringExt(x, 80, combinedName, color, qfalse, qfalse, DF_WIDTH, DF_HEIGHT, 0);
} else { } else {
CG_DrawBigString(320 - 9 * 8, 24, "following", 1.0F); CG_DrawBigString(320 - 9 * 8, 24, "following", 1.0F);
name = cgs.clientinfo[cg.snap->ps.clientNum].name; name = cgs.clientinfo[cg.snap->ps.clientNum].name;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.13 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.12 2004/01/26 21:26:08 makro // Revision 1.12 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -220,6 +223,9 @@ Coordinates are at 640 by 480 virtual resolution
void CG_DrawStringExt(int x, int y, const char *string, const float *setColor, void CG_DrawStringExt(int x, int y, const char *string, const float *setColor,
qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars) qboolean forceColor, qboolean shadow, int charWidth, int charHeight, int maxChars)
{ {
//Makro - for underlined chars
int yoffset = y + charHeight * 0.25f;
qboolean underlined = qfalse;
vec4_t color; vec4_t color;
const char *s; const char *s;
int xx; int xx;
@ -255,14 +261,28 @@ void CG_DrawStringExt(int x, int y, const char *string, const float *setColor,
while (*s && cnt < maxChars) { while (*s && cnt < maxChars) {
if (Q_IsColorString(s)) { if (Q_IsColorString(s)) {
if (!forceColor) { if (!forceColor) {
memcpy(color, g_color_table[ColorIndex(*(s + 1))], sizeof(color)); //Makro - new tricks
color[3] = setColor[3]; if (*(s+1) == '*')
trap_R_SetColor(color); {
memcpy(color, setColor, sizeof(color));
trap_R_SetColor(color);
} else if (*(s+1)== '_')
{
underlined ^= qtrue;
} else {
memcpy(color, g_color_table[ColorIndex(*(s + 1))], sizeof(color));
color[3] = setColor[3];
trap_R_SetColor(color);
}
} }
s += 2; s += 2;
continue; continue;
} }
CG_DrawChar(xx, y, charWidth, charHeight, *s); CG_DrawChar(xx, y, charWidth, charHeight, *s);
if (underlined)
{
CG_DrawChar(xx, yoffset, charWidth, charHeight, '_');
}
xx += charWidth; xx += charWidth;
cnt++; cnt++;
s++; s++;
@ -627,104 +647,103 @@ static int propMap[128][3] = {
*/ */
{0, 0, PROP_SPACE_WIDTH}, // SPACE {0, 0, PROP_SPACE_WIDTH}, // SPACE
{3, 0, 9}, // ! {3, 0, 36}, // !
{15, 0, 13}, // " {42, 0, 36}, // "
{31, 0, 18}, // # {81, 0, 36}, // #
{52, 0, 13}, // $ {120, 0, 36}, // $
{68, 0, 20}, // % {159, 0, 16}, // %
{91, 0, 13}, // & {178, 0, 36}, // &
{107, 0, 9}, // ' {217, 0, 58}, // '
{119, 0, 13}, // ( {278, 0, 36}, // (
{135, 0, 14}, // ) {317, 0, 58}, // )
{152, 0, 18}, // * {378, 0, 36}, // *
{173, 0, 21}, // + {417, 0, 36}, // +
{197, 0, 6}, // , {456, 0, 36}, // ,
{206, 0, 10}, // - {0, 27, 36}, // -
{219, 0, 6}, // . {39, 27, 19}, // .
{228, 0, 18}, // / {61, 27, 58}, // /
{249, 0, 17}, // 0 {122, 27, 14}, // 0
{269, 0, 6}, // 1 {139, 27, 8}, // 1
{278, 0, 13}, // 2 {150, 27, 13}, // 2
{294, 0, 13}, // 3 {166, 27, 13}, // 3
{310, 0, 13}, // 4 {182, 27, 14}, // 4
{326, 0, 14}, // 5 {199, 27, 13}, // 5
{343, 0, 14}, // 6 {215, 27, 14}, // 6
{360, 0, 13}, // 7 {232, 27, 12}, // 7
{376, 0, 14}, // 8 {247, 27, 13}, // 8
{393, 0, 13}, // 9 {263, 27, 13}, // 9
{409, 0, 7}, // : {279, 27, 11}, // :
{419, 0, 8}, // ; {293, 27, 58}, // ;
{430, 0, 12}, // < {354, 27, 58}, // <
{445, 0, 16}, // = {415, 27, 36}, // =
{464, 0, 13}, // > {454, 27, 58}, // >
{480, 0, 14}, // ? {0, 54, 36}, // ?
{0, 32, 16}, // @ {39, 54, 36}, // @
{19, 32, 12}, // A {78, 54, 17}, // A
{34, 32, 12}, // B {98, 54, 13}, // B
{49, 32, 12}, // C {114, 54, 15}, // C
{64, 32, 13}, // D {132, 54, 16}, // D
{80, 32, 11}, // E {151, 54, 15}, // E
{94, 32, 11}, // F {169, 54, 16}, // F
{108, 32, 13}, // G {188, 54, 18}, // G
{124, 32, 11}, // H {209, 54, 20}, // H
{138, 32, 5}, // I {232, 54, 9}, // I
{146, 32, 11}, // J {244, 54, 36}, // J
{160, 32, 10}, // K {283, 54, 18}, // K
{173, 32, 11}, // L {304, 54, 15}, // L
{187, 32, 16}, // M {322, 54, 20}, // M
{206, 32, 13}, // N {345, 54, 18}, // N
{222, 32, 15}, // O {366, 54, 16}, // O
{240, 32, 11}, // P {385, 54, 16}, // P
{254, 32, 15}, // Q {404, 54, 13}, // Q
{272, 32, 11}, // R {420, 54, 18}, // R
{286, 32, 11}, // S {441, 54, 14}, // S
{300, 32, 10}, // T {458, 54, 16}, // T
{313, 32, 11}, // U {477, 54, 18}, // U
{327, 32, 13}, // V {498, 54, 14}, // V
{343, 32, 17}, // W {0, 81, 18}, // W
{363, 32, 11}, // X {21, 81, 13}, // X
{377, 32, 10}, // Y {37, 81, 16}, // Y
{390, 32, 12}, // Z {56, 81, 36}, // Z
{405, 32, 13}, // [ {95, 81, 36}, // [
{421, 32, 17}, // '\' {134, 81, 36}, // '\'
{441, 32, 11}, // ] {173, 81, 36}, // ]
{455, 32, 13}, // ^ {212, 81, 36}, // ^
{471, 32, 16}, // _ {251, 81, 36}, // _
{490, 32, 7}, // ` {290, 81, 36}, // `
{500, 32, 10}, // a {329, 81, 18}, // a
{0, 64, 10}, // b {350, 81, 13}, // b
{13, 64, 9}, // c {366, 81, 15}, // c
{25, 64, 11}, // d {384, 81, 16}, // d
{39, 64, 10}, // e {403, 81, 15}, // e
{52, 64, 8}, // f {421, 81, 14}, // f
{63, 64, 10}, // g {438, 81, 17}, // g
{76, 64, 9}, // h {458, 81, 18}, // h
{88, 64, 5}, // i {479, 81, 11}, // i
{96, 64, 5}, // j {0, 108, 36}, // j
{104, 64, 9}, // k {39, 108, 20}, // k
{116, 64, 4}, // l {62, 108, 15}, // l
{123, 64, 12}, // m {80, 108, 19}, // m
{138, 64, 8}, // n {102, 108, 16}, // n
{149, 64, 9}, // o {121, 108, 14}, // o
{161, 64, 10}, // p {138, 108, 17}, // p
{174, 64, 11}, // q {158, 108, 13}, // q
{188, 64, 8}, // r {174, 108, 18}, // r
{199, 64, 9}, // s {195, 108, 13}, // s
{211, 64, 8}, // t {211, 108, 16}, // t
{222, 64, 8}, // u {230, 108, 15}, // u
{233, 64, 8}, // v {248, 108, 13}, // v
{244, 64, 12}, // w {264, 108, 18}, // w
{259, 64, 8}, // x {285, 108, 14}, // x
{270, 64, 9}, // y {302, 108, 16}, // y
{282, 64, 9}, // z {321, 108, 36}, // z
{294, 64, 9}, // { {360, 108, 36}, // {
{306, 64, 12}, // | {399, 108, 36}, // |
{321, 64, 9}, // } {438, 108, 36}, // }
{333, 64, 17}, // ~ {0, 135, 36}, // ~
{0, 0, -1} // DEL {0, 0, -1} // DEL
}; };
/*Elder: old one /*Elder: old one
{0, 0, PROP_SPACE_WIDTH}, // SPACE {0, 0, PROP_SPACE_WIDTH}, // SPACE
{11, 122, 7}, // ! {11, 122, 7}, // !

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.49 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.48 2004/01/26 21:26:08 makro // Revision 1.48 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -253,12 +256,19 @@ Also called by event processing code
*/ */
void CG_SetEntitySoundPosition(centity_t * cent) void CG_SetEntitySoundPosition(centity_t * cent)
{ {
if (cent->currentState.solid == SOLID_BMODEL) { if (cent->currentState.solid == SOLID_BMODEL)
{
vec3_t origin; vec3_t origin;
float *v;
v = cgs.inlineModelMidpoints[cent->currentState.modelindex]; VectorCopy(cgs.inlineModelMidpoints[cent->currentState.modelindex], origin);
VectorAdd(cent->lerpOrigin, v, origin); //Makro - rotate if needed
if (cent->lerpAngles[YAW] || cent->lerpAngles[PITCH] || cent->lerpAngles[ROLL])
{
vec3_t axis[3];
AnglesToAxis(cent->lerpAngles, axis);
ChangeRefSystem(origin, NULL, axis, origin);
}
VectorAdd(cent->lerpOrigin, origin, origin);
trap_S_UpdateEntityPosition(cent->currentState.number, origin); trap_S_UpdateEntityPosition(cent->currentState.number, origin);
} else { } else {
trap_S_UpdateEntityPosition(cent->currentState.number, cent->lerpOrigin); trap_S_UpdateEntityPosition(cent->currentState.number, cent->lerpOrigin);
@ -836,7 +846,9 @@ CG_AdjustPositionForMover
Also called by client movement prediction code Also called by client movement prediction code
========================= =========================
*/ */
void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out)
//Makro - made it so that angles get adjusted, too
void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out, vec3_t angleOut)
{ {
centity_t *cent; centity_t *cent;
vec3_t oldOrigin, origin, deltaOrigin; vec3_t oldOrigin, origin, deltaOrigin;
@ -848,23 +860,63 @@ void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int
} }
cent = &cg_entities[moverNum]; cent = &cg_entities[moverNum];
if (cent->currentState.eType != ET_MOVER) { //if (cent->currentState.eType != ET_MOVER) {
//Makro - adjust for movers and attached entities
if ( (cent->currentState.eType != ET_PLAYER && cent->currentState.eFlags & EF_ATTACHED == 0) //if not attached
&& cent->currentState.eType != ET_MOVER ) //and not a mover, either
{
VectorCopy(in, out); VectorCopy(in, out);
return; return;
} }
CG_EvaluateTrajectory(&cent->currentState.pos, fromTime, oldOrigin); //Makro - if mover is blocked, don't do anything
CG_EvaluateTrajectory(&cent->currentState.apos, fromTime, oldAngles); if (cent->currentState.eFlags & EF_MOVER_BLOCKED)
{
VectorCopy(in, out);
return;
}
CG_EvaluateTrajectory(&cent->currentState.pos, toTime, origin); //CG_EvaluateTrajectory(&cent->currentState.pos, fromTime, oldOrigin);
CG_EvaluateTrajectory(&cent->currentState.apos, toTime, angles); //CG_EvaluateTrajectory(&cent->currentState.apos, fromTime, oldAngles);
CG_EvaluateTrajectoryEx(cent, fromTime, oldOrigin, oldAngles);
//CG_EvaluateTrajectory(&cent->currentState.pos, toTime, origin);
//CG_EvaluateTrajectory(&cent->currentState.apos, toTime, angles)
CG_EvaluateTrajectoryEx(cent, toTime, origin, angles);
VectorSubtract(origin, oldOrigin, deltaOrigin); VectorSubtract(origin, oldOrigin, deltaOrigin);
VectorSubtract(angles, oldAngles, deltaAngles); VectorSubtract(angles, oldAngles, deltaAngles);
VectorAdd(in, deltaOrigin, out); VectorAdd(in, deltaOrigin, out);
// FIXME: origin change when on a rotating object // FIXME: origin change when on a rotating object
//Makro - okay
if (angleOut)
VectorAdd(angleOut, deltaAngles, angleOut);
if (deltaAngles[0] || deltaAngles[1] || deltaAngles[2])
{
vec3_t matrix[3], transpose[3];
VectorSubtract(in, oldOrigin, oldOrigin);
VectorCopy(oldOrigin, deltaOrigin);
CreateRotationMatrix(deltaAngles, transpose);
TransposeMatrix(transpose, matrix);
RotatePoint(deltaOrigin, matrix);
VectorSubtract(deltaOrigin, oldOrigin, deltaOrigin);
VectorAdd(out, deltaOrigin, out);
/*
float norm;
VectorSubtract(in, origin, deltaOrigin);
norm = VectorLength(deltaOrigin);
vectoangles(deltaOrigin, angles);
VectorAdd(angles, deltaAngles, angles);
AngleVectors(angles, origin, NULL, NULL);
VectorScale(origin, norm, origin);
VectorSubtract(origin, deltaOrigin, deltaOrigin);
VectorAdd(out, deltaOrigin, out);
*/
}
} }
/* /*
@ -943,14 +995,24 @@ static void CG_CalcEntityLerpPositions(centity_t * cent)
} }
// just use the current frame and evaluate as best we can // just use the current frame and evaluate as best we can
CG_EvaluateTrajectory(&cent->currentState.pos, cg.time, cent->lerpOrigin); //Makro - if this is a mover, it might be blocked
CG_EvaluateTrajectory(&cent->currentState.apos, cg.time, cent->lerpAngles); if (cent->currentState.eType == ET_MOVER && (cent->currentState.eFlags & EF_MOVER_BLOCKED) != 0)
{
//no prediction in this case
//CG_EvaluateTrajectory(&cent->currentState.pos, cg.snap->serverTime, cent->lerpOrigin);
//CG_EvaluateTrajectory(&cent->currentState.apos, cg.snap->serverTime, cent->lerpAngles);
CG_EvaluateTrajectoryEx(cent, cg.snap->serverTime, cent->lerpOrigin, cent->lerpAngles);
} else {
//CG_EvaluateTrajectory(&cent->currentState.pos, cg.time, cent->lerpOrigin);
//CG_EvaluateTrajectory(&cent->currentState.apos, cg.time, cent->lerpAngles);
CG_EvaluateTrajectoryEx(cent, cg.time, cent->lerpOrigin, cent->lerpAngles);
}
// adjust for riding a mover if it wasn't rolled into the predicted // adjust for riding a mover if it wasn't rolled into the predicted
// player state // player state
if (cent != &cg.predictedPlayerEntity) { if (cent != &cg.predictedPlayerEntity) {
CG_AdjustPositionForMover(cent->lerpOrigin, cent->currentState.groundEntityNum, CG_AdjustPositionForMover(cent->lerpOrigin, cent->currentState.groundEntityNum,
cg.snap->serverTime, cg.time, cent->lerpOrigin); cg.snap->serverTime, cg.time, cent->lerpOrigin, cent->lerpAngles);
} }
} }
@ -1101,6 +1163,13 @@ CG_AddPacketEntities
Makro - added skyportal param Makro - added skyportal param
=============== ===============
*/ */
//Makro - added
int cmpSnapEntities(const void *a, const void *b)
{
return cg_moveParentRanks[((entityState_t*)b)->number] - cg_moveParentRanks[((entityState_t*)a)->number];
}
void CG_AddPacketEntities(int mode) void CG_AddPacketEntities(int mode)
{ {
centity_t *cent; centity_t *cent;
@ -1148,7 +1217,8 @@ void CG_AddPacketEntities(int mode)
// JBravo: unlagged // JBravo: unlagged
if (cg.nextSnap) { if (cg.nextSnap) {
for (num = 0 ; num < cg.nextSnap->numEntities ; num++) { for (num = 0 ; num < cg.nextSnap->numEntities ; num++) {
cent = &cg_entities[cg.nextSnap->entities[num].number]; //Makro - use pre-determined order so that attached entities are added before their "parents"
cent = &cg_entities[cg.nextSnap->entities[cg_nextSnapEntityOrder[num]].number];
if (cent->nextState.eType == ET_MISSILE || cent->nextState.eType == ET_GENERAL) { if (cent->nextState.eType == ET_MISSILE || cent->nextState.eType == ET_GENERAL) {
CG_TransitionEntity(cent); CG_TransitionEntity(cent);
cent->interpolate = qtrue; cent->interpolate = qtrue;
@ -1162,7 +1232,8 @@ void CG_AddPacketEntities(int mode)
if (mode != ADDENTS_NOSKYPORTAL) { if (mode != ADDENTS_NOSKYPORTAL) {
// add each entity sent over by the server // add each entity sent over by the server
for (num = 0; num < cg.snap->numEntities; num++) { for (num = 0; num < cg.snap->numEntities; num++) {
cent = &cg_entities[cg.snap->entities[num].number]; //Makro - use pre-determined order so that attached entities are added before their "parents"
cent = &cg_entities[cg.snap->entities[cg_snapEntityOrder[num]].number];
//if we're adding sky portal entities //if we're adding sky portal entities
if (mode == ADDENTS_SKYPORTAL) { if (mode == ADDENTS_SKYPORTAL) {
if (cent->currentState.eFlags & EF_HEADLESS) { if (cent->currentState.eFlags & EF_HEADLESS) {
@ -1179,7 +1250,8 @@ void CG_AddPacketEntities(int mode)
//sky portal entities or not (faster) //sky portal entities or not (faster)
} else { } else {
for (num = 0; num < cg.snap->numEntities; num++) { for (num = 0; num < cg.snap->numEntities; num++) {
cent = &cg_entities[cg.snap->entities[num].number]; //Makro - use pre-determined order so that attached entities are added before their "parents"
cent = &cg_entities[cg.snap->entities[cg_snapEntityOrder[num]].number];
if (!cg.nextSnap || (cent->nextState.eType != ET_MISSILE && cent->nextState.eType != ET_GENERAL)) { if (!cg.nextSnap || (cent->nextState.eType != ET_MISSILE && cent->nextState.eType != ET_GENERAL)) {
CG_AddCEntity(cent); CG_AddCEntity(cent);
} }
@ -1233,14 +1305,33 @@ Added by Elder.
Use sparingly. Use sparingly.
================= =================
*/ */
//Makro - dlight styles
char dlightStyles[MAX_DLIGHT_STYLES][MAX_DLIGHT_STLE_LEN];
int dlightStyleCount;
#define DLIGHT_FRAMETIME 50
float Dlight_IntensityForChar(char c)
{
if (c>= 'a' && c<='z')
return ((float)(c-'a'))/((float)('z'-'a'));
else if (c>= 'A' && c<='Z')
return ((float)(c-'A'))/((float)('Z'-'A'));
else if (c>= '0' && c<='9')
return ((float)(c-'0'))/((float)('9'-'0'));
else
return 1.0f;
}
static void CG_Dlight(centity_t * cent) static void CG_Dlight(centity_t * cent)
{ {
//Makro - kinda hackish, but oh well... //Makro - kinda hackish, but oh well...
//allows us to trigger them on off; SVF_NOCLIENT should've done this already, though //allows us to trigger them on off; SVF_NOCLIENT should've done this already, though
if (!(cent->currentState.eFlags & EF_NODRAW)) { if (!(cent->currentState.eFlags & EF_NODRAW)) {
int cl; int cl, dls;
float i, r, g, b, i2; float i, r, g, b, i2;
dls = cent->currentState.eventParm & DLIGHT_CUSTOMSTYLE;
cl = cent->currentState.constantLight; cl = cent->currentState.constantLight;
r = (cl & 255) / 255.0f; r = (cl & 255) / 255.0f;
g = ((cl >> 8) & 255) / 255.0f; g = ((cl >> 8) & 255) / 255.0f;
@ -1260,13 +1351,26 @@ static void CG_Dlight(centity_t * cent)
//CG_Printf("%f\n", i); //CG_Printf("%f\n", i);
} }
if (dls>0)
{
int slen = strlen(dlightStyles[dls-1]);
if (slen)
{
int index = (cg.time / DLIGHT_FRAMETIME) % slen, nindex = index+1 % slen;
int dtime = cg.time % DLIGHT_FRAMETIME;
float f1 = Dlight_IntensityForChar(dlightStyles[dls-1][index]);
float f2 = Dlight_IntensityForChar(dlightStyles[dls-1][nindex]);
float frac = (f2 * dtime + f1 * (DLIGHT_FRAMETIME-dtime)) / DLIGHT_FRAMETIME;
r *= frac;
g *= frac;
b *= frac;
}
}
if (cent->currentState.eventParm & DLIGHT_ADDITIVE) if (cent->currentState.eventParm & DLIGHT_ADDITIVE)
trap_R_AddAdditiveLightToScene(cent->lerpOrigin, i, r, g, b); trap_R_AddAdditiveLightToScene(cent->lerpOrigin, i, r, g, b);
else else
trap_R_AddLightToScene(cent->lerpOrigin, i, r, g, b); trap_R_AddLightToScene(cent->lerpOrigin, i, r, g, b);
//trap_R_AddLightToScene(cent->lerpOrigin, 500, 1, 1, 1);
//CG_Printf("cgame: (%f %f %f)\n", cent->lerpOrigin[0], cent->lerpOrigin[1], cent->lerpOrigin[2]);
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.75 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.74 2003/09/07 19:51:39 makro // Revision 1.74 2003/09/07 19:51:39 makro
// no message // no message
// //
@ -1492,7 +1495,8 @@ void CG_CheckEvents(centity_t * cent)
} }
// calculate the position at exactly the frame time // calculate the position at exactly the frame time
CG_EvaluateTrajectory(&cent->currentState.pos, cg.snap->serverTime, cent->lerpOrigin); //CG_EvaluateTrajectory(&cent->currentState.pos, cg.snap->serverTime, cent->lerpOrigin);
CG_EvaluateTrajectoryEx(cent, cg.snap->serverTime, cent->lerpOrigin, NULL);
CG_SetEntitySoundPosition(cent); CG_SetEntitySoundPosition(cent);
CG_EntityEvent(cent, cent->lerpOrigin); CG_EntityEvent(cent, cent->lerpOrigin);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.159 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.158 2004/03/07 17:39:10 makro // Revision 1.158 2004/03/07 17:39:10 makro
// no message // no message
// //
@ -1166,6 +1169,8 @@ typedef struct {
//Makro - used for flares //Makro - used for flares
unsigned char flareShaderNum[MAX_VISIBLE_FLARES]; unsigned char flareShaderNum[MAX_VISIBLE_FLARES];
float flareShaderSize[MAX_VISIBLE_FLARES], flareColor[MAX_VISIBLE_FLARES][4]; float flareShaderSize[MAX_VISIBLE_FLARES], flareColor[MAX_VISIBLE_FLARES][4];
//Makro - zcam lines
char zcamLine[2][256];
} cg_t; } cg_t;
//Blaze: struct to hold the func_breakable stuff //Blaze: struct to hold the func_breakable stuff
@ -1744,6 +1749,13 @@ extern centity_t cg_entities[MAX_GENTITIES];
extern weaponInfo_t cg_weapons[MAX_WEAPONS]; extern weaponInfo_t cg_weapons[MAX_WEAPONS];
extern itemInfo_t cg_items[MAX_ITEMS]; extern itemInfo_t cg_items[MAX_ITEMS];
extern markPoly_t cg_markPolys[MAX_MARK_POLYS]; extern markPoly_t cg_markPolys[MAX_MARK_POLYS];
//Makro - dlight styles
extern char dlightStyles[MAX_DLIGHT_STYLES][MAX_DLIGHT_STLE_LEN];
extern int dlightStyleCount;
//Makro - moveparent rank for each entity
extern int cg_moveParentRanks[MAX_GENTITIES];
extern int cg_snapEntityOrder[MAX_GENTITIES];
extern int cg_nextSnapEntityOrder[MAX_GENTITIES];
extern vmCvar_t cg_centertime; extern vmCvar_t cg_centertime;
extern vmCvar_t cg_runpitch; extern vmCvar_t cg_runpitch;
@ -1908,8 +1920,16 @@ extern vmCvar_t cg_RQ3_predictWeapons;
//Makro - avidemo with jpegs //Makro - avidemo with jpegs
extern vmCvar_t cg_RQ3_avidemo; extern vmCvar_t cg_RQ3_avidemo;
//Makro - left-handed weapons
//extern vmCvar_t cg_RQ3_leftHanded;
//Makro - sun flares //Makro - sun flares
extern vmCvar_t cg_RQ3_flareIntensity; extern vmCvar_t cg_RQ3_flareIntensity;
//Makro - ssg crosshair size
extern vmCvar_t cg_RQ3_ssgCrosshairSize;
//Makro - temp!!!
extern vmCvar_t cg_RQ3_angle0;
extern vmCvar_t cg_RQ3_angle1;
extern vmCvar_t cg_RQ3_angle2;
extern vmCvar_t cg_drawFriend; extern vmCvar_t cg_drawFriend;
extern vmCvar_t cg_teamChatsOnly; extern vmCvar_t cg_teamChatsOnly;
@ -2152,7 +2172,8 @@ void CG_PredictPlayerState(void);
void CG_LoadDeferredPlayers(void); void CG_LoadDeferredPlayers(void);
void CG_EvaluateTrajectory(const trajectory_t * tr, int atTime, vec3_t result); void CG_EvaluateTrajectory(const trajectory_t * tr, int atTime, vec3_t result);
void CG_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t result); void CG_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t result);
//Makro - added
void CG_EvaluateTrajectoryEx(centity_t *cent, int time, vec3_t origin, vec3_t angles);
// //
// cg_events.c // cg_events.c
// //
@ -2175,7 +2196,9 @@ void CG_SetEntitySoundPosition(centity_t * cent);
void CG_AddPacketEntities(int mode); void CG_AddPacketEntities(int mode);
void CG_Beam(centity_t * cent); void CG_Beam(centity_t * cent);
void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out); //void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out);
//Makro - made it so that angles get adjusted, too
void CG_AdjustPositionForMover(const vec3_t in, int moverNum, int fromTime, int toTime, vec3_t out, vec3_t angleOut);
void CG_PositionEntityOnTag(refEntity_t * entity, const refEntity_t * parent, qhandle_t parentModel, char *tagName); void CG_PositionEntityOnTag(refEntity_t * entity, const refEntity_t * parent, qhandle_t parentModel, char *tagName);
void CG_PositionRotatedEntityOnTag(refEntity_t * entity, const refEntity_t * parent, void CG_PositionRotatedEntityOnTag(refEntity_t * entity, const refEntity_t * parent,

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.146 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.145 2004/03/07 17:39:11 makro // Revision 1.145 2004/03/07 17:39:11 makro
// no message // no message
// //
@ -436,6 +439,10 @@ cgs_t cgs;
centity_t cg_entities[MAX_GENTITIES]; centity_t cg_entities[MAX_GENTITIES];
weaponInfo_t cg_weapons[MAX_WEAPONS]; weaponInfo_t cg_weapons[MAX_WEAPONS];
itemInfo_t cg_items[MAX_ITEMS]; itemInfo_t cg_items[MAX_ITEMS];
//Makro - moveparents
int cg_moveParentRanks[MAX_GENTITIES];
int cg_snapEntityOrder[MAX_GENTITIES];
int cg_nextSnapEntityOrder[MAX_GENTITIES];
vmCvar_t cg_railTrailTime; vmCvar_t cg_railTrailTime;
vmCvar_t cg_centertime; vmCvar_t cg_centertime;
@ -606,11 +613,22 @@ vmCvar_t cg_RQ3_strobe;
vmCvar_t cg_RQ3_predictWeapons; vmCvar_t cg_RQ3_predictWeapons;
//Makro: avidemo with jpegs //Makro - avidemo with jpegs
vmCvar_t cg_RQ3_avidemo; vmCvar_t cg_RQ3_avidemo;
//Makro - left-handed models
//vmCvar_t cg_RQ3_leftHanded;
//Makro - dev tools
/*
vmCvar_t cg_RQ3_angle0;
vmCvar_t cg_RQ3_angle1;
vmCvar_t cg_RQ3_angle2;
*/
//Makro - sun flares //Makro - sun flares
vmCvar_t cg_RQ3_flareIntensity; vmCvar_t cg_RQ3_flareIntensity;
//Makro - ssg crosshair size
vmCvar_t cg_RQ3_ssgCrosshairSize;
//Makro - fastsky //Makro - fastsky
@ -888,8 +906,18 @@ static cvarTable_t cvarTable[] = { // bk001129
{&cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}, {&cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE},
//Makro - avidemo with jpegs //Makro - avidemo with jpegs
{&cg_RQ3_avidemo, "cg_RQ3_avidemo", "0", 0}, {&cg_RQ3_avidemo, "cg_RQ3_avidemo", "0", 0},
//Makro - left-handed weapons
//{&cg_RQ3_leftHanded, "cg_RQ3_leftHanded", "0", CVAR_ARCHIVE},
//Makro - dev tool
/*
{&cg_RQ3_angle0, "cg_RQ3_angle0", "0", 0},
{&cg_RQ3_angle1, "cg_RQ3_angle1", "0", 0},
{&cg_RQ3_angle2, "cg_RQ3_angle2", "0", 0},
*/
//Makro - sun flares //Makro - sun flares
{&cg_RQ3_flareIntensity, "cg_RQ3_flareIntensity", "1.0", CVAR_ARCHIVE}, {&cg_RQ3_flareIntensity, "cg_RQ3_flareIntensity", "1.0", CVAR_ARCHIVE},
//Makro - ssg crosshair size
{&cg_RQ3_ssgCrosshairSize, "cg_RQ3_ssgCrosshairSize", "256", CVAR_ARCHIVE},
//Makro - fastsky //Makro - fastsky
{&cg_fastSky, "r_fastSky", "0", CVAR_ARCHIVE}, {&cg_fastSky, "r_fastSky", "0", CVAR_ARCHIVE},
{&cg_RQ3_wantFastSky, "cg_RQ3_wantFastSky", "0", CVAR_ARCHIVE}, {&cg_RQ3_wantFastSky, "cg_RQ3_wantFastSky", "0", CVAR_ARCHIVE},

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.28 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.27 2003/03/10 07:07:58 jbravo // Revision 1.27 2003/03/10 07:07:58 jbravo
// Small unlagged fixes and voting delay added. // Small unlagged fixes and voting delay added.
// //
@ -148,8 +151,9 @@ static void CG_ClipMoveToEntities(const vec3_t start, const vec3_t mins, const v
if (ent->solid == SOLID_BMODEL) { if (ent->solid == SOLID_BMODEL) {
// special value for bmodel // special value for bmodel
cmodel = trap_CM_InlineModel(ent->modelindex); cmodel = trap_CM_InlineModel(ent->modelindex);
VectorCopy(cent->lerpAngles, angles); //VectorCopy(cent->lerpAngles, angles);
CG_EvaluateTrajectory(&cent->currentState.pos, cg.physicsTime, origin); //CG_EvaluateTrajectory(&cent->currentState.pos, cg.physicsTime, origin);
CG_EvaluateTrajectoryEx(cent, cg.physicsTime, origin, angles);
} else { } else {
// encoded bbox // encoded bbox
x = (ent->solid & 255); x = (ent->solid & 255);
@ -741,9 +745,10 @@ void CG_PredictPlayerState(void)
} else { } else {
vec3_t adjusted; vec3_t adjusted;
//Makro - made it so that angles get adjusted, too
CG_AdjustPositionForMover(cg.predictedPlayerState.origin, CG_AdjustPositionForMover(cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum, cg.physicsTime, cg.predictedPlayerState.groundEntityNum, cg.physicsTime,
cg.oldTime, adjusted); cg.oldTime, adjusted, cg.predictedPlayerState.viewangles);
if (cg_showmiss.integer) { if (cg_showmiss.integer) {
if (!VectorCompare(oldPlayerState.origin, adjusted)) { if (!VectorCompare(oldPlayerState.origin, adjusted)) {
@ -845,9 +850,10 @@ void CG_PredictPlayerState(void)
return; return;
} }
// adjust for the movement of the groundentity // adjust for the movement of the groundentity
//Makro - made it so that angles get adjusted, too
CG_AdjustPositionForMover(cg.predictedPlayerState.origin, CG_AdjustPositionForMover(cg.predictedPlayerState.origin,
cg.predictedPlayerState.groundEntityNum, cg.predictedPlayerState.groundEntityNum,
cg.physicsTime, cg.time, cg.predictedPlayerState.origin); cg.physicsTime, cg.time, cg.predictedPlayerState.origin, cg.predictedPlayerState.viewangles);
if (cg_showmiss.integer) { if (cg_showmiss.integer) {
if (cg.predictedPlayerState.eventSequence > oldPlayerState.eventSequence + MAX_PS_EVENTS) { if (cg.predictedPlayerState.eventSequence > oldPlayerState.eventSequence + MAX_PS_EVENTS) {
@ -954,3 +960,36 @@ void CG_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t resu
break; break;
} }
} }
void CG_EvaluateTrajectoryEx(centity_t *cent, int time, vec3_t origin, vec3_t angles)
{
if (origin) CG_EvaluateTrajectory(&cent->currentState.pos, time, origin);
if (angles) CG_EvaluateTrajectory(&cent->currentState.apos, time, angles);
if (cent->currentState.eType != ET_PLAYER && cent->currentState.eFlags & EF_ATTACHED)
{
vec3_t org, axis[3], parent_angles;
centity_t *parent = cg_entities+cent->currentState.time2;
VectorCopy(parent->lerpAngles, parent_angles);
if (origin)
{
if (parent->lerpAngles[YAW] || parent->lerpAngles[PITCH] || parent->lerpAngles[ROLL])
{
VectorCopy(cent->currentState.angles2, org);
VectorAdd(org, origin, org);
AnglesToAxis(parent_angles, axis);
ChangeRefSystem(org, NULL, axis, org);
VectorAdd(org, parent->lerpOrigin, origin);
} else {
VectorAdd(origin, cent->currentState.angles2, origin);
VectorAdd(origin, parent->lerpOrigin, origin);
}
}
if (angles)
{
VectorAdd(angles, parent_angles, angles);
}
}
}

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.79 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.78 2003/09/19 21:22:52 makro // Revision 1.78 2003/09/19 21:22:52 makro
// Flares // Flares
// //
@ -508,6 +511,39 @@ void CG_ParseFogHull(const char *str)
cgs.clearColorSet = qfalse; cgs.clearColorSet = qfalse;
} }
} }
void CG_ParseDlightStyles(const char *str)
{
int i;
memset(dlightStyles, 0, sizeof(dlightStyles));
dlightStyleCount = atoi(Info_ValueForKey(str, "n"));
for (i=0; i<dlightStyleCount; i++)
{
Q_strncpyz(dlightStyles[i], Info_ValueForKey(str, va("%i", i)), sizeof(dlightStyles[0]));
}
}
void CG_ParseMoveParents(const char *str)
{
int i, num;
char tmp[4]; //3 digits and trailing zero
memset(cg_moveParentRanks, 0, sizeof(cg_moveParentRanks));
Q_strncpyz(tmp, str, 4);
str += 3;
num = atoi(tmp);
for (i=0; i<num; i++)
{
int entnum;
Q_strncpyz(tmp, str, 4);
entnum = atoi(tmp);
str += 3;
Q_strncpyz(tmp, str, 4);
str += 3;
cg_moveParentRanks[entnum] = atoi(tmp);
}
}
/* /*
================ ================
CG_SetConfigValues CG_SetConfigValues
@ -535,10 +571,14 @@ void CG_SetConfigValues(void)
CG_ParseFogHull( CG_ConfigString(CS_FOGHULL) ); CG_ParseFogHull( CG_ConfigString(CS_FOGHULL) );
//Makro - sky portal //Makro - sky portal
CG_ParseSkyPortal( CG_ConfigString(CS_SKYPORTAL) ); CG_ParseSkyPortal( CG_ConfigString(CS_SKYPORTAL) );
//Makro - fake shadows //Makro - fake shadows (not implemented yet!)
s = Info_ValueForKey(CG_ConfigString(CS_SHADOWS), "1"); s = Info_ValueForKey(CG_ConfigString(CS_SHADOWS), "1");
if (s && *s) if (s && *s)
trap_R_RegisterShaderNoMip(s); trap_R_RegisterShaderNoMip(s);
//Makro - dlight styles
CG_ParseDlightStyles(CG_ConfigString(CS_DLIGHT_STYLES));
//Makro - moveparent order
CG_ParseMoveParents(CG_ConfigString(CS_MOVEPARENTS));
} }
/* /*
@ -664,6 +704,12 @@ static void CG_ConfigStringModified(void)
//Makro - "clear" color //Makro - "clear" color
} else if (num == CS_FOGHULL) { } else if (num == CS_FOGHULL) {
CG_ParseFogHull(str); CG_ParseFogHull(str);
//Makro - dlight styles
} else if (num == CS_DLIGHT_STYLES) {
CG_ParseDlightStyles(str);
//Makro - moveparent order
} else if (num == CS_MOVEPARENTS) {
CG_ParseMoveParents(str);
} }
} }
@ -1483,6 +1529,10 @@ void CG_RQ3_Cmd()
i = atoi(CG_Argv(2)); i = atoi(CG_Argv(2));
CG_CtbCountDown(i); CG_CtbCountDown(i);
break; break;
//Makro - added
case ZCAMTEXT:
strcpy(cg.zcamLine[1], CG_Argv(2));
break;
default: default:
break; break;
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.9 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.8 2003/04/19 15:27:30 jbravo // Revision 1.8 2003/04/19 15:27:30 jbravo
// Backing out of most of unlagged. Only optimized prediction and smooth clients // Backing out of most of unlagged. Only optimized prediction and smooth clients
// remains. // remains.
@ -75,6 +78,38 @@ void CG_TransitionEntity(centity_t * cent)
CG_CheckEvents(cent); CG_CheckEvents(cent);
} }
/*
==================
CG_OrderSnapshotEntities
Makro - orders snapshot entities so that
attached ones are added after their "parents"
==================
*/
static void CG_OrderSnapshotEntities(snapshot_t *snap, int *order)
{
int i, j;
//initial values
for (i=0; i<snap->numEntities; i++)
order[i] = i;
//actual sorting... not exactly the fastest algorithm ever written
for (i=0; i<snap->numEntities-1; i++)
{
for (j=i+1; j<snap->numEntities; j++)
{
if (cg_moveParentRanks[snap->entities[order[i]].number] <
cg_moveParentRanks[snap->entities[order[j]].number])
{
//swap
order[i] ^= order[j];
order[j] ^= order[i];
order[i] ^= order[j];
}
}
}
}
/* /*
================== ==================
CG_SetInitialSnapshot CG_SetInitialSnapshot
@ -93,6 +128,8 @@ void CG_SetInitialSnapshot(snapshot_t * snap)
entityState_t *state; entityState_t *state;
cg.snap = snap; cg.snap = snap;
//Makro - order snapshot entities so that attached ones are added after their "parents"
CG_OrderSnapshotEntities(snap, cg_snapEntityOrder);
BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].currentState, qfalse); BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].currentState, qfalse);
@ -155,6 +192,8 @@ static void CG_TransitionSnapshot(void)
// move nextSnap to snap and do the transitions // move nextSnap to snap and do the transitions
oldFrame = cg.snap; oldFrame = cg.snap;
cg.snap = cg.nextSnap; cg.snap = cg.nextSnap;
//Makro - copy entity order
memcpy(cg_snapEntityOrder, cg_nextSnapEntityOrder, cg.snap->numEntities * sizeof(cg_nextSnapEntityOrder[0]));
BG_PlayerStateToEntityState(&cg.snap->ps, &cg_entities[cg.snap->ps.clientNum].currentState, qfalse); BG_PlayerStateToEntityState(&cg.snap->ps, &cg_entities[cg.snap->ps.clientNum].currentState, qfalse);
cg_entities[cg.snap->ps.clientNum].interpolate = qfalse; cg_entities[cg.snap->ps.clientNum].interpolate = qfalse;
@ -203,6 +242,8 @@ static void CG_SetNextSnap(snapshot_t * snap)
centity_t *cent; centity_t *cent;
cg.nextSnap = snap; cg.nextSnap = snap;
//Makro - order snapshot entities so that attached ones are added after their "parents"
CG_OrderSnapshotEntities(snap, cg_nextSnapEntityOrder);
BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].nextState, qfalse); BG_PlayerStateToEntityState(&snap->ps, &cg_entities[snap->ps.clientNum].nextState, qfalse);
cg_entities[cg.snap->ps.clientNum].interpolate = qtrue; cg_entities[cg.snap->ps.clientNum].interpolate = qtrue;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.48 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.47 2004/03/09 01:05:21 makro // Revision 1.47 2004/03/09 01:05:21 makro
// Flares // Flares
// //
@ -1114,7 +1117,7 @@ void CG_AddLensFlare(qboolean sun)
ent.customShader = cgs.media.sunFlareShader; ent.customShader = cgs.media.sunFlareShader;
//this function wouldn't be complete without some funny math //this function wouldn't be complete without some funny math
//this makes the sprite as big as the mapper wanted it to be //this makes the sprite as big as the mapper wanted it to be
ent.radius = cgs.sunFlareSize * tr.fraction * 24.724346f; ent.radius = cgs.sunFlareSize * tr.fraction * 25.6f;
ent.renderfx = RF_DEPTHHACK; ent.renderfx = RF_DEPTHHACK;
ent.shaderRGBA[0] = cgs.flareFadeFactor * cgs.sunAlpha * 255; ent.shaderRGBA[0] = cgs.flareFadeFactor * cgs.sunAlpha * 255;
ent.shaderRGBA[1] = ent.shaderRGBA[0]; ent.shaderRGBA[1] = ent.shaderRGBA[0];
@ -1130,6 +1133,7 @@ void CG_AddLensFlare(qboolean sun)
{ {
float len = 0, color[4]; float len = 0, color[4];
float size, hsize; float size, hsize;
float ffov = cos(cg.refdef.fov_y/4);
int i; int i;
VectorSet(dir, 320-cgs.lastSunX, 240-cgs.lastSunY, 0); VectorSet(dir, 320-cgs.lastSunX, 240-cgs.lastSunY, 0);
@ -1149,10 +1153,11 @@ void CG_AddLensFlare(qboolean sun)
CG_DrawPic(dp[0] - hsize, dp[1] - hsize, size, size, CG_DrawPic(dp[0] - hsize, dp[1] - hsize, size, size,
cgs.media.flareShader[cg.flareShaderNum[i]]); cgs.media.flareShader[cg.flareShaderNum[i]]);
} }
if (cgs.flareForwardFactor > 0) if (cgs.flareForwardFactor > ffov)
{ {
color[0] = color[1] = color[2] = 1.0f; color[0] = color[1] = color[2] = 1.0f;
color[3] = cgs.sunAlpha * cgs.flareForwardFactor * cgs.flareFadeFactor * FLARE_BLIND_ALPHA; //color[3] = cgs.sunAlpha * cgs.flareForwardFactor * cgs.flareFadeFactor * FLARE_BLIND_ALPHA;
color[3] = (cgs.flareForwardFactor - ffov) / (1 - ffov) * cgs.flareFadeFactor * FLARE_BLIND_ALPHA;
//Makro - too expensive //Makro - too expensive
//color[3] = cgs.sunAlpha * cgs.flareFadeFactor * FLARE_BLIND_ALPHA * (1.0f - abs(320 - cgs.lastSunX) / 320.0f) * (1.0f - abs(240 - cgs.lastSunY) / 240.0f); //color[3] = cgs.sunAlpha * cgs.flareFadeFactor * FLARE_BLIND_ALPHA * (1.0f - abs(320 - cgs.lastSunX) / 320.0f) * (1.0f - abs(240 - cgs.lastSunY) / 240.0f);
CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color); CG_FillRect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, color);
@ -1350,7 +1355,7 @@ void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoP
} }
} }
//Makro - like cl_avidemo, just that it uses JPEG's //Makro - like cl_avidemo, just that it uses JPEG's
aviDemoFPS = atof(cg_RQ3_avidemo.string); aviDemoFPS = cg_RQ3_avidemo.value;
if (aviDemoFPS > 0) { if (aviDemoFPS > 0) {
//if it's time to take a screenshot //if it's time to take a screenshot
if (cg.time > cg.screenshotTime + (int) (1000.0f / aviDemoFPS)) { if (cg.time > cg.screenshotTime + (int) (1000.0f / aviDemoFPS)) {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.120 2005/02/15 16:33:38 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.119 2004/01/26 21:26:08 makro // Revision 1.119 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -1317,6 +1320,7 @@ void CG_AddPlayerWeapon( refEntity_t * parent, playerState_t * ps, centity_t * c
gun1.shaderRGBA[ 1 ] = 255; gun1.shaderRGBA[ 1 ] = 255;
gun1.shaderRGBA[ 2 ] = 255; gun1.shaderRGBA[ 2 ] = 255;
gun1.shaderRGBA[ 3 ] = 255; gun1.shaderRGBA[ 3 ] = 255;
gun1.nonNormalizedAxes = qtrue;
VectorCopy( parent->lightingOrigin, gun2.lightingOrigin ); VectorCopy( parent->lightingOrigin, gun2.lightingOrigin );
gun2.shadowPlane = parent->shadowPlane; gun2.shadowPlane = parent->shadowPlane;
gun2.renderfx = parent->renderfx; gun2.renderfx = parent->renderfx;
@ -1777,6 +1781,13 @@ void CG_AddViewWeapon(playerState_t * ps)
hand.backlerp = 0; hand.backlerp = 0;
hand.hModel = weapon->handsModel; hand.hModel = weapon->handsModel;
hand.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_MINLIGHT; hand.renderfx = RF_DEPTHHACK | RF_FIRST_PERSON | RF_MINLIGHT;
/*
hand.nonNormalizedAxes = qtrue;
if (cg_RQ3_leftHanded.integer)
{
VectorNegate(hand.axis[1], hand.axis[1]);
}
*/
// add everything onto the hand // add everything onto the hand
CG_AddPlayerWeapon(&hand, ps, &cg.predictedPlayerEntity, ps->persistant[PERS_TEAM]); CG_AddPlayerWeapon(&hand, ps, &cg.predictedPlayerEntity, ps->persistant[PERS_TEAM]);

View file

@ -1,6 +1,8 @@
@echo off
mkdir vm mkdir vm
cd vm cd vm
set cc=call ..\compile.bat
set cc=call ..\..\compile.bat -DCGAME
%cc% ../../game/bg_misc.c %cc% ../../game/bg_misc.c
@if errorlevel 1 goto quit @if errorlevel 1 goto quit
@ -14,6 +16,8 @@ set cc=call ..\compile.bat
@if errorlevel 1 goto quit @if errorlevel 1 goto quit
%cc% ../../game/q_shared.c %cc% ../../game/q_shared.c
@if errorlevel 1 goto quit @if errorlevel 1 goto quit
%cc% ../cg_atmospheric.c
@if errorlevel 1 goto quit
%cc% ../cg_consolecmds.c %cc% ../cg_consolecmds.c
@if errorlevel 1 goto quit @if errorlevel 1 goto quit
%cc% ../cg_draw.c %cc% ../cg_draw.c
@ -57,3 +61,6 @@ set cc=call ..\compile.bat
q3asm -f ../cgame q3asm -f ../cgame
:quit :quit
cd .. cd ..
pause

View file

@ -82,7 +82,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /base:"0x30000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"../Debug/cgamex86.dll" # ADD LINK32 /nologo /base:"0x30000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"D:\Work\rq3source\reaction\Release\cgamex86.dll"
# SUBTRACT LINK32 /profile /nodefaultlib # SUBTRACT LINK32 /profile /nodefaultlib
!ELSEIF "$(CFG)" == "cgame - Win32 Release TA" !ELSEIF "$(CFG)" == "cgame - Win32 Release TA"

View file

@ -3,148 +3,14 @@
<pre> <pre>
<h1>Build Log</h1> <h1>Build Log</h1>
<h3> <h3>
--------------------Configuration: cgame - Win32 Release-------------------- --------------------Configuration: cgame - Win32 Debug--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C0.tmp" with contents
[
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"D:\Work\rq3source\reaction\Release/" /Fp"D:\Work\rq3source\reaction\Release/cgame.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /c
"D:\Work\rq3source\reaction\game\bg_misc.c"
"D:\Work\rq3source\reaction\game\bg_pmove.c"
"D:\Work\rq3source\reaction\game\bg_slidemove.c"
"D:\Work\rq3source\reaction\cgame\cg_atmospheric.c"
"D:\Work\rq3source\reaction\cgame\cg_consolecmds.c"
"D:\Work\rq3source\reaction\cgame\cg_draw.c"
"D:\Work\rq3source\reaction\cgame\cg_drawtools.c"
"D:\Work\rq3source\reaction\cgame\cg_effects.c"
"D:\Work\rq3source\reaction\cgame\cg_ents.c"
"D:\Work\rq3source\reaction\cgame\cg_event.c"
"D:\Work\rq3source\reaction\cgame\cg_info.c"
"D:\Work\rq3source\reaction\cgame\cg_localents.c"
"D:\Work\rq3source\reaction\cgame\cg_main.c"
"D:\Work\rq3source\reaction\cgame\cg_marks.c"
"D:\Work\rq3source\reaction\cgame\cg_players.c"
"D:\Work\rq3source\reaction\cgame\cg_playerstate.c"
"D:\Work\rq3source\reaction\cgame\cg_predict.c"
"D:\Work\rq3source\reaction\cgame\cg_scoreboard.c"
"D:\Work\rq3source\reaction\cgame\cg_servercmds.c"
"D:\Work\rq3source\reaction\cgame\cg_snapshot.c"
"D:\Work\rq3source\reaction\cgame\cg_syscalls.c"
"D:\Work\rq3source\reaction\cgame\cg_unlagged.c"
"D:\Work\rq3source\reaction\cgame\cg_view.c"
"D:\Work\rq3source\reaction\cgame\cg_weapons.c"
"D:\Work\rq3source\reaction\game\q_math.c"
"D:\Work\rq3source\reaction\game\q_shared.c"
"D:\Work\rq3source\reaction\ui\ui_shared.c"
]
Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C0.tmp"
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C1.tmp" with contents
[
/nologo /base:"0x30000000" /subsystem:windows /dll /incremental:no /pdb:"D:\Work\rq3source\reaction\Release/cgamex86.pdb" /map:"D:\Work\rq3source\reaction\Release/cgamex86.map" /machine:I386 /def:".\cgame.def" /out:"D:\Work\rq3source\reaction\Release\cgamex86.dll" /implib:"D:\Work\rq3source\reaction\Release/cgamex86.lib"
\Work\rq3source\reaction\Release\bg_misc.obj
\Work\rq3source\reaction\Release\bg_pmove.obj
\Work\rq3source\reaction\Release\bg_slidemove.obj
\Work\rq3source\reaction\Release\cg_atmospheric.obj
\Work\rq3source\reaction\Release\cg_consolecmds.obj
\Work\rq3source\reaction\Release\cg_draw.obj
\Work\rq3source\reaction\Release\cg_drawtools.obj
\Work\rq3source\reaction\Release\cg_effects.obj
\Work\rq3source\reaction\Release\cg_ents.obj
\Work\rq3source\reaction\Release\cg_event.obj
\Work\rq3source\reaction\Release\cg_info.obj
\Work\rq3source\reaction\Release\cg_localents.obj
\Work\rq3source\reaction\Release\cg_main.obj
\Work\rq3source\reaction\Release\cg_marks.obj
\Work\rq3source\reaction\Release\cg_players.obj
\Work\rq3source\reaction\Release\cg_playerstate.obj
\Work\rq3source\reaction\Release\cg_predict.obj
\Work\rq3source\reaction\Release\cg_scoreboard.obj
\Work\rq3source\reaction\Release\cg_servercmds.obj
\Work\rq3source\reaction\Release\cg_snapshot.obj
\Work\rq3source\reaction\Release\cg_syscalls.obj
\Work\rq3source\reaction\Release\cg_unlagged.obj
\Work\rq3source\reaction\Release\cg_view.obj
\Work\rq3source\reaction\Release\cg_weapons.obj
\Work\rq3source\reaction\Release\q_math.obj
\Work\rq3source\reaction\Release\q_shared.obj
\Work\rq3source\reaction\Release\ui_shared.obj
]
Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C1.tmp"
<h3>Output Window</h3>
Compiling...
bg_misc.c
bg_pmove.c
bg_slidemove.c
cg_atmospheric.c
cg_consolecmds.c
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(626) : warning C4706: assignment within conditional expression
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(638) : warning C4706: assignment within conditional expression
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(184) : warning C4701: local variable 'tr' may be used without having been initialized
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(334) : warning C4701: local variable 'tr' may be used without having been initialized
cg_draw.c
cg_drawtools.c
cg_effects.c
cg_ents.c
cg_event.c
cg_info.c
cg_localents.c
cg_main.c
cg_marks.c
cg_players.c
cg_playerstate.c
cg_predict.c
cg_scoreboard.c
D:\Work\rq3source\reaction\cgame\cg_predict.c(805) : warning C4701: local variable 'predictCmd' may be used without having been initialized
D:\Work\rq3source\reaction\cgame\cg_predict.c(809) : warning C4701: local variable 'stateIndex' may be used without having been initialized
cg_servercmds.c
cg_snapshot.c
cg_syscalls.c
cg_unlagged.c
cg_view.c
cg_weapons.c
q_math.c
q_shared.c
ui_shared.c
Linking...
Creating library D:\Work\rq3source\reaction\Release/cgamex86.lib and object D:\Work\rq3source\reaction\Release/cgamex86.exp
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C5.tmp" with contents
[
/nologo /o"D:\Work\rq3source\reaction\Release/cgame.bsc"
\Work\rq3source\reaction\Release\bg_misc.sbr
\Work\rq3source\reaction\Release\bg_pmove.sbr
\Work\rq3source\reaction\Release\bg_slidemove.sbr
\Work\rq3source\reaction\Release\cg_atmospheric.sbr
\Work\rq3source\reaction\Release\cg_consolecmds.sbr
\Work\rq3source\reaction\Release\cg_draw.sbr
\Work\rq3source\reaction\Release\cg_drawtools.sbr
\Work\rq3source\reaction\Release\cg_effects.sbr
\Work\rq3source\reaction\Release\cg_ents.sbr
\Work\rq3source\reaction\Release\cg_event.sbr
\Work\rq3source\reaction\Release\cg_info.sbr
\Work\rq3source\reaction\Release\cg_localents.sbr
\Work\rq3source\reaction\Release\cg_main.sbr
\Work\rq3source\reaction\Release\cg_marks.sbr
\Work\rq3source\reaction\Release\cg_players.sbr
\Work\rq3source\reaction\Release\cg_playerstate.sbr
\Work\rq3source\reaction\Release\cg_predict.sbr
\Work\rq3source\reaction\Release\cg_scoreboard.sbr
\Work\rq3source\reaction\Release\cg_servercmds.sbr
\Work\rq3source\reaction\Release\cg_snapshot.sbr
\Work\rq3source\reaction\Release\cg_syscalls.sbr
\Work\rq3source\reaction\Release\cg_unlagged.sbr
\Work\rq3source\reaction\Release\cg_view.sbr
\Work\rq3source\reaction\Release\cg_weapons.sbr
\Work\rq3source\reaction\Release\q_math.sbr
\Work\rq3source\reaction\Release\q_shared.sbr
\Work\rq3source\reaction\Release\ui_shared.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP2C5.tmp"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3> <h3>Results</h3>
cgamex86.dll - 0 error(s), 6 warning(s) cgamex86.dll - 0 error(s), 0 warning(s)
</pre> </pre>
</body> </body>
</html> </html>

View file

@ -1,6 +1,8 @@
@echo off
mkdir vm mkdir vm
cd vm cd vm
set cc=lcc -DQ3_VM -DMISSIONPACK -DCGAME -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1
set cc=call ..\..\compile.bat -DCGAME -DMISSIONPACK
%cc% ../../game/bg_misc.c %cc% ../../game/bg_misc.c
@if errorlevel 1 goto quit @if errorlevel 1 goto quit

View file

@ -1,2 +1,2 @@
lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ta_ui %1

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.10 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.9 2002/07/22 06:35:03 niceass // Revision 1.9 2002/07/22 06:35:03 niceass
// cleaned up the powerup code // cleaned up the powerup code
// //
@ -751,7 +754,9 @@ int BotChat_Death(bot_state_t * bs)
bs->botdeathtype == MOD_CRUSH || bs->botdeathtype == MOD_CRUSH ||
bs->botdeathtype == MOD_SUICIDE || bs->botdeathtype == MOD_SUICIDE ||
bs->botdeathtype == MOD_TARGET_LASER || bs->botdeathtype == MOD_TARGET_LASER ||
bs->botdeathtype == MOD_TRIGGER_HURT || bs->botdeathtype == MOD_UNKNOWN) bs->botdeathtype == MOD_TRIGGER_HURT || bs->botdeathtype == MOD_UNKNOWN ||
//Makro - custom message implies a trigger_hurt
bs->botdeathtype >= MOD_CUSTOM)
BotAI_BotInitialChat(bs, "death_suicide", BotRandomOpponentName(bs), NULL); BotAI_BotInitialChat(bs, "death_suicide", BotRandomOpponentName(bs), NULL);
else if (bs->botdeathtype == MOD_TELEFRAG) else if (bs->botdeathtype == MOD_TELEFRAG)
BotAI_BotInitialChat(bs, "death_telefrag", name, NULL); BotAI_BotInitialChat(bs, "death_telefrag", name, NULL);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.56 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.55 2003/03/09 21:30:38 jbravo // Revision 1.55 2003/03/09 21:30:38 jbravo
// Adding unlagged. Still needs work. // Adding unlagged. Still needs work.
// //
@ -3981,11 +3984,12 @@ int BotFuncDoorRotatingActivateGoal(bot_state_t * bs, int bspent, bot_activatego
VectorAdd(mins, maxs, origin); VectorAdd(mins, maxs, origin);
VectorScale(origin, 0.5, origin); VectorScale(origin, 0.5, origin);
activategoal->goal.entitynum = entitynum; activategoal->goal.entitynum = entitynum;
VectorTargetDist(bs->origin, origin, -40, activategoal->origin); VectorTargetDist(bs->origin, origin, -48, activategoal->origin);
activategoal->openDoor = qtrue; activategoal->openDoor = qtrue;
activategoal->goal.number = 0; activategoal->goal.number = 0;
activategoal->goal.flags = 0; activategoal->goal.flags = 0;
VectorCopy(bs->origin, activategoal->goal.origin); //VectorCopy(bs->origin, activategoal->goal.origin);
VectorCopy(activategoal->origin, activategoal->goal.origin);
activategoal->goal.areanum = bs->areanum; activategoal->goal.areanum = bs->areanum;
VectorSet(activategoal->goal.mins, -8, -8, -8); VectorSet(activategoal->goal.mins, -8, -8, -8);
VectorSet(activategoal->goal.maxs, 8, 8, 8); VectorSet(activategoal->goal.maxs, 8, 8, 8);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.12 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.11 2002/06/16 20:06:13 jbravo // Revision 1.11 2002/06/16 20:06:13 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -1010,7 +1013,8 @@ void RemoveColorEscapeSequences(char *text)
l = 0; l = 0;
for (i = 0; text[i]; i++) { for (i = 0; text[i]; i++) {
if (Q_IsColorString(&text[i])) { //Makro - don't remove underlined char escape sequence
if (Q_IsColorString(&text[i]) && text[i+1]!='_') {
i++; i++;
continue; continue;
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.10 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.9 2002/08/21 03:43:23 niceass // Revision 1.9 2002/08/21 03:43:23 niceass
// allow clipvelocity outside of the bg_'s // allow clipvelocity outside of the bg_'s
// //
@ -50,6 +53,9 @@ typedef struct {
qboolean groundPlane; qboolean groundPlane;
trace_t groundTrace; trace_t groundTrace;
qboolean ladder; // We'll use this to tell when the player is on a ladder (c3a tut) qboolean ladder; // We'll use this to tell when the player is on a ladder (c3a tut)
//Makro - flags for the ladder surface, in case there is one
//(for playing the right footstep sounds)
int ladderSurface;
//qboolean previous_ladder; // Elder: need this to see if player was on ladder //qboolean previous_ladder; // Elder: need this to see if player was on ladder
qboolean opendoor; qboolean opendoor;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.56 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.55 2003/07/30 16:05:46 makro // Revision 1.55 2003/07/30 16:05:46 makro
// no message // no message
// //
@ -1580,14 +1583,14 @@ int MatFlags[] = {
SURF_HARDMETAL SURF_HARDMETAL
}; };
#define MatFlagCount 5 #define MAT_FLAG_COUNT 5
int GetMaterialFromFlag(int flag) int GetMaterialFromFlag(int flag)
{ {
int Material = 0; int Material = 0;
int i = 0; int i = 0;
for (i = 0; i < MatFlagCount; i++) { for (i = 0; i < MAT_FLAG_COUNT; i++) {
if ((flag & MatFlags[i])) { if ((flag & MatFlags[i])) {
Material += (1 << i); Material += (1 << i);
} }
@ -1596,48 +1599,6 @@ int GetMaterialFromFlag(int flag)
return Material; return Material;
} }
//metal
qboolean IsMetalMat(int Material)
{
if (Material == MAT_METALSTEPS || Material == MAT_METAL2 || Material == MAT_HARDMETAL) {
return qtrue;
}
return qfalse;
}
qboolean IsMetalFlag(int flag)
{
return IsMetalMat(GetMaterialFromFlag(flag));
}
//wood
qboolean IsWoodMat(int Material)
{
if (Material == MAT_WOOD || Material == MAT_WOOD2) {
return qtrue;
}
return qfalse;
}
qboolean IsWoodFlag(int flag)
{
return IsWoodMat(GetMaterialFromFlag(flag));
}
//snow
qboolean IsSnowMat(int Material)
{
if (Material == MAT_SNOW || Material == MAT_SNOW2) {
return qtrue;
}
return qfalse;
}
qboolean IsSnowFlag(int flag)
{
return IsSnowMat(GetMaterialFromFlag(flag));
}
//Makro - added //Makro - added
/* char *modelFromStr(char *s) /* char *modelFromStr(char *s)
{ {
@ -1673,7 +1634,7 @@ char *modelFromStr(char *s)
if (!s) if (!s)
return NULL; return NULL;
strncpy(buffer, s, 128); strncpy(buffer, s, sizeof(buffer));
if ((p = Q_strrchr(buffer, '/')) != NULL) if ((p = Q_strrchr(buffer, '/')) != NULL)
*p = '\0'; *p = '\0';
return buffer; return buffer;
@ -1684,7 +1645,7 @@ char *skinFromStr(char *s)
static char buffer[128]; static char buffer[128];
char *p; char *p;
memset(buffer, 0, 128); memset(buffer, 0, sizeof(buffer));
if (!s) if (!s)
return NULL; return NULL;
if (!*s) if (!*s)

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.94 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.93 2003/03/09 19:47:48 niceass // Revision 1.93 2003/03/09 19:47:48 niceass
// Support for torso pistol animations // Support for torso pistol animations
// //
@ -1005,11 +1008,13 @@ static void PM_NoclipMove(void)
PM_FootstepForSurface PM_FootstepForSurface
Returns an event number apropriate for the groundsurface Returns an event number apropriate for the groundsurface
Makro - changed prototype so that we can use it for other surfaces, too
(ladder footsteps)
================ ================
*/ */
static int PM_FootstepForSurface(void) static int PM_FootstepForSurface(int surfaceFlags)
{ {
int Material = GetMaterialFromFlag(pml.groundTrace.surfaceFlags); int Material = GetMaterialFromFlag(surfaceFlags);
if (pml.groundTrace.surfaceFlags & SURF_NOSTEPS) { if (pml.groundTrace.surfaceFlags & SURF_NOSTEPS) {
return 0; return 0;
@ -1152,7 +1157,7 @@ static void PM_CrashLand(void)
pm->ps->stats[STAT_FALLDAMAGE] = damage; pm->ps->stats[STAT_FALLDAMAGE] = damage;
} else { } else {
PM_AddEvent(PM_FootstepForSurface()); PM_AddEvent(PM_FootstepForSurface(pml.groundTrace.surfaceFlags));
//Elder: added? useful? //Elder: added? useful?
pm->ps->stats[STAT_FALLDAMAGE] = 0; pm->ps->stats[STAT_FALLDAMAGE] = 0;
} }
@ -1171,8 +1176,9 @@ static void PM_CrashLand(void)
// JBravo: new multiple itemcode // JBravo: new multiple itemcode
} else if (!(pm->ps->stats[STAT_HOLDABLE_ITEM] & (1 << HI_SLIPPERS))) { } else if (!(pm->ps->stats[STAT_HOLDABLE_ITEM] & (1 << HI_SLIPPERS))) {
// Elder: don't spam sound events going up -- more like Q2 ladders as well // Elder: don't spam sound events going up -- more like Q2 ladders as well
if (!pml.ladder || pm->ps->velocity[2] < 0) //Makro - ladder footsteps are handled in PM_LadderMove, chaging || to &&
PM_AddEvent(PM_FootstepForSurface()); if (!pml.ladder && pm->ps->velocity[2] < 0)
PM_AddEvent(PM_FootstepForSurface(pml.groundTrace.surfaceFlags));
//Elder: added? useful? //Elder: added? useful?
pm->ps->stats[STAT_FALLDAMAGE] = 0; pm->ps->stats[STAT_FALLDAMAGE] = 0;
} }
@ -1563,7 +1569,7 @@ static void PM_Footsteps(void)
if ((footstep && !pm->noFootsteps) if ((footstep && !pm->noFootsteps)
// JBravo: new multiple itemcode // JBravo: new multiple itemcode
&& !(pm->ps->stats[STAT_HOLDABLE_ITEM] & (1 << HI_SLIPPERS))) { && !(pm->ps->stats[STAT_HOLDABLE_ITEM] & (1 << HI_SLIPPERS))) {
PM_AddEvent(PM_FootstepForSurface()); PM_AddEvent(PM_FootstepForSurface(pml.groundTrace.surfaceFlags));
} }
} else if (pm->waterlevel == 1) { } else if (pm->waterlevel == 1) {
// splashing // splashing
@ -2675,7 +2681,7 @@ Ladders with angles on them (urban2 for AQ2) haven't been tested.
*/ */
static void PM_LadderMove(void) static void PM_LadderMove(void)
{ {
int i; int i, old;
vec3_t wishvel; vec3_t wishvel;
float wishspeed; float wishspeed;
vec3_t wishdir; vec3_t wishdir;
@ -2786,7 +2792,23 @@ static void PM_LadderMove(void)
PM_StepSlideMove(qfalse); // move without gravity PM_StepSlideMove(qfalse); // move without gravity
// Elder: stop legs from animating // Elder: stop legs from animating
PM_ForceLegsAnim(LEGS_JUMP); //PM_ForceLegsAnim(LEGS_JUMP);
//Makro - changed to LEGS_IDLE
PM_ForceLegsAnim(LEGS_IDLE);
//Makro - play footstep sound
if (pm->ps->velocity[2]) {
old = pm->ps->bobCycle;
//the faster we move, the more frequent the footsteps
pm->ps->bobCycle = (int) (old + 0.45 * fabs(pm->ps->velocity[2]) / 225.0f * pml.msec) & 255;
// if we just crossed a cycle boundary, play an apropriate footstep event
if (((old + 64) ^ (pm->ps->bobCycle + 64)) & 128) {
PM_AddEvent(PM_FootstepForSurface(pml.ladderSurface));
}
} else {
pm->ps->bobCycle = 0;
}
} }
/* /*
@ -2810,6 +2832,9 @@ void CheckLadder(void)
VectorMA(pm->ps->origin, 1, flatforward, spot); VectorMA(pm->ps->origin, 1, flatforward, spot);
pm->trace(&trace, pm->ps->origin, pm->mins, pm->maxs, spot, pm->ps->clientNum, MASK_PLAYERSOLID); pm->trace(&trace, pm->ps->origin, pm->mins, pm->maxs, spot, pm->ps->clientNum, MASK_PLAYERSOLID);
//Makro - save the surface flags so we can play the appropriate sound
pml.ladderSurface = trace.surfaceFlags;
if ((trace.fraction < 1) && (trace.surfaceFlags & SURF_LADDER)) if ((trace.fraction < 1) && (trace.surfaceFlags & SURF_LADDER))
pml.ladder = qtrue; pml.ladder = qtrue;
@ -3012,7 +3037,9 @@ void PmoveSingle(pmove_t * pmove)
PM_TorsoAnimation(); PM_TorsoAnimation();
// footstep events / legs animations // footstep events / legs animations
PM_Footsteps(); //Makro - ladder footsteps already handled in PM_LadderMove
if (!pml.ladder)
PM_Footsteps();
// entering / leaving water splashes // entering / leaving water splashes
// JBravo: only if you are alive // JBravo: only if you are alive

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.110 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.109 2004/01/26 21:26:08 makro // Revision 1.109 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -294,10 +297,18 @@
#define RQ3_DEBRIS_POPCAN 0x00000800 #define RQ3_DEBRIS_POPCAN 0x00000800
// Elder: dynamic light switches // Elder: dynamic light switches
#define DLIGHT_ADDITIVE 1 //Makro - new flag; reordered old ones
#define DLIGHT_FLICKER 2 #define DLIGHT_CUSTOMSTYLE 63
#define DLIGHT_PULSE 4
#define DLIGHT_STROBE 8 #define DLIGHT_ADDITIVE 64
#define DLIGHT_FLICKER 128
#define DLIGHT_PULSE 256
#define DLIGHT_STROBE 512
#define MAX_DLIGHT_STYLES 64
#define MAX_DLIGHT_STLE_LEN 64
#define MAX_CUSTOM_DEATH_MSG 32
//Blaze: Max number of breakables //Blaze: Max number of breakables
#define RQ3_MAX_BREAKABLES 64 #define RQ3_MAX_BREAKABLES 64
@ -438,7 +449,8 @@ enum {
SCREENSHOT, SCREENSHOT,
OWNED, OWNED,
CVARSET, CVARSET,
CTBCOUNTDOWN CTBCOUNTDOWN,
ZCAMTEXT //Makro - added
}; };
//Elder: sound events for EV_RQ3_SOUND //Elder: sound events for EV_RQ3_SOUND
@ -616,23 +628,30 @@ extern radio_msg_t female_radio_msgs[];
#define CS_ITEMS 27 // string of 0's and 1's that tell which items are present #define CS_ITEMS 27 // string of 0's and 1's that tell which items are present
#define CS_ATMOSEFFECT 28 // q3f: Atmospheric effect, if any. #define CS_ATMOSEFFECT 28 // q3f: Atmospheric effect, if any.
#define CS_SHADOWS 29 #define CS_SHADOWS 29
//Makro - color for the loading screen text //Makro - color for the loading screen text
//#define CS_LOADINGSCREEN 29 //#define CS_LOADINGSCREEN 29
//Makro - sky portals ! //Makro - sky portals !
#define CS_SKYPORTAL 30 #define CS_SKYPORTAL 30
//Makro - fog hull //Makro - fog hull
#define CS_FOGHULL 31 #define CS_FOGHULL 31
#define CS_MODELS 32 #define CS_MODELS 32
#define CS_SOUNDS (CS_MODELS+MAX_MODELS) #define CS_SOUNDS (CS_MODELS+MAX_MODELS)
#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) #define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS)
#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) #define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS)
#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) //Makro - CS_PARTICLES not used, removing
//#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS)
//Blaze: Storing breakables in config strings now //Blaze: Storing breakables in config strings now
#define CS_BREAKABLES (CS_PARTICLES+MAX_LOCATIONS) //#define CS_BREAKABLES (CS_PARTICLES+MAX_LOCATIONS)
#define CS_BREAKABLES (CS_LOCATIONS+MAX_LOCATIONS)
//Makro - dlight styles
#define CS_DLIGHT_STYLES (CS_BREAKABLES+RQ3_MAX_BREAKABLES)
//Makro - moveparent order
#define CS_MOVEPARENTS CS_DLIGHT_STYLES+1
#define CS_MAX (CS_BREAKABLES+RQ3_MAX_BREAKABLES) //#define CS_MAX (CS_BREAKABLES+RQ3_MAX_BREAKABLES)
#define CS_MAX (CS_MOVEPARENTS+1)
#if (CS_MAX) > MAX_CONFIGSTRINGS #if (CS_MAX) > MAX_CONFIGSTRINGS
#error overflow: (CS_MAX) > MAX_CONFIGSTRINGS #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS
@ -862,16 +881,24 @@ typedef enum {
#define EF_HEADLESS 0x00000200 // NiceAss: Replaced EF_KAMAKAZI #define EF_HEADLESS 0x00000200 // NiceAss: Replaced EF_KAMAKAZI
#define EF_MOVER_STOP 0x00000400 // will push otherwise #define EF_MOVER_STOP 0x00000400 // will push otherwise
#define EF_AWARD_CAP 0x00000800 // draw the capture sprite #define EF_AWARD_CAP 0x00000800 // draw the capture sprite
#define EF_ATTACHED EF_AWARD_CAP //Makro - reusing this flag for non-player entities
#define EF_TALK 0x00001000 // draw a talk balloon #define EF_TALK 0x00001000 // draw a talk balloon
#define EF_CONNECTION 0x00002000 // draw a connection trouble sprite #define EF_CONNECTION 0x00002000 // draw a connection trouble sprite
#define EF_VOTED 0x00004000 // already cast a vote #define EF_VOTED 0x00004000 // already cast a vote
#define EF_AWARD_IMPRESSIVE 0x00008000 // draw an impressive sprite #define EF_AWARD_IMPRESSIVE 0x00008000 // draw an impressive sprite
#define EF_MOVER_BLOCKED EF_AWARD_IMPRESSIVE //Makro - reusing this flag for non-player entities
#define EF_AWARD_DEFEND 0x00010000 // draw a defend sprite #define EF_AWARD_DEFEND 0x00010000 // draw a defend sprite
#define EF_AWARD_ASSIST 0x00020000 // draw a assist sprite #define EF_AWARD_ASSIST 0x00020000 // draw a assist sprite
#define EF_AWARD_DENIED 0x00040000 // denied #define EF_AWARD_DENIED 0x00040000 // denied
#define EF_TEAMVOTED 0x00080000 // already cast a team vote #define EF_TEAMVOTED 0x00080000 // already cast a team vote
//Makro - moveparent ranks
#define RANK_NONE 0
#define RANK_SLAVE 1
#define RANK_MASTER 2
// NOTE: may not have more than 16 // NOTE: may not have more than 16
typedef enum { typedef enum {
PW_NONE, PW_NONE,
@ -1386,7 +1413,10 @@ typedef enum {
MOD_M3, MOD_M3,
MOD_HANDCANNON, MOD_HANDCANNON,
MOD_KICK, MOD_KICK,
MOD_BLEEDING MOD_BLEEDING,
//Makro - entity defined
//this must be last so we can have MOD_CUSTOM+index args
MOD_CUSTOM
} meansOfDeath_t; } meansOfDeath_t;
//--------------------------------------------------------- //---------------------------------------------------------
@ -1524,43 +1554,11 @@ qboolean BG_PlayerTouchesItem(playerState_t * ps, entityState_t * item, int atTi
#define KAMI_BOOMSPHERE_MAXRADIUS 720 #define KAMI_BOOMSPHERE_MAXRADIUS 720
#define KAMI_SHOCKWAVE2_MAXRADIUS 704 #define KAMI_SHOCKWAVE2_MAXRADIUS 704
//Makro - for the new surfaceparm system
#define MAT_DEFAULT 0
#define MAT_METALSTEPS 1
#define MAT_GRAVEL 2
#define MAT_WOOD 3
#define MAT_CARPET 4
#define MAT_METAL2 5
#define MAT_GLASS 6
#define MAT_GRASS 7
#define MAT_SNOW 8
#define MAT_MUD 9
#define MAT_WOOD2 10
#define MAT_HARDMETAL 11
//new
#define MAT_LEAVES 12
#define MAT_CEMENT 13
#define MAT_MARBLE 14
#define MAT_SNOW2 15
#define MAT_HARDSTEPS 16
#define MAT_SAND 17
#define MAT_BRICK 18
#define MAT_CERAMIC 19
//Makro - moved from the UI/cgame header files //Makro - moved from the UI/cgame header files
#define NUM_CROSSHAIRS 10 #define NUM_CROSSHAIRS 10
//Makro - for the SSG crosshair preview //Makro - for the SSG crosshair preview
#define NUM_SSGCROSSHAIRS 17 #define NUM_SSGCROSSHAIRS 17
int GetMaterialFromFlag(int flag);
qboolean IsMetalMat(int Material);
qboolean IsMetalFlag(int flag);
qboolean IsWoodMat(int Material);
qboolean IsWoodFlag(int flag);
qboolean IsSnowMat(int Material);
qboolean IsSnowFlag(int flag);
holdable_t CharToItem(char *name, holdable_t defitem); holdable_t CharToItem(char *name, holdable_t defitem);
weapon_t CharToWeapon(char *name, weapon_t defweapon); weapon_t CharToWeapon(char *name, weapon_t defweapon);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.18 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.17 2002/07/16 04:27:19 niceass // Revision 1.17 2002/07/16 04:27:19 niceass
// physics back to 2.0 // physics back to 2.0
// //
@ -291,11 +294,15 @@ void PM_StepSlideMove(qboolean gravity)
if (!trace.allsolid) if (!trace.allsolid)
VectorCopy(trace.endpos, pm->ps->origin); VectorCopy(trace.endpos, pm->ps->origin);
if (trace.plane.normal[2] < 0.7f) { //Makro - possible fix for the "player stuck on stairs" bug ?
VectorCopy(down_o, pm->ps->origin); //if (trace.plane.normal[0] || trace.plane.normal[1] || trace.plane.normal[2])
VectorCopy(down_v, pm->ps->velocity); //{
return; if (trace.plane.normal[2] < 0.7f) {
} VectorCopy(down_o, pm->ps->origin);
VectorCopy(down_v, pm->ps->velocity);
return;
}
//}
pm->ps->velocity[2] = down_v[2]; pm->ps->velocity[2] = down_v[2];

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.191 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.190 2004/01/26 21:26:08 makro // Revision 1.190 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -2069,10 +2072,14 @@ void Cmd_CallVote_f(gentity_t * ent)
} }
// if there is still a vote to be executed // if there is still a vote to be executed
//Makro - commented out
/*
if (level.voteExecuteTime) { if (level.voteExecuteTime) {
level.voteExecuteTime = 0; level.voteExecuteTime = 0;
trap_SendConsoleCommand(EXEC_APPEND, va("%s\n", level.voteString)); trap_SendConsoleCommand(EXEC_APPEND, va("%s\n", level.voteString));
} }
*/
// special case for g_gametype, check for bad values // special case for g_gametype, check for bad values
if (!Q_stricmp(arg1, "g_gametype")) { if (!Q_stricmp(arg1, "g_gametype")) {
i = atoi(arg2); i = atoi(arg2);
@ -2502,13 +2509,14 @@ void Cmd_OpenDoor(gentity_t * ent)
void Cmd_Weapon(gentity_t * ent) void Cmd_Weapon(gentity_t * ent)
{ {
//Makro - this was a few lines below
if (ent->client->ps.pm_type == PM_SPECTATOR)
return;
ent->client->weapon_attempts--; ent->client->weapon_attempts--;
if (ent->client->weapon_attempts < 0) if (ent->client->weapon_attempts < 0)
ent->client->weapon_attempts = 0; ent->client->weapon_attempts = 0;
if (ent->client->ps.pm_type == PM_SPECTATOR)
return;
if (ent->client->ps.weaponstate == WEAPON_BANDAGING) { if (ent->client->ps.weaponstate == WEAPON_BANDAGING) {
if (!ent->client->weapon_after_bandage_warned) { if (!ent->client->weapon_after_bandage_warned) {
ent->client->weapon_after_bandage_warned = qtrue; ent->client->weapon_after_bandage_warned = qtrue;
@ -2661,6 +2669,10 @@ void Cmd_New_Weapon(gentity_t * ent)
// Hawkins make sure spread comes back // Hawkins make sure spread comes back
void Cmd_Unzoom(gentity_t * ent) void Cmd_Unzoom(gentity_t * ent)
{ {
//Makro - if the client is dead or spectating, do nothing
if (!ent || !ent->client || ent->client->ps.stats[STAT_HEALTH] <= 0 || ent->client->ps.pm_type == PM_SPECTATOR)
return;
// Freud, play zooming sounds for unzoom // Freud, play zooming sounds for unzoom
if (ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_LOW || if (ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_LOW ||
ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_MED) ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_MED)

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.141 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.140 2003/04/26 22:33:06 jbravo // Revision 1.140 2003/04/26 22:33:06 jbravo
// Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging // Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging
// //
@ -657,7 +660,9 @@ char *modNames[] = {
"MOD_M3", "MOD_M3",
"MOD_HANDCANNON", "MOD_HANDCANNON",
"MOD_KICK", "MOD_KICK",
"MOD_BLEEDING" "MOD_BLEEDING",
//Makro - entity-defined
"MOD_CUSTOM"
}; };
/* /*
@ -831,7 +836,14 @@ void PrintDeathMessage(gentity_t * target, gentity_t * attacker, int location, i
Q_strncpyz(message, "bleeds to death", sizeof(message)); Q_strncpyz(message, "bleeds to death", sizeof(message));
break; break;
default: default:
message[0] = '\0'; //Makro - added check for MOD_CUSTOM+index mods
if (meansOfDeath >= MOD_CUSTOM && meansOfDeath - MOD_CUSTOM < level.numCustomDeathMsg)
{
//TODO: replace %he% with he/she/it based on gender. Same thing for %his%
Q_strncpyz(message, level.customDeathMsg[meansOfDeath-MOD_CUSTOM], sizeof(message));
} else {
message[0] = '\0';
}
break; break;
} }
if (attacker == target) { if (attacker == target) {
@ -1630,6 +1642,8 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i
i = (i + 1) % 3; i = (i + 1) % 3;
} }
self->physicsObject = qfalse;
// JBravo: lets not relink players that have been gibbed here. // JBravo: lets not relink players that have been gibbed here.
if (!self->client->gibbed) if (!self->client->gibbed)
trap_RQ3LinkEntity(self, __LINE__, __FILE__); trap_RQ3LinkEntity(self, __LINE__, __FILE__);
@ -1907,8 +1921,14 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
knockback = (int) (0.75 * damage); knockback = (int) (0.75 * damage);
break; break;
default: default:
G_Printf("G_Damage: Received unknown MOD - using default knockback\n"); //Makro - custom death message implies a trigger_hurt
knockback = 50; if (mod >= MOD_CUSTOM && mod - MOD_CUSTOM < level.numCustomDeathMsg)
{
knockback = (int) (0.75 * damage);
} else {
G_Printf("G_Damage: Received unknown MOD - using default knockback\n");
knockback = 50;
}
break; break;
} }
} }
@ -2029,7 +2049,9 @@ void G_Damage(gentity_t * targ, gentity_t * inflictor, gentity_t * attacker,
// Elder: removed M3, handcannon, and grenades from location damage code // Elder: removed M3, handcannon, and grenades from location damage code
if (take && (mod == MOD_M3 || mod == MOD_HANDCANNON || if (take && (mod == MOD_M3 || mod == MOD_HANDCANNON ||
mod == MOD_GRENADE || mod == MOD_GRENADE_SPLASH || mod == MOD_TRIGGER_HURT)) { mod == MOD_GRENADE || mod == MOD_GRENADE_SPLASH || mod == MOD_TRIGGER_HURT ||
//Makro - custom death message implies a trigger_hurt
mod >= MOD_CUSTOM)) {
bleeding = 1; bleeding = 1;
instant_dam = 0; instant_dam = 0;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.58 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.57 2003/09/08 19:19:19 makro // Revision 1.57 2003/09/08 19:19:19 makro
// New code for respawning entities in TP // New code for respawning entities in TP
// //
@ -1330,7 +1333,6 @@ void G_RunItem(gentity_t * ent)
ent->s.pos.trTime = level.time; ent->s.pos.trTime = level.time;
} }
} }
if (ent->s.pos.trType == TR_STATIONARY) { if (ent->s.pos.trType == TR_STATIONARY) {
// check think function // check think function
G_RunThink(ent); G_RunThink(ent);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.151 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.150 2004/01/26 21:26:08 makro // Revision 1.150 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -532,6 +535,8 @@ struct gentity_s {
//Makro - called at the begining of the round in TP //Makro - called at the begining of the round in TP
void (*reset) (gentity_t *self); void (*reset) (gentity_t *self);
qboolean noreset; //Makro - if set to 1, this entity will not respawn in TP qboolean noreset; //Makro - if set to 1, this entity will not respawn in TP
void (*onAttach) (gentity_t *self);
void (*onDetach) (gentity_t *self);
int pain_debounce_time; int pain_debounce_time;
int fly_sound_debounce_time; // wind tunnel int fly_sound_debounce_time; // wind tunnel
@ -575,9 +580,15 @@ struct gentity_s {
float distance; // VALKYRIE: for rotating door float distance; // VALKYRIE: for rotating door
//Blaze: Holds the target set by a button //Blaze: Holds the target set by a button
char *pathtarget; char *pathtarget;
//Makro - added //Makro - inactive entities
char *activatename, *targetInactive; char *activatename, *targetInactive;
int inactive; int inactive;
//Makro - entity id strings
char *alias;
//Makro - moveparent
char *moveParent;
gentity_t *moveParent_ent;
int moveParent_rank;
}; };
typedef enum { typedef enum {
@ -971,6 +982,12 @@ typedef struct {
qboolean teams_assigned[MAX_TEAMS]; qboolean teams_assigned[MAX_TEAMS];
gentity_t *potential_spawns[MAX_TEAMS][MAX_SPAWN_POINTS]; gentity_t *potential_spawns[MAX_TEAMS][MAX_SPAWN_POINTS];
gentity_t *used_farteamplay_spawns[MAX_TEAMS][MAX_SPAWN_POINTS]; gentity_t *used_farteamplay_spawns[MAX_TEAMS][MAX_SPAWN_POINTS];
//Makro - moveParent stuff
int num_moveParents;
int num_attachedEnts;
//Makro - custom death messages for trigger_hurt entities
int numCustomDeathMsg;
char *customDeathMsg[MAX_CUSTOM_DEATH_MSG];
} level_locals_t; } level_locals_t;
// //
@ -1076,6 +1093,8 @@ double G_acos(double x);
//Makro - added //Makro - added
gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2); gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldofs2, const char *match2);
qboolean MatchesId(gentity_t *ent, const char *ids);
gentity_t *G_PickTarget(char *targetname); gentity_t *G_PickTarget(char *targetname);
void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator); void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator);
void G_UseTargets(gentity_t * ent, gentity_t * activator); void G_UseTargets(gentity_t * ent, gentity_t * activator);
@ -1169,6 +1188,7 @@ void G_BreakGlass(gentity_t * ent, gentity_t * inflictor, gentity_t * attacker,
//void G_RunDlight(gentity_t * ent); // Elder: dlight running //void G_RunDlight(gentity_t * ent); // Elder: dlight running
void G_EvaluateTrajectory(const trajectory_t * tr, int atTime, vec3_t result); void G_EvaluateTrajectory(const trajectory_t * tr, int atTime, vec3_t result);
void G_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t result); void G_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t result);
void G_EvaluateTrajectoryEx(gentity_t *ent, int atTime, vec3_t origin, vec3_t angles);
void G_GravityChange(void); void G_GravityChange(void);
void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t * ent); void G_CreatePressure(vec3_t origin, vec3_t normal, gentity_t * ent);
qboolean G_FileExists(char *filename); qboolean G_FileExists(char *filename);
@ -1384,6 +1404,8 @@ void BotTestAAS(vec3_t origin);
extern level_locals_t level; extern level_locals_t level;
extern gentity_t g_entities[MAX_GENTITIES]; extern gentity_t g_entities[MAX_GENTITIES];
//Makro - moveparent tree
extern gentity_t *g_parentOrder[MAX_GENTITIES];
#define FOFS(x) ((int)&(((gentity_t *)0)->x)) #define FOFS(x) ((int)&(((gentity_t *)0)->x))
@ -1735,5 +1757,8 @@ void trap_SnapVector(float *v);
gentity_t *findradius(gentity_t * from, vec3_t org, float rad); // Blaze: Find someone in a radius around you gentity_t *findradius(gentity_t * from, vec3_t org, float rad); // Blaze: Find someone in a radius around you
//Makro - saves a custom death message index in "field"
void G_InitCustomDeathMessage(gentity_t *ent, int *field);
//Slicer: MatchMode //Slicer: MatchMode
#include "g_matchmode.h" #include "g_matchmode.h"

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.150 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.149 2003/09/01 15:17:52 jbravo // Revision 1.149 2003/09/01 15:17:52 jbravo
// Made g_RQ3_haveHelmet a systeminfo cvar. // Made g_RQ3_haveHelmet a systeminfo cvar.
// //
@ -434,6 +437,7 @@
int trap_RealTime(qtime_t * qtime); int trap_RealTime(qtime_t * qtime);
gentity_t *getEntByName(char *name); gentity_t *getEntByName(char *name);
void AddIP(char *str); void AddIP(char *str);
void G_SetGlobalRefSystem(int newRefSys);
level_locals_t level; level_locals_t level;
typedef struct { typedef struct {
@ -448,6 +452,9 @@ typedef struct {
gentity_t g_entities[MAX_GENTITIES]; gentity_t g_entities[MAX_GENTITIES];
gclient_t g_clients[MAX_CLIENTS]; gclient_t g_clients[MAX_CLIENTS];
//Makro - moveparent tree
gentity_t *g_parentOrder[MAX_GENTITIES];
vec3_t g_moveDelta[MAX_GENTITIES], g_angleDelta[MAX_GENTITIES], g_rmoveDelta[MAX_GENTITIES];
vmCvar_t g_gametype; vmCvar_t g_gametype;
vmCvar_t g_dmflags; vmCvar_t g_dmflags;
@ -750,7 +757,9 @@ int vmMain(int command, int arg0, int arg1, int arg2, int arg3, int arg4, int ar
case GAME_CLIENT_CONNECT: case GAME_CLIENT_CONNECT:
return (int) ClientConnect(arg0, arg1, arg2); return (int) ClientConnect(arg0, arg1, arg2);
case GAME_CLIENT_THINK: case GAME_CLIENT_THINK:
//G_SetGlobalRefSystem(REFSYSTEM_WORLD);
ClientThink(arg0); ClientThink(arg0);
//G_SetGlobalRefSystem(REFSYSTEM_OWN);
return 0; return 0;
case GAME_CLIENT_USERINFO_CHANGED: case GAME_CLIENT_USERINFO_CHANGED:
ClientUserinfoChanged(arg0); ClientUserinfoChanged(arg0);
@ -1142,6 +1151,130 @@ void RQ3_loadmodels(void)
} }
} }
//Makro - FIXME: add comment
void G_InitMoveParents()
{
int i;
level.num_moveParents = 0;
level.num_attachedEnts = 0;
for (i=0; i<MAX_GENTITIES; i++)
{
gentity_t *ent = g_entities+i;
ent->moveParent_ent = NULL;
ent->moveParent_rank = RANK_NONE;
if (ent->moveParent)
{
int j;
for (j=0; j<level.num_entities; j++)
{
gentity_t *test = g_entities+j;
if (i==j)
continue;
if (MatchesId(test, ent->moveParent))
{
vec3_t v, axis[3], matrix[3];
ent->moveParent_ent = test;
ent->moveParent_rank = RANK_SLAVE;
//get a vector from the moveparent to the origin
VectorNegate(ent->moveParent_ent->s.origin, ent->s.angles2);
VectorNegate(ent->moveParent_ent->s.angles, v);
AnglesToAxis(v, axis);
TransposeMatrix(axis, matrix);
RotatePoint(ent->s.angles2, matrix);
/*
//adjust origin, angles etc.
VectorSubtract(ent->s.origin, ent->moveParent_ent->s.origin, ent->s.origin);
VectorSubtract(ent->r.currentOrigin, ent->moveParent_ent->s.origin, ent->r.currentOrigin);
VectorSubtract(ent->s.pos.trBase, ent->moveParent_ent->s.origin, ent->s.pos.trBase);
//temp!!!
VectorSubtract(ent->pos1, ent->moveParent_ent->s.origin, ent->pos1);
VectorSubtract(ent->pos2, ent->moveParent_ent->s.origin, ent->pos2);
//
RotatePoint(ent->s.origin, matrix);
RotatePoint(ent->r.currentOrigin, matrix);
RotatePoint(ent->s.pos.trBase, matrix);
//temp
RotatePoint(ent->pos1, matrix);
RotatePoint(ent->pos2, matrix);
//
*/
VectorSubtract(ent->s.angles, ent->moveParent_ent->s.angles, ent->s.angles);
ent->s.eFlags |= EF_ATTACHED;
//this is so cgame knows which entity is the moveparent
ent->s.time2 = ent->moveParent_ent - g_entities;
if (ent->r.linked)
trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
break;
}
}
}
}
}
//Makro - determine moveparent order
void G_SetMoveParentOrder()
{
int i, j;
char info[MAX_INFO_STRING], *p;
for (i=0; i<MAX_GENTITIES; i++)
{
gentity_t *ent = g_entities+i;
//default value
g_parentOrder[i] = ent;
//new rank for parent?
while (ent->moveParent_ent)
{
if (ent->moveParent_ent->moveParent_rank < ent->moveParent_rank+1)
ent->moveParent_ent->moveParent_rank = ent->moveParent_rank+1;
ent = ent->moveParent_ent;
}
}
//sort g_parentOrder
//higher ranks first
for (i=0; i<MAX_GENTITIES-1; i++)
{
for (j=i+1; j<MAX_GENTITIES; j++)
{
if ( g_parentOrder[i]->moveParent_rank < g_parentOrder[j]->moveParent_rank )
{
gentity_t *tmp = g_parentOrder[i];
g_parentOrder[i] = g_parentOrder[j];
g_parentOrder[j] = tmp;
}
}
if (level.num_moveParents == 0 && g_parentOrder[i]->moveParent_rank == RANK_SLAVE) {
level.num_moveParents = i;
} else if (level.num_attachedEnts == 0 && g_parentOrder[i]->moveParent_rank == RANK_NONE) {
level.num_attachedEnts = i;
break;
}
}
p = info;
Com_sprintf(p, 4, "%03i", level.num_attachedEnts);
p += 3;
for (i=0; i<level.num_attachedEnts; i++)
{
Com_sprintf(p, 4, "%03i", g_parentOrder[i]-g_entities);
p += 3;
Com_sprintf(p, 4, "%03i", g_parentOrder[i]->moveParent_rank);
p+=3;
G_Printf("%i (%i)> %s, rank %i\n", i, g_parentOrder[i]-g_entities,
g_parentOrder[i]->classname, g_parentOrder[i]->moveParent_rank);
}
G_Printf("INFO STRING: %s\n", info);
trap_SetConfigstring(CS_MOVEPARENTS, info);
}
/* /*
============ ============
G_InitGame G_InitGame
@ -1238,6 +1371,9 @@ void G_InitGame(int levelTime, int randomSeed, int restart)
ClearRegisteredItems(); ClearRegisteredItems();
//Makro - no dlight styles by default
trap_SetConfigstring(CS_DLIGHT_STYLES, "\\n\\0");
// parse the key/value pairs and spawn gentities // parse the key/value pairs and spawn gentities
G_SpawnEntitiesFromString(); G_SpawnEntitiesFromString();
@ -1329,6 +1465,10 @@ void G_InitGame(int levelTime, int randomSeed, int restart)
} }
G_RemapTeamShaders(); G_RemapTeamShaders();
//Makro - moveparents stuff
G_InitMoveParents();
G_SetMoveParentOrder();
} }
/* /*
@ -2404,7 +2544,7 @@ void CheckVote(void)
if (Q_stricmp(level.voteString, "cyclemap") == 0) { if (Q_stricmp(level.voteString, "cyclemap") == 0) {
BeginIntermission(); BeginIntermission();
} else if (Q_stricmp(level.voteString, "map") == 0) { } else if (Q_stricmp(level.voteString, "map") == 0) {
trap_Cvar_Set("g_RQ3_ValidIniFile", "2"); // check this latter. This trap may not be necessary trap_Cvar_Set("g_RQ3_ValidIniFile", "2"); // check this later. This trap may not be necessary
g_RQ3_ValidIniFile.integer = 2; g_RQ3_ValidIniFile.integer = 2;
BeginIntermission(); BeginIntermission();
} else if (Q_stricmp(level.voteString, "g_gametype") == 0) { } else if (Q_stricmp(level.voteString, "g_gametype") == 0) {
@ -2627,8 +2767,19 @@ void G_RunThink(gentity_t * ent)
ent->nextthink = 0; ent->nextthink = 0;
if (!ent->think) { if (!ent->think) {
G_Error("NULL ent->think"); G_Error("NULL ent->think");
} else {
//Makro - moved inside else branch; probably not needed, but I can sleep
//better at night now that I've done it. Right.
ent->think(ent);
} }
ent->think(ent); }
void G_RunAttachedEnt(gentity_t *ent)
{
G_EvaluateTrajectoryEx(ent, level.time, ent->r.currentOrigin, ent->r.currentAngles);
VectorCopy(ent->r.currentOrigin, ent->s.origin);
if (ent->r.linked)
trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*
@ -2658,6 +2809,10 @@ void G_RunFrame(int levelTime)
level.time = levelTime; level.time = levelTime;
msec = level.time - level.previousTime; msec = level.time - level.previousTime;
//Makro - in progress
//G_UpdateParentDeltas();
//G_AddParentDeltas();
// get any cvar changes // get any cvar changes
G_UpdateCvars(); G_UpdateCvars();
@ -2665,8 +2820,9 @@ void G_RunFrame(int levelTime)
// go through all allocated objects // go through all allocated objects
// //
start = trap_Milliseconds(); start = trap_Milliseconds();
ent = &g_entities[0]; //Makro - use g_parentOder
for (i = 0; i < level.num_entities; i++, ent++) { for (i = 0; i < level.num_entities; i++) {
ent = g_parentOrder[i];
if (!ent->inuse) { if (!ent->inuse) {
continue; continue;
} }
@ -2702,23 +2858,36 @@ void G_RunFrame(int levelTime)
} }
if (ent->s.eType == ET_ITEM || ent->physicsObject) { if (ent->s.eType == ET_ITEM || ent->physicsObject) {
//G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD);
G_RunItem(ent); G_RunItem(ent);
continue; continue;
} }
if (ent->s.eType == ET_MOVER) { if (ent->s.eType == ET_MOVER) {
//G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD);
G_RunMover(ent); G_RunMover(ent);
G_RunAttachedEnt(ent);
continue; continue;
} }
if (i < MAX_CLIENTS) { if (ent-g_entities < MAX_CLIENTS) {
G_RunClient(ent); // Basicly calls ClientThink_real() G_RunClient(ent); // Basicly calls ClientThink_real()
continue; continue;
} }
if (ent->moveParent_ent)
G_RunAttachedEnt(ent);
//G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD);
G_RunThink(ent); G_RunThink(ent);
} }
//Makro - undo the refsystem changes
//G_SetGlobalRefSystem(REFSYSTEM_OWN);
//Makro - in progress
//G_AdjustCoordinates();
end = trap_Milliseconds(); end = trap_Milliseconds();
start = trap_Milliseconds(); start = trap_Milliseconds();
@ -2803,6 +2972,7 @@ void RQ3_StartUniqueItems(void)
if ((int) g_RQ3_weaponban.integer & ITF_SLIPPERS) { if ((int) g_RQ3_weaponban.integer & ITF_SLIPPERS) {
rq3_item = BG_FindItemForHoldable(HI_SLIPPERS); rq3_item = BG_FindItemForHoldable(HI_SLIPPERS);
rq3_temp = (gentity_t *) SelectRandomDeathmatchSpawnPoint(); rq3_temp = (gentity_t *) SelectRandomDeathmatchSpawnPoint();
//Makro: TODO - stop server if there is no spawn point, otherwise the game crashes
Drop_Item(rq3_temp, rq3_item, angle); Drop_Item(rq3_temp, rq3_item, angle);
angle += 30; angle += 30;
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.83 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.82 2004/01/26 21:26:08 makro // Revision 1.82 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -360,6 +363,32 @@ void SP_dlight(gentity_t * ent)
G_SpawnFloat("light2", "0", &light); G_SpawnFloat("light2", "0", &light);
ent->s.weapon = light; ent->s.weapon = light;
if (G_SpawnString("style", "9", &s))
{
char info[MAX_INFO_STRING];
int i, num;
if (strlen(s) > 64)
s[64] = 0;
trap_GetConfigstring(CS_DLIGHT_STYLES, info, sizeof(info));
num = atoi(Info_ValueForKey(info, "n"));
for (i=0; i<num; i++)
{
char *key = va("%i", i);
if (!Q_stricmp(Info_ValueForKey(info, key), s))
break;
}
if (i >= num)
{
num = i+1;
Info_SetValueForKey(info, va("%i", i), s);
Info_SetValueForKey(info, "n", va("%i", num));
trap_SetConfigstring(CS_DLIGHT_STYLES, info);
}
ent->s.eventParm |= ((i+1) & DLIGHT_CUSTOMSTYLE);
}
ent->s.pos.trType = TR_STATIONARY; ent->s.pos.trType = TR_STATIONARY;
VectorCopy(ent->s.origin, ent->r.currentOrigin); VectorCopy(ent->s.origin, ent->r.currentOrigin);
@ -416,6 +445,8 @@ void SP_dlight(gentity_t * ent)
ent->unbreakable = 1; ent->unbreakable = 1;
ent->use(ent, NULL, NULL); ent->use(ent, NULL, NULL);
} }
VectorCopy(ent->s.origin, ent->r.currentOrigin);
VectorCopy(ent->s.origin, ent->s.pos.trBase);
ent->s.eType = ET_DLIGHT; ent->s.eType = ET_DLIGHT;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
@ -1013,11 +1044,50 @@ static void InitBreakable_Finish(gentity_t * ent)
void Touch_Breakable(gentity_t * self, gentity_t * other, trace_t * trace) void Touch_Breakable(gentity_t * self, gentity_t * other, trace_t * trace)
{ {
if (!other->client)
return;
//Makro - FIXME: find out why trace->plane.normal is a null vector (q3map2 issue?)
//we really should be checking a dot product here and not the absolute length...
if (VectorLength(other->client->ps.velocity) < self->speed)
return;
if (self->damage) if (self->damage)
G_Damage(other, self, self, NULL, NULL, self->damage, 0, MOD_TRIGGER_HURT); {
//Makro - custom death message
if (self->methodOfDeath)
{
G_Damage(other, self, self, NULL, NULL, self->damage, 0, MOD_CUSTOM+self->methodOfDeath-1);
} else {
G_Damage(other, self, self, NULL, NULL, self->damage, 0, MOD_TRIGGER_HURT);
}
}
Use_Breakable(self, other, other); Use_Breakable(self, other, other);
} }
//Makro - saves a custom death message index in "field"
void G_InitCustomDeathMessage(gentity_t *ent, int *field)
{
if (ent->message)
{
//go through all the existing messages and see if it has already been defined
int i;
for (i=0; i<level.numCustomDeathMsg; i++)
{
if (!strcmp(ent->message, level.customDeathMsg[i]))
{
*field = i+1;
return;
}
}
if (level.numCustomDeathMsg < MAX_CUSTOM_DEATH_MSG)
{
level.customDeathMsg[level.numCustomDeathMsg] = ent->message;
*field = ++level.numCustomDeathMsg;
return;
}
}
*field = 0;
}
void SP_func_breakable(gentity_t * ent) void SP_func_breakable(gentity_t * ent)
{ {
int health; int health;
@ -1145,9 +1215,13 @@ void SP_func_breakable(gentity_t * ent)
ent->health_saved = health; ent->health_saved = health;
ent->takedamage = qtrue; ent->takedamage = qtrue;
ent->s.origin[0] = ent->r.mins[0] + (0.5 * (ent->r.maxs[0] - ent->r.mins[0])); //Makro - custom death message
ent->s.origin[1] = ent->r.mins[1] + (0.5 * (ent->r.maxs[1] - ent->r.mins[1])); G_InitCustomDeathMessage(ent, &ent->methodOfDeath);
ent->s.origin[2] = ent->r.mins[2] + (0.5 * (ent->r.maxs[2] - ent->r.mins[2]));
//Makro - commented out
//ent->s.origin[0] = ent->r.mins[0] + (0.5 * (ent->r.maxs[0] - ent->r.mins[0]));
//ent->s.origin[1] = ent->r.mins[1] + (0.5 * (ent->r.maxs[1] - ent->r.mins[1]));
//ent->s.origin[2] = ent->r.mins[2] + (0.5 * (ent->r.maxs[2] - ent->r.mins[2]));
// Let it know it is a breakable object // Let it know it is a breakable object
ent->s.eType = ET_BREAKABLE; ent->s.eType = ET_BREAKABLE;
@ -1163,6 +1237,7 @@ void SP_func_breakable(gentity_t * ent)
//ent->nextthink = level.time + FRAMETIME; //ent->nextthink = level.time + FRAMETIME;
//ent->think = Think_SpawnNewDoorTrigger; //ent->think = Think_SpawnNewDoorTrigger;
ent->r.svFlags |= SVF_USE_CURRENT_ORIGIN;
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
@ -1489,3 +1564,81 @@ void G_GravityChange(void)
} }
} }
} }
//Makro - we need this function as accurate as possible on the server side, as the server
//doesn't update as often as the clients so any errors would be amplified
void G_EvaluateTrajectoryEx(gentity_t *ent, int atTime, vec3_t origin, vec3_t angles)
{
if (origin) G_EvaluateTrajectory(&ent->s.pos, atTime, origin);
if (angles) G_EvaluateTrajectory(&ent->s.apos, atTime, angles);
//if the entity is not attached to another one, we're done
if (!ent->moveParent_ent)
return;
//if we're evaluating the trajectory at level.time, we already know the co-ordinates of the
//parent, so just use its r.currentOrigin and r.currentAngles instead of calculating them again
if (atTime == level.time)
{
vec3_t org, parent_angles, parent_origin, axis[3];
VectorCopy(ent->moveParent_ent->r.currentAngles, parent_angles);
VectorCopy(ent->moveParent_ent->r.currentOrigin, parent_origin);
if (origin)
{
if (parent_angles[YAW] || parent_angles[PITCH] || parent_angles[ROLL])
{
VectorCopy(ent->s.angles2, org);
VectorAdd(org, origin, org);
AnglesToAxis(parent_angles, axis);
ChangeRefSystem(org, NULL, axis, org);
VectorAdd(org, parent_origin, origin);
} else {
VectorAdd(origin, ent->s.angles2, origin);
VectorAdd(origin, parent_origin, origin);
}
}
if (angles)
{
//AnglesToAxis(angles, axis);
//ChangeAngleRefSystem(parent_angles, axis, parent_angles);
VectorAdd(angles, parent_angles, angles);
//if (!Q_stricmp(ent->targetname, "t2"))
// G_Printf("New axis: %s %s %s, angles: %s\n", vtos(axis[0]), vtos(axis[1]), vtos(axis[2]), vtos(angles));
}
} else {
//otherwise, do all the necessary math
gentity_t *parent;
vec3_t org, axis[3], parent_origin, parent_angles;
for (parent = ent->moveParent_ent; parent; ent = parent, parent = parent->moveParent_ent)
{
G_EvaluateTrajectory(&parent->s.pos, atTime, parent_origin);
G_EvaluateTrajectory(&parent->s.apos, atTime, parent_angles);
if (origin)
{
if (parent_angles[YAW] || parent_angles[PITCH] || parent_angles[ROLL])
{
VectorCopy(ent->s.angles2, org);
VectorAdd(org, origin, org);
AnglesToAxis(parent_angles, axis);
ChangeRefSystem(org, NULL, axis, org);
VectorAdd(org, parent_origin, origin);
} else {
VectorAdd(origin, ent->s.angles2, origin);
VectorAdd(origin, parent_origin, origin);
}
}
if (angles)
{
//AnglesToAxis(angles, axis);
//ChangeAngleRefSystem(parent_angles, axis, parent_angles);
VectorAdd(angles, parent_angles, angles);
}
}
}
}

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.35 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.34 2003/04/26 22:33:06 jbravo // Revision 1.34 2003/04/26 22:33:06 jbravo
// Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging // Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging
// //
@ -63,10 +66,6 @@
//Makro - to get the new surfaceparm system to work :/ //Makro - to get the new surfaceparm system to work :/
#include "surfaceflags.h" #include "surfaceflags.h"
int GetMaterialFromFlag(int flag);
qboolean IsMetalMat(int Material);
qboolean IsMetalFlag(int flag);
#define MISSILE_PRESTEP_TIME 50 #define MISSILE_PRESTEP_TIME 50
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.77 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.76 2004/03/12 15:56:46 makro // Revision 1.76 2004/03/12 15:56:46 makro
// no message // no message
// //
@ -253,48 +256,6 @@ gentity_t *G_TestEntityPosition(gentity_t * ent)
return NULL; return NULL;
} }
/*
================
G_CreateRotationMatrix
================
*/
void G_CreateRotationMatrix(vec3_t angles, vec3_t matrix[3])
{
AngleVectors(angles, matrix[0], matrix[1], matrix[2]);
VectorInverse(matrix[1]);
}
/*
================
G_TransposeMatrix
================
*/
void G_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];
}
}
}
/*
================
G_RotatePoint
================
*/
void G_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);
}
/* /*
================== ==================
G_TryPushingEntity G_TryPushingEntity
@ -328,15 +289,20 @@ qboolean G_TryPushingEntity(gentity_t * check, gentity_t * pusher, vec3_t move,
// try moving the contacted entity // try moving the contacted entity
// figure movement due to the pusher's amove // figure movement due to the pusher's amove
G_CreateRotationMatrix(amove, transpose); CreateRotationMatrix(amove, transpose);
G_TransposeMatrix(transpose, matrix); TransposeMatrix(transpose, matrix);
if (check->client) { if (check->client) {
VectorSubtract(check->client->ps.origin, pusher->r.currentOrigin, org); VectorSubtract(check->client->ps.origin, pusher->r.currentOrigin, org);
} else { } else {
VectorSubtract(check->s.pos.trBase, pusher->r.currentOrigin, org); VectorSubtract(check->s.pos.trBase, pusher->r.currentOrigin, org);
} }
//Makro - at this time, the pusher has already advanced while the pushed entity hasn't
//so we have to take the pusher's move into account before rotating the pushed entity
VectorAdd(org, move, org);
VectorCopy(org, org2); VectorCopy(org, org2);
G_RotatePoint(org2, matrix); RotatePoint(org2, matrix);
VectorSubtract(org2, org, move2); VectorSubtract(org2, org, move2);
// add movement // add movement
VectorAdd(check->s.pos.trBase, move, check->s.pos.trBase); VectorAdd(check->s.pos.trBase, move, check->s.pos.trBase);
@ -346,6 +312,10 @@ qboolean G_TryPushingEntity(gentity_t * check, gentity_t * pusher, vec3_t move,
VectorAdd(check->client->ps.origin, move2, check->client->ps.origin); VectorAdd(check->client->ps.origin, move2, check->client->ps.origin);
// make sure the client's view rotates when on a rotating mover // make sure the client's view rotates when on a rotating mover
check->client->ps.delta_angles[YAW] += ANGLE2SHORT(amove[YAW]); check->client->ps.delta_angles[YAW] += ANGLE2SHORT(amove[YAW]);
} else if (check->s.eType == ET_ITEM) {
//Makro - other entities should rotate, too
VectorAdd(check->s.angles, amove, check->s.angles);
VectorAdd(check->s.apos.trBase, amove, check->s.apos.trBase);
} }
// may have pushed them off an edge // may have pushed them off an edge
if (check->s.groundEntityNum != pusher->s.number) { if (check->s.groundEntityNum != pusher->s.number) {
@ -463,8 +433,10 @@ qboolean G_MoverPush(gentity_t * pusher, vec3_t move, vec3_t amove, gentity_t **
// mins/maxs are the bounds at the destination // mins/maxs are the bounds at the destination
// totalMins / totalMaxs are the bounds for the entire move // totalMins / totalMaxs are the bounds for the entire move
if (pusher->r.currentAngles[0] || pusher->r.currentAngles[1] || pusher->r.currentAngles[2] //Makro - check yaw first, then pitch, then roll (instead of [0], [1], [2])
|| amove[0] || amove[1] || amove[2]) { //because most of the time the yaw is the one that's changing
if (pusher->r.currentAngles[YAW] || pusher->r.currentAngles[PITCH] || pusher->r.currentAngles[ROLL]
|| amove[YAW] || amove[PITCH] || amove[ROLL]) {
float radius; float radius;
radius = RadiusFromBounds(pusher->r.mins, pusher->r.maxs); radius = RadiusFromBounds(pusher->r.mins, pusher->r.maxs);
@ -614,8 +586,9 @@ void G_MoverTeam(gentity_t * ent)
pushed_p = pushed; pushed_p = pushed;
for (part = ent; part; part = part->teamchain) { for (part = ent; part; part = part->teamchain) {
// get current position // get current position
G_EvaluateTrajectory(&part->s.pos, level.time, origin); //G_EvaluateTrajectory(&part->s.pos, level.time, origin);
G_EvaluateTrajectory(&part->s.apos, level.time, angles); //G_EvaluateTrajectory(&part->s.apos, level.time, angles);
G_EvaluateTrajectoryEx(part, level.time, origin, angles);
VectorSubtract(origin, part->r.currentOrigin, move); VectorSubtract(origin, part->r.currentOrigin, move);
VectorSubtract(angles, part->r.currentAngles, amove); VectorSubtract(angles, part->r.currentAngles, amove);
if (!G_MoverPush(part, move, amove, &obstacle)) { if (!G_MoverPush(part, move, amove, &obstacle)) {
@ -628,8 +601,11 @@ void G_MoverTeam(gentity_t * ent)
for (part = ent; part; part = part->teamchain) { for (part = ent; part; part = part->teamchain) {
part->s.pos.trTime += level.time - level.previousTime; part->s.pos.trTime += level.time - level.previousTime;
part->s.apos.trTime += level.time - level.previousTime; part->s.apos.trTime += level.time - level.previousTime;
G_EvaluateTrajectory(&part->s.pos, level.time, part->r.currentOrigin); //G_EvaluateTrajectory(&part->s.pos, level.time, part->r.currentOrigin);
G_EvaluateTrajectory(&part->s.apos, level.time, part->r.currentAngles); //G_EvaluateTrajectory(&part->s.apos, level.time, part->r.currentAngles);
G_EvaluateTrajectoryEx(part, level.time, part->r.currentOrigin, part->r.currentAngles);
//Makro - set blocked flag so that clients don't predict movement for this frame
part->s.eFlags |= EF_MOVER_BLOCKED;
trap_RQ3LinkEntity(part, __LINE__, __FILE__); trap_RQ3LinkEntity(part, __LINE__, __FILE__);
} }
@ -668,6 +644,12 @@ G_RunMover
*/ */
void G_RunMover(gentity_t * ent) void G_RunMover(gentity_t * ent)
{ {
//Makro - assume entity isn't blocked
if (ent->s.eType != ET_PLAYER)
{
ent->s.eFlags &= ~EF_MOVER_BLOCKED;
}
// if not a team captain, don't do anything, because // if not a team captain, don't do anything, because
// the captain will handle everything // the captain will handle everything
if (ent->flags & FL_TEAMSLAVE) { if (ent->flags & FL_TEAMSLAVE) {
@ -752,8 +734,9 @@ void SetMoverState(gentity_t * ent, moverState_t moverState, int time)
ent->s.apos.trType = TR_LINEAR_STOP; ent->s.apos.trType = TR_LINEAR_STOP;
break; break;
} }
G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin); //G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin);
G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles); //G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles);
G_EvaluateTrajectoryEx(ent, level.time, ent->r.currentOrigin, ent->r.currentAngles);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__); trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
@ -1199,6 +1182,9 @@ void InitMover(gentity_t * ent)
G_SpawnInt("health", "0", &ent->health); G_SpawnInt("health", "0", &ent->health);
ent->health_saved = ent->health; ent->health_saved = ent->health;
//Makro - custom death message
G_InitCustomDeathMessage(ent, &ent->methodOfDeath);
// if the "color" or "light" keys are set, setup constantLight // if the "color" or "light" keys are set, setup constantLight
lightSet = G_SpawnFloat("light", "100", &light); lightSet = G_SpawnFloat("light", "100", &light);
colorSet = G_SpawnVector("color", "1 1 1", color); colorSet = G_SpawnVector("color", "1 1 1", color);
@ -1314,7 +1300,13 @@ void Blocked_Door(gentity_t * ent, gentity_t * other)
} }
if (ent->damage) { if (ent->damage) {
G_Damage(other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CRUSH); //Makro - check for custom death message
if (ent->methodOfDeath)
{
G_Damage(other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CUSTOM + ent->methodOfDeath - 1);
} else {
G_Damage(other, ent, ent, NULL, NULL, ent->damage, 0, MOD_CRUSH);
}
} }
//if ( ent->spawnflags & 4 ) { //if ( ent->spawnflags & 4 ) {
//Elder: new crusher flag //Elder: new crusher flag
@ -1451,9 +1443,23 @@ void Think_SpawnNewDoorTrigger(gentity_t * ent)
if (!(ent->targetname) && !ent->health) { if (!(ent->targetname) && !ent->health) {
other = G_Spawn(); other = G_Spawn();
other->classname = "door_trigger"; other->classname = "door_trigger";
VectorCopy(mins, other->r.mins); VectorCopy(mins, other->r.absmin);
VectorCopy(maxs, other->r.maxs); VectorCopy(maxs, other->r.absmax);
other->parent = ent; other->parent = ent;
//Makro - if the door moves with another entity, so should this trigger
other->moveParent_ent = ent->moveParent_ent;
VectorCopy(ent->s.angles2, other->s.angles2);
other->s.origin[0] = (maxs[0] + mins[0]) / 2;
other->s.origin[1] = (maxs[1] + mins[1]) / 2;
other->s.origin[2] = (maxs[2] + mins[2]) / 2;
VectorCopy(other->s.origin, other->s.pos.trBase);
VectorSubtract(other->r.absmin, other->s.origin, other->r.mins);
VectorSubtract(other->r.absmax, other->s.origin, other->r.maxs);
VectorClear(other->s.apos.trBase);
G_EvaluateTrajectoryEx(other, level.time, other->r.currentOrigin, other->r.currentAngles);
other->r.svFlags |= SVF_USE_CURRENT_ORIGIN;
other->s.eFlags |= EF_ATTACHED;
other->r.contents = CONTENTS_TRIGGER; other->r.contents = CONTENTS_TRIGGER;
other->touch = Touch_DoorTrigger; other->touch = Touch_DoorTrigger;
// remember the thinnest axis // remember the thinnest axis
@ -1903,6 +1909,9 @@ void InitRotator(gentity_t * ent)
ent->use = Use_BinaryMover; ent->use = Use_BinaryMover;
ent->reached = Reached_BinaryMover; ent->reached = Reached_BinaryMover;
//Makro - custom death message
G_InitCustomDeathMessage(ent, &ent->methodOfDeath);
ent->moverState = ROTATOR_POS1; ent->moverState = ROTATOR_POS1;
ent->r.svFlags = SVF_USE_CURRENT_ORIGIN; ent->r.svFlags = SVF_USE_CURRENT_ORIGIN;
ent->s.eType = ET_MOVER; ent->s.eType = ET_MOVER;
@ -2328,6 +2337,33 @@ void Think_SetupTrainTargets(gentity_t * ent)
Reached_Train(ent); Reached_Train(ent);
} }
void Think_AimPathCorner(gentity_t *self)
{
gentity_t *prev, *next, *nnext;
if ( (prev = G_Find2(NULL, FOFS(classname), "path_corner", FOFS(target), self->targetname)) != NULL)
{
if ( (next = G_Find2(NULL, FOFS(classname), "path_corner", FOFS(targetname), self->target)) != NULL)
{
if ( (nnext = G_Find2(NULL, FOFS(classname), "path_corner", FOFS(targetname), next->target)) != NULL)
{
vec3_t dir, angles, deltaAngles;
self->spawnflags &= ~2;
self->spawnflags |= 1;
VectorSubtract(self->s.origin, prev->s.origin, dir);
vectoangles(dir, angles);
VectorSubtract(nnext->s.origin, next->s.origin, dir);
vectoangles(dir, deltaAngles);
self->movedir[0] = AngleNormalize180(deltaAngles[0] - angles[0]);
self->movedir[1] = AngleNormalize180(deltaAngles[1] - angles[1]);
self->movedir[2] = AngleNormalize180(deltaAngles[2] - angles[2]);
}
}
}
self->nextthink = 0;
self->think = 0;
}
/*QUAKED path_corner (.5 .3 0) (-8 -8 -8) (8 8 8) /*QUAKED path_corner (.5 .3 0) (-8 -8 -8) (8 8 8)
Train path corners. Train path corners.
Target: next path corner and other targets to fire Target: next path corner and other targets to fire
@ -2351,6 +2387,13 @@ void SP_path_corner(gentity_t * self)
if (self->spawnflags & 1) if (self->spawnflags & 1)
G_SpawnVector("rotate", "0 90 0", self->movedir); G_SpawnVector("rotate", "0 90 0", self->movedir);
//Makro - auto-aim
if (self->spawnflags & 2)
{
self->nextthink = level.time + FRAMETIME;
self->think = Think_AimPathCorner;
}
// path corners don't need to be linked in // path corners don't need to be linked in
} }
@ -2545,10 +2588,12 @@ void SP_func_static(gentity_t * ent)
InitMover(ent); InitMover(ent);
VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->s.pos.trBase);
VectorCopy(ent->s.origin, ent->r.currentOrigin); VectorCopy(ent->s.origin, ent->r.currentOrigin);
VectorCopy(ent->s.apos.trBase, ent->r.currentAngles);
//Makro - added //Makro - added
ent->use = use_func_static; ent->use = use_func_static;
ent->reset = reset_func_static; ent->reset = reset_func_static;
ent->reset(ent); ent->reset(ent);
trap_RQ3LinkEntity(ent, __LINE__, __FILE__);
} }
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.7 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.6 2002/07/22 06:32:43 niceass // Revision 1.6 2002/07/22 06:32:43 niceass
// cleaned up the powerup code // cleaned up the powerup code
// //
@ -245,6 +248,9 @@ void G_RankDamage(int self, int attacker, int damage, int means_of_death)
case MOD_TRIGGER_HURT: case MOD_TRIGGER_HURT:
return; return;
default: default:
//Makro - custom death message implies a trigger_hurt
if (means_of_death >= MOD_CUSTOM)
return;
break; break;
} }
@ -476,7 +482,13 @@ void G_RankPlayerDie(int self, int attacker, int means_of_death)
trap_RankReportInt(p1, p2, QGR_KEY_TRIGGER_HURT, 1, 1); trap_RankReportInt(p1, p2, QGR_KEY_TRIGGER_HURT, 1, 1);
break; break;
default: default:
trap_RankReportInt(p1, p2, QGR_KEY_HAZARD_MISC, 1, 1); //Makro - custom msg implies a trigger_hurt
if (means_of_death >= MOD_CUSTOM)
{
trap_RankReportInt(p1, p2, QGR_KEY_TRIGGER_HURT, 1, 1);
} else {
trap_RankReportInt(p1, p2, QGR_KEY_HAZARD_MISC, 1, 1);
}
break; break;
} }
} else if (attacker == self) { } else if (attacker == self) {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.51 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.50 2004/01/26 21:26:08 makro // Revision 1.50 2004/01/26 21:26:08 makro
// no message // no message
// //
@ -253,6 +256,9 @@ field_t fields[] = {
{"pathtarget", FOFS(pathtarget), F_LSTRING}, // Makro - for func_trains {"pathtarget", FOFS(pathtarget), F_LSTRING}, // Makro - for func_trains
{"inactive", FOFS(inactive), F_INT}, // Makro - for inactive objects {"inactive", FOFS(inactive), F_INT}, // Makro - for inactive objects
{"activatename", FOFS(activatename), F_LSTRING}, {"activatename", FOFS(activatename), F_LSTRING},
{"alias", FOFS(alias), F_LSTRING}, //Makro - entity id strings
{"moveparent", FOFS(moveParent), F_LSTRING}, //Makro - entity id strings
{"attachto", FOFS(moveParent), F_LSTRING}, //
{"noreset", FOFS(noreset), F_INT}, //Makro - for entities that shouldn't respawn in TP {"noreset", FOFS(noreset), F_INT}, //Makro - for entities that shouldn't respawn in TP
{NULL} {NULL}
}; };

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.33 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.32 2004/03/13 01:17:32 makro // Revision 1.32 2004/03/13 01:17:32 makro
// no message // no message
// //
@ -132,13 +135,6 @@ void multi_trigger(gentity_t * ent, gentity_t * activator)
if (ent->nextthink) { if (ent->nextthink) {
return; // can't retrigger until the wait is over return; // can't retrigger until the wait is over
} }
if (ent->spawnflags & SF_TRIGGER_MULTIPLE_DOOR) {
if (!activator || !activator->client || !activator->client->openDoor)
return;
if (activator->client->openDoorTime <= ent->timestamp)
return;
ent->timestamp = activator->client->openDoorTime;
}
//Makro - inactive trigger ? //Makro - inactive trigger ?
if (ent->inactive) { if (ent->inactive) {
//note - since the trigger is not sent to the clients, we cannot send the event //note - since the trigger is not sent to the clients, we cannot send the event
@ -196,9 +192,14 @@ void Use_Multi(gentity_t * ent, gentity_t * other, gentity_t * activator)
void Touch_Multi(gentity_t * self, gentity_t * other, trace_t * trace) void Touch_Multi(gentity_t * self, gentity_t * other, trace_t * trace)
{ {
if (!other->client) { if (!other || !other->client) {
return; return;
} }
if (self->spawnflags & SF_TRIGGER_MULTIPLE_DOOR) {
if (!other->client->openDoor || other->client->openDoorTime <= self->timestamp)
return;
self->timestamp = other->client->openDoorTime;
}
multi_trigger(self, other); multi_trigger(self, other);
} }
@ -581,7 +582,12 @@ void hurt_touch(gentity_t * self, gentity_t * other, trace_t * trace)
dflags = DAMAGE_NO_PROTECTION; dflags = DAMAGE_NO_PROTECTION;
else else
dflags = 0; dflags = 0;
G_Damage(other, self, self, NULL, NULL, self->damage, dflags, MOD_TRIGGER_HURT); if (self->methodOfDeath)
{
G_Damage(other, self, self, NULL, NULL, self->damage, dflags, MOD_CUSTOM+self->methodOfDeath-1);
} else {
G_Damage(other, self, self, NULL, NULL, self->damage, dflags, MOD_TRIGGER_HURT);
}
} }
void SP_trigger_hurt(gentity_t * self) void SP_trigger_hurt(gentity_t * self)
@ -597,6 +603,9 @@ void SP_trigger_hurt(gentity_t * self)
self->r.contents = CONTENTS_TRIGGER; self->r.contents = CONTENTS_TRIGGER;
//Makro - custom death message
G_InitCustomDeathMessage(self, &self->methodOfDeath);
//Makro - removed this check //Makro - removed this check
//if ( self->spawnflags & 2 ) { //if ( self->spawnflags & 2 ) {
self->use = hurt_use; self->use = hurt_use;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.25 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.24 2003/09/19 21:25:10 makro // Revision 1.24 2003/09/19 21:25:10 makro
// Flares (again!). Doors that open away from players. // Flares (again!). Doors that open away from players.
// //
@ -245,6 +248,63 @@ gentity_t *G_Find2(gentity_t * from, int fieldofs, const char *match, int fieldo
return NULL; return NULL;
} }
qboolean MatchesId(gentity_t *ent, const char *ids)
{
char tmp_alias[128]={0}, tmp_ids[128]={0}, *pi;
if (!ent || !ids)
return qfalse;
strcpy(tmp_ids, ids);
if (ent->alias)
strcpy(tmp_alias, ent->alias);
//iterate through all the id strings in ids
pi = tmp_ids;
while (*pi)
{
char *sep, *ps, *tok = pi;
if ( (sep = strchr(pi, ',')) != NULL )
{
*sep = 0;
pi = sep+1;
} else {
pi += strlen(pi);
}
if (ent->targetname)
if (Q_stricmp(tok, ent->targetname) == 0)
return qtrue;
if (ent->activatename)
if (Q_stricmp(tok, ent->activatename) == 0)
return qtrue;
//iterate through all the entity id strings
ps = tmp_alias;
while (*ps)
{
char *sep2, *tok2 = ps;
if ( (sep2 = strchr(ps, ',')) != NULL )
{
*sep2 = 0;
ps = sep2+1;
} else {
ps += strlen(ps);
}
if (Q_stricmp(tok, tok2) == 0)
return qtrue;
if (sep2)
*sep2 = ',';
}
if (sep)
*sep = ',';
}
return qfalse;
}
/* /*
============= =============
G_PickTarget G_PickTarget
@ -310,7 +370,12 @@ void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator)
} }
t = NULL; t = NULL;
while ((t = G_Find(t, FOFS(targetname), target)) != NULL) { //Makro - entity matching via MatchesId
//while ((t = G_Find(t, FOFS(targetname), target)) != NULL) {
for (t = g_entities; t-g_entities<level.num_entities; t++)
{
if (!MatchesId(t, target))
continue;
if (t == ent) { if (t == ent) {
G_Printf("WARNING: Entity used itself.\n"); G_Printf("WARNING: Entity used itself.\n");
} else { } else {

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.93 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.92 2003/09/19 21:25:10 makro // Revision 1.92 2003/09/19 21:25:10 makro
// Flares (again!). Doors that open away from players. // Flares (again!). Doors that open away from players.
// //
@ -203,11 +206,6 @@
// JBravo: for warnings // JBravo: for warnings
void Use_BinaryMover(gentity_t * ent, gentity_t * other, gentity_t * activator); void Use_BinaryMover(gentity_t * ent, gentity_t * other, gentity_t * activator);
//Makro - to get the new surfaceparm system to work :/
int GetMaterialFromFlag(int flag);
qboolean IsMetalMat(int Material);
qboolean IsMetalFlag(int flag);
static vec3_t forward, right, up; static vec3_t forward, right, up;
static vec3_t muzzle; static vec3_t muzzle;

View file

@ -80,7 +80,7 @@ BSC32=bscmake.exe
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386
# ADD LINK32 kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"..\Debug/qagamex86.dll" # ADD LINK32 kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /map /debug /machine:I386 /out:"D:\Work\rq3source\reaction\Release\qagamex86.dll"
# SUBTRACT LINK32 /incremental:no # SUBTRACT LINK32 /incremental:no
!ENDIF !ENDIF

View file

@ -3,410 +3,69 @@
<pre> <pre>
<h1>Build Log</h1> <h1>Build Log</h1>
<h3> <h3>
--------------------Configuration: cgame - Win32 Release-------------------- --------------------Configuration: game - Win32 Debug--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP526.tmp" with contents Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP375B.tmp" with contents
[ [
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"D:\Work\rq3source\reaction\Release/" /Fp"D:\Work\rq3source\reaction\Release/cgame.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /c /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "BUILDING_REF_GL" /D "DEBUG" /FR"c:\reactionoutput/" /Fp"c:\reactionoutput/game.pch" /YX /Fo"c:\reactionoutput/" /Fd"c:\reactionoutput/" /FD /c
"D:\Work\rq3source\reaction\game\bg_misc.c"
"D:\Work\rq3source\reaction\game\bg_pmove.c"
"D:\Work\rq3source\reaction\game\bg_slidemove.c"
"D:\Work\rq3source\reaction\cgame\cg_atmospheric.c"
"D:\Work\rq3source\reaction\cgame\cg_consolecmds.c"
"D:\Work\rq3source\reaction\cgame\cg_draw.c"
"D:\Work\rq3source\reaction\cgame\cg_drawtools.c"
"D:\Work\rq3source\reaction\cgame\cg_effects.c"
"D:\Work\rq3source\reaction\cgame\cg_ents.c"
"D:\Work\rq3source\reaction\cgame\cg_event.c"
"D:\Work\rq3source\reaction\cgame\cg_info.c"
"D:\Work\rq3source\reaction\cgame\cg_localents.c"
"D:\Work\rq3source\reaction\cgame\cg_main.c"
"D:\Work\rq3source\reaction\cgame\cg_marks.c"
"D:\Work\rq3source\reaction\cgame\cg_players.c"
"D:\Work\rq3source\reaction\cgame\cg_playerstate.c"
"D:\Work\rq3source\reaction\cgame\cg_predict.c"
"D:\Work\rq3source\reaction\cgame\cg_scoreboard.c"
"D:\Work\rq3source\reaction\cgame\cg_servercmds.c"
"D:\Work\rq3source\reaction\cgame\cg_snapshot.c"
"D:\Work\rq3source\reaction\cgame\cg_syscalls.c"
"D:\Work\rq3source\reaction\cgame\cg_unlagged.c"
"D:\Work\rq3source\reaction\cgame\cg_view.c"
"D:\Work\rq3source\reaction\cgame\cg_weapons.c"
"D:\Work\rq3source\reaction\game\q_math.c"
"D:\Work\rq3source\reaction\game\q_shared.c"
"D:\Work\rq3source\reaction\ui\ui_shared.c"
]
Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP526.tmp"
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP527.tmp" with contents
[
/nologo /base:"0x30000000" /subsystem:windows /dll /incremental:no /pdb:"D:\Work\rq3source\reaction\Release/cgamex86.pdb" /map:"D:\Work\rq3source\reaction\Release/cgamex86.map" /machine:I386 /def:".\cgame.def" /out:"D:\Work\rq3source\reaction\Release\cgamex86.dll" /implib:"D:\Work\rq3source\reaction\Release/cgamex86.lib"
\Work\rq3source\reaction\Release\bg_misc.obj
\Work\rq3source\reaction\Release\bg_pmove.obj
\Work\rq3source\reaction\Release\bg_slidemove.obj
\Work\rq3source\reaction\Release\cg_atmospheric.obj
\Work\rq3source\reaction\Release\cg_consolecmds.obj
\Work\rq3source\reaction\Release\cg_draw.obj
\Work\rq3source\reaction\Release\cg_drawtools.obj
\Work\rq3source\reaction\Release\cg_effects.obj
\Work\rq3source\reaction\Release\cg_ents.obj
\Work\rq3source\reaction\Release\cg_event.obj
\Work\rq3source\reaction\Release\cg_info.obj
\Work\rq3source\reaction\Release\cg_localents.obj
\Work\rq3source\reaction\Release\cg_main.obj
\Work\rq3source\reaction\Release\cg_marks.obj
\Work\rq3source\reaction\Release\cg_players.obj
\Work\rq3source\reaction\Release\cg_playerstate.obj
\Work\rq3source\reaction\Release\cg_predict.obj
\Work\rq3source\reaction\Release\cg_scoreboard.obj
\Work\rq3source\reaction\Release\cg_servercmds.obj
\Work\rq3source\reaction\Release\cg_snapshot.obj
\Work\rq3source\reaction\Release\cg_syscalls.obj
\Work\rq3source\reaction\Release\cg_unlagged.obj
\Work\rq3source\reaction\Release\cg_view.obj
\Work\rq3source\reaction\Release\cg_weapons.obj
\Work\rq3source\reaction\Release\q_math.obj
\Work\rq3source\reaction\Release\q_shared.obj
\Work\rq3source\reaction\Release\ui_shared.obj
]
Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP527.tmp"
<h3>Output Window</h3>
Compiling...
bg_misc.c
bg_pmove.c
bg_slidemove.c
cg_atmospheric.c
cg_consolecmds.c
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(626) : warning C4706: assignment within conditional expression
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(638) : warning C4706: assignment within conditional expression
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(184) : warning C4701: local variable 'tr' may be used without having been initialized
D:\Work\rq3source\reaction\cgame\cg_atmospheric.c(334) : warning C4701: local variable 'tr' may be used without having been initialized
cg_draw.c
cg_drawtools.c
cg_effects.c
cg_ents.c
cg_event.c
cg_info.c
cg_localents.c
cg_main.c
cg_marks.c
cg_players.c
cg_playerstate.c
cg_predict.c
cg_scoreboard.c
D:\Work\rq3source\reaction\cgame\cg_predict.c(805) : warning C4701: local variable 'predictCmd' may be used without having been initialized
D:\Work\rq3source\reaction\cgame\cg_predict.c(809) : warning C4701: local variable 'stateIndex' may be used without having been initialized
cg_servercmds.c
cg_snapshot.c
cg_syscalls.c
cg_unlagged.c
cg_view.c
cg_weapons.c
q_math.c
q_shared.c
ui_shared.c
Linking...
Creating library D:\Work\rq3source\reaction\Release/cgamex86.lib and object D:\Work\rq3source\reaction\Release/cgamex86.exp
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52B.tmp" with contents
[
/nologo /o"D:\Work\rq3source\reaction\Release/cgame.bsc"
\Work\rq3source\reaction\Release\bg_misc.sbr
\Work\rq3source\reaction\Release\bg_pmove.sbr
\Work\rq3source\reaction\Release\bg_slidemove.sbr
\Work\rq3source\reaction\Release\cg_atmospheric.sbr
\Work\rq3source\reaction\Release\cg_consolecmds.sbr
\Work\rq3source\reaction\Release\cg_draw.sbr
\Work\rq3source\reaction\Release\cg_drawtools.sbr
\Work\rq3source\reaction\Release\cg_effects.sbr
\Work\rq3source\reaction\Release\cg_ents.sbr
\Work\rq3source\reaction\Release\cg_event.sbr
\Work\rq3source\reaction\Release\cg_info.sbr
\Work\rq3source\reaction\Release\cg_localents.sbr
\Work\rq3source\reaction\Release\cg_main.sbr
\Work\rq3source\reaction\Release\cg_marks.sbr
\Work\rq3source\reaction\Release\cg_players.sbr
\Work\rq3source\reaction\Release\cg_playerstate.sbr
\Work\rq3source\reaction\Release\cg_predict.sbr
\Work\rq3source\reaction\Release\cg_scoreboard.sbr
\Work\rq3source\reaction\Release\cg_servercmds.sbr
\Work\rq3source\reaction\Release\cg_snapshot.sbr
\Work\rq3source\reaction\Release\cg_syscalls.sbr
\Work\rq3source\reaction\Release\cg_unlagged.sbr
\Work\rq3source\reaction\Release\cg_view.sbr
\Work\rq3source\reaction\Release\cg_weapons.sbr
\Work\rq3source\reaction\Release\q_math.sbr
\Work\rq3source\reaction\Release\q_shared.sbr
\Work\rq3source\reaction\Release\ui_shared.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52B.tmp"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3>
cgamex86.dll - 0 error(s), 6 warning(s)
<h3>
--------------------Configuration: game - Win32 Release--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52C.tmp" with contents
[
/nologo /G6 /ML /W4 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FR"D:\Work\rq3source\reaction\Release/" /Fp"D:\Work\rq3source\reaction\Release/game.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /c
"D:\Work\rq3source\reaction\game\ai_chat.c"
"D:\Work\rq3source\reaction\game\ai_cmd.c"
"D:\Work\rq3source\reaction\game\ai_dmnet.c"
"D:\Work\rq3source\reaction\game\ai_dmq3.c"
"D:\Work\rq3source\reaction\game\ai_main.c"
"D:\Work\rq3source\reaction\game\ai_team.c"
"D:\Work\rq3source\reaction\game\ai_vcmd.c"
"D:\Work\rq3source\reaction\game\bg_misc.c"
"D:\Work\rq3source\reaction\game\bg_pmove.c"
"D:\Work\rq3source\reaction\game\bg_slidemove.c"
"D:\Work\rq3source\reaction\game\g_active.c"
"D:\Work\rq3source\reaction\game\g_arenas.c"
"D:\Work\rq3source\reaction\game\g_bot.c"
"D:\Work\rq3source\reaction\game\g_client.c"
"D:\Work\rq3source\reaction\game\g_cmds.c" "D:\Work\rq3source\reaction\game\g_cmds.c"
"D:\Work\rq3source\reaction\game\g_combat.c"
"D:\Work\rq3source\reaction\game\g_fileio.c"
"D:\Work\rq3source\reaction\game\g_items.c"
"D:\Work\rq3source\reaction\game\g_main.c"
"D:\Work\rq3source\reaction\game\g_matchmode.c"
"D:\Work\rq3source\reaction\game\g_mem.c"
"D:\Work\rq3source\reaction\game\g_misc.c"
"D:\Work\rq3source\reaction\game\g_missile.c"
"D:\Work\rq3source\reaction\game\g_mover.c"
"D:\Work\rq3source\reaction\game\g_session.c"
"D:\Work\rq3source\reaction\game\g_spawn.c"
"D:\Work\rq3source\reaction\game\g_svcmds.c"
"D:\Work\rq3source\reaction\game\g_syscalls.c"
"D:\Work\rq3source\reaction\game\g_target.c"
"D:\Work\rq3source\reaction\game\g_team.c"
"D:\Work\rq3source\reaction\game\g_teamplay.c"
"D:\Work\rq3source\reaction\game\g_trigger.c"
"D:\Work\rq3source\reaction\game\g_unlagged.c"
"D:\Work\rq3source\reaction\game\g_utils.c"
"D:\Work\rq3source\reaction\game\g_weapon.c"
"D:\Work\rq3source\reaction\game\q_math.c"
"D:\Work\rq3source\reaction\game\q_shared.c"
"D:\Work\rq3source\reaction\game\rxn_game.c"
"D:\Work\rq3source\reaction\game\zcam.c"
"D:\Work\rq3source\reaction\game\zcam_target.c"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52C.tmp" Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP375B.tmp"
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52D.tmp" with contents Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP375C.tmp" with contents
[ [
kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:no /pdb:"D:\Work\rq3source\reaction\Release/qagamex86.pdb" /map:"D:\Work\rq3source\reaction\Release/qagamex86.map" /machine:I386 /def:".\game.def" /out:"D:\Work\rq3source\reaction\Release\qagamex86.dll" /implib:"D:\Work\rq3source\reaction\Release/qagamex86.lib" kernel32.lib user32.lib winmm.lib /nologo /base:"0x20000000" /subsystem:windows /dll /incremental:yes /pdb:"c:\reactionoutput/qagamex86.pdb" /map:"c:\reactionoutput/qagamex86.map" /debug /machine:I386 /def:".\game.def" /out:"D:\Work\rq3source\reaction\Release\qagamex86.dll" /implib:"c:\reactionoutput/qagamex86.lib"
\Work\rq3source\reaction\Release\ai_chat.obj c:\reactionoutput\ai_chat.obj
\Work\rq3source\reaction\Release\ai_cmd.obj c:\reactionoutput\ai_cmd.obj
\Work\rq3source\reaction\Release\ai_dmnet.obj c:\reactionoutput\ai_dmnet.obj
\Work\rq3source\reaction\Release\ai_dmq3.obj c:\reactionoutput\ai_dmq3.obj
\Work\rq3source\reaction\Release\ai_main.obj c:\reactionoutput\ai_main.obj
\Work\rq3source\reaction\Release\ai_team.obj c:\reactionoutput\ai_team.obj
\Work\rq3source\reaction\Release\ai_vcmd.obj c:\reactionoutput\ai_vcmd.obj
\Work\rq3source\reaction\Release\bg_misc.obj c:\reactionoutput\bg_misc.obj
\Work\rq3source\reaction\Release\bg_pmove.obj c:\reactionoutput\bg_pmove.obj
\Work\rq3source\reaction\Release\bg_slidemove.obj c:\reactionoutput\bg_slidemove.obj
\Work\rq3source\reaction\Release\g_active.obj c:\reactionoutput\g_active.obj
\Work\rq3source\reaction\Release\g_arenas.obj c:\reactionoutput\g_arenas.obj
\Work\rq3source\reaction\Release\g_bot.obj c:\reactionoutput\g_bot.obj
\Work\rq3source\reaction\Release\g_client.obj c:\reactionoutput\g_client.obj
\Work\rq3source\reaction\Release\g_cmds.obj c:\reactionoutput\g_cmds.obj
\Work\rq3source\reaction\Release\g_combat.obj c:\reactionoutput\g_combat.obj
\Work\rq3source\reaction\Release\g_fileio.obj c:\reactionoutput\g_fileio.obj
\Work\rq3source\reaction\Release\g_items.obj c:\reactionoutput\g_items.obj
\Work\rq3source\reaction\Release\g_main.obj c:\reactionoutput\g_main.obj
\Work\rq3source\reaction\Release\g_matchmode.obj c:\reactionoutput\g_matchmode.obj
\Work\rq3source\reaction\Release\g_mem.obj c:\reactionoutput\g_mem.obj
\Work\rq3source\reaction\Release\g_misc.obj c:\reactionoutput\g_misc.obj
\Work\rq3source\reaction\Release\g_missile.obj c:\reactionoutput\g_missile.obj
\Work\rq3source\reaction\Release\g_mover.obj c:\reactionoutput\g_mover.obj
\Work\rq3source\reaction\Release\g_session.obj c:\reactionoutput\g_session.obj
\Work\rq3source\reaction\Release\g_spawn.obj c:\reactionoutput\g_spawn.obj
\Work\rq3source\reaction\Release\g_svcmds.obj c:\reactionoutput\g_svcmds.obj
\Work\rq3source\reaction\Release\g_syscalls.obj c:\reactionoutput\g_syscalls.obj
\Work\rq3source\reaction\Release\g_target.obj c:\reactionoutput\g_target.obj
\Work\rq3source\reaction\Release\g_team.obj c:\reactionoutput\g_team.obj
\Work\rq3source\reaction\Release\g_teamplay.obj c:\reactionoutput\g_teamplay.obj
\Work\rq3source\reaction\Release\g_trigger.obj c:\reactionoutput\g_trigger.obj
\Work\rq3source\reaction\Release\g_unlagged.obj c:\reactionoutput\g_unlagged.obj
\Work\rq3source\reaction\Release\g_utils.obj c:\reactionoutput\g_utils.obj
\Work\rq3source\reaction\Release\g_weapon.obj c:\reactionoutput\g_weapon.obj
\Work\rq3source\reaction\Release\q_math.obj c:\reactionoutput\q_math.obj
\Work\rq3source\reaction\Release\q_shared.obj c:\reactionoutput\q_shared.obj
\Work\rq3source\reaction\Release\rxn_game.obj c:\reactionoutput\rxn_game.obj
\Work\rq3source\reaction\Release\zcam.obj c:\reactionoutput\zcam.obj
\Work\rq3source\reaction\Release\zcam_target.obj c:\reactionoutput\zcam_target.obj
] ]
Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52D.tmp" Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP375C.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
ai_chat.c
ai_cmd.c
ai_dmnet.c
ai_dmq3.c
ai_main.c
ai_team.c
ai_vcmd.c
bg_misc.c
bg_pmove.c
bg_slidemove.c
g_active.c
g_arenas.c
g_bot.c
g_client.c
g_cmds.c g_cmds.c
D:\Work\rq3source\reaction\game\g_client.c(1640) : warning C4701: local variable 'classname' may be used without having been initialized
D:\Work\rq3source\reaction\game\g_cmds.c(2479) : warning C4189: 'door' : local variable is initialized but not referenced
g_combat.c
g_fileio.c
D:\Work\rq3source\reaction\game\g_combat.c(2014) : warning C4700: local variable 'asave' used without having been initialized
g_items.c
g_main.c
g_matchmode.c
g_mem.c
g_misc.c
g_missile.c
g_mover.c
g_session.c
g_spawn.c
g_svcmds.c
g_syscalls.c
g_target.c
g_team.c
g_teamplay.c
g_trigger.c
g_unlagged.c
g_utils.c
g_weapon.c
q_math.c
D:\Work\rq3source\reaction\game\g_weapon.c(1954) : warning C4701: local variable 'tr' may be used without having been initialized
q_shared.c
rxn_game.c
zcam.c
zcam_target.c
Linking... Linking...
Creating library D:\Work\rq3source\reaction\Release/qagamex86.lib and object D:\Work\rq3source\reaction\Release/qagamex86.exp
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP531.tmp" with contents
[
/nologo /o"D:\Work\rq3source\reaction\Release/game.bsc"
\Work\rq3source\reaction\Release\ai_chat.sbr
\Work\rq3source\reaction\Release\ai_cmd.sbr
\Work\rq3source\reaction\Release\ai_dmnet.sbr
\Work\rq3source\reaction\Release\ai_dmq3.sbr
\Work\rq3source\reaction\Release\ai_main.sbr
\Work\rq3source\reaction\Release\ai_team.sbr
\Work\rq3source\reaction\Release\ai_vcmd.sbr
\Work\rq3source\reaction\Release\bg_misc.sbr
\Work\rq3source\reaction\Release\bg_pmove.sbr
\Work\rq3source\reaction\Release\bg_slidemove.sbr
\Work\rq3source\reaction\Release\g_active.sbr
\Work\rq3source\reaction\Release\g_arenas.sbr
\Work\rq3source\reaction\Release\g_bot.sbr
\Work\rq3source\reaction\Release\g_client.sbr
\Work\rq3source\reaction\Release\g_cmds.sbr
\Work\rq3source\reaction\Release\g_combat.sbr
\Work\rq3source\reaction\Release\g_fileio.sbr
\Work\rq3source\reaction\Release\g_items.sbr
\Work\rq3source\reaction\Release\g_main.sbr
\Work\rq3source\reaction\Release\g_matchmode.sbr
\Work\rq3source\reaction\Release\g_mem.sbr
\Work\rq3source\reaction\Release\g_misc.sbr
\Work\rq3source\reaction\Release\g_missile.sbr
\Work\rq3source\reaction\Release\g_mover.sbr
\Work\rq3source\reaction\Release\g_session.sbr
\Work\rq3source\reaction\Release\g_spawn.sbr
\Work\rq3source\reaction\Release\g_svcmds.sbr
\Work\rq3source\reaction\Release\g_syscalls.sbr
\Work\rq3source\reaction\Release\g_target.sbr
\Work\rq3source\reaction\Release\g_team.sbr
\Work\rq3source\reaction\Release\g_teamplay.sbr
\Work\rq3source\reaction\Release\g_trigger.sbr
\Work\rq3source\reaction\Release\g_unlagged.sbr
\Work\rq3source\reaction\Release\g_utils.sbr
\Work\rq3source\reaction\Release\g_weapon.sbr
\Work\rq3source\reaction\Release\q_math.sbr
\Work\rq3source\reaction\Release\q_shared.sbr
\Work\rq3source\reaction\Release\rxn_game.sbr
\Work\rq3source\reaction\Release\zcam.sbr
\Work\rq3source\reaction\Release\zcam_target.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP531.tmp"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3> <h3>Results</h3>
qagamex86.dll - 0 error(s), 4 warning(s) qagamex86.dll - 0 error(s), 0 warning(s)
<h3>
--------------------Configuration: ui - Win32 Release TA--------------------
</h3>
<h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP532.tmp" with contents
[
/nologo /G6 /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR"D:\Work\rq3source\reaction\Release/" /Fp"D:\Work\rq3source\reaction\Release/ta_ui.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /c
"D:\Work\rq3source\reaction\game\bg_misc.c"
"D:\Work\rq3source\reaction\game\q_math.c"
"D:\Work\rq3source\reaction\game\q_shared.c"
"D:\Work\rq3source\reaction\ta_ui\ui_atoms.c"
"D:\Work\rq3source\reaction\ta_ui\ui_gameinfo.c"
"D:\Work\rq3source\reaction\ta_ui\ui_main.c"
"D:\Work\rq3source\reaction\ta_ui\ui_players.c"
"D:\Work\rq3source\reaction\ta_ui\ui_shared.c"
"D:\Work\rq3source\reaction\ta_ui\ui_syscalls.c"
"D:\Work\rq3source\reaction\ta_ui\ui_util.c"
]
Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP532.tmp"
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP533.tmp" with contents
[
/nologo /base:"0x40000000" /dll /incremental:no /pdb:"D:\Work\rq3source\reaction\Release/uix86.pdb" /map:"D:\Work\rq3source\reaction\Release/uix86.map" /machine:I386 /def:".\ui.def" /out:"D:\Work\rq3source\reaction\Release\uix86.dll" /implib:"D:\Work\rq3source\reaction\Release/uix86.lib"
\Work\rq3source\reaction\Release\bg_misc.obj
\Work\rq3source\reaction\Release\q_math.obj
\Work\rq3source\reaction\Release\q_shared.obj
\Work\rq3source\reaction\Release\ui_atoms.obj
\Work\rq3source\reaction\Release\ui_gameinfo.obj
\Work\rq3source\reaction\Release\ui_main.obj
\Work\rq3source\reaction\Release\ui_players.obj
\Work\rq3source\reaction\Release\ui_shared.obj
\Work\rq3source\reaction\Release\ui_syscalls.obj
\Work\rq3source\reaction\Release\ui_util.obj
]
Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP533.tmp"
<h3>Output Window</h3>
Compiling...
bg_misc.c
q_math.c
q_shared.c
ui_atoms.c
ui_gameinfo.c
ui_main.c
ui_players.c
ui_shared.c
ui_syscalls.c
ui_util.c
Linking...
Creating library D:\Work\rq3source\reaction\Release/uix86.lib and object D:\Work\rq3source\reaction\Release/uix86.exp
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP537.tmp" with contents
[
/nologo /o"D:\Work\rq3source\reaction\Release/ta_ui.bsc"
\Work\rq3source\reaction\Release\bg_misc.sbr
\Work\rq3source\reaction\Release\q_math.sbr
\Work\rq3source\reaction\Release\q_shared.sbr
\Work\rq3source\reaction\Release\ui_atoms.sbr
\Work\rq3source\reaction\Release\ui_gameinfo.sbr
\Work\rq3source\reaction\Release\ui_main.sbr
\Work\rq3source\reaction\Release\ui_players.sbr
\Work\rq3source\reaction\Release\ui_shared.sbr
\Work\rq3source\reaction\Release\ui_syscalls.sbr
\Work\rq3source\reaction\Release\ui_util.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP537.tmp"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3>
uix86.dll - 0 error(s), 0 warning(s)
</pre> </pre>
</body> </body>
</html> </html>

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.10 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.9 2002/06/16 20:51:10 niceass // Revision 1.9 2002/06/16 20:51:10 niceass
// assembly code got messed up // assembly code got messed up
// //
@ -67,6 +70,269 @@ vec4_t g_color_table[8] = {
, ,
}; };
//Makro - new table; this allows for a much faster DirToByte function
vec3_t bytedirs[NUMVERTEXNORMALS] =
{
{ 1.00000000f, 0.00000000f, 0.00000000f },
{ 0.92387950f, 0.38268346f, 0.00000000f },
{ 0.70710677f, 0.70710677f, 0.00000000f },
{ 0.38268343f, 0.92387950f, 0.00000000f },
{ -0.00000004f, 1.00000000f, 0.00000000f },
{ -0.38268340f, 0.92387956f, 0.00000000f },
{ -0.70710677f, 0.70710677f, 0.00000000f },
{ -0.92387950f, 0.38268349f, 0.00000000f },
{ -1.00000000f, -0.00000009f, 0.00000000f },
{ -0.92387950f, -0.38268343f, 0.00000000f },
{ -0.70710683f, -0.70710671f, 0.00000000f },
{ -0.38268358f, -0.92387950f, 0.00000000f },
{ 0.00000001f, -1.00000000f, 0.00000000f },
{ 0.38268360f, -0.92387944f, 0.00000000f },
{ 0.70710665f, -0.70710689f, 0.00000000f },
{ 0.92387956f, -0.38268343f, 0.00000000f },
{ 0.92387950f, 0.00000000f, -0.38268346f },
{ 0.85355335f, 0.35355341f, -0.38268346f },
{ 0.65328145f, 0.65328145f, -0.38268346f },
{ 0.35355338f, 0.85355335f, -0.38268346f },
{ -0.00000004f, 0.92387950f, -0.38268346f },
{ -0.35355335f, 0.85355341f, -0.38268346f },
{ -0.65328145f, 0.65328145f, -0.38268346f },
{ -0.85355335f, 0.35355341f, -0.38268346f },
{ -0.92387950f, -0.00000008f, -0.38268346f },
{ -0.85355335f, -0.35355338f, -0.38268346f },
{ -0.65328151f, -0.65328139f, -0.38268346f },
{ -0.35355350f, -0.85355335f, -0.38268346f },
{ 0.00000001f, -0.92387950f, -0.38268346f },
{ 0.35355353f, -0.85355330f, -0.38268346f },
{ 0.65328133f, -0.65328157f, -0.38268346f },
{ 0.85355341f, -0.35355338f, -0.38268346f },
{ 0.70710677f, 0.00000000f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.49999997f, 0.49999997f, -0.70710677f },
{ 0.27059805f, 0.65328145f, -0.70710677f },
{ -0.00000003f, 0.70710677f, -0.70710677f },
{ -0.27059802f, 0.65328151f, -0.70710677f },
{ -0.49999997f, 0.49999997f, -0.70710677f },
{ -0.65328145f, 0.27059808f, -0.70710677f },
{ -0.70710677f, -0.00000006f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.50000000f, -0.49999994f, -0.70710677f },
{ -0.27059814f, -0.65328145f, -0.70710677f },
{ 0.00000001f, -0.70710677f, -0.70710677f },
{ 0.27059817f, -0.65328139f, -0.70710677f },
{ 0.49999991f, -0.50000006f, -0.70710677f },
{ 0.65328151f, -0.27059805f, -0.70710677f },
{ 0.38268343f, 0.00000000f, -0.92387950f },
{ 0.35355338f, 0.14644662f, -0.92387950f },
{ 0.27059805f, 0.27059805f, -0.92387950f },
{ 0.14644660f, 0.35355338f, -0.92387950f },
{ -0.00000002f, 0.38268343f, -0.92387950f },
{ -0.14644660f, 0.35355338f, -0.92387950f },
{ -0.27059805f, 0.27059805f, -0.92387950f },
{ -0.35355338f, 0.14644663f, -0.92387950f },
{ -0.38268343f, -0.00000003f, -0.92387950f },
{ -0.35355338f, -0.14644660f, -0.92387950f },
{ -0.27059805f, -0.27059802f, -0.92387950f },
{ -0.14644666f, -0.35355338f, -0.92387950f },
{ 0.00000000f, -0.38268343f, -0.92387950f },
{ 0.14644668f, -0.35355335f, -0.92387950f },
{ 0.27059799f, -0.27059808f, -0.92387950f },
{ 0.35355338f, -0.14644660f, -0.92387950f },
{ -0.00000004f, 0.00000000f, -1.00000000f },
{ -0.00000004f, -0.00000002f, -1.00000000f },
{ -0.00000003f, -0.00000003f, -1.00000000f },
{ -0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000000f, -0.00000004f, -1.00000000f },
{ 0.00000002f, -0.00000004f, -1.00000000f },
{ 0.00000003f, -0.00000003f, -1.00000000f },
{ 0.00000004f, -0.00000002f, -1.00000000f },
{ 0.00000004f, 0.00000000f, -1.00000000f },
{ 0.00000004f, 0.00000002f, -1.00000000f },
{ 0.00000003f, 0.00000003f, -1.00000000f },
{ 0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000000f, 0.00000004f, -1.00000000f },
{ -0.00000002f, 0.00000004f, -1.00000000f },
{ -0.00000003f, 0.00000003f, -1.00000000f },
{ -0.00000004f, 0.00000002f, -1.00000000f },
{ -0.38268340f, 0.00000000f, -0.92387956f },
{ -0.35355335f, -0.14644660f, -0.92387956f },
{ -0.27059802f, -0.27059802f, -0.92387956f },
{ -0.14644660f, -0.35355335f, -0.92387956f },
{ 0.00000002f, -0.38268340f, -0.92387956f },
{ 0.14644659f, -0.35355335f, -0.92387956f },
{ 0.27059802f, -0.27059802f, -0.92387956f },
{ 0.35355335f, -0.14644662f, -0.92387956f },
{ 0.38268340f, 0.00000003f, -0.92387956f },
{ 0.35355335f, 0.14644660f, -0.92387956f },
{ 0.27059805f, 0.27059799f, -0.92387956f },
{ 0.14644665f, 0.35355335f, -0.92387956f },
{ -0.00000000f, 0.38268340f, -0.92387956f },
{ -0.14644666f, 0.35355332f, -0.92387956f },
{ -0.27059796f, 0.27059805f, -0.92387956f },
{ -0.35355335f, 0.14644660f, -0.92387956f },
{ -0.70710677f, 0.00000000f, -0.70710677f },
{ -0.65328145f, -0.27059805f, -0.70710677f },
{ -0.49999997f, -0.49999997f, -0.70710677f },
{ -0.27059805f, -0.65328145f, -0.70710677f },
{ 0.00000003f, -0.70710677f, -0.70710677f },
{ 0.27059802f, -0.65328151f, -0.70710677f },
{ 0.49999997f, -0.49999997f, -0.70710677f },
{ 0.65328145f, -0.27059808f, -0.70710677f },
{ 0.70710677f, 0.00000006f, -0.70710677f },
{ 0.65328145f, 0.27059805f, -0.70710677f },
{ 0.50000000f, 0.49999994f, -0.70710677f },
{ 0.27059814f, 0.65328145f, -0.70710677f },
{ -0.00000001f, 0.70710677f, -0.70710677f },
{ -0.27059817f, 0.65328139f, -0.70710677f },
{ -0.49999991f, 0.50000006f, -0.70710677f },
{ -0.65328151f, 0.27059805f, -0.70710677f },
{ -0.92387950f, 0.00000000f, -0.38268349f },
{ -0.85355335f, -0.35355341f, -0.38268349f },
{ -0.65328145f, -0.65328145f, -0.38268349f },
{ -0.35355338f, -0.85355335f, -0.38268349f },
{ 0.00000004f, -0.92387950f, -0.38268349f },
{ 0.35355335f, -0.85355341f, -0.38268349f },
{ 0.65328145f, -0.65328145f, -0.38268349f },
{ 0.85355335f, -0.35355341f, -0.38268349f },
{ 0.92387950f, 0.00000008f, -0.38268349f },
{ 0.85355335f, 0.35355338f, -0.38268349f },
{ 0.65328151f, 0.65328139f, -0.38268349f },
{ 0.35355350f, 0.85355335f, -0.38268349f },
{ -0.00000001f, 0.92387950f, -0.38268349f },
{ -0.35355353f, 0.85355330f, -0.38268349f },
{ -0.65328133f, 0.65328157f, -0.38268349f },
{ -0.85355341f, 0.35355338f, -0.38268349f },
{ -1.00000000f, 0.00000000f, 0.00000009f },
{ -0.92387950f, -0.38268346f, 0.00000009f },
{ -0.70710677f, -0.70710677f, 0.00000009f },
{ -0.38268343f, -0.92387950f, 0.00000009f },
{ 0.00000004f, -1.00000000f, 0.00000009f },
{ 0.38268340f, -0.92387956f, 0.00000009f },
{ 0.70710677f, -0.70710677f, 0.00000009f },
{ 0.92387950f, -0.38268349f, 0.00000009f },
{ 1.00000000f, 0.00000009f, 0.00000009f },
{ 0.92387950f, 0.38268343f, 0.00000009f },
{ 0.70710683f, 0.70710671f, 0.00000009f },
{ 0.38268358f, 0.92387950f, 0.00000009f },
{ -0.00000001f, 1.00000000f, 0.00000009f },
{ -0.38268360f, 0.92387944f, 0.00000009f },
{ -0.70710665f, 0.70710689f, 0.00000009f },
{ -0.92387956f, 0.38268343f, 0.00000009f },
{ -0.92387950f, 0.00000000f, 0.38268343f },
{ -0.85355335f, -0.35355341f, 0.38268343f },
{ -0.65328145f, -0.65328145f, 0.38268343f },
{ -0.35355338f, -0.85355335f, 0.38268343f },
{ 0.00000004f, -0.92387950f, 0.38268343f },
{ 0.35355335f, -0.85355341f, 0.38268343f },
{ 0.65328145f, -0.65328145f, 0.38268343f },
{ 0.85355335f, -0.35355341f, 0.38268343f },
{ 0.92387950f, 0.00000008f, 0.38268343f },
{ 0.85355335f, 0.35355338f, 0.38268343f },
{ 0.65328151f, 0.65328139f, 0.38268343f },
{ 0.35355350f, 0.85355335f, 0.38268343f },
{ -0.00000001f, 0.92387950f, 0.38268343f },
{ -0.35355353f, 0.85355330f, 0.38268343f },
{ -0.65328133f, 0.65328157f, 0.38268343f },
{ -0.85355341f, 0.35355338f, 0.38268343f },
{ -0.70710683f, 0.00000000f, 0.70710671f },
{ -0.65328151f, -0.27059808f, 0.70710671f },
{ -0.50000000f, -0.50000000f, 0.70710671f },
{ -0.27059805f, -0.65328151f, 0.70710671f },
{ 0.00000003f, -0.70710683f, 0.70710671f },
{ 0.27059805f, -0.65328157f, 0.70710671f },
{ 0.50000000f, -0.50000000f, 0.70710671f },
{ 0.65328151f, -0.27059811f, 0.70710671f },
{ 0.70710683f, 0.00000006f, 0.70710671f },
{ 0.65328151f, 0.27059805f, 0.70710671f },
{ 0.50000006f, 0.49999997f, 0.70710671f },
{ 0.27059817f, 0.65328151f, 0.70710671f },
{ -0.00000001f, 0.70710683f, 0.70710671f },
{ -0.27059820f, 0.65328145f, 0.70710671f },
{ -0.49999994f, 0.50000012f, 0.70710671f },
{ -0.65328157f, 0.27059805f, 0.70710671f },
{ -0.38268358f, 0.00000000f, 0.92387950f },
{ -0.35355350f, -0.14644668f, 0.92387950f },
{ -0.27059814f, -0.27059814f, 0.92387950f },
{ -0.14644666f, -0.35355350f, 0.92387950f },
{ 0.00000002f, -0.38268358f, 0.92387950f },
{ 0.14644665f, -0.35355353f, 0.92387950f },
{ 0.27059814f, -0.27059814f, 0.92387950f },
{ 0.35355350f, -0.14644669f, 0.92387950f },
{ 0.38268358f, 0.00000003f, 0.92387950f },
{ 0.35355350f, 0.14644666f, 0.92387950f },
{ 0.27059817f, 0.27059811f, 0.92387950f },
{ 0.14644672f, 0.35355350f, 0.92387950f },
{ -0.00000000f, 0.38268358f, 0.92387950f },
{ -0.14644673f, 0.35355350f, 0.92387950f },
{ -0.27059811f, 0.27059820f, 0.92387950f },
{ -0.35355353f, 0.14644666f, 0.92387950f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000000f, 1.00000000f },
{ 0.00000001f, 0.00000001f, 1.00000000f },
{ 0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000000f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000001f, 1.00000000f },
{ -0.00000001f, 0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000000f, 1.00000000f },
{ -0.00000001f, -0.00000001f, 1.00000000f },
{ -0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000000f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000001f, 1.00000000f },
{ 0.00000001f, -0.00000000f, 1.00000000f },
{ 0.38268360f, 0.00000000f, 0.92387944f },
{ 0.35355353f, 0.14644669f, 0.92387944f },
{ 0.27059817f, 0.27059817f, 0.92387944f },
{ 0.14644668f, 0.35355353f, 0.92387944f },
{ -0.00000002f, 0.38268360f, 0.92387944f },
{ -0.14644666f, 0.35355356f, 0.92387944f },
{ -0.27059817f, 0.27059817f, 0.92387944f },
{ -0.35355353f, 0.14644669f, 0.92387944f },
{ -0.38268360f, -0.00000003f, 0.92387944f },
{ -0.35355353f, -0.14644668f, 0.92387944f },
{ -0.27059820f, -0.27059814f, 0.92387944f },
{ -0.14644673f, -0.35355353f, 0.92387944f },
{ 0.00000000f, -0.38268360f, 0.92387944f },
{ 0.14644673f, -0.35355350f, 0.92387944f },
{ 0.27059811f, -0.27059820f, 0.92387944f },
{ 0.35355356f, -0.14644668f, 0.92387944f },
{ 0.70710665f, 0.00000000f, 0.70710689f },
{ 0.65328133f, 0.27059802f, 0.70710689f },
{ 0.49999991f, 0.49999991f, 0.70710689f },
{ 0.27059799f, 0.65328133f, 0.70710689f },
{ -0.00000003f, 0.70710665f, 0.70710689f },
{ -0.27059796f, 0.65328139f, 0.70710689f },
{ -0.49999991f, 0.49999991f, 0.70710689f },
{ -0.65328133f, 0.27059802f, 0.70710689f },
{ -0.70710665f, -0.00000006f, 0.70710689f },
{ -0.65328133f, -0.27059799f, 0.70710689f },
{ -0.49999994f, -0.49999985f, 0.70710689f },
{ -0.27059811f, -0.65328133f, 0.70710689f },
{ 0.00000001f, -0.70710665f, 0.70710689f },
{ 0.27059811f, -0.65328127f, 0.70710689f },
{ 0.49999982f, -0.49999997f, 0.70710689f },
{ 0.65328139f, -0.27059799f, 0.70710689f },
{ 0.92387956f, 0.00000000f, 0.38268343f },
{ 0.85355341f, 0.35355341f, 0.38268343f },
{ 0.65328151f, 0.65328151f, 0.38268343f },
{ 0.35355338f, 0.85355341f, 0.38268343f },
{ -0.00000004f, 0.92387956f, 0.38268343f },
{ -0.35355335f, 0.85355347f, 0.38268343f },
{ -0.65328151f, 0.65328151f, 0.38268343f },
{ -0.85355341f, 0.35355344f, 0.38268343f },
{ -0.92387956f, -0.00000008f, 0.38268343f },
{ -0.85355341f, -0.35355338f, 0.38268343f },
{ -0.65328157f, -0.65328145f, 0.38268343f },
{ -0.35355353f, -0.85355341f, 0.38268343f },
{ 0.00000001f, -0.92387956f, 0.38268343f },
{ 0.35355356f, -0.85355335f, 0.38268343f },
{ 0.65328139f, -0.65328163f, 0.38268343f },
{ 0.85355347f, -0.35355338f, 0.38268343f }
};
//old table
/*
vec3_t bytedirs[NUMVERTEXNORMALS] = { vec3_t bytedirs[NUMVERTEXNORMALS] = {
{-0.525731f, 0.000000f, 0.850651f} {-0.525731f, 0.000000f, 0.850651f}
, {-0.442863f, 0.238856f, 0.864188f} , {-0.442863f, 0.238856f, 0.864188f}
@ -311,6 +577,8 @@ vec3_t bytedirs[NUMVERTEXNORMALS] = {
{-0.587785f, -0.425325f, -0.688191f} {-0.587785f, -0.425325f, -0.688191f}
, {-0.688191f, -0.587785f, -0.425325f} , {-0.688191f, -0.587785f, -0.425325f}
}; };
*/
//============================================================== //==============================================================
@ -418,7 +686,17 @@ signed short ClampShort(int i)
return i; return i;
} }
//Makro - new function
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);
}
//old function
// this isn't a real cheap function to call! // this isn't a real cheap function to call!
/*
int DirToByte(vec3_t dir) int DirToByte(vec3_t dir)
{ {
int i, best; int i, best;
@ -440,6 +718,7 @@ int DirToByte(vec3_t dir)
return best; return best;
} }
*/
void ByteToDir(int b, vec3_t dir) void ByteToDir(int b, vec3_t dir)
{ {
@ -1487,3 +1766,125 @@ int ReflectVectorByte(vec3_t dir, vec3_t plane)
return DirToByte(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);
}
void ToQuakeAngles(vec3_t in, vec3_t out)
{
vec3_t result;
}

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.15 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.14 2004/01/26 21:26:09 makro // Revision 1.14 2004/01/26 21:26:09 makro
// no message // no message
// //
@ -414,9 +417,14 @@ typedef int clipHandle_t;
#define MIN_QINT (-MAX_QINT-1) #define MIN_QINT (-MAX_QINT-1)
// angle indexes // angle indexes
#define PITCH 0 // up / down #define PITCH 0 // up / down
#define YAW 1 // left / right #define YAW 1 // left / right
#define ROLL 2 // fall over #define ROLL 2 // fall over
//Makro - angle axis
#define PITCH_AXIS 1
#define YAW_AXIS 2
#define ROLL_AXIS 0
// the game guarantees that no string from the network will ever // the game guarantees that no string from the network will ever
// exceed MAX_STRING_CHARS // exceed MAX_STRING_CHARS
@ -562,7 +570,8 @@ typedef int fixed16_t;
#define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h #define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h
#endif #endif
#define NUMVERTEXNORMALS 162 //Makro - changed from 162 to 256 in order to use the new bytedirs table
#define NUMVERTEXNORMALS 256
extern vec3_t bytedirs[NUMVERTEXNORMALS]; extern vec3_t bytedirs[NUMVERTEXNORMALS];
// all drawing is done to a 640*480 virtual screen size // all drawing is done to a 640*480 virtual screen size
@ -615,12 +624,25 @@ extern vec4_t colorDkGrey;
#define S_COLOR_CYAN "^5" #define S_COLOR_CYAN "^5"
#define S_COLOR_MAGENTA "^6" #define S_COLOR_MAGENTA "^6"
#define S_COLOR_WHITE "^7" #define S_COLOR_WHITE "^7"
//Makro - reset color
#define S_COLOR_RESET "^*"
extern vec4_t g_color_table[8]; extern vec4_t g_color_table[8];
#define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b #define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b
#define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a #define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a
//Makro - for the UI
#define Vector2Copy(a,b) ((b)[0]=(a)[0],(b)[1]=(a)[1])
#define Vector2MA(v,s,b,o) ((o)[0]=(v)[0]+(b)[0]*(s),(o)[1]=(v)[1]+(b)[1]*(s))
#define Vector2Add(a,b,o) ((o)[0]=(a)[0]+(b)[0],(o)[1]=(a)[1]+(b)[1])
#define Vector2Subtract(a,b,o) ((o)[0]=(a)[0]-(b)[0],(o)[1]=(a)[1]-(b)[1])
#define Vector2Scale(a,s,o) ((o)[0]=(a)[0]*(s),(o)[1]=(a)[1]*(s))
#define Vector2Negate(a,o) ((o)[0]=-(a)[0],(o)[1]=-(a)[1])
#define Vector2Set(v,x,y) ((v)[0]=(x),(v)[1]=(y))
#define Vector2Norm2(v) ((v)[0]*(v)[0]+(v)[1]*(v)[1])
#define DEG2RAD( a ) ( ( (a) * M_PI ) / 180.0F ) #define DEG2RAD( a ) ( ( (a) * M_PI ) / 180.0F )
#define RAD2DEG( a ) ( ( (a) * 180.0f ) / M_PI ) #define RAD2DEG( a ) ( ( (a) * 180.0f ) / M_PI )
@ -863,6 +885,15 @@ void AngleVectors(const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up);
void PerpendicularVector(vec3_t dst, const vec3_t src); void PerpendicularVector(vec3_t dst, const vec3_t src);
int ReflectVectorByte(vec3_t dir, vec3_t plane); int ReflectVectorByte(vec3_t dir, vec3_t plane);
//Makro - moved from g_main
void CreateRotationMatrix(vec3_t angles, vec3_t matrix[3]);
void TransposeMatrix(vec3_t matrix[3], vec3_t transpose[3]);
void RotatePoint(vec3_t point, vec3_t matrix[3]);
//Makro - added
void ChangeRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out);
void ChangeBackRefSystem(vec3_t in, vec3_t neworg, vec3_t newaxis[], vec3_t out);
void ChangeAngleRefSystem(vec3_t in, vec3_t newaxis[], vec3_t out);
//============================================= //=============================================
float Com_Clamp(float min, float max, float value); float Com_Clamp(float min, float max, float value);

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.13 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.12 2002/06/16 20:06:14 jbravo // Revision 1.12 2002/06/16 20:06:14 jbravo
// Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap" // Reindented all the source files with "indent -kr -ut -i8 -l120 -lc120 -sob -bad -bap"
// //
@ -94,3 +97,36 @@
#define SURF_MUD 0x4000000 #define SURF_MUD 0x4000000
#define SURF_WOOD2 0x8000000 #define SURF_WOOD2 0x8000000
#define SURF_HARDMETAL 0x10000000 #define SURF_HARDMETAL 0x10000000
//Makro - for the new surfaceparm system
#define MAT_DEFAULT 0
#define MAT_METALSTEPS 1
#define MAT_GRAVEL 2
#define MAT_WOOD 3
#define MAT_CARPET 4
#define MAT_METAL2 5
#define MAT_GLASS 6
#define MAT_GRASS 7
#define MAT_SNOW 8
#define MAT_MUD 9
#define MAT_WOOD2 10
#define MAT_HARDMETAL 11
//new
#define MAT_LEAVES 12
#define MAT_CEMENT 13
#define MAT_MARBLE 14
#define MAT_SNOW2 15
#define MAT_HARDSTEPS 16
#define MAT_SAND 17
#define MAT_BRICK 18
#define MAT_CERAMIC 19
int GetMaterialFromFlag(int flag);
#define IsMetalMat(Mat) ( (Mat)==MAT_METALSTEPS || (Mat)==MAT_METAL2 || (Mat)==MAT_HARDMETAL )
#define IsMetalFlag(Flag) ( IsMetalMat( GetMaterialFromFlag( Flag ) ) )
#define IsWoodMat(Mat) ( (Mat)==MAT_WOOD || (Mat)==MAT_WOOD2 )
#define IsWoodFlag(Flag) ( IsWoodMat( GetMaterialFromFlag( Flag ) ) )
#define IsSnowMat(Mat) ( (Mat)==MAT_SNOW || (Mat)==MAT_SNOW2 )
#define IsSnowFlag(Flag) ( IsSnowMat( GetMaterialFromFlag( Flag ) ) )

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.12 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.11 2003/03/31 00:23:18 makro // Revision 1.11 2003/03/31 00:23:18 makro
// Replacements and stuff // Replacements and stuff
// //
@ -248,6 +251,9 @@
#define CG_2NDPLACE 68 #define CG_2NDPLACE 68
#define CG_CAPTURES 69 #define CG_CAPTURES 69
//Makro - clock
#define UI_CLOCK 149
//Makro - for SSG crosshair selection //Makro - for SSG crosshair selection
#define UI_SSG_CROSSHAIR 150 #define UI_SSG_CROSSHAIR 150

View file

@ -44,7 +44,8 @@ RSC=rc.exe
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c # ADD BASE CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /c # ADD CPP /nologo /G6 /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
@ -66,12 +67,13 @@ LINK32=link.exe
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug" # PROP Output_Dir "D:\Work\rq3source\reaction\Release"
# PROP Intermediate_Dir "Debug" # PROP Intermediate_Dir "D:\Work\rq3source\reaction\Release"
# PROP Ignore_Export_Lib 0 # PROP Ignore_Export_Lib 0
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c # ADD BASE CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR /YX /FD /GZ /c # ADD CPP /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /YX /FD /GZ /c
# SUBTRACT CPP /Fr
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD BASE RSC /l 0x409 /d "_DEBUG"
@ -82,7 +84,7 @@ BSC32=bscmake.exe
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept # ADD BASE LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"../Debug/uix86_new.dll" /pdbtype:sept
# SUBTRACT BASE LINK32 /pdb:none # SUBTRACT BASE LINK32 /pdb:none
# ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"uix86.dll" /pdbtype:sept # ADD LINK32 /nologo /base:"0x40000000" /dll /pdb:"../Debug/ui.pdb" /map /debug /machine:I386 /out:"D:\Work\rq3source\reaction\Release\uix86.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none # SUBTRACT LINK32 /pdb:none
!ENDIF !ENDIF

View file

@ -3,12 +3,12 @@
<pre> <pre>
<h1>Build Log</h1> <h1>Build Log</h1>
<h3> <h3>
--------------------Configuration: ui - Win32 Release TA-------------------- --------------------Configuration: ui - Win32 Debug TA--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BD.tmp" with contents Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP17B.tmp" with contents
[ [
/nologo /G6 /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /FR"D:\Work\rq3source\reaction\Release/" /Fp"D:\Work\rq3source\reaction\Release/ta_ui.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /c /nologo /G5 /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UI_EXPORTS" /Fp"D:\Work\rq3source\reaction\Release/ta_ui.pch" /YX /Fo"D:\Work\rq3source\reaction\Release/" /Fd"D:\Work\rq3source\reaction\Release/" /FD /GZ /c
"D:\Work\rq3source\reaction\game\bg_misc.c" "D:\Work\rq3source\reaction\game\bg_misc.c"
"D:\Work\rq3source\reaction\game\q_math.c" "D:\Work\rq3source\reaction\game\q_math.c"
"D:\Work\rq3source\reaction\game\q_shared.c" "D:\Work\rq3source\reaction\game\q_shared.c"
@ -20,10 +20,10 @@ Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BD.tmp" with conte
"D:\Work\rq3source\reaction\ta_ui\ui_syscalls.c" "D:\Work\rq3source\reaction\ta_ui\ui_syscalls.c"
"D:\Work\rq3source\reaction\ta_ui\ui_util.c" "D:\Work\rq3source\reaction\ta_ui\ui_util.c"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BD.tmp" Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP17B.tmp"
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BE.tmp" with contents Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP17C.tmp" with contents
[ [
/nologo /base:"0x40000000" /dll /incremental:no /pdb:"D:\Work\rq3source\reaction\Release/uix86.pdb" /map:"D:\Work\rq3source\reaction\Release/uix86.map" /machine:I386 /def:".\ui.def" /out:"D:\Work\rq3source\reaction\Release\uix86.dll" /implib:"D:\Work\rq3source\reaction\Release/uix86.lib" /nologo /base:"0x40000000" /dll /incremental:yes /pdb:"../Debug/ui.pdb" /map:"D:\Work\rq3source\reaction\Release/uix86.map" /debug /machine:I386 /def:".\ui.def" /out:"D:\Work\rq3source\reaction\Release\uix86.dll" /implib:"D:\Work\rq3source\reaction\Release/uix86.lib" /pdbtype:sept
\Work\rq3source\reaction\Release\bg_misc.obj \Work\rq3source\reaction\Release\bg_misc.obj
\Work\rq3source\reaction\Release\q_math.obj \Work\rq3source\reaction\Release\q_math.obj
\Work\rq3source\reaction\Release\q_shared.obj \Work\rq3source\reaction\Release\q_shared.obj
@ -35,11 +35,12 @@ Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BE.tmp" with conte
\Work\rq3source\reaction\Release\ui_syscalls.obj \Work\rq3source\reaction\Release\ui_syscalls.obj
\Work\rq3source\reaction\Release\ui_util.obj \Work\rq3source\reaction\Release\ui_util.obj
] ]
Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BE.tmp" Creating command line "link.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP17C.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
bg_misc.c bg_misc.c
q_math.c q_math.c
d:\work\rq3source\reaction\game\q_math.c(1885) : warning C4101: 'result' : unreferenced local variable
q_shared.c q_shared.c
ui_atoms.c ui_atoms.c
ui_gameinfo.c ui_gameinfo.c
@ -50,27 +51,11 @@ ui_syscalls.c
ui_util.c ui_util.c
Linking... Linking...
Creating library D:\Work\rq3source\reaction\Release/uix86.lib and object D:\Work\rq3source\reaction\Release/uix86.exp Creating library D:\Work\rq3source\reaction\Release/uix86.lib and object D:\Work\rq3source\reaction\Release/uix86.exp
Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4C2.tmp" with contents
[
/nologo /o"D:\Work\rq3source\reaction\Release/ta_ui.bsc"
\Work\rq3source\reaction\Release\bg_misc.sbr
\Work\rq3source\reaction\Release\q_math.sbr
\Work\rq3source\reaction\Release\q_shared.sbr
\Work\rq3source\reaction\Release\ui_atoms.sbr
\Work\rq3source\reaction\Release\ui_gameinfo.sbr
\Work\rq3source\reaction\Release\ui_main.sbr
\Work\rq3source\reaction\Release\ui_players.sbr
\Work\rq3source\reaction\Release\ui_shared.sbr
\Work\rq3source\reaction\Release\ui_syscalls.sbr
\Work\rq3source\reaction\Release\ui_util.sbr]
Creating command line "bscmake.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4C2.tmp"
Creating browse info file...
<h3>Output Window</h3>
<h3>Results</h3> <h3>Results</h3>
uix86.dll - 0 error(s), 0 warning(s) uix86.dll - 0 error(s), 1 warning(s)
</pre> </pre>
</body> </body>
</html> </html>

View file

@ -1,7 +1,8 @@
@echo off
mkdir vm mkdir vm
cd vm cd vm
set cc=lcc -DQ3_VM -S -Wf-target=bytecode -Wf-g -I..\..\cgame -I..\..\game -I..\..\ui %1 set cc=call ..\..\compile.bat
%cc% ../ui_main.c %cc% ../ui_main.c
@if errorlevel 1 goto quit @if errorlevel 1 goto quit

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.21 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.20 2003/03/31 00:23:18 makro // Revision 1.20 2003/03/31 00:23:18 makro
// Replacements and stuff // Replacements and stuff
// //
@ -615,7 +618,8 @@ void UI_DrawNamedPic(float x, float y, float width, float height, const char *pi
hShader = trap_R_RegisterShaderNoMip(picname); hShader = trap_R_RegisterShaderNoMip(picname);
UI_AdjustFrom640(&x, &y, &width, &height); UI_AdjustFrom640(&x, &y, &width, &height);
trap_R_DrawStretchPic(x, y, width, height, 0, 0, 1, 1, hShader); //trap_R_DrawStretchPic(x, y, width, height, 0, 0, 1, 1, hShader);
uiInfo.uiDC.drawStretchPic(x, y, width, height, 0, 0, 1, 1, hShader);
} }
void UI_DrawHandlePic(float x, float y, float w, float h, qhandle_t hShader) void UI_DrawHandlePic(float x, float y, float w, float h, qhandle_t hShader)
@ -644,7 +648,8 @@ void UI_DrawHandlePic(float x, float y, float w, float h, qhandle_t hShader)
} }
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
trap_R_DrawStretchPic(x, y, w, h, s0, t0, s1, t1, hShader); //trap_R_DrawStretchPic(x, y, w, h, s0, t0, s1, t1, hShader);
uiInfo.uiDC.drawStretchPic(x, y, w, h, s0, t0, s1, t1, hShader);
} }
/* /*
@ -659,7 +664,8 @@ void UI_FillRect(float x, float y, float width, float height, const float *color
trap_R_SetColor(color); trap_R_SetColor(color);
UI_AdjustFrom640(&x, &y, &width, &height); UI_AdjustFrom640(&x, &y, &width, &height);
trap_R_DrawStretchPic(x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y, width, height, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
trap_R_SetColor(NULL); trap_R_SetColor(NULL);
} }
@ -667,15 +673,19 @@ void UI_FillRect(float x, float y, float width, float height, const float *color
void UI_DrawSides(float x, float y, float w, float h) void UI_DrawSides(float x, float y, float w, float h)
{ {
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
trap_R_DrawStretchPic(x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
trap_R_DrawStretchPic(x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x + w - 1, y, 1, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
} }
void UI_DrawTopBottom(float x, float y, float w, float h) void UI_DrawTopBottom(float x, float y, float w, float h)
{ {
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
trap_R_DrawStretchPic(x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
trap_R_DrawStretchPic(x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y + h - 1, w, 1, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
} }
/* /*

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.26 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.25 2003/04/19 17:41:26 jbravo // Revision 1.25 2003/04/19 17:41:26 jbravo
// Applied changes that where in 1.29h -> 1.32b gamecode. // Applied changes that where in 1.29h -> 1.32b gamecode.
// //
@ -262,6 +265,9 @@ extern vmCvar_t ui_RQ3_refPassword;
extern vmCvar_t ui_RQ3_teamName; extern vmCvar_t ui_RQ3_teamName;
extern vmCvar_t ui_RQ3_teamModel; extern vmCvar_t ui_RQ3_teamModel;
//Makro - maxpolys hack
extern vmCvar_t ui_maxpolys;
// //
// ui_qmenu.c // ui_qmenu.c
// //
@ -1005,7 +1011,6 @@ typedef struct {
//Makro - weapon/item bans //Makro - weapon/item bans
int weapBan, itemBan; int weapBan, itemBan;
} uiInfo_t; } uiInfo_t;
extern uiInfo_t uiInfo; extern uiInfo_t uiInfo;

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.81 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.80 2004/03/12 11:26:05 makro // Revision 1.80 2004/03/12 11:26:05 makro
// no message // no message
// //
@ -467,7 +470,9 @@ This must be the very first function compiled into the .qvm file
================ ================
*/ */
vmCvar_t ui_new; vmCvar_t ui_new;
vmCvar_t ui_debug; //Makro - renamed to ui_developer
//vmCvar_t ui_debug;
vmCvar_t ui_developer;
vmCvar_t ui_initialized; vmCvar_t ui_initialized;
vmCvar_t ui_teamArenaFirstRun; vmCvar_t ui_teamArenaFirstRun;
@ -588,20 +593,44 @@ void AssetCache()
uiInfo.newHighScoreSound = trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav", qfalse); uiInfo.newHighScoreSound = trap_S_RegisterSound("sound/feedback/voc_newhighscore.wav", qfalse);
} }
//Makro - angled rectangles
void _UI_DrawAngledRect(float x, float y, float w, float h, const float *u, const float *v, float size, const float *color, unsigned char type)
{
float p[2], p2[2];
p[0] = x;
p[1] = y;
Vector2MA(p, w, u, p2);
Vector2MA(p2, h, v, p2);
if (type & RECT_TOPBOTTOM) {
uiInfo.uiDC.drawAngledPic(p[0], p[1], w, size, u, v, color, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawAngledPic(p2[0], p2[1], -w, -size, u, v, color, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
}
if (type & RECT_SIDES) {
uiInfo.uiDC.drawAngledPic(p[0], p[1], size, h, u, v, color, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawAngledPic(p2[0], p2[1], -size, -h, u, v, color, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
}
}
void _UI_DrawSides(float x, float y, float w, float h, float size) void _UI_DrawSides(float x, float y, float w, float h, float size)
{ {
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
size *= uiInfo.uiDC.xscale; size *= uiInfo.uiDC.xscale;
trap_R_DrawStretchPic(x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
trap_R_DrawStretchPic(x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x + w - size, y, size, h, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
} }
void _UI_DrawTopBottom(float x, float y, float w, float h, float size) void _UI_DrawTopBottom(float x, float y, float w, float h, float size)
{ {
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
size *= uiInfo.uiDC.yscale; size *= uiInfo.uiDC.yscale;
trap_R_DrawStretchPic(x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
trap_R_DrawStretchPic(x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader); //trap_R_DrawStretchPic(x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
uiInfo.uiDC.drawStretchPic(x, y + h - size, w, size, 0, 0, 0, 0, uiInfo.uiDC.whiteShader);
} }
/* /*
@ -623,7 +652,7 @@ void _UI_DrawRect(float x, float y, float width, float height, float size, const
int Text_Width(const char *text, float scale, int limit) int Text_Width(const char *text, float scale, int limit)
{ {
int count, len; int count, len, maxPixels = 0;
float out; float out;
glyphInfo_t *glyph; glyphInfo_t *glyph;
float useScale; float useScale;
@ -639,8 +668,12 @@ int Text_Width(const char *text, float scale, int limit)
useScale = scale * font->glyphScale; useScale = scale * font->glyphScale;
out = 0; out = 0;
if (text) { if (text) {
len = strlen(text); //Makro - strlen doesn't take into account color escape sequences
if (limit > 0 && len > limit) { len = Q_PrintStrlen(text);
//Makro - new feature: negative limit = -max pixels
if (limit < 0) {
maxPixels = -limit;
} else if (limit > 0 && len > limit) {
len = limit; len = limit;
} }
count = 0; count = 0;
@ -651,6 +684,10 @@ int Text_Width(const char *text, float scale, int limit)
} else { } else {
glyph = &font->glyphs[(int) *s]; glyph = &font->glyphs[(int) *s];
out += glyph->xSkip; out += glyph->xSkip;
//Makro - added
if (maxPixels)
if (out > maxPixels)
break;
s++; s++;
count++; count++;
} }
@ -699,6 +736,8 @@ int Text_Height(const char *text, float scale, int limit)
} }
//Makro - added //Makro - added
//FIXME: doesn't take into account color escape sequences
//also, Text_Width now supports pixel limits, not just char count limits
int Text_maxPaintChars(char *text, float scale, float width) int Text_maxPaintChars(char *text, float scale, float width)
{ {
char buf[1024]; char buf[1024];
@ -723,16 +762,20 @@ void Text_PaintChar(float x, float y, float width, float height, float scale, fl
w = width * scale; w = width * scale;
h = height * scale; h = height * scale;
UI_AdjustFrom640(&x, &y, &w, &h); UI_AdjustFrom640(&x, &y, &w, &h);
trap_R_DrawStretchPic(x, y, w, h, s, t, s2, t2, hShader); //trap_R_DrawStretchPic(x, y, w, h, s, t, s2, t2, hShader);
uiInfo.uiDC.drawStretchPic(x, y, w, h, s, t, s2, t2, hShader);
} }
void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style) void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, int style)
{ {
int len, count; int len, count;
qboolean underlined = qfalse;
vec4_t newColor; vec4_t newColor;
glyphInfo_t *glyph;
float useScale; float useScale;
fontInfo_t *font = &uiInfo.uiDC.Assets.textFont; fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
glyphInfo_t *glyph, *uglyph = &font->glyphs[(int)'_']; //Makro - added for underlined chars;
if (scale <= ui_smallFont.value) { if (scale <= ui_smallFont.value) {
font = &uiInfo.uiDC.Assets.smallFont; font = &uiInfo.uiDC.Assets.smallFont;
@ -757,14 +800,23 @@ void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, f
//int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top; //int yadj = Assets.textFont.glyphs[text[i]].bottom + Assets.textFont.glyphs[text[i]].top;
//float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height); //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height);
if (Q_IsColorString(s)) { if (Q_IsColorString(s)) {
memcpy(newColor, g_color_table[ColorIndex(*(s + 1))], sizeof(newColor)); //Makro - new tricks
newColor[3] = color[3]; if (*(s+1) == '*')
trap_R_SetColor(newColor); {
memcpy(newColor, color, sizeof(newColor));
trap_R_SetColor(newColor);
} else if (*(s+1)== '_')
{
underlined ^= qtrue;
} else {
memcpy(newColor, g_color_table[ColorIndex(*(s + 1))], sizeof(newColor));
newColor[3] = color[3];
trap_R_SetColor(newColor);
}
s += 2; s += 2;
continue; continue;
} else { } else {
float yadj = useScale * glyph->top; float yadj = useScale * glyph->top;
if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) {
int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2; int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2;
@ -782,6 +834,12 @@ void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, f
glyph->imageWidth, glyph->imageWidth,
glyph->imageHeight, glyph->imageHeight,
useScale, glyph->s, glyph->t, glyph->s2, glyph->t2, glyph->glyph); useScale, glyph->s, glyph->t, glyph->s2, glyph->t2, glyph->glyph);
//Makro - added
if (underlined)
{
Text_PaintChar(x, y, glyph->imageWidth, uglyph->imageHeight,
useScale, uglyph->s, uglyph->t, uglyph->s2, uglyph->t2, uglyph->glyph);
}
x += (glyph->xSkip * useScale) + adjust; x += (glyph->xSkip * useScale) + adjust;
s++; s++;
@ -792,6 +850,161 @@ void Text_Paint(float x, float y, float scale, vec4_t color, const char *text, f
} }
} }
void UI_AddQuadToScene(qhandle_t hShader, const polyVert_t *verts)
{
polyVert_t mverts[4];
memcpy(mverts, verts, sizeof(mverts));
mverts[0].xyz[0] += uiInfo.uiDC.polyZ;
mverts[1].xyz[0] += uiInfo.uiDC.polyZ;
mverts[2].xyz[0] += uiInfo.uiDC.polyZ;
mverts[3].xyz[0] += uiInfo.uiDC.polyZ;
/*
verts[0].xyz[0] += uiInfo.uiDC.polyZ;
verts[1].xyz[0] += uiInfo.uiDC.polyZ;
verts[2].xyz[0] += uiInfo.uiDC.polyZ;
verts[3].xyz[0] += uiInfo.uiDC.polyZ;
*/
trap_R_AddPolyToScene(hShader, 4, mverts);
/*
verts[0].xyz[0] -= uiInfo.uiDC.polyZ;
verts[1].xyz[0] -= uiInfo.uiDC.polyZ;
verts[2].xyz[0] -= uiInfo.uiDC.polyZ;
verts[3].xyz[0] -= uiInfo.uiDC.polyZ;
*/
uiInfo.uiDC.polyZ += UI_POLY_Z_OFFSET;
uiInfo.uiDC.pendingPolys++;
}
void UI_DrawAngledPic(float x, float y, float w, float h, const float *u, const float *v, const float *color, float s, float t, float s2, float t2, qhandle_t hShader)
{
polyVert_t verts[4];
//memset(verts, 0, sizeof(verts));
verts[0].modulate[0]=verts[1].modulate[0]=verts[2].modulate[0]=verts[3].modulate[0]=((int)(color[0]*255))&255;
verts[0].modulate[1]=verts[1].modulate[1]=verts[2].modulate[1]=verts[3].modulate[1]=((int)(color[1]*255))&255;
verts[0].modulate[2]=verts[1].modulate[2]=verts[2].modulate[2]=verts[3].modulate[2]=((int)(color[2]*255))&255;
verts[0].modulate[3]=verts[1].modulate[3]=verts[2].modulate[3]=verts[3].modulate[3]=((int)(color[3]*255))&255;
verts[0].st[0]=s;
verts[0].st[1]=t;
verts[1].st[0]=s2;
verts[1].st[1]=t;
verts[2].st[0]=s2;
verts[2].st[1]=t2;
verts[3].st[0]=s;
verts[3].st[1]=t2;
/*
VectorSet(verts[0].xyz, 320, 320-x, 240-y);
VectorSet(verts[1].xyz, 320, 320-(x+u[0]*w), 240-(y+u[1]*w));
VectorSet(verts[2].xyz, 320, 320-(x+u[0]*w+v[0]*h), 240-(y+u[1]*w+v[1]*h));
VectorSet(verts[3].xyz, 320, 320-(x+v[0]*h), 240-(y+v[1]*h));
*/
VectorSet(verts[0].xyz, 320, 320-x, 240-y);
VectorSet(verts[1].xyz, 320, verts[0].xyz[1]-u[0]*w, verts[0].xyz[2]-u[1]*w);
VectorSet(verts[2].xyz, 320, verts[1].xyz[1]-v[0]*h, verts[1].xyz[2]-v[1]*h);
VectorSet(verts[3].xyz, 320, verts[0].xyz[1]-v[0]*h, verts[0].xyz[2]-v[1]*h);
//trap_R_AddPolyToScene(hShader, 4, verts);
//uiInfo.uiDC.polyZ += UI_POLY_Z_OFFSET;
//uiInfo.uiDC.pendingPolys++;
UI_AddQuadToScene(hShader, verts);
//trap_R_RenderScene(&uiInfo.uiDC.scene2D);
}
//Makro - angled text
void Text_PaintAngled(float x, float y, const float *u, const float *v, float scale, vec4_t color, const char *text, float adjust, int limit, int style)
{
int len, count;
qboolean underlined = qfalse;
vec4_t newColor;
float useScale;
float p[2], *colorPtr;
fontInfo_t *font = &uiInfo.uiDC.Assets.textFont;
glyphInfo_t *glyph, *uglyph = &font->glyphs[(int)'_']; //Makro - added for underlined chars;
if (scale <= ui_smallFont.value) {
font = &uiInfo.uiDC.Assets.smallFont;
} else if (scale >= ui_bigFont.value) {
font = &uiInfo.uiDC.Assets.bigFont;
}
useScale = scale * font->glyphScale;
if (text) {
// TTimo: FIXME
// const unsigned char *s = text; // bk001206 - unsigned
const char *s = text; // bk001206 - unsigned
//trap_R_SetColor(color);
colorPtr = color;
memcpy(&newColor[0], &color[0], sizeof(vec4_t));
len = strlen(text);
if (limit > 0 && len > limit) {
len = limit;
}
count = 0;
while (s && *s && count < len) {
glyph = &font->glyphs[(int) *s]; // TTimo: FIXME: getting nasty warnings without the cast, hopefully this doesn't break the VM build
if (Q_IsColorString(s)) {
//Makro - new tricks
if (*(s+1) == '*')
{
memcpy(newColor, color, sizeof(newColor));
//trap_R_SetColor(newColor);
colorPtr = color;
} else if (*(s+1)== '_')
{
underlined ^= qtrue;
} else {
memcpy(newColor, g_color_table[ColorIndex(*(s + 1))], sizeof(newColor));
newColor[3] = color[3];
//trap_R_SetColor(newColor);
colorPtr = newColor;
}
s += 2;
continue;
} else {
float yadj = useScale * glyph->top;
if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE)
{
int ofs = style == ITEM_TEXTSTYLE_SHADOWED ? 1 : 2;
colorBlack[3] = newColor[3];
Vector2Set(p, x, y);
Vector2MA(p, ofs, u, p);
Vector2MA(p, ofs-yadj, v, p);
UI_DrawAngledPic(p[0], p[1],
glyph->imageWidth * useScale,
glyph->imageHeight * useScale,
u,v, colorBlack,
glyph->s, glyph->t, glyph->s2, glyph->t2, glyph->glyph);
colorBlack[3] = 1.0;
}
Vector2Set(p, x, y);
Vector2MA(p, -yadj, v, p);
UI_DrawAngledPic(p[0], p[1],
glyph->imageWidth * useScale,
glyph->imageHeight * useScale,
u,v,colorPtr,
glyph->s, glyph->t, glyph->s2, glyph->t2, glyph->glyph);
//Makro - added
if (underlined)
{
UI_DrawAngledPic(x, y, glyph->imageWidth * useScale, uglyph->imageHeight * useScale,
u, v, colorPtr, uglyph->s, uglyph->t, uglyph->s2, uglyph->t2, uglyph->glyph);
}
x += ((glyph->xSkip * useScale) + adjust) * u[0];
y += ((glyph->xSkip * useScale) + adjust) * u[1];
s++;
count++;
}
}
}
}
void Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor, void Text_PaintWithCursor(float x, float y, float scale, vec4_t color, const char *text, int cursorPos, char cursor,
int limit, int style) int limit, int style)
{ {
@ -946,6 +1159,10 @@ void UI_ShowPostGame(qboolean newHigh)
_UI_SetActiveMenu(UIMENU_POSTGAME); _UI_SetActiveMenu(UIMENU_POSTGAME);
} }
//Makro - added
int GMemory();
/* /*
================= =================
_UI_Refresh _UI_Refresh
@ -967,20 +1184,28 @@ void UI_DrawCenteredPic(qhandle_t image, int w, int h)
UI_DrawHandlePic(x, y, w, h, image); UI_DrawHandlePic(x, y, w, h, image);
} }
int frameCount = 0; //int frameCount = 0;
int startTime; //int startTime;
#define UI_FPS_FRAMES 4 #define UI_FPS_FRAMES 4
void _UI_Refresh(int realtime) void _UI_Refresh(int realtime)
{ {
static int index; static int index;
static int previousTimes[UI_FPS_FRAMES]; static int previousTimes[UI_FPS_FRAMES];
//Makro - smoother version
static int FPSCheckTime = 0, frameCount = 0;
int modelModCount; int modelModCount;
//Makro - added
uiClientState_t cstate;
//if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) { //if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) {
// return; // return;
//} //}
uiInfo.uiDC.pendingPolys = 0;
uiInfo.uiDC.polyZ = 0;
uiInfo.uiDC.scene2D.time = realtime;
uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime; uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime;
uiInfo.uiDC.realTime = realtime; uiInfo.uiDC.realTime = realtime;
@ -999,6 +1224,14 @@ void _UI_Refresh(int realtime)
} }
uiInfo.uiDC.FPS = 1000 * UI_FPS_FRAMES / total; uiInfo.uiDC.FPS = 1000 * UI_FPS_FRAMES / total;
} }
frameCount++;
//Makro - smooth (and inaccurate) version
if (realtime > FPSCheckTime)
{
FPSCheckTime = realtime + 1000;
uiInfo.uiDC.smoothFPS = frameCount;
frameCount = 0;
}
modelModCount = ui_RQ3_model.modificationCount; modelModCount = ui_RQ3_model.modificationCount;
UI_UpdateCvars(); UI_UpdateCvars();
@ -1023,14 +1256,89 @@ void _UI_Refresh(int realtime)
// refresh find player list // refresh find player list
UI_BuildFindPlayerList(qfalse); UI_BuildFindPlayerList(qfalse);
} }
//Makro - let's play with the mouse a bit
if (ui_developer.integer)
{
if (uiInfo.uiDC.mouseDown[0] || uiInfo.uiDC.mouseDown[1] || uiInfo.uiDC.mouseDown[2])
{
int dif[2];
float angle, u[2], v[2], norm;
vec4_t linecolor = {0.8f, 0.8f, 0.8f, 0.75f};
dif[0] = uiInfo.uiDC.cursorx;
dif[1] = uiInfo.uiDC.cursory;
Vector2Subtract(dif, uiInfo.uiDC.mouseDownPos, dif);
norm = sqrt(Vector2Norm2(dif));
angle = -RAD2DEG(atan2(dif[1], dif[0]));
Text_Paint(20, 20, 0.225f, colorCyan, va("(%i, %i) - (%i,%i) = (%i, %i) = %.2f = %.3f deg",
uiInfo.uiDC.mouseDownPos[0], uiInfo.uiDC.mouseDownPos[1], uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory,
dif[0], dif[1], norm, angle), 0, 0, ITEM_TEXTSTYLE_SHADOWED);
if (norm)
{
Vector2Scale(dif, 1.0f/norm, u);
//Vector2Set(v, cos(angle), sin(angle));
Vector2Set(v, -u[1], u[0]);
UI_DrawAngledPic(uiInfo.uiDC.mouseDownPos[0], uiInfo.uiDC.mouseDownPos[1], norm, 2, u, v, linecolor, 0, 0, norm/16, 1, uiInfo.uiDC.selectShader);
}
Text_Paint(uiInfo.uiDC.mouseDownPos[0]-4, uiInfo.uiDC.mouseDownPos[1]+6, 0.4f, colorYellow, "x", 0, 0, ITEM_TEXTSTYLE_SHADOWED);
} else {
char *s;
menuDef_t *menu = Menu_GetFocused();
if (menu)
{
s = va("Abs = (%i, %i) Rel = (%.0f, %.0f)", uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory,
uiInfo.uiDC.cursorx - menu->window.rect.x, uiInfo.uiDC.cursory - menu->window.rect.y);
} else {
s = va("(%i, %i)", uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
}
Text_Paint(20, 20, 0.225f, colorCyan, s, 0, 0, ITEM_TEXTSTYLE_SHADOWED);
}
Text_Paint(20, 40, 0.225f, colorCyan, va("%i fps", uiInfo.uiDC.smoothFPS), 0, 0, ITEM_TEXTSTYLE_SHADOWED);
}
//any left-overs?
if (uiInfo.uiDC.pendingPolys)
{
UI_Render2DScene();
}
// draw cursor // draw cursor
UI_SetColor(NULL); UI_SetColor(NULL);
if (Menu_Count() > 0) { trap_GetClientState(&cstate);
if (Menu_Count() > 0 && (cstate.connState != CA_LOADING)) {
float ccolor[4] = {1.0f, 1.0f, 1.0f, 1.0f};
int size = uiInfo.uiDC.cursorSize; int size = uiInfo.uiDC.cursorSize;
if (!size) if (!size)
size = 32; size = 32;
UI_DrawHandlePic(uiInfo.uiDC.cursorx - size/2, uiInfo.uiDC.cursory - size/2, size, size, uiInfo.uiDC.Assets.cursor); if (uiInfo.uiDC.mouseDown[0] || uiInfo.uiDC.mouseDown[1] || uiInfo.uiDC.mouseDown[2])
{
ccolor[0] = 1.00f;
ccolor[1] = 0.50f;
ccolor[2] = 0.25f;
}
UI_SetColor(ccolor);
UI_DrawHandlePic(uiInfo.uiDC.cursorx - (size>>1), uiInfo.uiDC.cursory - (size>>1), size, size, uiInfo.uiDC.Assets.cursor);
UI_SetColor(NULL);
} }
//Makro - draw overlay
//is fading ?
if (IsBetween(realtime, uiInfo.uiDC.overlayFadeStart, uiInfo.uiDC.overlayFadeEnd)) {
float oColor[4];
float amt = (float) (realtime - uiInfo.uiDC.overlayFadeStart) / (uiInfo.uiDC.overlayFadeEnd - uiInfo.uiDC.overlayFadeStart);
LerpColor(uiInfo.uiDC.overlayColor, uiInfo.uiDC.overlayColor2, oColor, amt);
if (oColor[3] != 0.0f) {
UI_SetColor(oColor);
uiInfo.uiDC.drawStretchPic(0, 0, uiInfo.uiDC.glconfig.vidWidth, uiInfo.uiDC.glconfig.vidHeight, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
UI_SetColor(NULL);
}
} else {
if (uiInfo.uiDC.overlayColor2[3] != 0.0f) {
UI_SetColor(uiInfo.uiDC.overlayColor2);
uiInfo.uiDC.drawStretchPic(0, 0, uiInfo.uiDC.glconfig.vidWidth, uiInfo.uiDC.glconfig.vidHeight, 0, 0, 1, 1, uiInfo.uiDC.whiteShader);
UI_SetColor(NULL);
}
}
#ifndef NDEBUG #ifndef NDEBUG
if (uiInfo.uiDC.debug) { if (uiInfo.uiDC.debug) {
// cursor coordinates // cursor coordinates
@ -2439,6 +2747,25 @@ static void UI_DrawCrosshair(rectDef_t * rect, float scale, vec4_t color)
trap_R_SetColor(NULL); trap_R_SetColor(NULL);
} }
//Makro - digital clock
static void UI_DrawClock(itemDef_t *item, rectDef_t * rect, float scale, vec4_t color, int textStyle)
{
int time = uiInfo.uiDC.realTime;
char *text;
qtime_t qt;
trap_RealTime(&qt);
text = va("%02i:%02i", qt.tm_hour, qt.tm_min);
if (!item->window.rectClient.hasVectors) {
Text_Paint(rect->x, rect->y, scale, color, text, 0, 0, textStyle);
} else {
Text_PaintAngled(rect->x, rect->y,
item->window.rectClient.u, item->window.rectClient.v, scale, color, text, 0, 0, textStyle);
}
}
//Makro - for the SSG crosshair preview //Makro - for the SSG crosshair preview
static void UI_DrawSSGCrosshair(rectDef_t * rect) static void UI_DrawSSGCrosshair(rectDef_t * rect)
{ {
@ -2725,7 +3052,7 @@ void UI_SelectReplacement(void)
void UI_BuildReplacementList(const char *type) void UI_BuildReplacementList(const char *type)
{ {
int i, numfiles, filelen; int i, numfiles, filelen;
char filelist[2048], *fileptr; char filelist[8192], *fileptr;
if (!type || !*type) if (!type || !*type)
return; return;
@ -3101,49 +3428,6 @@ static void UI_DrawReplacementSubtype(rectDef_t * rect, float scale, vec4_t colo
} }
static void UI_DrawReplacementModel(rectDef_t *rect) static void UI_DrawReplacementModel(rectDef_t *rect)
/*
{
refdef_t refdef;
refEntity_t model;
vec3_t mins, maxs, origin;
float x = rect->x, y = rect->y, w = rect->w, h = rect->h;
float len;
memset(&refdef, 0, sizeof(refdef));
memset(&model, 0, sizeof(model));
refdef.rdflags = RDF_NOWORLDMODEL;
AxisClear(refdef.viewaxis);
UI_AdjustFrom640(&x, &y, &w, &h);
refdef.x = x;
refdef.y = y;
refdef.width = w;
refdef.height = h;
model.hModel = uiInfo.replacementModel;
model.customSkin = uiInfo.replacementSkin;
uiInfo.uiDC.modelBounds(model.hModel, mins, maxs);
len = 0.5 * (maxs[2] - mins[2]);
origin[0] = len / 0.268;
origin[2] = -0.5 * (mins[2] + maxs[2]);
origin[1] = 0.5 * (mins[1] + maxs[1]);
refdef.fov_x = 90;
refdef.fov_y = 90;
trap_R_ClearScene();
VectorCopy(origin, model.origin);
VectorCopy(origin, model.lightingOrigin);
model.renderfx = RF_LIGHTING_ORIGIN | RF_NOSHADOW;
VectorCopy(model.origin, model.oldorigin);
trap_R_AddRefEntityToScene(&model);
trap_R_RenderScene(&refdef);
}
*/
{ {
float x, y, w, h; float x, y, w, h;
refdef_t refdef; refdef_t refdef;
@ -3229,16 +3513,31 @@ static void UI_DrawReplacementModel(rectDef_t *rect)
// FIXME: table drive // FIXME: table drive
// //
static void UI_OwnerDraw(float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, //Makro - going to... eventually
static void UI_OwnerDraw(itemDef_t *item, float x, float y, float w, float h, float text_x, float text_y, int ownerDraw,
int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader, int ownerDrawFlags, int align, float special, float scale, vec4_t color, qhandle_t shader,
int textStyle) int textStyle)
{ {
rectDef_t rect; rectDef_t rect;
rect.x = x + text_x;
rect.y = y + text_y;
rect.w = w; rect.w = w;
rect.h = h; rect.h = h;
if (item->window.rectClient.hasVectors)
{
float p[2];
p[0] = x;
p[1] = y;
Vector2Copy(item->window.rectClient.u, rect.u);
Vector2Copy(item->window.rectClient.v, rect.v);
Vector2MA(p, text_x, rect.u, p);
Vector2MA(p, text_y, rect.v, p);
rect.x = p[0];
rect.y = p[1];
} else {
rect.x = x + text_x;
rect.y = y + text_y;
}
switch (ownerDraw) { switch (ownerDraw) {
case UI_HANDICAP: case UI_HANDICAP:
@ -3382,6 +3681,9 @@ static void UI_OwnerDraw(float x, float y, float w, float h, float text_x, float
case UI_SSG_CROSSHAIR: case UI_SSG_CROSSHAIR:
UI_DrawSSGCrosshair(&rect); UI_DrawSSGCrosshair(&rect);
break; break;
case UI_CLOCK:
UI_DrawClock(item, &rect, scale, color, textStyle);
break;
//Makro - radio presets //Makro - radio presets
case UI_RQ3_RADIOPRESET1: case UI_RQ3_RADIOPRESET1:
case UI_RQ3_RADIOPRESET2: case UI_RQ3_RADIOPRESET2:
@ -5775,7 +6077,7 @@ static void UI_BuildServerDisplayList(qboolean force)
if (len == 0) { if (len == 0) {
//Makro - changing from Team Arena to RQ3 beta2 //Makro - changing from Team Arena to RQ3 beta2
//strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!"); //strcpy(uiInfo.serverStatus.motd, "Welcome to Team Arena!");
strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 v3.2 *** "); strcpy(uiInfo.serverStatus.motd, " *** Welcome to Reaction Quake 3 v3.3 *** ");
len = strlen(uiInfo.serverStatus.motd); len = strlen(uiInfo.serverStatus.motd);
} }
if (len != uiInfo.serverStatus.motdLen) { if (len != uiInfo.serverStatus.motdLen) {
@ -7235,6 +7537,37 @@ void UI_RQ3_StartBackgroundTrack(const char *intro, const char *loop)
} }
} }
void UI_Render2DScene()
{
trap_R_RenderScene(&uiInfo.uiDC.scene2D);
uiInfo.uiDC.pendingPolys = 0;
}
void UI_ClearScene()
{
if (uiInfo.uiDC.pendingPolys)
{
UI_Render2DScene();
}
trap_R_ClearScene();
}
void UI_RenderScene(const refdef_t *ref)
{
trap_R_RenderScene(ref);
trap_R_ClearScene();
}
void UI_DrawPolyStretchPic(float x, float y, float w, float h, float s1, float t1, float s2, float t2, qhandle_t hShader)
{
if (uiInfo.uiDC.pendingPolys)
{
UI_Render2DScene();
}
trap_R_DrawStretchPic(x, y, w, h, s1, t1, s2, t2, hShader);
}
/* /*
================= =================
UI_Init UI_Init
@ -7253,9 +7586,16 @@ void _UI_Init(qboolean inGameLoad)
UI_RegisterCvars(); UI_RegisterCvars();
UI_InitMemory(); UI_InitMemory();
// cache redundant calulations // cache redundant calulations
trap_GetGlconfig(&uiInfo.uiDC.glconfig); trap_GetGlconfig(&uiInfo.uiDC.glconfig);
if (ui_maxpolys.integer < 4096)
{
trap_Cvar_SetValue("r_maxpolys", 4096);
trap_Cmd_ExecuteText(EXEC_INSERT, "vid_restart");
}
// for 640x480 virtualized screen // for 640x480 virtualized screen
uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0 / 480.0); uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0 / 480.0);
uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0 / 640.0); uiInfo.uiDC.xscale = uiInfo.uiDC.glconfig.vidWidth * (1.0 / 640.0);
@ -7268,12 +7608,28 @@ void _UI_Init(qboolean inGameLoad)
uiInfo.uiDC.bias = 0; uiInfo.uiDC.bias = 0;
} }
memset(&uiInfo.uiDC.scene2D, 0, sizeof(&uiInfo.uiDC.scene2D));
uiInfo.uiDC.scene2D.x = 0;
uiInfo.uiDC.scene2D.y = 0;
uiInfo.uiDC.scene2D.width = 640 * uiInfo.uiDC.xscale;
uiInfo.uiDC.scene2D.height = 480 * uiInfo.uiDC.yscale ;
uiInfo.uiDC.scene2D.fov_x = 90;
uiInfo.uiDC.scene2D.fov_y = 73.739795291688f;
uiInfo.uiDC.scene2D.rdflags = RDF_NOWORLDMODEL;
AxisClear(uiInfo.uiDC.scene2D.viewaxis);
//UI_Load(); //UI_Load();
uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip;
uiInfo.uiDC.setColor = &UI_SetColor; uiInfo.uiDC.setColor = &UI_SetColor;
uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic; uiInfo.uiDC.drawHandlePic = &UI_DrawHandlePic;
uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic; //uiInfo.uiDC.drawStretchPic = &trap_R_DrawStretchPic;
uiInfo.uiDC.drawStretchPic = &UI_DrawPolyStretchPic;
//Makro - angled pictures
uiInfo.uiDC.drawAngledPic = &UI_DrawAngledPic;
uiInfo.uiDC.drawText = &Text_Paint; uiInfo.uiDC.drawText = &Text_Paint;
//Makro - angled text
uiInfo.uiDC.drawAngledText = &Text_PaintAngled;
uiInfo.uiDC.textWidth = &Text_Width; uiInfo.uiDC.textWidth = &Text_Width;
uiInfo.uiDC.textHeight = &Text_Height; uiInfo.uiDC.textHeight = &Text_Height;
uiInfo.uiDC.registerModel = &trap_R_RegisterModel; uiInfo.uiDC.registerModel = &trap_R_RegisterModel;
@ -7282,10 +7638,14 @@ void _UI_Init(qboolean inGameLoad)
uiInfo.uiDC.drawRect = &_UI_DrawRect; uiInfo.uiDC.drawRect = &_UI_DrawRect;
uiInfo.uiDC.drawSides = &_UI_DrawSides; uiInfo.uiDC.drawSides = &_UI_DrawSides;
uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom; uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom;
uiInfo.uiDC.clearScene = &trap_R_ClearScene; //Makro - angled rectangles
uiInfo.uiDC.drawSides = &_UI_DrawSides; uiInfo.uiDC.drawAngledRect = &_UI_DrawAngledRect;
//Makro - changed
//uiInfo.uiDC.clearScene = &trap_R_ClearScene;
uiInfo.uiDC.clearScene = &UI_ClearScene;
uiInfo.uiDC.addRefEntityToScene = &trap_R_AddRefEntityToScene; uiInfo.uiDC.addRefEntityToScene = &trap_R_AddRefEntityToScene;
uiInfo.uiDC.renderScene = &trap_R_RenderScene; //uiInfo.uiDC.renderScene = &trap_R_RenderScene;
uiInfo.uiDC.renderScene = &UI_RenderScene;
uiInfo.uiDC.registerFont = &trap_R_RegisterFont; uiInfo.uiDC.registerFont = &trap_R_RegisterFont;
uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw; uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw;
uiInfo.uiDC.getValue = &UI_GetValue; uiInfo.uiDC.getValue = &UI_GetValue;
@ -7329,6 +7689,8 @@ void _UI_Init(qboolean inGameLoad)
uiInfo.uiDC.cursor = trap_R_RegisterShaderNoMip("menu/art/3_cursor2"); uiInfo.uiDC.cursor = trap_R_RegisterShaderNoMip("menu/art/3_cursor2");
uiInfo.uiDC.whiteShader = trap_R_RegisterShaderNoMip("white"); uiInfo.uiDC.whiteShader = trap_R_RegisterShaderNoMip("white");
//Makro - added; almost useless
uiInfo.uiDC.selectShader = trap_R_RegisterShaderNoMip("selectshader");
AssetCache(); AssetCache();
@ -7406,6 +7768,9 @@ void _UI_Init(qboolean inGameLoad)
trap_Cvar_Register(NULL, "debug_protocol", "", 0); trap_Cvar_Register(NULL, "debug_protocol", "", 0);
trap_Cvar_Set("ui_actualNetGameType", va("%d", ui_netGameType.integer)); trap_Cvar_Set("ui_actualNetGameType", va("%d", ui_netGameType.integer));
uiInfo.uiDC.cursorx = 320;
uiInfo.uiDC.cursory = 240;
} }
/* /*
@ -7415,6 +7780,18 @@ UI_KeyEvent
*/ */
void _UI_KeyEvent(int key, qboolean down) void _UI_KeyEvent(int key, qboolean down)
{ {
//Makro - for the cursor
if (key == K_MOUSE1)
{
uiInfo.uiDC.mouseDown[0] = down;
Vector2Set(uiInfo.uiDC.mouseDownPos, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
} else if (key == K_MOUSE2) {
uiInfo.uiDC.mouseDown[1] = down;
Vector2Set(uiInfo.uiDC.mouseDownPos, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
} else if (key == K_MOUSE3) {
uiInfo.uiDC.mouseDown[2] = down;
Vector2Set(uiInfo.uiDC.mouseDownPos, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
}
if (Menu_Count() > 0) { if (Menu_Count() > 0) {
menuDef_t *menu = Menu_GetFocused(); menuDef_t *menu = Menu_GetFocused();
@ -7461,7 +7838,6 @@ void _UI_MouseEvent(int dx, int dy)
//Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory); //Menu_HandleMouseMove(menu, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory); Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory);
} }
} }
void UI_LoadNonIngame() void UI_LoadNonIngame()
@ -8010,6 +8386,8 @@ vmCvar_t ui_RQ3_joinAddress;
vmCvar_t ui_RQ3_joinPort; vmCvar_t ui_RQ3_joinPort;
//Makro - demo name //Makro - demo name
vmCvar_t ui_RQ3_demoName; vmCvar_t ui_RQ3_demoName;
//Makro - maxpolys hack
vmCvar_t ui_maxpolys;
//Makro - matchmode settings //Makro - matchmode settings
vmCvar_t ui_RQ3_timelimit; vmCvar_t ui_RQ3_timelimit;
vmCvar_t ui_RQ3_roundlimit; vmCvar_t ui_RQ3_roundlimit;
@ -8119,7 +8497,9 @@ static cvarTable_t cvarTable[] = {
{&ui_server16, "server16", "", CVAR_ARCHIVE}, {&ui_server16, "server16", "", CVAR_ARCHIVE},
{&ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM}, {&ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM},
{&ui_new, "ui_new", "0", CVAR_TEMP}, {&ui_new, "ui_new", "0", CVAR_TEMP},
{&ui_debug, "ui_debug", "0", CVAR_TEMP}, //Makro - renamed to ui_developer
//{&ui_debug, "ui_debug", "0", CVAR_TEMP},
{&ui_developer, "ui_developer", "0", CVAR_TEMP},
{&ui_initialized, "ui_initialized", "0", CVAR_TEMP}, {&ui_initialized, "ui_initialized", "0", CVAR_TEMP},
{&ui_teamName, "ui_teamName", "Pagans", CVAR_ARCHIVE}, {&ui_teamName, "ui_teamName", "Pagans", CVAR_ARCHIVE},
{&ui_opponentName, "ui_opponentName", "Stroggs", CVAR_ARCHIVE}, {&ui_opponentName, "ui_opponentName", "Stroggs", CVAR_ARCHIVE},
@ -8199,6 +8579,8 @@ static cvarTable_t cvarTable[] = {
{&ui_RQ3_joinPort, "ui_RQ3_joinPort", "27960", CVAR_ARCHIVE}, {&ui_RQ3_joinPort, "ui_RQ3_joinPort", "27960", CVAR_ARCHIVE},
//Makro - demo name //Makro - demo name
{&ui_RQ3_demoName, "ui_RQ3_demoName", "", 0}, {&ui_RQ3_demoName, "ui_RQ3_demoName", "", 0},
//Makro - maxpolys hack
{&ui_maxpolys, "r_maxpolys", "4096", CVAR_ARCHIVE},
//Makro - matchmode settings //Makro - matchmode settings
{&ui_RQ3_timelimit, "ui_RQ3_timelimit", "0", 0}, {&ui_RQ3_timelimit, "ui_RQ3_timelimit", "0", 0},
{&ui_RQ3_roundlimit, "ui_RQ3_roundlimit", "0", 0}, {&ui_RQ3_roundlimit, "ui_RQ3_roundlimit", "0", 0},
@ -8266,7 +8648,6 @@ void UI_RegisterCvars(void)
trap_Cvar_Register(cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags); trap_Cvar_Register(cv->vmCvar, cv->cvarName, cv->defaultString, cv->cvarFlags);
} }
} }
/* /*
================= =================
UI_UpdateCvars UI_UpdateCvars
@ -8427,3 +8808,4 @@ static void UI_StartServerRefresh(qboolean full)
} }
} }
} }

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.8 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.7 2003/03/28 10:36:03 jbravo // Revision 1.7 2003/03/28 10:36:03 jbravo
// Tweaking the replacement system a bit. Reactionmale now the default model // Tweaking the replacement system a bit. Reactionmale now the default model
// //
@ -751,7 +754,9 @@ void UI_DrawPlayer(float x, float y, float w, float h, playerInfo_t * pi, int ti
refdef.time = dp_realtime; refdef.time = dp_realtime;
trap_R_ClearScene(); //trap_R_ClearScene();
uiInfo.uiDC.clearScene();
// get the rotation information // get the rotation information
UI_PlayerAngles(pi, legs.axis, torso.axis, head.axis); UI_PlayerAngles(pi, legs.axis, torso.axis, head.axis);
@ -890,7 +895,8 @@ void UI_DrawPlayer(float x, float y, float w, float h, playerInfo_t * pi, int ti
origin[2] -= 100; origin[2] -= 100;
trap_R_AddLightToScene(origin, 500, 1.0, 0.0, 0.0); trap_R_AddLightToScene(origin, 500, 1.0, 0.0, 0.0);
trap_R_RenderScene(&refdef); //trap_R_RenderScene(&refdef);
uiInfo.uiDC.renderScene(&refdef);
} }
/* /*

File diff suppressed because it is too large Load diff

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.20 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.19 2003/04/06 21:46:56 makro // Revision 1.19 2003/04/06 21:46:56 makro
// no message // no message
// //
@ -76,8 +79,9 @@
#define MAX_MENUDEFFILE 4096 #define MAX_MENUDEFFILE 4096
#define MAX_MENUFILE 32768 #define MAX_MENUFILE 32768
#define MAX_MENUS 64 #define MAX_MENUS 64
//Makro - changed max item count from 96 //Makro - changed max item count from 96 to 100
#define MAX_MENUITEMS 100 //Makro - changed to 192
#define MAX_MENUITEMS 192
#define MAX_COLOR_RANGES 10 #define MAX_COLOR_RANGES 10
#define MAX_OPEN_MENUS 16 #define MAX_OPEN_MENUS 16
@ -105,6 +109,9 @@
#define WINDOW_POPUP 0x00200000 // popup #define WINDOW_POPUP 0x00200000 // popup
#define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set #define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set
#define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented ) #define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented )
//Makro - ugliest hack ever... by far
#define WINDOW_RENDERPOINT 0x01000000
// CGAME cursor type bits // CGAME cursor type bits
#define CURSOR_NONE 0x00000001 #define CURSOR_NONE 0x00000001
@ -160,10 +167,19 @@ typedef struct {
float y; // vert position float y; // vert position
float w; // width float w; // width
float h; // height; float h; // height;
qboolean hasVectors;
float u[2], v[2];
} rectDef_t; } rectDef_t;
typedef rectDef_t Rectangle; typedef rectDef_t Rectangle;
//Makro - point
typedef struct {
float x;
float y;
} pointDef_t;
typedef pointDef_t Point;
//Makro - for the new fading method //Makro - for the new fading method
typedef struct { typedef struct {
vec4_t color1; vec4_t color1;
@ -173,6 +189,11 @@ typedef struct {
int startTime, endTime; int startTime, endTime;
} timeFade_t; } timeFade_t;
#define MAX_SHORTCUT_KEYS 8
//-----------------------------------------------
// FIXME: do something to separate text vs window stuff // FIXME: do something to separate text vs window stuff
typedef struct { typedef struct {
Rectangle rect; // client coord rectangle Rectangle rect; // client coord rectangle
@ -180,7 +201,7 @@ typedef struct {
const char *name; // const char *name; //
//Makro - adding support for shortcut keys //Makro - adding support for shortcut keys
//const char *shortcutKey; //const char *shortcutKey;
int shortcutKey; int shortcutKey[MAX_SHORTCUT_KEYS];
//Makro - drop shadow effect //Makro - drop shadow effect
int shadowStyle; int shadowStyle;
const char *group; // if it belongs to a group const char *group; // if it belongs to a group
@ -305,8 +326,8 @@ typedef struct itemDef_s {
const char *action; // select script const char *action; // select script
const char *onFocus; // select script const char *onFocus; // select script
const char *leaveFocus; // select script const char *leaveFocus; // select script
//Makro - extra action executed when the timer shows this item //Makro - action executed when the timer shows/hides this item
const char *onTimer; const char *onTimerShow, *onTimerHide;
const char *cvar; // associated cvar const char *cvar; // associated cvar
const char *cvarTest; // associated cvar for enable actions const char *cvarTest; // associated cvar for enable actions
const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list
@ -317,6 +338,7 @@ typedef struct itemDef_s {
float special; // used for feeder id's etc.. diff per type float special; // used for feeder id's etc.. diff per type
int cursorPos; // cursor position in characters int cursorPos; // cursor position in characters
void *typeData; // type specific data ptr's void *typeData; // type specific data ptr's
//Makro - color to fade when
} itemDef_t; } itemDef_t;
typedef struct { typedef struct {
@ -334,6 +356,8 @@ typedef struct {
const char *onESC; // run when the menu is closed const char *onESC; // run when the menu is closed
//Makro - executed when all the items in a timed sequence have been shown //Makro - executed when all the items in a timed sequence have been shown
const char *onFinishTimer; const char *onFinishTimer;
//Makro - extra action to be executed on shown/hidden timer items
const char *onTimerShow, *onTimerHide;
//Makro - executed when the menu is shown //Makro - executed when the menu is shown
const char *onShow; const char *onShow;
const char *onFirstShow; const char *onFirstShow;
@ -349,7 +373,7 @@ typedef struct {
//Makro - timer is on/off //Makro - timer is on/off
qboolean timerEnabled; qboolean timerEnabled;
int nextTimer, timerInterval, timedItems, timerPos; int nextTimer, timerInterval, timedItems, timerPos, timerMaxDisplay;
} menuDef_t; } menuDef_t;
typedef struct { typedef struct {
@ -402,14 +426,29 @@ typedef struct {
void (*handler) (itemDef_t * item, char **args); void (*handler) (itemDef_t * item, char **args);
} commandDef_t; } commandDef_t;
//Makro - added for packing bits
#define GETBIT(intvec, pos) ( ( ((intvec)[(pos)>>5]) & (1<<((pos) & 31)) ) != 0 )
#define SETBIT(intvec, pos, bit) if (bit)\
(intvec)[(pos)>>5] |= (1 << ((pos) & 31));\
else\
(intvec)[(pos)>>5] &= ~(1 << ((pos) & 31))\
typedef struct { typedef struct {
qhandle_t(*registerShaderNoMip) (const char *p); qhandle_t(*registerShaderNoMip) (const char *p);
void (*setColor) (const vec4_t v); void (*setColor) (const vec4_t v);
void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset); void (*drawHandlePic) (float x, float y, float w, float h, qhandle_t asset);
void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2, void (*drawStretchPic) (float x, float y, float w, float h, float s1, float t1, float s2, float t2,
qhandle_t hShader); qhandle_t hShader);
//Makro - angled pictures
void (*drawAngledPic) (float x, float y, float w, float h, const float *u, const float *v, const float *color, float s1, float t1, float s2, float t2,
qhandle_t hShader);
void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit, void (*drawText) (float x, float y, float scale, vec4_t color, const char *text, float adjust, int limit,
int style); int style);
//Makro - angled text
void (*drawAngledText) (float x, float y, const float *u, const float *v, float scale, vec4_t color, const char *text, float adjust, int limit,
int style);
int (*textWidth) (const char *text, float scale, int limit); int (*textWidth) (const char *text, float scale, int limit);
int (*textHeight) (const char *text, float scale, int limit); int (*textHeight) (const char *text, float scale, int limit);
qhandle_t(*registerModel) (const char *p); qhandle_t(*registerModel) (const char *p);
@ -417,12 +456,14 @@ typedef struct {
void (*fillRect) (float x, float y, float w, float h, const vec4_t color); void (*fillRect) (float x, float y, float w, float h, const vec4_t color);
void (*drawRect) (float x, float y, float w, float h, float size, const vec4_t color); void (*drawRect) (float x, float y, float w, float h, float size, const vec4_t color);
void (*drawSides) (float x, float y, float w, float h, float size); void (*drawSides) (float x, float y, float w, float h, float size);
void (*drawAngledRect) (float x, float y, float w, float h, const float *u, const float *v, float size, const float *color, unsigned char type);
void (*drawTopBottom) (float x, float y, float w, float h, float size); void (*drawTopBottom) (float x, float y, float w, float h, float size);
void (*clearScene) (); void (*clearScene) ();
void (*addRefEntityToScene) (const refEntity_t * re); void (*addRefEntityToScene) (const refEntity_t * re);
void (*renderScene) (const refdef_t * fd); void (*renderScene) (const refdef_t * fd);
void (*registerFont) (const char *pFontname, int pointSize, fontInfo_t * font); void (*registerFont) (const char *pFontname, int pointSize, fontInfo_t * font);
void (*ownerDrawItem) (float x, float y, float w, float h, float text_x, float text_y, int ownerDraw, //Makro - aded item
void (*ownerDrawItem) (itemDef_t *item, float x, float y, float w, float h, float text_x, float text_y, int ownerDraw,
int ownerDrawFlags, int align, float special, float scale, vec4_t color, int ownerDrawFlags, int align, float special, float scale, vec4_t color,
qhandle_t shader, int textStyle); qhandle_t shader, int textStyle);
float (*getValue) (int ownerDraw); float (*getValue) (int ownerDraw);
@ -467,6 +508,9 @@ typedef struct {
int cursory; int cursory;
//Makro - added cursor size //Makro - added cursor size
int cursorSize; int cursorSize;
//Makro - mouse down
qboolean mouseDown[3];
int mouseDownPos[2];
qboolean debug; qboolean debug;
cachedAssets_t Assets; cachedAssets_t Assets;
@ -475,8 +519,21 @@ typedef struct {
qhandle_t whiteShader; qhandle_t whiteShader;
qhandle_t gradientImage; qhandle_t gradientImage;
qhandle_t cursor; qhandle_t cursor;
//Makro - added; almost useless
qhandle_t selectShader;
float FPS; float FPS;
//Makro - added
int smoothFPS;
//Makro - vector items speed hack
int pendingPolys;
//and a z-order hack
float polyZ;
refdef_t scene2D;
//Makro - fade in/out
float overlayColor[4], overlayColor2[4];
int overlayFadeStart, overlayFadeEnd;
//Makro - keep track of key presses
int keysStatus[1024/(8*sizeof(int))];
} displayContextDef_t; } displayContextDef_t;
const char *String_Alloc(const char *p); const char *String_Alloc(const char *p);
@ -545,4 +602,15 @@ int trap_PC_FreeSource(int handle);
int trap_PC_ReadToken(int handle, pc_token_t * pc_token); int trap_PC_ReadToken(int handle, pc_token_t * pc_token);
int trap_PC_SourceFileAndLine(int handle, char *filename, int *line); int trap_PC_SourceFileAndLine(int handle, char *filename, int *line);
//Makro - new rendering stuff
void UI_AddQuadToScene(qhandle_t hShader, const polyVert_t *verts);
void UI_Render2DScene();
#define UI_POLY_Z_OFFSET -0.00001f
//Makro - for all the lazy people
#define IsBetween(a, min, max) ( (a) >= (min) && (a) <= (max) )
#define RECT_SIDES 1
#define RECT_TOPBOTTOM 2
#define RECT_FULL 3
#endif #endif

View file

@ -5,6 +5,9 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Log$ // $Log$
// Revision 1.5 2005/02/15 16:33:39 makro
// Tons of updates (entity tree attachment system, UI vectors)
//
// Revision 1.4 2002/01/11 19:48:31 jbravo // Revision 1.4 2002/01/11 19:48:31 jbravo
// Formatted the source in non DOS format. // Formatted the source in non DOS format.
// //
@ -5474,11 +5477,15 @@ qboolean MenuParse_itemDef( itemDef_t *item, int handle ) {
if (menu->itemCount < MAX_MENUITEMS) { if (menu->itemCount < MAX_MENUITEMS) {
menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t)); menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t));
Item_Init(menu->items[menu->itemCount]); Item_Init(menu->items[menu->itemCount]);
//was below
menu->items[menu->itemCount]->parent = menu;
if (!Item_Parse(handle, menu->items[menu->itemCount])) { if (!Item_Parse(handle, menu->items[menu->itemCount])) {
return qfalse; return qfalse;
} }
Item_InitControls(menu->items[menu->itemCount]); Item_InitControls(menu->items[menu->itemCount]);
menu->items[menu->itemCount++]->parent = menu; //Makro - moved above
//menu->items[menu->itemCount++]->parent = menu;
menu->itemCount++;
} }
return qtrue; return qtrue;
} }

View file

@ -308,26 +308,26 @@
decoration decoration
} }
//Back ///Back
itemdef { itemdef {
name "btn_back" name "btn_back"
style WINDOW_STYLE_SHADER shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
type 1 style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close cdkey_menu ; open setup_menu ; } type 1
visible 1
action { close *self; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
timeFade back_hint forecolor .9 .9 .9 0 0 250 } timeFade back_hint forecolor .9 .9 .9 0 0 250 }
visible 1
} }
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -658,12 +658,13 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
type 1 type 1
visible 1 visible 1
action { close control_look_menu; open setup_menu ; } action { close _self; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -672,7 +673,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -618,12 +618,13 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
type 1 type 1
visible 1 visible 1
action { close control_misc_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -632,7 +633,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -682,12 +682,13 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
type 1 type 1
visible 1 visible 1
action { close control_move_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -696,7 +697,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -668,12 +668,13 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
type 1 type 1
visible 1 visible 1
action { close control_reaction_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -682,7 +683,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -703,12 +703,13 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
rect 12 432 32 32 rect 12 432 32 32
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
type 1 type 1
visible 1 visible 1
action { close control_weapon_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -717,7 +718,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -1095,6 +1095,7 @@
itemdef { itemdef {
name "btn_start" name "btn_start"
shortcutKey "G"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 560 432 64 32 rect 560 432 64 32
type 1 type 1
@ -1124,29 +1125,33 @@
//Join //Join
itemdef {
style WINDOW_STYLE_SHADER
forecolor .5 .5 .5 1
rect 532 12 96 36
decoration
background "ui/assets/button.tga"
visible 1
}
itemdef { itemdef {
name "btn_join" name "btn_join"
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
rect 540 20 80 20 rect 540 20 80 20
//border 1
//bordersize 1
//bordercolor .5 .5 .5 1
backcolor Ig_Sub_Color1 backcolor Ig_Sub_Color1
forecolor 1 1 1 1 forecolor 1 1 1 1
textscale .25 textscale .25
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 40 textalignx 40
textaligny 14 textaligny 14
text "Connect >" textstyle ITEM_TEXTSTYLE_SHADOWED
text "^_C^_onnect >"
shortcutKey "C"
visible 1 visible 1
action { close createserver ; open joinserver } action { close createserver ; open joinserver }
//onFocus { setcolor backcolor Ig_Sub_Color2 ; show join_hint } onFocus { show join_hint ; timeFade join_hint forecolor .9 .9 .9 1 0 250 }
//leaveFocus { setcolor backcolor Ig_Sub_Color1 ; hide join_hint } leaveFocus { timeFade join_hint forecolor .9 .9 .9 0 0 250 }
onFocus { setcolor backcolor Ig_Sub_Color2 ;
show join_hint ; timeFade join_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ;
timeFade join_hint forecolor .9 .9 .9 0 0 250 }
} }
itemdef { itemdef {
@ -1168,11 +1173,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type 1 type 1
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close createserver ; open main ; } action { close _self ; open main ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -1180,9 +1186,10 @@
visible 1 visible 1
} }
itemdef { itemdef {
name back_hint name back_hint
text "Go back to main menu" text "Go ^_b^_ack to main menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -1196,3 +1203,4 @@
} }
} }
}

File diff suppressed because it is too large Load diff

View file

@ -200,6 +200,7 @@
itemdef { itemdef {
name "btn_play" name "btn_play"
shortcutKey "P"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 592 432 32 32 rect 592 432 32 32
type 1 type 1
@ -215,7 +216,7 @@
itemdef { itemdef {
name play_hint name play_hint
text "Play the selected demo" text "^_P^_lay the selected demo"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -232,11 +233,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type 1 type 1
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close demo; open main ; } action { close _self ; open main ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -244,9 +246,10 @@
visible 1 visible 1
} }
itemdef { itemdef {
name back_hint name back_hint
text "Go back to main menu" text "Go ^_b^_ack to main menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -259,6 +262,5 @@
decoration decoration
} }
} }
} }

View file

@ -97,10 +97,10 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 30 textalignx 30
textaligny 12 textaligny 12
text "Close" text "^_C^_lose"
shortcutKey "C" shortcutKey "C"
visible 1 visible 1
action { close error_popmenu ; open main } action { close _self ; open main }
} }
} }
} }

View file

@ -9,7 +9,7 @@
cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor
cursorSize 64 cursorSize 64
gradientBar "ui/assets/gradientbar2.tga" // gradient bar gradientBar "ui/assets/gradientbar2.tga" // gradient bar
itemFocusSound "sound/misc/menu2.wav" // sound for item getting focus (via keyboard or mouse ) itemFocusSound "sound/ui/whoosh2.wav" // sound for item getting focus (via keyboard or mouse )
fadeClamp 1.0 // sets the fadeup alpha fadeClamp 1.0 // sets the fadeup alpha
fadeCycle 1 // how often fade happens in milliseconds fadeCycle 1 // how often fade happens in milliseconds
@ -88,7 +88,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Player" text "^_P^_layer"
shortcutKey "P" shortcutKey "P"
border 1 border 1
bordersize 1 bordersize 1
@ -113,7 +113,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Options" text "^_O^_ptions"
shortcutKey "O" shortcutKey "O"
border 1 border 1
bordersize 1 bordersize 1
@ -139,7 +139,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "About" text "^_A^_bout"
shortcutKey "A" shortcutKey "A"
border 1 border 1
bordersize 1 bordersize 1
@ -164,7 +164,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 34 textalignx 34
textaligny 12 textaligny 12
text "Matchmode" text "^_M^_atchmode"
shortcutKey "M" shortcutKey "M"
border 1 border 1
bordersize 1 bordersize 1
@ -191,7 +191,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Vote" text "^_V^_ote"
shortcutKey "V" shortcutKey "V"
border 1 border 1
bordersize 1 bordersize 1
@ -218,7 +218,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Add bot" text "Add ^_b^_ot"
shortcutKey "B" shortcutKey "B"
border 1 border 1
bordersize 1 bordersize 1
@ -245,7 +245,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Devmode" text "^_D^_evmode"
shortcutKey "D" shortcutKey "D"
border 1 border 1
bordersize 1 bordersize 1
@ -273,7 +273,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 26 textalignx 26
textaligny 12 textaligny 12
text "Quit" text "^_Q^_uit"
shortcutKey "Q" shortcutKey "Q"
border 1 border 1
bordersize 1 bordersize 1

View file

@ -56,7 +56,7 @@
rect 12 32 256 20 rect 12 32 256 20
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
text "View: summary" text "^_V^_iew: summary"
shortcutKey "V" shortcutKey "V"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
cvarTest "ui_RQ3_ingameDetails" cvarTest "ui_RQ3_ingameDetails"
@ -75,7 +75,7 @@
rect 12 32 256 20 rect 12 32 256 20
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
text "View: details" text "^_V^_iew: details"
shortcutKey "V" shortcutKey "V"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
cvarTest "ui_RQ3_ingameDetails" cvarTest "ui_RQ3_ingameDetails"

View file

@ -54,7 +54,8 @@
itemdef { itemdef {
name "ig-bot-name" name "ig-bot-name"
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
text "Name:" text "^_N^_ame:"
shortcutKey "N"
ownerdraw UI_BOTNAME ownerdraw UI_BOTNAME
rect 0 32 128 20 rect 0 32 128 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
@ -70,7 +71,8 @@
itemdef { itemdef {
name "ig-bot-team" name "ig-bot-team"
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
text "Team:" text "^_T^_eam:"
shortcutKey "T"
ownerdraw UI_REDBLUE ownerdraw UI_REDBLUE
rect 0 52 128 20 rect 0 52 128 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
@ -88,7 +90,8 @@
itemdef { itemdef {
name "ig-bot-skill" name "ig-bot-skill"
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
text "Skill:" text "^_S^_kill:"
shortcutKey "S"
ownerdraw UI_BOTSKILL ownerdraw UI_BOTSKILL
rect 0 72 128 20 rect 0 72 128 20
textalign ITEM_ALIGN_RIGHT textalign ITEM_ALIGN_RIGHT
@ -111,7 +114,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 32 textalignx 32
textaligny 14 textaligny 14
text "Ok" text "^_O^_k"
shortcutKey "O" shortcutKey "O"
border 1 border 1
bordersize 1 bordersize 1
@ -120,7 +123,6 @@
bordercolor Ig_Sub_BorderColor1 bordercolor Ig_Sub_BorderColor1
visible 1 visible 1
action { play "sound/misc/menu1.wav" ; uiScript addBot ; uiScript closeingame } action { play "sound/misc/menu1.wav" ; uiScript addBot ; uiScript closeingame }
//action { exec "screenshotJPEG" }
onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 } onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 } leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 }
} }

View file

@ -54,7 +54,7 @@
itemdef { itemdef {
name leave name leave
text "Main Menu" text "^_M^_ain Menu"
shortcutKey "M" shortcutKey "M"
group grpMenu group grpMenu
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
@ -72,7 +72,7 @@
itemdef { itemdef {
name leave name leave
group grpMenu group grpMenu
text "Restart" text "^_R^_estart"
shortcutKey "R" shortcutKey "R"
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -90,7 +90,7 @@
name leave name leave
group grpMenu group grpMenu
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
text "Quit" text "^_Q^_uit"
shortcutKey "Q" shortcutKey "Q"
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
rect 0 74 128 20 rect 0 74 128 20
@ -137,7 +137,7 @@
itemdef { itemdef {
name leaveConfirm name leaveConfirm
text "Yes" text "^_Y^_es"
shortcutKey "Y" shortcutKey "Y"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -161,7 +161,7 @@
itemdef { itemdef {
name leaveConfirm name leaveConfirm
text "No" text "^_N^_o"
shortcutKey "N" shortcutKey "N"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -215,7 +215,7 @@
itemdef { itemdef {
name restartConfirm name restartConfirm
text "Yes" text "^_Y^_es"
shortcutKey "Y" shortcutKey "Y"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -239,7 +239,7 @@
itemdef { itemdef {
name restartConfirm name restartConfirm
text "No" text "^_N^_o"
shortcutKey "N" shortcutKey "N"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -293,7 +293,7 @@
itemdef { itemdef {
name quitConfirm name quitConfirm
text "Yes" text "^_Y^_es"
shortcutKey "Y" shortcutKey "Y"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
@ -317,7 +317,7 @@
itemdef { itemdef {
name quitConfirm name quitConfirm
text "No" text "^_N^_o"
shortcutKey "N" shortcutKey "N"
group grpConfirm group grpConfirm
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON

View file

@ -614,10 +614,10 @@
itemdef { itemdef {
name page3 name page3
group grpGame group grpGame
rect 103 63 96 96 rect 95 55 114 128
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/rq3-ingame-loadout" background "ui/assets/rq3-ingame-loadout"
border 1 border 0
bordersize 1 bordersize 1
bordercolor Ig_Window_BorderColor bordercolor Ig_Window_BorderColor
//backcolor .5 .5 .5 .4 //backcolor .5 .5 .5 .4
@ -676,13 +676,13 @@
group grpGame group grpGame
style 1 style 1
ownerdraw UI_RQ3_REPLACEMENTNAME ownerdraw UI_RQ3_REPLACEMENTNAME
rect 103 158 96 16 rect 107 150 80 16
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
textalignx 5 textalignx 5
textaligny 12 textaligny 12
textscale .18 textscale .18
forecolor .75 .75 .75 1 forecolor 0 0 0 1
border 1 border 0
bordersize 1 bordersize 1
bordercolor Ig_Window_BorderColor bordercolor Ig_Window_BorderColor
visible 0 visible 0
@ -691,10 +691,22 @@
//Select button //Select button
itemdef {
name page3
group grpGame
style WINDOW_STYLE_SHADER
forecolor .5 .5 .5 1
rect 95 166 112 32
decoration
background "ui/assets/button.tga"
visible 0
}
itemDef { itemDef {
name page3 name page3
group grpGame group grpGame
text "Select" text "^_S^_elect"
shortcutKey "S"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
textscale .225 textscale .225
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
@ -702,6 +714,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 48 textalignx 48
textaligny 12 textaligny 12
textstyle ITEM_TEXTSTYLE_SHADOWED
border 1 border 1
bordersize 1 bordersize 1
backcolor Ig_Sub_Color1 backcolor Ig_Sub_Color1
@ -709,8 +722,6 @@
bordercolor Ig_Sub_BorderColor1 bordercolor Ig_Sub_BorderColor1
visible 0 visible 0
action { play "sound/misc/menu1.wav" ; uiScript "selectReplacement" } action { play "sound/misc/menu1.wav" ; uiScript "selectReplacement" }
onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 }
} }
//Type //Type

View file

@ -110,7 +110,7 @@
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
textalignx 6 textalignx 6
textaligny 12 textaligny 12
text "W. Weapon/item" text "^_W^_eapon/item"
shortcutKey "W" shortcutKey "W"
border 1 border 1
bordersize 1 bordersize 1
@ -139,7 +139,7 @@
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
textalignx 6 textalignx 6
textaligny 12 textaligny 12
text "J. Join team" text "^_J^_oin team"
shortcutKey "J" shortcutKey "J"
border 1 border 1
bordersize 1 bordersize 1
@ -163,7 +163,7 @@
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
textalignx 6 textalignx 6
textaligny 12 textaligny 12
text "I. Ignore players" text "^_I^_gnore players"
shortcutKey "I" shortcutKey "I"
border 1 border 1
bordersize 1 bordersize 1
@ -181,7 +181,7 @@
rect 138 122 160 16 rect 138 122 160 16
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
text "M. Male Radio voice:" text "^_M^_ale Radio voice:"
shortcutKey "M" shortcutKey "M"
border 1 border 1
bordersize 1 bordersize 1
@ -203,7 +203,7 @@
rect 138 138 160 16 rect 138 138 160 16
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
text "D. Dynamic Radio:" text "^_D^_ynamic Radio:"
shortcutKey "D" shortcutKey "D"
border 1 border 1
bordersize 1 bordersize 1

View file

@ -55,7 +55,7 @@
itemdef { itemdef {
name yes name yes
text "Yes" text "^_Y^_es"
shortcutKey "Y" shortcutKey "Y"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
@ -73,7 +73,7 @@
itemdef { itemdef {
name no name no
text "No" text "^_N^_o"
shortcutKey "N" shortcutKey "N"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
@ -91,7 +91,7 @@
itemdef { itemdef {
name call name call
text "Call vote" text "^_C^_all vote"
shortcutKey "C" shortcutKey "C"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY style WINDOW_STYLE_EMPTY
@ -125,7 +125,7 @@
itemdef { itemdef {
name yes name yes
text "TeamYes" text "Team^_Y^_es"
shortcutKey "Y" shortcutKey "Y"
type 1 type 1
//ownerdrawflag UI_SHOW_ANYTEAMGAME //ownerdrawflag UI_SHOW_ANYTEAMGAME
@ -143,7 +143,7 @@
itemdef { itemdef {
name no name no
text "TeamNo" text "Team^_N^_o"
shortcutKey "N" shortcutKey "N"
type 1 type 1
//ownerdrawflag UI_SHOW_ANYTEAMGAME //ownerdrawflag UI_SHOW_ANYTEAMGAME

View file

@ -908,6 +908,7 @@
itemdef { itemdef {
name "btn_join" name "btn_join"
shortcutKey "G"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 560 432 64 32 rect 560 432 64 32
type 1 type 1
@ -952,29 +953,33 @@
//Create //Create
itemdef {
style WINDOW_STYLE_SHADER
forecolor .5 .5 .5 1
rect 532 12 96 36
decoration
background "ui/assets/button.tga"
visible 1
}
itemdef { itemdef {
name "btn_create" name "btn_create"
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
rect 540 20 80 20 rect 540 20 80 20
//border 1
//bordersize 1
//bordercolor .5 .5 .5 1
backcolor Ig_Sub_Color1 backcolor Ig_Sub_Color1
forecolor 1 1 1 1 forecolor 1 1 1 1
textscale .25 textscale .25
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 40 textalignx 40
textaligny 14 textaligny 14
text "Create >" textstyle ITEM_TEXTSTYLE_SHADOWED
text "^_C^_reate >"
shortcutKey "C"
visible 1 visible 1
action { close joinserver ; open createserver } action { close joinserver ; open createserver }
//onFocus { setcolor backcolor Ig_Sub_Color2 ; show create_hint } onFocus { show create_hint ; timeFade create_hint forecolor .9 .9 .9 1 0 250 }
//leaveFocus { setcolor backcolor Ig_Sub_Color1 ; hide create_hint } leaveFocus { timeFade create_hint forecolor .9 .9 .9 0 0 250 }
onFocus { setcolor backcolor Ig_Sub_Color2 ;
show create_hint ; timeFade create_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ;
timeFade create_hint forecolor .9 .9 .9 0 0 250 }
} }
itemdef { itemdef {
@ -996,11 +1001,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type 1 type 1
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close joinserver ; open main ; } action { close _self ; open main ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -1008,9 +1014,10 @@
visible 1 visible 1
} }
itemdef { itemdef {
name back_hint name back_hint
text "Go back to main menu" text "Go ^_b^_ack to main menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -1022,5 +1029,6 @@
visible 0 visible 0
decoration decoration
} }
} }
} }

View file

@ -7,8 +7,8 @@
bigFont "fonts/bigfont" 20 // font bigFont "fonts/bigfont" 20 // font
cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor
cursorSize 64 cursorSize 64
gradientBar "ui/assets/gradientbar2.tga" // gradient bar gradientBar UI_ASSETS"/gradientbar2.tga" // gradient bar
itemFocusSound "sound/misc/menu2.wav" // sound for item getting focus (via keyboard or mouse ) itemFocusSound "sound/ui/whoosh2.wav" // sound for item getting focus (via keyboard or mouse )
fadeCycle 2 // how often fade happens in milliseconds fadeCycle 2 // how often fade happens in milliseconds
fadeAmount 0.05 // amount to adjust alpha per cycle fadeAmount 0.05 // amount to adjust alpha per cycle
@ -20,7 +20,8 @@
menuDef { menuDef {
name "main" // Makro: rename it to "main-rq3" name "main" // Makro: rename it to "main-rq3"
background "rq3-ta-menuback" // Makro: replace "rq3-ta-menuback" with "rq3-menuback" //background "rq3-ta-menuback" // Makro: replace "rq3-ta-menuback" with "rq3-menuback"
background UI_ASSETS"/main" // Makro: replace "rq3-ta-menuback" with "rq3-menuback"
fullScreen MENU_TRUE fullScreen MENU_TRUE
//rect 0 0 640 480 // Size and position of the menu //rect 0 0 640 480 // Size and position of the menu
@ -31,380 +32,327 @@
onOpen { onOpen {
//setitemcolor fadebox backcolor 0 0 0 1 ; play "sound/ui/whoosh3.wav" ;
//fadeout fadebox ;
play "sound/misc/menu1.wav" ;
uiScript stopRefresh ; uiScript stopRefresh ;
} }
onFirstShow { onFirstShow {
hide overlay ; show fadebox ; setoverlaycolor 0 0 0 1 ;
setitemcolor fadebox backcolor 0 0 0 1 ; fadeoverlay 0 0 0 0 0 1000 ;
timeFade fadebox backcolor 0 0 0 0 0 1000 ; setfocus btn_join ;
setfocus rq3_start ;
} }
onShow { onESC { open quit_popmenu }
hide fadebox ; show overlay ;
setitemcolor overlay backcolor RQ3_MENU_OVERLAY_COLOR ;
timeFade overlay backcolor 0 0 0 0 0 500 ;
}
onESC { show overlay ; hide fadebox ;
setitemcolor overlay backcolor RQ3_MENU_OVERLAY_COLOR ;
open quit_popmenu }
//=================== //--------------------------------------------
// RQ3 stuff #include "ui/shared.h"
//=================== //--------------------------------------------
itemDef { //Boomstick logo
name top_bar //rq3: Top bar
rect 0 0 640 56
style WINDOW_STYLE_FILLED
//background "ui/assets/top"
backcolor RQ3_MAIN_BAR_COLOR
decoration
visible 1
}
itemDef { itemDef {
name top_bar //rq3: Top bar
rect 0 58 640 12
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/rq3-main-shadow-1" rect 280 288 120 120
anglevectors 9 -81
background UI_ASSETS"/logo"
forecolor 1 1 1 0.2
decoration decoration
visible 1 visible 1
} }
itemDef {
name top_bar2 //rq3: Top bar - border
rect 0 56 640 2
style 1
backcolor RQ3_MAIN_BAR_COLOR2
//border 2
//bordersize 1
//bordercolor 1 0 0 1
decoration
visible 1
}
itemDef {
name bottom_bar //rq3: bottom bar
rect 0 420 640 60
style 1
backcolor RQ3_MAIN_BAR_COLOR
//border 2
//bordersize 1
//bordercolor 1 0 0 1
decoration
visible 1
}
itemDef { #define UI_MAIN_ITEM_SPACING_Y 36
name bottom_bar2 //rq3: bottom bar - border #define UI_MAIN_HINT_OFFSET_Y 20
rect 0 418 640 2 #define UI_MAIN_TEXTSIZE .28
style 1
backcolor RQ3_MAIN_BAR_COLOR2
//border 2
//bordersize 1
//bordercolor 1 0 0 1
decoration
visible 1
}
itemdef {
name overlay
style 1 //Join server
itemdef {
name "btn_join"
text "> ^_J^_oin server "
shortcutKey "J"
forecolor 0 0 0 1 forecolor 0 0 0 1
backcolor 0 0 0 0
rect 0 58 640 360
visible 0
decoration
}
//Box for hints
itemDef {
style WINDOW_STYLE_SHADER
rect 0 408 180 24
background "ui/assets/rq3-main-box-1.tga"
visible 1
decoration
}
itemDef {
style WINDOW_STYLE_SHADER
rect 180 408 56 24
background "ui/assets/rq3-main-box-2.tga"
visible 1
decoration
}
//Copyright
itemDef {
name copyright
autowrapped
text "Reaction Quake 3 v3.2\n"
"Copyright (c) 2000 - 2004 Boomstick Studios\n"
"Quake III Arena (c) 1999 - 2000 id Software Inc."
style 0
textscale .15
rect 0 420 640 28
textalign 0 textalign 0
textaligny 24 textalignx 0
textalignx 8 textaligny 20
forecolor .5 .5 .5 1 textscale UI_MAIN_TEXTSIZE
rect 108 112 96 24
//anglevectors 9 -81
anglevectors 8.8 -80.6
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
visible 1
action { close _self; open joinserver}
}
itemdef {
text "Join an existing Reaction game"
forecolor .25 .25 .25 1
textalign 0
textalignx 12
textaligny 12
textscale 0.2
alignrect "btn_join" ITEM_ALIGN_LEFT 0 20 96 24
type ITEM_TYPE_TEXT
style 0
visible 1 visible 1
decoration decoration
} }
//================ //Create server
// Buttons
//================
itemdef {
//Start game name "btn_create"
text "> ^_C^_reate server"
itemDef { shortcutKey "C"
name RQ3_start forecolor 0 0 0 1
group "topmenu"
type 1
background "menu/art/rq3-menu-start"
rect 8 16 32 32
style WINDOW_STYLE_SHADER
visible 1
mouseenter { setfocus rq3_start ; }
action { close main ; open joinserver ; }
onFocus { show rq3_start_focus ; timefade rq3_start_focus forecolor 1 1 1 1 0 250 ;
show rq3_start_hint ; timeFade rq3_start_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { timefade rq3_start_focus forecolor 1 1 1 0 0 250 ; timeFade rq3_start_hint forecolor .9 .9 .9 0 0 250 }
}
itemDef {
name RQ3_start_focus
background "menu/art/rq3-menu-focus"
forecolor 1 1 1 0
rect 8 16 32 32
style WINDOW_STYLE_SHADER
visible 0
decoration
}
itemDef {
name RQ3_start_hint
group hints
text "Play Reaction Quake 3"
forecolor RQ3_MAIN_HINT_COLOR
textalign 0 textalign 0
textalignx 8 textalignx 0
textaligny 16 textaligny 20
textscale RQ3_MAIN_TEXTSIZE textscale UI_MAIN_TEXTSIZE
rect 0 410 260 24 alignrect "btn_join" ITEM_ALIGN_LEFT 0 36 96 24
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
visible 1
action { close _self; open createserver }
}
itemdef {
text "Start up a new Reaction server"
forecolor .25 .25 .25 1
textalign 0
textalignx 12
textaligny 12
textscale 0.2
alignrect "btn_create" ITEM_ALIGN_LEFT 0 20 96 24
type ITEM_TYPE_TEXT
style 0 style 0
visible 0 visible 1
decoration decoration
} }
//Setup //Setup
itemDef { itemdef {
name RQ3_Setup name "btn_setup"
group "topmenu" text "> ^_O^_ptions"
type 1 shortcutKey "O"
background "menu/art/rq3-menu-setup" forecolor 0 0 0 1
rect 56 16 32 32
style WINDOW_STYLE_SHADER
visible 1
action { close main ; open setup_menu ; }
onFocus { show rq3_setup_focus ; timefade rq3_setup_focus forecolor 1 1 1 1 0 250 ;
show rq3_setup_hint ; timeFade rq3_setup_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { timefade rq3_setup_focus forecolor 1 1 1 0 0 250 ; timeFade rq3_setup_hint forecolor .9 .9 .9 0 0 250 }
}
itemDef {
name RQ3_Setup_focus
background "menu/art/rq3-menu-focus"
forecolor 1 1 1 0
rect 56 16 32 32
style WINDOW_STYLE_SHADER
visible 0
decoration
}
itemDef {
name RQ3_setup_hint
group hints
text "Configure Reaction Quake 3"
forecolor RQ3_MAIN_HINT_COLOR
textalign 0 textalign 0
textalignx 8 textalignx 0
textaligny 16 textaligny 20
textscale RQ3_MAIN_TEXTSIZE textscale UI_MAIN_TEXTSIZE
rect 0 410 260 24 alignrect "btn_create" ITEM_ALIGN_LEFT 0 36 96 24
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
visible 1
action { close _self; open setup_menu }
}
itemdef {
text "Configure Reaction Quake 3"
forecolor .25 .25 .25 1
textalign 0
textalignx 12
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 0 36 96 24
type ITEM_TYPE_TEXT
style 0 style 0
visible 0 visible 1
decoration decoration
} }
// Sub-options //
//Player
itemdef {
text "^_P^_layer."
shortcutKey "P"
forecolor 0 0 0 1
textalign 0
textalignx 4
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 8 24 34 16
style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON
action { close _self ; open player_menu ; }
visible 1
}
//Control
itemdef {
text "Co^_n^_trols."
shortcutKey "N"
forecolor 0 0 0 1
textalign 0
textalignx 4
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 44 24 46 16
style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON
action { close _self ; open control_look_menu ; }
visible 1
}
//System
itemdef {
text "^_S^_ystem."
shortcutKey "S"
forecolor 0 0 0 1
textalign 0
textalignx 4
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 92 24 42 16
style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON
action { close _self ; open system_menu ; }
visible 1
}
//Game
itemdef {
text "^_G^_ame."
shortcutKey "G"
forecolor 0 0 0 1
textalign 0
textalignx 4
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 136 24 32 16
style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON
action { close _self ; open options_menu ; }
visible 1
}
//Replacements
itemdef {
text "^_R^_eplacements."
shortcutKey "R"
forecolor 0 0 0 1
textalign 0
textalignx 4
textaligny 12
textscale 0.2
alignrect "btn_setup" ITEM_ALIGN_LEFT 170 24 72 16
style WINDOW_STYLE_EMPTY
type ITEM_TYPE_BUTTON
action { close _self ; open replacements_menu ; }
visible 1
}
//Demos //Demos
itemDef { itemdef {
name RQ3_demos text "> ^_D^_emos"
group "topmenu" shortcutKey "D"
type 1 name "btn_demo"
background "menu/art/rq3-menu-demos" forecolor 0 0 0 1
rect 104 16 32 32
style WINDOW_STYLE_SHADER
visible 1
action { close main ; open demo ; }
mouseenter { setfocus rq3_demos ; }
onFocus { show rq3_demos_focus ; timefade rq3_demos_focus forecolor 1 1 1 1 0 250 ;
show rq3_demos_hint ; timeFade rq3_demos_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { timefade rq3_demos_focus forecolor 1 1 1 0 0 250 ; timeFade rq3_demos_hint forecolor .9 .9 .9 0 0 250 }
}
itemDef {
name RQ3_demos_focus
background "menu/art/rq3-menu-focus"
forecolor 1 1 1 0
rect 104 16 32 32
style WINDOW_STYLE_SHADER
visible 0
decoration
}
itemDef {
name RQ3_demos_hint
group hints
text "Playback in-game demos"
forecolor RQ3_MAIN_HINT_COLOR
textalign 0 textalign 0
textalignx 8 textalignx 0
textaligny 16 textaligny 20
textscale RQ3_MAIN_TEXTSIZE textscale UI_MAIN_TEXTSIZE
rect 0 410 260 24 alignrect "btn_setup" ITEM_ALIGN_LEFT 0 52 96 24
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
visible 1
action { close _self; open demo }
}
itemdef {
text "Playback in-game demos"
forecolor .25 .25 .25 1
textalign 0
textalignx 12
textaligny 12
textscale 0.2
alignrect "btn_demo" ITEM_ALIGN_LEFT 0 20 96 24
type ITEM_TYPE_TEXT
style 0 style 0
visible 0 visible 1
decoration decoration
} }
//Mods //Mods
itemDef { itemdef {
name RQ3_mods text "> ^_M^_ods"
group "topmenu" shortcutKey "M"
type 1 name "btn_mod"
background "menu/art/rq3-menu-mods" forecolor 0 0 0 1
rect 544 16 32 32
style WINDOW_STYLE_SHADER
visible 1
mouseenter { setfocus rq3_mods ; }
action { close main ; open mod ; }
onFocus { show rq3_mods_focus ; timefade rq3_mods_focus forecolor 1 1 1 1 0 250 ;
show rq3_mods_hint ; timeFade rq3_mods_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { timefade rq3_mods_focus forecolor 1 1 1 0 0 250 ; timeFade rq3_mods_hint forecolor .9 .9 .9 0 0 250 }
}
itemDef {
name RQ3_mods_focus
background "menu/art/rq3-menu-focus"
forecolor 1 1 1 0
rect 544 16 32 32
style WINDOW_STYLE_SHADER
visible 0
decoration
}
itemDef {
name RQ3_mods_hint
group hints
text "Change game modification"
forecolor RQ3_MAIN_HINT_COLOR
textalign 0 textalign 0
textalignx 8 textalignx 0
textaligny 16 textaligny 20
textscale RQ3_MAIN_TEXTSIZE textscale UI_MAIN_TEXTSIZE
rect 0 410 260 24 alignrect "btn_demo" ITEM_ALIGN_LEFT 0 36 96 24
type ITEM_TYPE_BUTTON
style WINDOW_STYLE_EMPTY
visible 1
action { close _self; open mod }
}
itemdef {
text "Play a different Quake 3 mod"
forecolor .25 .25 .25 1
textalign 0
textalignx 12
textaligny 12
textscale 0.2
alignrect "btn_mod" ITEM_ALIGN_LEFT 0 20 96 24
type ITEM_TYPE_TEXT
style 0 style 0
visible 0 visible 1
decoration decoration
} }
//Quit //Quit
itemDef { itemdef {
name RQ3_quit text "> ^_Q^_uit"
group "topmenu" shortcutKey "Q"
type 1 name "btn_quit"
background "menu/art/rq3-menu-exit" forecolor 0 0 0 1
rect 600 16 32 32
style WINDOW_STYLE_SHADER
visible 1
action { show overlay ; hide fadebox ;
setitemcolor overlay backcolor RQ3_MENU_OVERLAY_COLOR ;
open quit_popmenu }
onFocus { show rq3_quit_focus ; timefade rq3_quit_focus forecolor 1 1 1 1 0 250 ;
show rq3_quit_hint ; timeFade rq3_quit_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { timefade rq3_quit_focus forecolor 1 1 1 0 0 250 ; timeFade rq3_quit_hint forecolor .9 .9 .9 0 0 250 }
// onFocus { fadein rq3_quit_focus ; fadein rq3_quit_hint ; }
// leaveFocus { hide rq3_quit_focus ; hide rq3_quit_hint ; }
}
itemDef {
name RQ3_quit_focus
background "menu/art/rq3-menu-focus"
forecolor 1 1 1 0
rect 600 16 32 32
style WINDOW_STYLE_SHADER
visible 0
decoration
}
itemDef {
name RQ3_quit_hint
group hints
text "Exit Reaction Quake 3"
forecolor RQ3_MAIN_HINT_COLOR
textalign 0 textalign 0
textalignx 8 textalignx 0
textaligny 16 textaligny 20
textscale RQ3_MAIN_TEXTSIZE textscale UI_MAIN_TEXTSIZE
rect 0 410 260 24 alignrect "btn_mod" ITEM_ALIGN_LEFT 0 36 96 24
style 0 type ITEM_TYPE_BUTTON
visible 0 style WINDOW_STYLE_EMPTY
decoration visible 1
action { open quit_popmenu }
} }
//Logo+credits itemdef {
autowrapped
itemDef { text "Exit Reaction Quake 3"
name rq3_logo forecolor .25 .25 .25 1
type 1 textalign 0
background "menu/art/rq3-title-logo.tga" textalignx 12
rect 448 408 192 64 textaligny 12
style WINDOW_STYLE_SHADER textscale 0.2
alignrect "btn_quit" ITEM_ALIGN_LEFT 0 20 240 24
type ITEM_TYPE_TEXT
style 0
visible 1 visible 1
decoration decoration
} }
//Box for fading in menus
itemDef {
name fadebox
style WINDOW_STYLE_FILLED
//background "ui/assets/alpha"
//forecolor 0 0 0 1
backcolor 0 0 0 1
rect 0 0 640 480
visible 0
decoration
}
} }

View file

@ -7,7 +7,7 @@
bigFont "fonts/bigfont" 20 // font bigFont "fonts/bigfont" 20 // font
cursor "gfx/rq3_ta_hud/3_cursor3.tga" // cursor cursor "gfx/rq3_ta_hud/3_cursor3.tga" // cursor
gradientBar "ui/assets/gradientbar2.tga" // gradient bar gradientBar "ui/assets/gradientbar2.tga" // gradient bar
itemFocusSound "sound/misc/menu2.wav" // sound for item getting focus (via keyboard or mouse ) itemFocusSound "sound/ui/whoosh2.wav" // sound for item getting focus (via keyboard or mouse )
fadeCycle 2 // how often fade happens in milliseconds fadeCycle 2 // how often fade happens in milliseconds
fadeAmount 0.05 // amount to adjust alpha per cycle fadeAmount 0.05 // amount to adjust alpha per cycle
@ -30,7 +30,7 @@
onOpen { onOpen {
//setitemcolor fadebox backcolor 0 0 0 1 ; //setitemcolor fadebox backcolor 0 0 0 1 ;
//fadeout fadebox ; //fadeout fadebox ;
play "sound/misc/menu1.wav" ; play "sound/misc/whoosh3.wav" ;
//exec "music music/rq3_title_intro.wav music/rq3_title_loop.wav" ; //exec "music music/rq3_title_intro.wav music/rq3_title_loop.wav" ;
setfocus rq3_start ; setfocus rq3_start ;
uiScript stopRefresh ; uiScript stopRefresh ;

View file

@ -100,7 +100,7 @@
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 30 textalignx 30
textaligny 12 textaligny 12
text "Ok" text "^_O^_k"
shortcutKey "O" shortcutKey "O"
visible 1 visible 1
action { uiScript "quit" } action { uiScript "quit" }

View file

@ -212,6 +212,8 @@
#define CG_2NDPLACE 68 #define CG_2NDPLACE 68
#define CG_CAPTURES 69 #define CG_CAPTURES 69
//Makro - clock
#define UI_CLOCK 149
//Makro - for SSG crosshair selection //Makro - for SSG crosshair selection
#define UI_SSG_CROSSHAIR 150 #define UI_SSG_CROSSHAIR 150
@ -343,11 +345,14 @@
#define RQ3_MAIN_HINT_COLOR .75 .75 1 .75 #define RQ3_MAIN_HINT_COLOR .75 .75 1 .75
*/ */
#define RQ3_MAIN_BAR_COLOR 0 0 0 1 #define RQ3_MAIN_BAR_COLOR 1 1 1 .5
#define RQ3_MAIN_BAR_COLOR2 .5 .5 .5 1 #define RQ3_MAIN_BAR_COLOR2 0 0 0 1
//#define RQ3_MAIN_HINT_COLOR .75 .75 .75 1 //#define RQ3_MAIN_HINT_COLOR .75 .75 .75 1
#define RQ3_MAIN_HINT_COLOR .9 .9 .9 0 #define RQ3_MAIN_HINT_COLOR .9 .9 .9 0
#define UI_FOLDER "ui"
#define UI_ASSETS "ui/assets"
/* old colors, if you like them more /* old colors, if you like them more
#define RQ3_MAIN_BAR_COLOR 0 0 0 1 #define RQ3_MAIN_BAR_COLOR 0 0 0 1
#define RQ3_MAIN_BAR_COLOR2 1 0 0 1 #define RQ3_MAIN_BAR_COLOR2 1 0 0 1
@ -356,7 +361,7 @@
#define RQ3_MAIN_TEXTSIZE .28 #define RQ3_MAIN_TEXTSIZE .28
#define RQ3_MENU_OVERLAY_COLOR 0 0 0 .5 #define RQ3_MENU_OVERLAY_COLOR 0 0 0 .5
#define RQ3_MAIN_FOCUSCOLOR 1 .75 0 1 #define RQ3_MAIN_FOCUSCOLOR .5 .5 .5 1
//Ingame stuff //Ingame stuff

View file

@ -232,11 +232,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type 1 type 1
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close mod; open main ; } action { close _self ; open main ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -244,9 +245,10 @@
visible 1 visible 1
} }
itemdef { itemdef {
name back_hint name back_hint
text "Go back to main menu" text "Go ^_b^_ack to main menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -259,6 +261,5 @@
decoration decoration
} }
} }
} }

View file

@ -11,7 +11,7 @@
visible MENU_TRUE // Visible on open visible MENU_TRUE // Visible on open
focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items
onOpen { play "sound/misc/menu1.wav" } onOpen { play "sound/ui/whoosh3.wav" }
onEsc { close options_menu ; open setup_menu } onEsc { close options_menu ; open setup_menu }
@ -945,11 +945,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close options_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 } show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -959,7 +960,7 @@
itemdef { itemdef {
name hint_back name hint_back
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -6,88 +6,103 @@
menuDef { menuDef {
name "quit_popmenu" name "quit_popmenu"
visible 0 visible 0
rect 170 180 300 100 rect 332 182 180 152
focusColor RQ3_MAIN_FOCUSCOLOR anglevectors -10 -100
focusColor .25 .25 .5 1
popup popup
outOfBoundsClick outOfBoundsClick
//onOpen { transition window 0 50 300 0 0 0 300 100 10 4 } //onOpen { transition window 0 50 300 0 0 0 300 100 10 4 }
//onClose { transition window 0 0 300 100 0 50 300 0 10 4 } //onClose { transition window 0 0 300 100 0 50 300 0 10 4 }
onOpen { play "sound/misc/menu1.wav" } onOpen {
setrandomitemcolor postit forecolor 2 .94 .94 .82 1 1 .95 .8 1 ;
setitemcolor window forecolor 2 2 2 0 ;
timefade window forecolor 2 2 2 1 0 100 ;
play "sound/ui/whoosh3.wav" ;
setQuitText confirm
}
onESC { close quit_popmenu ; open main } onESC { close quit_popmenu ; open main }
itemDef { itemDef {
name window name "postit"
group window
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/fake_gradient_75" //style WINDOW_STYLE_FILLED
rect 0 0 300 100 background "ui/assets/post_it"
border 4 forecolor .94 .94 .82 .9
bordersize 2 //backcolor .94 .94 .82 1
bordercolor 1 0 0 1 rect 0 0 180 152
//backcolor 0 0 0 .65 anglevectors -10 -100
visible 1 visible 1
decoration decoration
} }
// QUIT // // QUIT //
itemDef { itemDef {
renderpoint
name confirm name confirm
text "Exit Reaction Quake 3 ?" group window
style 0 autowrapped
textscale .32 text "Done playing ?"
textstyle 3 style WINDOW_STYLE_EMPTY
rect 0 16 300 32 backcolor 0 0 0 .1
textscale .25
rect 32 24 112 32
adjustrect
textalign 1 textalign 1
textalignx 150 textalignx 56
textaligny 16 textaligny 16
decoration decoration
forecolor 1 1 1 1 forecolor 0 0 .15 1
visible 1 visible 1
} }
// YES // // YES //
itemDef { itemDef {
name yes name yes
text "YES" group window
text "^_Y^_ES"
shortcutKey "Y" shortcutKey "Y"
type 1 type ITEM_TYPE_BUTTON
style 0 style WINDOW_STYLE_EMPTY
textscale .32 backcolor 0 0 0 .1
textstyle 3 textscale .25
rect 100 64 50 32 //rect 32 88 32 16
textalign 1 //anglevectors -15 -105
textalignx 25 alignrect confirm ITEM_ALIGN_LEFT 20 56 32 16
textaligny 16 textalign ITEM_ALIGN_CENTER
forecolor 1 1 1 1 textalignx 16
textaligny 12
forecolor 0 0 .15 1
visible 1 visible 1
action { close main ; close quit_popmenu ; open credit } action { close main ; close quit_popmenu ; open credit }
mouseEnter { setitemcolor yes backcolor .1 .37 .1 1 }
mouseExit { setitemcolor yes backcolor .37 .1 .1 1 }
} }
// NO // // NO //
itemDef { itemDef {
name no name no
text "NO" group window
text "^_N^_O"
shortcutKey "N" shortcutKey "N"
type 1 type ITEM_TYPE_BUTTON
style 0 style WINDOW_STYLE_EMPTY
textscale .3 backcolor 0 0 0 .1
textstyle 3 textscale .25
rect 150 64 50 32 //rect 72 100 32 16
textalign 1 //anglevectors -15 -105
textalignx 25 alignrect confirm ITEM_ALIGN_RIGHT 20 56 32 16
textaligny 16 textalign ITEM_ALIGN_CENTER
forecolor 1 1 1 1 textalignx 16
textaligny 12
forecolor 0 0 .15 1
visible 1 visible 1
action { close quit_popmenu ; open main } action { close quit_popmenu ; open main }
mouseEnter { setitemcolor no backcolor .1 .37 .1 1 }
mouseExit { setitemcolor no backcolor .37 .1 .1 1 }
} }
} }

View file

@ -12,7 +12,8 @@
focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items
onOpen { play "sound/misc/menu1.wav" ; uiScript buildReplacementList } onOpen { play "sound/misc/menu1.wav" ; uiScript buildReplacementList }
onEsc { close options_menu ; open setup_menu } //onEsc { close replacements_menu ; open setup_menu }
onEsc { close _self ; open _previous }
//================= //=================
@ -126,10 +127,10 @@
//Background //Background
itemdef { itemdef {
name page3 name page3
rect 143 133 96 96 rect 135 125 114 128
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/rq3-ingame-loadout" background "ui/assets/rq3-ingame-loadout"
border 1 border 0
bordersize 1 bordersize 1
bordercolor Ig_Window_BorderColor bordercolor Ig_Window_BorderColor
//backcolor .5 .5 .5 .4 //backcolor .5 .5 .5 .4
@ -142,7 +143,7 @@
name page3 name page3
//type ITEM_TYPE_MODEL //type ITEM_TYPE_MODEL
ownerdraw UI_RQ3_REPLACEMENTMODEL ownerdraw UI_RQ3_REPLACEMENTMODEL
rect 143 133 96 96 rect 143 133 98 110
decoration decoration
visible 1 visible 1
} }
@ -170,6 +171,7 @@
itemDef { itemDef {
name page3 name page3
shortcutkey "," shortcutkey ","
shortcutkey "P"
rect 147 178 16 16 rect 147 178 16 16
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/arrow_left_white" background "ui/assets/arrow_left_white"
@ -185,6 +187,7 @@
itemDef { itemDef {
name page3 name page3
shortcutkey "." shortcutkey "."
shortcutkey "N"
rect 219 178 16 16 rect 219 178 16 16
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
background "ui/assets/arrow_right_white" background "ui/assets/arrow_right_white"
@ -203,13 +206,13 @@
name page3 name page3
style 1 style 1
ownerdraw UI_RQ3_REPLACEMENTNAME ownerdraw UI_RQ3_REPLACEMENTNAME
rect 143 228 96 16 rect 147 220 80 16
textalign ITEM_ALIGN_LEFT textalign ITEM_ALIGN_LEFT
textalignx 5 textalignx 5
textaligny 12 textaligny 12
textscale .18 textscale .18
forecolor .75 .75 .75 1 forecolor 0 0 0 1
border 1 border 0
bordersize 1 bordersize 1
bordercolor Ig_Window_BorderColor bordercolor Ig_Window_BorderColor
visible 1 visible 1
@ -218,16 +221,28 @@
//Select button //Select button
itemdef {
name page3
style WINDOW_STYLE_SHADER
forecolor .5 .5 .5 1
rect 135 240 112 32
decoration
background "ui/assets/button.tga"
visible 1
}
itemDef { itemDef {
name page3 name page3
text "Select" text "^_S^_elect"
shortcutKey "S"
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
textscale .225 textscale .225
style WINDOW_STYLE_FILLED style WINDOW_STYLE_FILLED
rect 143 244 96 16 rect 143 248 96 16
textalign ITEM_ALIGN_CENTER textalign ITEM_ALIGN_CENTER
textalignx 48 textalignx 48
textaligny 12 textaligny 12
textstyle ITEM_TEXTSTYLE_SHADOWED
border 1 border 1
bordersize 1 bordersize 1
backcolor Ig_Sub_Color1 backcolor Ig_Sub_Color1
@ -235,8 +250,25 @@
bordercolor Ig_Sub_BorderColor1 bordercolor Ig_Sub_BorderColor1
visible 1 visible 1
action { play "sound/misc/menu1.wav" ; uiScript "selectReplacement" } action { play "sound/misc/menu1.wav" ; uiScript "selectReplacement" }
onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 } //onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 }
leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 } //leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 }
onFocus { show hint_select ; timeFade hint_select forecolor .9 .9 .9 1 0 250 }
leaveFocus { timeFade hint_select forecolor .9 .9 .9 0 0 250 }
}
itemdef {
name hint_select
text "Use the chosen model"
forecolor RQ3_MAIN_HINT_COLOR
textalign 1
textalignx 240
textaligny 20
textscale RQ3_MAIN_TEXTSIZE
rect 80 420 480 40
type 0
style 0
visible 0
decoration
} }
//Type //Type
@ -318,11 +350,12 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type ITEM_TYPE_BUTTON type ITEM_TYPE_BUTTON
background "menu/art/rq3-menu-back.tga" background "menu/art/rq3-menu-back.tga"
action { close replacements_menu; open setup_menu ; } action { close _self ; open setup_menu ; }
onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ; onFocus { setbackground "menu/art/rq3-menu-back-focus-anim" ;
show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 } show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 }
leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ;
@ -332,7 +365,7 @@
itemdef { itemdef {
name hint_back name hint_back
text "Go back to setup menu" text "Go ^_b^_ack to setup menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240

View file

@ -12,7 +12,7 @@
onOpen { onOpen {
play "sound/misc/menu1.wav" ; play "sound/ui/whoosh3.wav" ;
} }
onEsc { close setup_menu ; open main } onEsc { close setup_menu ; open main }
@ -362,6 +362,7 @@
itemdef { itemdef {
name "btn_back" name "btn_back"
shortcutKey "B"
style WINDOW_STYLE_SHADER style WINDOW_STYLE_SHADER
rect 12 432 32 32 rect 12 432 32 32
type 1 type 1
@ -377,7 +378,7 @@
itemdef { itemdef {
name back_hint name back_hint
text "Go back to main menu" text "Go ^_b^_ack to main menu"
forecolor RQ3_MAIN_HINT_COLOR forecolor RQ3_MAIN_HINT_COLOR
textalign 1 textalign 1
textalignx 240 textalignx 240
@ -448,7 +449,7 @@
itemDef { itemDef {
name yes name yes
text "YES" text "^_Y^_ES"
shortcutKey "Y" shortcutKey "Y"
type 1 type 1
style 0 style 0
@ -469,7 +470,7 @@
itemDef { itemDef {
name no name no
text "NO" text "^_N^_O"
shortcutKey "N" shortcutKey "N"
type 1 type 1
style 0 style 0

View file

@ -191,7 +191,7 @@
//Pre-defined settings //Pre-defined settings
itemdef { itemdef {
name opt_predef name opt_predef
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -227,7 +227,7 @@
//Driver //Driver
itemdef { itemdef {
name opt_gldriver name opt_gldriver
group graphics group graphics
type ITEM_TYPE_EDITFIELD type ITEM_TYPE_EDITFIELD
@ -261,7 +261,7 @@
//GL Extensions //GL Extensions
itemdef { itemdef {
name opt_glext name opt_glext
group graphics group graphics
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
@ -296,7 +296,7 @@
//Resolution //Resolution
itemdef { itemdef {
name opt_res name opt_res
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -332,7 +332,7 @@
//Color depth //Color depth
itemdef { itemdef {
name opt_cldepth name opt_cldepth
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -368,7 +368,7 @@
//Fullscreen //Fullscreen
itemdef { itemdef {
name opt_fscreen name opt_fscreen
group graphics group graphics
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
@ -403,7 +403,7 @@
//Lightmap/vertex //Lightmap/vertex
itemdef { itemdef {
name opt_light name opt_light
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -439,7 +439,7 @@
//Geometric detail //Geometric detail
itemdef { itemdef {
name opt_geodetail name opt_geodetail
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -475,7 +475,7 @@
//Texture detail //Texture detail
itemdef { itemdef {
name opt_texdetail name opt_texdetail
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -511,7 +511,7 @@
//Texture quality //Texture quality
itemdef { itemdef {
name opt_texquality name opt_texquality
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -547,7 +547,7 @@
//Texture filtering mode //Texture filtering mode
itemdef { itemdef {
name opt_texfilter name opt_texfilter
group graphics group graphics
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
@ -583,7 +583,7 @@
//Compressed textures //Compressed textures
itemdef { itemdef {
name opt_comptex name opt_comptex
group graphics group graphics
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
@ -789,9 +789,10 @@
//Brightness //Brightness
itemdef { itemdef {
name opt_gamma name opt_gamma
type ITEM_TYPE_SLIDER type ITEM_TYPE_SLIDER
anglevectors 30 -60
text "Brightness:" text "Brightness:"
cvarfloat r_gamma 1 .5 1.7 cvarfloat r_gamma 1 .5 1.7
rect 472 100 112 20 rect 472 100 112 20
@ -822,7 +823,7 @@
//Screen size //Screen size
itemdef { itemdef {
name opt_screensize name opt_screensize
type ITEM_TYPE_SLIDER type ITEM_TYPE_SLIDER
text "Screen Size:" text "Screen Size:"
@ -855,7 +856,7 @@
//Overbrightbits //Overbrightbits
itemdef { itemdef {
name opt_overbits name opt_overbits
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Overbright Bits:" text "Overbright Bits:"
@ -934,7 +935,7 @@
//Sound volume //Sound volume
itemdef { itemdef {
name opt_svol name opt_svol
type ITEM_TYPE_SLIDER type ITEM_TYPE_SLIDER
text "Sound Volume:" text "Sound Volume:"
@ -967,7 +968,7 @@
//Music volume //Music volume
itemdef { itemdef {
name opt_mvol name opt_mvol
type ITEM_TYPE_SLIDER type ITEM_TYPE_SLIDER
text "Music volume:" text "Music volume:"
@ -1000,7 +1001,7 @@
//Sound quality //Sound quality
itemdef { itemdef {
name opt_squality name opt_squality
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
text "Sound Quality:" text "Sound Quality:"
@ -1034,7 +1035,7 @@
//Doppler effect //Doppler effect
itemdef { itemdef {
name opt_doppler name opt_doppler
type ITEM_TYPE_YESNO type ITEM_TYPE_YESNO
text "Doppler Sound:" text "Doppler Sound:"
@ -1113,7 +1114,7 @@
//Net rate //Net rate
itemdef { itemdef {
name opt_netrate name opt_netrate
type ITEM_TYPE_MULTI type ITEM_TYPE_MULTI
text "Net Data Rate:" text "Net Data Rate:"