diff --git a/reaction/cgame/cg_draw.c b/reaction/cgame/cg_draw.c index 1b603149..fba7d09f 100644 --- a/reaction/cgame/cg_draw.c +++ b/reaction/cgame/cg_draw.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -477,11 +480,10 @@ CG_DrawStatusBar */ static void CG_DrawStatusBar(void) { - int color; int style; centity_t *cent; playerState_t *ps; - int value; + int value, max; vec4_t hcolor; qhandle_t hicon; qhandle_t icon; @@ -497,13 +499,14 @@ static void CG_DrawStatusBar(void) {0.8f, 0.0f, 0.0f, 1.0f} }; // out of ammo */ + //Makro - now using the same colors for both health and ammo static float colors[5][4] = { {1.0f, 1.0f, 1.0f, 1.0f}, // full green {1.0f, 1.0f, 0.0f, 1.0f}, // firing {0.7f, 0.7f, 0.7f, 1.0f}, // not maximum {0.8f, 0.0f, 0.0f, 1.0f}, // out of ammo {0.0f, 1.0f, 0.0f, 1.0f} //Makro - reloading - }; + }; //Makro - health colors static float hcolors[3][4] = { {1.0f, 1.0f, 1.0f, 1.0f}, @@ -591,6 +594,8 @@ static void CG_DrawStatusBar(void) value = ps->ammo[cent->currentState.weapon]; // 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) color = 1; //Makro - added reloading check @@ -605,13 +610,35 @@ static void CG_DrawStatusBar(void) if (value >= 0) 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]); value = ps->stats[STAT_CLIPS]; if (value > -1 && 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 //if (cg.snap->ps.stats[STAT_RELOADTIME] > 0) @@ -913,7 +940,8 @@ static float CG_DrawFPSandPing(float y) } // 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++) { l = (lagometer.frameCount & (LAG_SAMPLES - 1)) - i; 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); } - if (!cg_drawFPS.integer && !cg_drawPing.integer) + if (!cg_drawFPS.integer && (!cg_drawPing.integer || cg.demoPlayback)) return y; return y + SMALLCHAR_HEIGHT + 4; @@ -1897,26 +1925,9 @@ static void CG_DrawCrosshair(void) if (cg.renderingThirdPerson) { return; } - // 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); - } + //Makro - moved some code below to prevent some variables from getting overwritten by the ssg code + //Elder: Sniper crosshairs - lots of hardcoded values :/ //if ( cg.snap->ps.weapon==WP_SSG3000 && cg.zoomLevel > 0 && cg.zoomLevel < 4) { // some pile of crap @@ -1960,7 +1971,13 @@ static void CG_DrawCrosshair(void) trap_R_SetColor(crosshairColor); //I can probably scale the zoom with the screen width -/+ keys //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); drawSSG = 1; @@ -1970,32 +1987,54 @@ static void CG_DrawCrosshair(void) //Slicer if no crosshair, and not using SSG, dont draw crosshair if(!cg_drawCrosshair.integer) 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)) { - x = cg_crosshairX.integer; - y = cg_crosshairY.integer; - CG_AdjustFrom640(&x, &y, &w, &h); - - ca = cg_drawCrosshair.integer; - if (ca < 0) { - ca = 0; - } - hShader = cgs.media.crosshairShader[ca % NUM_CROSSHAIRS]; - - crosshairColor[0] = cg_RQ3_crosshairColorR.value; - crosshairColor[1] = cg_RQ3_crosshairColorG.value; - crosshairColor[2] = cg_RQ3_crosshairColorB.value; - crosshairColor[3] = cg_RQ3_crosshairColorA.value; - for (i = 0; i < 4; i++) { - if (crosshairColor[i] > 1.0f) - crosshairColor[i] = 1.0f; - else if (crosshairColor[i] < 0) - crosshairColor[i] = 0; - } - - trap_R_SetColor(crosshairColor); - 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); - trap_R_SetColor(NULL); + x = cg_crosshairX.integer; + y = cg_crosshairY.integer; + CG_AdjustFrom640(&x, &y, &w, &h); + + ca = cg_drawCrosshair.integer; + if (ca < 0) { + ca = 0; + } + hShader = cgs.media.crosshairShader[ca % NUM_CROSSHAIRS]; + + crosshairColor[0] = cg_RQ3_crosshairColorR.value; + crosshairColor[1] = cg_RQ3_crosshairColorG.value; + crosshairColor[2] = cg_RQ3_crosshairColorB.value; + crosshairColor[3] = cg_RQ3_crosshairColorA.value; + for (i = 0; i < 4; i++) { + if (crosshairColor[i] > 1.0f) + crosshairColor[i] = 1.0f; + else if (crosshairColor[i] < 0) + crosshairColor[i] = 0; + } + + trap_R_SetColor(crosshairColor); + 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); + trap_R_SetColor(NULL); } } @@ -2248,6 +2287,12 @@ CG_DrawFollow */ 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; vec4_t color; const char *name; @@ -2257,14 +2302,16 @@ static qboolean CG_DrawFollow(void) if (!(cg.snap->ps.pm_flags & PMF_FOLLOW)) { return qfalse; } - color[0] = 1; - color[1] = 1; - color[2] = 1; - color[3] = 1; + color[0] = 0.75f; + color[1] = 0.75f; + color[2] = 0.75f; + color[3] = 1.0f; // JBravo: if gametype >= team, append teamname to his name. if (cgs.gametype >= GT_TEAM) { team = cgs.clientinfo[cg.snap->ps.clientNum].team; + //Makro - different look + /* if (team == TEAM_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, @@ -2276,6 +2323,33 @@ static qboolean CG_DrawFollow(void) } x = 0.5 * (640 - BIGCHAR_WIDTH * CG_DrawStrlen(combinedName)); 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 { CG_DrawBigString(320 - 9 * 8, 24, "following", 1.0F); name = cgs.clientinfo[cg.snap->ps.clientNum].name; diff --git a/reaction/cgame/cg_drawtools.c b/reaction/cgame/cg_drawtools.c index bcfc55d2..1c357e93 100644 --- a/reaction/cgame/cg_drawtools.c +++ b/reaction/cgame/cg_drawtools.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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, 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; const char *s; int xx; @@ -255,14 +261,28 @@ void CG_DrawStringExt(int x, int y, const char *string, const float *setColor, while (*s && cnt < maxChars) { if (Q_IsColorString(s)) { if (!forceColor) { - memcpy(color, g_color_table[ColorIndex(*(s + 1))], sizeof(color)); - color[3] = setColor[3]; - trap_R_SetColor(color); + //Makro - new tricks + if (*(s+1) == '*') + { + 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; continue; } CG_DrawChar(xx, y, charWidth, charHeight, *s); + if (underlined) + { + CG_DrawChar(xx, yoffset, charWidth, charHeight, '_'); + } xx += charWidth; cnt++; s++; @@ -627,104 +647,103 @@ static int propMap[128][3] = { */ {0, 0, PROP_SPACE_WIDTH}, // SPACE -{3, 0, 9}, // ! -{15, 0, 13}, // " -{31, 0, 18}, // # -{52, 0, 13}, // $ -{68, 0, 20}, // % -{91, 0, 13}, // & -{107, 0, 9}, // ' -{119, 0, 13}, // ( -{135, 0, 14}, // ) -{152, 0, 18}, // * -{173, 0, 21}, // + -{197, 0, 6}, // , -{206, 0, 10}, // - -{219, 0, 6}, // . -{228, 0, 18}, // / -{249, 0, 17}, // 0 -{269, 0, 6}, // 1 -{278, 0, 13}, // 2 -{294, 0, 13}, // 3 -{310, 0, 13}, // 4 -{326, 0, 14}, // 5 -{343, 0, 14}, // 6 -{360, 0, 13}, // 7 -{376, 0, 14}, // 8 -{393, 0, 13}, // 9 -{409, 0, 7}, // : -{419, 0, 8}, // ; -{430, 0, 12}, // < -{445, 0, 16}, // = -{464, 0, 13}, // > -{480, 0, 14}, // ? -{0, 32, 16}, // @ -{19, 32, 12}, // A -{34, 32, 12}, // B -{49, 32, 12}, // C -{64, 32, 13}, // D -{80, 32, 11}, // E -{94, 32, 11}, // F -{108, 32, 13}, // G -{124, 32, 11}, // H -{138, 32, 5}, // I -{146, 32, 11}, // J -{160, 32, 10}, // K -{173, 32, 11}, // L -{187, 32, 16}, // M -{206, 32, 13}, // N -{222, 32, 15}, // O -{240, 32, 11}, // P -{254, 32, 15}, // Q -{272, 32, 11}, // R -{286, 32, 11}, // S -{300, 32, 10}, // T -{313, 32, 11}, // U -{327, 32, 13}, // V -{343, 32, 17}, // W -{363, 32, 11}, // X -{377, 32, 10}, // Y -{390, 32, 12}, // Z -{405, 32, 13}, // [ -{421, 32, 17}, // '\' -{441, 32, 11}, // ] -{455, 32, 13}, // ^ -{471, 32, 16}, // _ -{490, 32, 7}, // ` -{500, 32, 10}, // a -{0, 64, 10}, // b -{13, 64, 9}, // c -{25, 64, 11}, // d -{39, 64, 10}, // e -{52, 64, 8}, // f -{63, 64, 10}, // g -{76, 64, 9}, // h -{88, 64, 5}, // i -{96, 64, 5}, // j -{104, 64, 9}, // k -{116, 64, 4}, // l -{123, 64, 12}, // m -{138, 64, 8}, // n -{149, 64, 9}, // o -{161, 64, 10}, // p -{174, 64, 11}, // q -{188, 64, 8}, // r -{199, 64, 9}, // s -{211, 64, 8}, // t -{222, 64, 8}, // u -{233, 64, 8}, // v -{244, 64, 12}, // w -{259, 64, 8}, // x -{270, 64, 9}, // y -{282, 64, 9}, // z -{294, 64, 9}, // { -{306, 64, 12}, // | -{321, 64, 9}, // } -{333, 64, 17}, // ~ +{3, 0, 36}, // ! +{42, 0, 36}, // " +{81, 0, 36}, // # +{120, 0, 36}, // $ +{159, 0, 16}, // % +{178, 0, 36}, // & +{217, 0, 58}, // ' +{278, 0, 36}, // ( +{317, 0, 58}, // ) +{378, 0, 36}, // * +{417, 0, 36}, // + +{456, 0, 36}, // , +{0, 27, 36}, // - +{39, 27, 19}, // . +{61, 27, 58}, // / +{122, 27, 14}, // 0 +{139, 27, 8}, // 1 +{150, 27, 13}, // 2 +{166, 27, 13}, // 3 +{182, 27, 14}, // 4 +{199, 27, 13}, // 5 +{215, 27, 14}, // 6 +{232, 27, 12}, // 7 +{247, 27, 13}, // 8 +{263, 27, 13}, // 9 +{279, 27, 11}, // : +{293, 27, 58}, // ; +{354, 27, 58}, // < +{415, 27, 36}, // = +{454, 27, 58}, // > +{0, 54, 36}, // ? +{39, 54, 36}, // @ +{78, 54, 17}, // A +{98, 54, 13}, // B +{114, 54, 15}, // C +{132, 54, 16}, // D +{151, 54, 15}, // E +{169, 54, 16}, // F +{188, 54, 18}, // G +{209, 54, 20}, // H +{232, 54, 9}, // I +{244, 54, 36}, // J +{283, 54, 18}, // K +{304, 54, 15}, // L +{322, 54, 20}, // M +{345, 54, 18}, // N +{366, 54, 16}, // O +{385, 54, 16}, // P +{404, 54, 13}, // Q +{420, 54, 18}, // R +{441, 54, 14}, // S +{458, 54, 16}, // T +{477, 54, 18}, // U +{498, 54, 14}, // V +{0, 81, 18}, // W +{21, 81, 13}, // X +{37, 81, 16}, // Y +{56, 81, 36}, // Z +{95, 81, 36}, // [ +{134, 81, 36}, // '\' +{173, 81, 36}, // ] +{212, 81, 36}, // ^ +{251, 81, 36}, // _ +{290, 81, 36}, // ` +{329, 81, 18}, // a +{350, 81, 13}, // b +{366, 81, 15}, // c +{384, 81, 16}, // d +{403, 81, 15}, // e +{421, 81, 14}, // f +{438, 81, 17}, // g +{458, 81, 18}, // h +{479, 81, 11}, // i +{0, 108, 36}, // j +{39, 108, 20}, // k +{62, 108, 15}, // l +{80, 108, 19}, // m +{102, 108, 16}, // n +{121, 108, 14}, // o +{138, 108, 17}, // p +{158, 108, 13}, // q +{174, 108, 18}, // r +{195, 108, 13}, // s +{211, 108, 16}, // t +{230, 108, 15}, // u +{248, 108, 13}, // v +{264, 108, 18}, // w +{285, 108, 14}, // x +{302, 108, 16}, // y +{321, 108, 36}, // z +{360, 108, 36}, // { +{399, 108, 36}, // | +{438, 108, 36}, // } +{0, 135, 36}, // ~ {0, 0, -1} // DEL }; - /*Elder: old one {0, 0, PROP_SPACE_WIDTH}, // SPACE {11, 122, 7}, // ! diff --git a/reaction/cgame/cg_ents.c b/reaction/cgame/cg_ents.c index 26571bf7..b3e128bd 100644 --- a/reaction/cgame/cg_ents.c +++ b/reaction/cgame/cg_ents.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -253,12 +256,19 @@ Also called by event processing code */ void CG_SetEntitySoundPosition(centity_t * cent) { - if (cent->currentState.solid == SOLID_BMODEL) { + if (cent->currentState.solid == SOLID_BMODEL) + { vec3_t origin; - float *v; - - v = cgs.inlineModelMidpoints[cent->currentState.modelindex]; - VectorAdd(cent->lerpOrigin, v, origin); + + VectorCopy(cgs.inlineModelMidpoints[cent->currentState.modelindex], 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); } else { trap_S_UpdateEntityPosition(cent->currentState.number, cent->lerpOrigin); @@ -836,7 +846,9 @@ CG_AdjustPositionForMover 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; 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]; - 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); return; } - CG_EvaluateTrajectory(¢->currentState.pos, fromTime, oldOrigin); - CG_EvaluateTrajectory(¢->currentState.apos, fromTime, oldAngles); + //Makro - if mover is blocked, don't do anything + if (cent->currentState.eFlags & EF_MOVER_BLOCKED) + { + VectorCopy(in, out); + return; + } - CG_EvaluateTrajectory(¢->currentState.pos, toTime, origin); - CG_EvaluateTrajectory(¢->currentState.apos, toTime, angles); + //CG_EvaluateTrajectory(¢->currentState.pos, fromTime, oldOrigin); + //CG_EvaluateTrajectory(¢->currentState.apos, fromTime, oldAngles); + CG_EvaluateTrajectoryEx(cent, fromTime, oldOrigin, oldAngles); + + //CG_EvaluateTrajectory(¢->currentState.pos, toTime, origin); + //CG_EvaluateTrajectory(¢->currentState.apos, toTime, angles) + CG_EvaluateTrajectoryEx(cent, toTime, origin, angles); VectorSubtract(origin, oldOrigin, deltaOrigin); VectorSubtract(angles, oldAngles, deltaAngles); VectorAdd(in, deltaOrigin, out); + // 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 - CG_EvaluateTrajectory(¢->currentState.pos, cg.time, cent->lerpOrigin); - CG_EvaluateTrajectory(¢->currentState.apos, cg.time, cent->lerpAngles); + //Makro - if this is a mover, it might be blocked + if (cent->currentState.eType == ET_MOVER && (cent->currentState.eFlags & EF_MOVER_BLOCKED) != 0) + { + //no prediction in this case + //CG_EvaluateTrajectory(¢->currentState.pos, cg.snap->serverTime, cent->lerpOrigin); + //CG_EvaluateTrajectory(¢->currentState.apos, cg.snap->serverTime, cent->lerpAngles); + CG_EvaluateTrajectoryEx(cent, cg.snap->serverTime, cent->lerpOrigin, cent->lerpAngles); + } else { + //CG_EvaluateTrajectory(¢->currentState.pos, cg.time, cent->lerpOrigin); + //CG_EvaluateTrajectory(¢->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 // player state if (cent != &cg.predictedPlayerEntity) { 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 +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) { centity_t *cent; @@ -1148,7 +1217,8 @@ void CG_AddPacketEntities(int mode) // JBravo: unlagged if (cg.nextSnap) { 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) { CG_TransitionEntity(cent); cent->interpolate = qtrue; @@ -1162,7 +1232,8 @@ void CG_AddPacketEntities(int mode) if (mode != ADDENTS_NOSKYPORTAL) { // add each entity sent over by the server 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 (mode == ADDENTS_SKYPORTAL) { if (cent->currentState.eFlags & EF_HEADLESS) { @@ -1179,7 +1250,8 @@ void CG_AddPacketEntities(int mode) //sky portal entities or not (faster) } else { 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)) { CG_AddCEntity(cent); } @@ -1233,14 +1305,33 @@ Added by Elder. 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) { //Makro - kinda hackish, but oh well... //allows us to trigger them on off; SVF_NOCLIENT should've done this already, though if (!(cent->currentState.eFlags & EF_NODRAW)) { - int cl; + int cl, dls; float i, r, g, b, i2; + dls = cent->currentState.eventParm & DLIGHT_CUSTOMSTYLE; cl = cent->currentState.constantLight; r = (cl & 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); } + 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) trap_R_AddAdditiveLightToScene(cent->lerpOrigin, i, r, g, b); else 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]); } } diff --git a/reaction/cgame/cg_event.c b/reaction/cgame/cg_event.c index 49c23059..be3314b3 100644 --- a/reaction/cgame/cg_event.c +++ b/reaction/cgame/cg_event.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -1492,7 +1495,8 @@ void CG_CheckEvents(centity_t * cent) } // calculate the position at exactly the frame time - CG_EvaluateTrajectory(¢->currentState.pos, cg.snap->serverTime, cent->lerpOrigin); + //CG_EvaluateTrajectory(¢->currentState.pos, cg.snap->serverTime, cent->lerpOrigin); + CG_EvaluateTrajectoryEx(cent, cg.snap->serverTime, cent->lerpOrigin, NULL); CG_SetEntitySoundPosition(cent); CG_EntityEvent(cent, cent->lerpOrigin); diff --git a/reaction/cgame/cg_local.h b/reaction/cgame/cg_local.h index ede18954..a4d58396 100644 --- a/reaction/cgame/cg_local.h +++ b/reaction/cgame/cg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -1166,6 +1169,8 @@ typedef struct { //Makro - used for flares unsigned char flareShaderNum[MAX_VISIBLE_FLARES]; float flareShaderSize[MAX_VISIBLE_FLARES], flareColor[MAX_VISIBLE_FLARES][4]; + //Makro - zcam lines + char zcamLine[2][256]; } cg_t; //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 itemInfo_t cg_items[MAX_ITEMS]; 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_runpitch; @@ -1908,8 +1920,16 @@ extern vmCvar_t cg_RQ3_predictWeapons; //Makro - avidemo with jpegs extern vmCvar_t cg_RQ3_avidemo; +//Makro - left-handed weapons +//extern vmCvar_t cg_RQ3_leftHanded; //Makro - sun flares 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_teamChatsOnly; @@ -2152,7 +2172,8 @@ void CG_PredictPlayerState(void); void CG_LoadDeferredPlayers(void); void CG_EvaluateTrajectory(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 // @@ -2175,7 +2196,9 @@ void CG_SetEntitySoundPosition(centity_t * cent); void CG_AddPacketEntities(int mode); 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_PositionRotatedEntityOnTag(refEntity_t * entity, const refEntity_t * parent, diff --git a/reaction/cgame/cg_main.c b/reaction/cgame/cg_main.c index 31dadddd..84bdf535 100644 --- a/reaction/cgame/cg_main.c +++ b/reaction/cgame/cg_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -436,6 +439,10 @@ cgs_t cgs; centity_t cg_entities[MAX_GENTITIES]; weaponInfo_t cg_weapons[MAX_WEAPONS]; 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_centertime; @@ -606,11 +613,22 @@ vmCvar_t cg_RQ3_strobe; vmCvar_t cg_RQ3_predictWeapons; -//Makro: avidemo with jpegs +//Makro - avidemo with jpegs 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 vmCvar_t cg_RQ3_flareIntensity; +//Makro - ssg crosshair size +vmCvar_t cg_RQ3_ssgCrosshairSize; //Makro - fastsky @@ -888,8 +906,18 @@ static cvarTable_t cvarTable[] = { // bk001129 {&cg_trueLightning, "cg_trueLightning", "0.0", CVAR_ARCHIVE}, //Makro - avidemo with jpegs {&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 {&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 {&cg_fastSky, "r_fastSky", "0", CVAR_ARCHIVE}, {&cg_RQ3_wantFastSky, "cg_RQ3_wantFastSky", "0", CVAR_ARCHIVE}, diff --git a/reaction/cgame/cg_predict.c b/reaction/cgame/cg_predict.c index 7989a52c..ca8f1bbd 100644 --- a/reaction/cgame/cg_predict.c +++ b/reaction/cgame/cg_predict.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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) { // special value for bmodel cmodel = trap_CM_InlineModel(ent->modelindex); - VectorCopy(cent->lerpAngles, angles); - CG_EvaluateTrajectory(¢->currentState.pos, cg.physicsTime, origin); + //VectorCopy(cent->lerpAngles, angles); + //CG_EvaluateTrajectory(¢->currentState.pos, cg.physicsTime, origin); + CG_EvaluateTrajectoryEx(cent, cg.physicsTime, origin, angles); } else { // encoded bbox x = (ent->solid & 255); @@ -741,9 +745,10 @@ void CG_PredictPlayerState(void) } else { vec3_t adjusted; + //Makro - made it so that angles get adjusted, too CG_AdjustPositionForMover(cg.predictedPlayerState.origin, cg.predictedPlayerState.groundEntityNum, cg.physicsTime, - cg.oldTime, adjusted); + cg.oldTime, adjusted, cg.predictedPlayerState.viewangles); if (cg_showmiss.integer) { if (!VectorCompare(oldPlayerState.origin, adjusted)) { @@ -845,9 +850,10 @@ void CG_PredictPlayerState(void) return; } // adjust for the movement of the groundentity + //Makro - made it so that angles get adjusted, too CG_AdjustPositionForMover(cg.predictedPlayerState.origin, 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.predictedPlayerState.eventSequence > oldPlayerState.eventSequence + MAX_PS_EVENTS) { @@ -954,3 +960,36 @@ void CG_EvaluateTrajectoryDelta(const trajectory_t * tr, int atTime, vec3_t resu break; } } + +void CG_EvaluateTrajectoryEx(centity_t *cent, int time, vec3_t origin, vec3_t angles) +{ + + if (origin) CG_EvaluateTrajectory(¢->currentState.pos, time, origin); + if (angles) CG_EvaluateTrajectory(¢->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); + } + } +} \ No newline at end of file diff --git a/reaction/cgame/cg_servercmds.c b/reaction/cgame/cg_servercmds.c index afc4be00..743b6c0e 100644 --- a/reaction/cgame/cg_servercmds.c +++ b/reaction/cgame/cg_servercmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Flares // @@ -508,6 +511,39 @@ void CG_ParseFogHull(const char *str) 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; inumEntities; i++) + order[i] = i; + //actual sorting... not exactly the fastest algorithm ever written + for (i=0; inumEntities-1; i++) + { + for (j=i+1; jnumEntities; 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 @@ -93,6 +128,8 @@ void CG_SetInitialSnapshot(snapshot_t * snap) entityState_t *state; 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); @@ -155,6 +192,8 @@ static void CG_TransitionSnapshot(void) // move nextSnap to snap and do the transitions oldFrame = cg.snap; 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); cg_entities[cg.snap->ps.clientNum].interpolate = qfalse; @@ -203,6 +242,8 @@ static void CG_SetNextSnap(snapshot_t * snap) centity_t *cent; 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); cg_entities[cg.snap->ps.clientNum].interpolate = qtrue; diff --git a/reaction/cgame/cg_view.c b/reaction/cgame/cg_view.c index 09bb65df..69e20f7e 100644 --- a/reaction/cgame/cg_view.c +++ b/reaction/cgame/cg_view.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Flares // @@ -1114,7 +1117,7 @@ void CG_AddLensFlare(qboolean sun) ent.customShader = cgs.media.sunFlareShader; //this function wouldn't be complete without some funny math //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.shaderRGBA[0] = cgs.flareFadeFactor * cgs.sunAlpha * 255; ent.shaderRGBA[1] = ent.shaderRGBA[0]; @@ -1130,6 +1133,7 @@ void CG_AddLensFlare(qboolean sun) { float len = 0, color[4]; float size, hsize; + float ffov = cos(cg.refdef.fov_y/4); int i; 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, cgs.media.flareShader[cg.flareShaderNum[i]]); } - if (cgs.flareForwardFactor > 0) + if (cgs.flareForwardFactor > ffov) { 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 //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); @@ -1350,7 +1355,7 @@ void CG_DrawActiveFrame(int serverTime, stereoFrame_t stereoView, qboolean demoP } } //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 it's time to take a screenshot if (cg.time > cg.screenshotTime + (int) (1000.0f / aviDemoFPS)) { diff --git a/reaction/cgame/cg_weapons.c b/reaction/cgame/cg_weapons.c index 4a1e869b..8eca6086 100644 --- a/reaction/cgame/cg_weapons.c +++ b/reaction/cgame/cg_weapons.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -1317,6 +1320,7 @@ void CG_AddPlayerWeapon( refEntity_t * parent, playerState_t * ps, centity_t * c gun1.shaderRGBA[ 1 ] = 255; gun1.shaderRGBA[ 2 ] = 255; gun1.shaderRGBA[ 3 ] = 255; + gun1.nonNormalizedAxes = qtrue; VectorCopy( parent->lightingOrigin, gun2.lightingOrigin ); gun2.shadowPlane = parent->shadowPlane; gun2.renderfx = parent->renderfx; @@ -1777,6 +1781,13 @@ void CG_AddViewWeapon(playerState_t * ps) hand.backlerp = 0; hand.hModel = weapon->handsModel; 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 CG_AddPlayerWeapon(&hand, ps, &cg.predictedPlayerEntity, ps->persistant[PERS_TEAM]); diff --git a/reaction/cgame/cgame.bat b/reaction/cgame/cgame.bat index 324feb7d..e5ce9a57 100755 --- a/reaction/cgame/cgame.bat +++ b/reaction/cgame/cgame.bat @@ -1,6 +1,8 @@ +@echo off mkdir vm cd vm -set cc=call ..\compile.bat + +set cc=call ..\..\compile.bat -DCGAME %cc% ../../game/bg_misc.c @if errorlevel 1 goto quit @@ -14,6 +16,8 @@ set cc=call ..\compile.bat @if errorlevel 1 goto quit %cc% ../../game/q_shared.c @if errorlevel 1 goto quit +%cc% ../cg_atmospheric.c +@if errorlevel 1 goto quit %cc% ../cg_consolecmds.c @if errorlevel 1 goto quit %cc% ../cg_draw.c @@ -57,3 +61,6 @@ set cc=call ..\compile.bat q3asm -f ../cgame :quit cd .. + + +pause \ No newline at end of file diff --git a/reaction/cgame/cgame.dsp b/reaction/cgame/cgame.dsp index 4024eec2..9c0fb6d7 100644 --- a/reaction/cgame/cgame.dsp +++ b/reaction/cgame/cgame.dsp @@ -82,7 +82,7 @@ BSC32=bscmake.exe # ADD BSC32 /nologo 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 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 !ELSEIF "$(CFG)" == "cgame - Win32 Release TA" diff --git a/reaction/cgame/cgame.plg b/reaction/cgame/cgame.plg index ef4b2986..4ee5866c 100644 --- a/reaction/cgame/cgame.plg +++ b/reaction/cgame/cgame.plg @@ -3,148 +3,14 @@
 

Build Log

---------------------Configuration: cgame - Win32 Release-------------------- +--------------------Configuration: cgame - Win32 Debug--------------------

Command Lines

-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" -

Output Window

-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... -

Output Window

Results

-cgamex86.dll - 0 error(s), 6 warning(s) +cgamex86.dll - 0 error(s), 0 warning(s)
diff --git a/reaction/cgame/cgame_ta.bat b/reaction/cgame/cgame_ta.bat index d5e22679..9ce2658c 100755 --- a/reaction/cgame/cgame_ta.bat +++ b/reaction/cgame/cgame_ta.bat @@ -1,6 +1,8 @@ +@echo off mkdir 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 @if errorlevel 1 goto quit diff --git a/reaction/cgame/compile.bat b/reaction/cgame/compile.bat index 69b5b1a1..10623323 100755 --- a/reaction/cgame/compile.bat +++ b/reaction/cgame/compile.bat @@ -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 diff --git a/reaction/game/ai_chat.c b/reaction/game/ai_chat.c index be3cc036..11695ea8 100644 --- a/reaction/game/ai_chat.c +++ b/reaction/game/ai_chat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // cleaned up the powerup code // @@ -751,7 +754,9 @@ int BotChat_Death(bot_state_t * bs) bs->botdeathtype == MOD_CRUSH || bs->botdeathtype == MOD_SUICIDE || 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); else if (bs->botdeathtype == MOD_TELEFRAG) BotAI_BotInitialChat(bs, "death_telefrag", name, NULL); diff --git a/reaction/game/ai_dmq3.c b/reaction/game/ai_dmq3.c index 27d147ab..c6e0e5d7 100644 --- a/reaction/game/ai_dmq3.c +++ b/reaction/game/ai_dmq3.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Adding unlagged. Still needs work. // @@ -3981,11 +3984,12 @@ int BotFuncDoorRotatingActivateGoal(bot_state_t * bs, int bspent, bot_activatego VectorAdd(mins, maxs, origin); VectorScale(origin, 0.5, origin); activategoal->goal.entitynum = entitynum; - VectorTargetDist(bs->origin, origin, -40, activategoal->origin); + VectorTargetDist(bs->origin, origin, -48, activategoal->origin); activategoal->openDoor = qtrue; activategoal->goal.number = 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; VectorSet(activategoal->goal.mins, -8, -8, -8); VectorSet(activategoal->goal.maxs, 8, 8, 8); diff --git a/reaction/game/ai_main.c b/reaction/game/ai_main.c index 25575e23..b00b69e1 100644 --- a/reaction/game/ai_main.c +++ b/reaction/game/ai_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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; 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++; continue; } diff --git a/reaction/game/bg_local.h b/reaction/game/bg_local.h index 376be428..fc9cebbd 100644 --- a/reaction/game/bg_local.h +++ b/reaction/game/bg_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // allow clipvelocity outside of the bg_'s // @@ -50,6 +53,9 @@ typedef struct { qboolean groundPlane; trace_t groundTrace; 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 opendoor; diff --git a/reaction/game/bg_misc.c b/reaction/game/bg_misc.c index c434e178..297b1486 100644 --- a/reaction/game/bg_misc.c +++ b/reaction/game/bg_misc.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -1580,14 +1583,14 @@ int MatFlags[] = { SURF_HARDMETAL }; -#define MatFlagCount 5 +#define MAT_FLAG_COUNT 5 int GetMaterialFromFlag(int flag) { int Material = 0; int i = 0; - for (i = 0; i < MatFlagCount; i++) { + for (i = 0; i < MAT_FLAG_COUNT; i++) { if ((flag & MatFlags[i])) { Material += (1 << i); } @@ -1596,48 +1599,6 @@ int GetMaterialFromFlag(int flag) 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 /* char *modelFromStr(char *s) { @@ -1673,7 +1634,7 @@ char *modelFromStr(char *s) if (!s) return NULL; - strncpy(buffer, s, 128); + strncpy(buffer, s, sizeof(buffer)); if ((p = Q_strrchr(buffer, '/')) != NULL) *p = '\0'; return buffer; @@ -1684,7 +1645,7 @@ char *skinFromStr(char *s) static char buffer[128]; char *p; - memset(buffer, 0, 128); + memset(buffer, 0, sizeof(buffer)); if (!s) return NULL; if (!*s) diff --git a/reaction/game/bg_pmove.c b/reaction/game/bg_pmove.c index 8e7e9e78..29ce8781 100644 --- a/reaction/game/bg_pmove.c +++ b/reaction/game/bg_pmove.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Support for torso pistol animations // @@ -1005,11 +1008,13 @@ static void PM_NoclipMove(void) PM_FootstepForSurface 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) { return 0; @@ -1152,7 +1157,7 @@ static void PM_CrashLand(void) pm->ps->stats[STAT_FALLDAMAGE] = damage; } else { - PM_AddEvent(PM_FootstepForSurface()); + PM_AddEvent(PM_FootstepForSurface(pml.groundTrace.surfaceFlags)); //Elder: added? useful? pm->ps->stats[STAT_FALLDAMAGE] = 0; } @@ -1171,8 +1176,9 @@ static void PM_CrashLand(void) // JBravo: new multiple itemcode } 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 - if (!pml.ladder || pm->ps->velocity[2] < 0) - PM_AddEvent(PM_FootstepForSurface()); + //Makro - ladder footsteps are handled in PM_LadderMove, chaging || to && + if (!pml.ladder && pm->ps->velocity[2] < 0) + PM_AddEvent(PM_FootstepForSurface(pml.groundTrace.surfaceFlags)); //Elder: added? useful? pm->ps->stats[STAT_FALLDAMAGE] = 0; } @@ -1563,7 +1569,7 @@ static void PM_Footsteps(void) if ((footstep && !pm->noFootsteps) // JBravo: new multiple itemcode && !(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) { // splashing @@ -2675,7 +2681,7 @@ Ladders with angles on them (urban2 for AQ2) haven't been tested. */ static void PM_LadderMove(void) { - int i; + int i, old; vec3_t wishvel; float wishspeed; vec3_t wishdir; @@ -2786,7 +2792,23 @@ static void PM_LadderMove(void) PM_StepSlideMove(qfalse); // move without gravity // 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); 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)) pml.ladder = qtrue; @@ -3012,7 +3037,9 @@ void PmoveSingle(pmove_t * pmove) PM_TorsoAnimation(); // footstep events / legs animations - PM_Footsteps(); + //Makro - ladder footsteps already handled in PM_LadderMove + if (!pml.ladder) + PM_Footsteps(); // entering / leaving water splashes // JBravo: only if you are alive diff --git a/reaction/game/bg_public.h b/reaction/game/bg_public.h index 404115be..9e1de8ee 100644 --- a/reaction/game/bg_public.h +++ b/reaction/game/bg_public.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -294,10 +297,18 @@ #define RQ3_DEBRIS_POPCAN 0x00000800 // Elder: dynamic light switches -#define DLIGHT_ADDITIVE 1 -#define DLIGHT_FLICKER 2 -#define DLIGHT_PULSE 4 -#define DLIGHT_STROBE 8 +//Makro - new flag; reordered old ones +#define DLIGHT_CUSTOMSTYLE 63 + +#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 #define RQ3_MAX_BREAKABLES 64 @@ -438,7 +449,8 @@ enum { SCREENSHOT, OWNED, CVARSET, - CTBCOUNTDOWN + CTBCOUNTDOWN, + ZCAMTEXT //Makro - added }; //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_ATMOSEFFECT 28 // q3f: Atmospheric effect, if any. -#define CS_SHADOWS 29 +#define CS_SHADOWS 29 //Makro - color for the loading screen text //#define CS_LOADINGSCREEN 29 //Makro - sky portals ! -#define CS_SKYPORTAL 30 +#define CS_SKYPORTAL 30 //Makro - fog hull -#define CS_FOGHULL 31 +#define CS_FOGHULL 31 -#define CS_MODELS 32 -#define CS_SOUNDS (CS_MODELS+MAX_MODELS) -#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) -#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) -#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) +#define CS_MODELS 32 +#define CS_SOUNDS (CS_MODELS+MAX_MODELS) +#define CS_PLAYERS (CS_SOUNDS+MAX_SOUNDS) +#define CS_LOCATIONS (CS_PLAYERS+MAX_CLIENTS) +//Makro - CS_PARTICLES not used, removing +//#define CS_PARTICLES (CS_LOCATIONS+MAX_LOCATIONS) //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 #error overflow: (CS_MAX) > MAX_CONFIGSTRINGS @@ -862,16 +881,24 @@ typedef enum { #define EF_HEADLESS 0x00000200 // NiceAss: Replaced EF_KAMAKAZI #define EF_MOVER_STOP 0x00000400 // will push otherwise #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_CONNECTION 0x00002000 // draw a connection trouble sprite #define EF_VOTED 0x00004000 // already cast a vote #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_ASSIST 0x00020000 // draw a assist sprite #define EF_AWARD_DENIED 0x00040000 // denied #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 typedef enum { PW_NONE, @@ -1386,7 +1413,10 @@ typedef enum { MOD_M3, MOD_HANDCANNON, 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; //--------------------------------------------------------- @@ -1524,43 +1554,11 @@ qboolean BG_PlayerTouchesItem(playerState_t * ps, entityState_t * item, int atTi #define KAMI_BOOMSPHERE_MAXRADIUS 720 #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 #define NUM_CROSSHAIRS 10 //Makro - for the SSG crosshair preview #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); weapon_t CharToWeapon(char *name, weapon_t defweapon); diff --git a/reaction/game/bg_slidemove.c b/reaction/game/bg_slidemove.c index 51086459..112e4a69 100644 --- a/reaction/game/bg_slidemove.c +++ b/reaction/game/bg_slidemove.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // physics back to 2.0 // @@ -291,11 +294,15 @@ void PM_StepSlideMove(qboolean gravity) if (!trace.allsolid) VectorCopy(trace.endpos, pm->ps->origin); - if (trace.plane.normal[2] < 0.7f) { - VectorCopy(down_o, pm->ps->origin); - VectorCopy(down_v, pm->ps->velocity); - return; - } + //Makro - possible fix for the "player stuck on stairs" bug ? + //if (trace.plane.normal[0] || trace.plane.normal[1] || trace.plane.normal[2]) + //{ + 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]; diff --git a/reaction/game/g_cmds.c b/reaction/game/g_cmds.c index d241ddcd..435d885e 100644 --- a/reaction/game/g_cmds.c +++ b/reaction/game/g_cmds.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -2069,10 +2072,14 @@ void Cmd_CallVote_f(gentity_t * ent) } // if there is still a vote to be executed + //Makro - commented out + /* if (level.voteExecuteTime) { level.voteExecuteTime = 0; trap_SendConsoleCommand(EXEC_APPEND, va("%s\n", level.voteString)); } + */ + // special case for g_gametype, check for bad values if (!Q_stricmp(arg1, "g_gametype")) { i = atoi(arg2); @@ -2502,13 +2509,14 @@ void Cmd_OpenDoor(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--; if (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->weapon_after_bandage_warned) { ent->client->weapon_after_bandage_warned = qtrue; @@ -2661,6 +2669,10 @@ void Cmd_New_Weapon(gentity_t * ent) // Hawkins make sure spread comes back 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 if (ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_LOW || ent->client->ps.stats[STAT_RQ3] & RQ3_ZOOM_MED) diff --git a/reaction/game/g_combat.c b/reaction/game/g_combat.c index a660258f..d2ffead8 100644 --- a/reaction/game/g_combat.c +++ b/reaction/game/g_combat.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Wratted all calls to G_FreeEnt() to avoid crashing and provide debugging // @@ -657,7 +660,9 @@ char *modNames[] = { "MOD_M3", "MOD_HANDCANNON", "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)); break; 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; } if (attacker == target) { @@ -1630,6 +1642,8 @@ void player_die(gentity_t * self, gentity_t * inflictor, gentity_t * attacker, i i = (i + 1) % 3; } + self->physicsObject = qfalse; + // JBravo: lets not relink players that have been gibbed here. if (!self->client->gibbed) 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); break; default: - G_Printf("G_Damage: Received unknown MOD - using default knockback\n"); - knockback = 50; + //Makro - custom death message implies a trigger_hurt + 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; } } @@ -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 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; instant_dam = 0; diff --git a/reaction/game/g_items.c b/reaction/game/g_items.c index c35bfee4..b4710f41 100644 --- a/reaction/game/g_items.c +++ b/reaction/game/g_items.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // New code for respawning entities in TP // @@ -1330,7 +1333,6 @@ void G_RunItem(gentity_t * ent) ent->s.pos.trTime = level.time; } } - if (ent->s.pos.trType == TR_STATIONARY) { // check think function G_RunThink(ent); diff --git a/reaction/game/g_local.h b/reaction/game/g_local.h index 19b4795d..c1668818 100644 --- a/reaction/game/g_local.h +++ b/reaction/game/g_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -532,6 +535,8 @@ struct gentity_s { //Makro - called at the begining of the round in TP void (*reset) (gentity_t *self); 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 fly_sound_debounce_time; // wind tunnel @@ -575,9 +580,15 @@ struct gentity_s { float distance; // VALKYRIE: for rotating door //Blaze: Holds the target set by a button char *pathtarget; - //Makro - added + //Makro - inactive entities char *activatename, *targetInactive; int inactive; + //Makro - entity id strings + char *alias; + //Makro - moveparent + char *moveParent; + gentity_t *moveParent_ent; + int moveParent_rank; }; typedef enum { @@ -971,6 +982,12 @@ typedef struct { qboolean teams_assigned[MAX_TEAMS]; gentity_t *potential_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; // @@ -1076,6 +1093,8 @@ double G_acos(double x); //Makro - added 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); void G_UseEntities(gentity_t * ent, char *target, 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_EvaluateTrajectory(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_CreatePressure(vec3_t origin, vec3_t normal, gentity_t * ent); qboolean G_FileExists(char *filename); @@ -1384,6 +1404,8 @@ void BotTestAAS(vec3_t origin); extern level_locals_t level; 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)) @@ -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 +//Makro - saves a custom death message index in "field" +void G_InitCustomDeathMessage(gentity_t *ent, int *field); + //Slicer: MatchMode #include "g_matchmode.h" diff --git a/reaction/game/g_main.c b/reaction/game/g_main.c index 03d16a47..3e7c295a 100644 --- a/reaction/game/g_main.c +++ b/reaction/game/g_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Made g_RQ3_haveHelmet a systeminfo cvar. // @@ -434,6 +437,7 @@ int trap_RealTime(qtime_t * qtime); gentity_t *getEntByName(char *name); void AddIP(char *str); +void G_SetGlobalRefSystem(int newRefSys); level_locals_t level; typedef struct { @@ -448,6 +452,9 @@ typedef struct { gentity_t g_entities[MAX_GENTITIES]; 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_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: return (int) ClientConnect(arg0, arg1, arg2); case GAME_CLIENT_THINK: + //G_SetGlobalRefSystem(REFSYSTEM_WORLD); ClientThink(arg0); + //G_SetGlobalRefSystem(REFSYSTEM_OWN); return 0; case GAME_CLIENT_USERINFO_CHANGED: 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; imoveParent_ent = NULL; + ent->moveParent_rank = RANK_NONE; + if (ent->moveParent) + { + int j; + for (j=0; jmoveParent)) + { + 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; imoveParent_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; imoveParent_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; imoveParent_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 @@ -1238,6 +1371,9 @@ void G_InitGame(int levelTime, int randomSeed, int restart) ClearRegisteredItems(); + //Makro - no dlight styles by default + trap_SetConfigstring(CS_DLIGHT_STYLES, "\\n\\0"); + // parse the key/value pairs and spawn gentities G_SpawnEntitiesFromString(); @@ -1329,6 +1465,10 @@ void G_InitGame(int levelTime, int randomSeed, int restart) } G_RemapTeamShaders(); + + //Makro - moveparents stuff + G_InitMoveParents(); + G_SetMoveParentOrder(); } /* @@ -2404,7 +2544,7 @@ void CheckVote(void) if (Q_stricmp(level.voteString, "cyclemap") == 0) { BeginIntermission(); } 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; BeginIntermission(); } else if (Q_stricmp(level.voteString, "g_gametype") == 0) { @@ -2627,8 +2767,19 @@ void G_RunThink(gentity_t * ent) ent->nextthink = 0; if (!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; msec = level.time - level.previousTime; + //Makro - in progress + //G_UpdateParentDeltas(); + //G_AddParentDeltas(); + // get any cvar changes G_UpdateCvars(); @@ -2665,8 +2820,9 @@ void G_RunFrame(int levelTime) // go through all allocated objects // start = trap_Milliseconds(); - ent = &g_entities[0]; - for (i = 0; i < level.num_entities; i++, ent++) { + //Makro - use g_parentOder + for (i = 0; i < level.num_entities; i++) { + ent = g_parentOrder[i]; if (!ent->inuse) { continue; } @@ -2702,23 +2858,36 @@ void G_RunFrame(int levelTime) } if (ent->s.eType == ET_ITEM || ent->physicsObject) { + //G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD); G_RunItem(ent); continue; } if (ent->s.eType == ET_MOVER) { + //G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD); G_RunMover(ent); + G_RunAttachedEnt(ent); continue; } - if (i < MAX_CLIENTS) { + if (ent-g_entities < MAX_CLIENTS) { G_RunClient(ent); // Basicly calls ClientThink_real() continue; } + if (ent->moveParent_ent) + G_RunAttachedEnt(ent); + + //G_ChangeEntRefSystem(ent, REFSYSTEM_WORLD); G_RunThink(ent); } + //Makro - undo the refsystem changes + //G_SetGlobalRefSystem(REFSYSTEM_OWN); + + //Makro - in progress + //G_AdjustCoordinates(); + end = trap_Milliseconds(); start = trap_Milliseconds(); @@ -2803,6 +2972,7 @@ void RQ3_StartUniqueItems(void) if ((int) g_RQ3_weaponban.integer & ITF_SLIPPERS) { rq3_item = BG_FindItemForHoldable(HI_SLIPPERS); 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); angle += 30; } diff --git a/reaction/game/g_misc.c b/reaction/game/g_misc.c index 098f568c..b89d7056 100644 --- a/reaction/game/g_misc.c +++ b/reaction/game/g_misc.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -360,6 +363,32 @@ void SP_dlight(gentity_t * ent) G_SpawnFloat("light2", "0", &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) + { + 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; VectorCopy(ent->s.origin, ent->r.currentOrigin); @@ -416,6 +445,8 @@ void SP_dlight(gentity_t * ent) ent->unbreakable = 1; 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; 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) { + 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) - 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); } +//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; imessage, 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) { int health; @@ -1145,9 +1215,13 @@ void SP_func_breakable(gentity_t * ent) ent->health_saved = health; ent->takedamage = qtrue; - 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])); + //Makro - custom death message + G_InitCustomDeathMessage(ent, &ent->methodOfDeath); + + //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 ent->s.eType = ET_BREAKABLE; @@ -1163,6 +1237,7 @@ void SP_func_breakable(gentity_t * ent) //ent->nextthink = level.time + FRAMETIME; //ent->think = Think_SpawnNewDoorTrigger; + ent->r.svFlags |= SVF_USE_CURRENT_ORIGIN; 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); + } + } + } +} + diff --git a/reaction/game/g_missile.c b/reaction/game/g_missile.c index 52b3d896..8f30131f 100644 --- a/reaction/game/g_missile.c +++ b/reaction/game/g_missile.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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 :/ #include "surfaceflags.h" -int GetMaterialFromFlag(int flag); -qboolean IsMetalMat(int Material); -qboolean IsMetalFlag(int flag); - #define MISSILE_PRESTEP_TIME 50 /* diff --git a/reaction/game/g_mover.c b/reaction/game/g_mover.c index 20df01fb..48763f67 100644 --- a/reaction/game/g_mover.c +++ b/reaction/game/g_mover.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -253,48 +256,6 @@ gentity_t *G_TestEntityPosition(gentity_t * ent) 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 @@ -328,15 +289,20 @@ qboolean G_TryPushingEntity(gentity_t * check, gentity_t * pusher, vec3_t move, // try moving the contacted entity // figure movement due to the pusher's amove - G_CreateRotationMatrix(amove, transpose); - G_TransposeMatrix(transpose, matrix); + CreateRotationMatrix(amove, transpose); + TransposeMatrix(transpose, matrix); if (check->client) { VectorSubtract(check->client->ps.origin, pusher->r.currentOrigin, org); } else { 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); - G_RotatePoint(org2, matrix); + RotatePoint(org2, matrix); VectorSubtract(org2, org, move2); // add movement 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); // make sure the client's view rotates when on a rotating mover 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 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 // totalMins / totalMaxs are the bounds for the entire move - if (pusher->r.currentAngles[0] || pusher->r.currentAngles[1] || pusher->r.currentAngles[2] - || amove[0] || amove[1] || amove[2]) { + //Makro - check yaw first, then pitch, then roll (instead of [0], [1], [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; radius = RadiusFromBounds(pusher->r.mins, pusher->r.maxs); @@ -614,8 +586,9 @@ void G_MoverTeam(gentity_t * ent) pushed_p = pushed; for (part = ent; part; part = part->teamchain) { // get current position - G_EvaluateTrajectory(&part->s.pos, level.time, origin); - G_EvaluateTrajectory(&part->s.apos, level.time, angles); + //G_EvaluateTrajectory(&part->s.pos, level.time, origin); + //G_EvaluateTrajectory(&part->s.apos, level.time, angles); + G_EvaluateTrajectoryEx(part, level.time, origin, angles); VectorSubtract(origin, part->r.currentOrigin, move); VectorSubtract(angles, part->r.currentAngles, amove); if (!G_MoverPush(part, move, amove, &obstacle)) { @@ -628,8 +601,11 @@ void G_MoverTeam(gentity_t * ent) for (part = ent; part; part = part->teamchain) { part->s.pos.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.apos, level.time, part->r.currentAngles); + //G_EvaluateTrajectory(&part->s.pos, level.time, part->r.currentOrigin); + //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__); } @@ -668,6 +644,12 @@ G_RunMover */ 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 // the captain will handle everything 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; break; } - G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin); - G_EvaluateTrajectory(&ent->s.apos, level.time, ent->r.currentAngles); + //G_EvaluateTrajectory(&ent->s.pos, level.time, ent->r.currentOrigin); + //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__); } @@ -1199,6 +1182,9 @@ void InitMover(gentity_t * ent) G_SpawnInt("health", "0", &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 lightSet = G_SpawnFloat("light", "100", &light); colorSet = G_SpawnVector("color", "1 1 1", color); @@ -1314,7 +1300,13 @@ void Blocked_Door(gentity_t * ent, gentity_t * other) } 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 ) { //Elder: new crusher flag @@ -1451,9 +1443,23 @@ void Think_SpawnNewDoorTrigger(gentity_t * ent) if (!(ent->targetname) && !ent->health) { other = G_Spawn(); other->classname = "door_trigger"; - VectorCopy(mins, other->r.mins); - VectorCopy(maxs, other->r.maxs); + VectorCopy(mins, other->r.absmin); + VectorCopy(maxs, other->r.absmax); 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->touch = Touch_DoorTrigger; // remember the thinnest axis @@ -1903,6 +1909,9 @@ void InitRotator(gentity_t * ent) ent->use = Use_BinaryMover; ent->reached = Reached_BinaryMover; + //Makro - custom death message + G_InitCustomDeathMessage(ent, &ent->methodOfDeath); + ent->moverState = ROTATOR_POS1; ent->r.svFlags = SVF_USE_CURRENT_ORIGIN; ent->s.eType = ET_MOVER; @@ -2328,6 +2337,33 @@ void Think_SetupTrainTargets(gentity_t * 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) Train path corners. Target: next path corner and other targets to fire @@ -2350,6 +2386,13 @@ void SP_path_corner(gentity_t * self) //Makro - added if (self->spawnflags & 1) 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 } @@ -2545,10 +2588,12 @@ void SP_func_static(gentity_t * ent) InitMover(ent); VectorCopy(ent->s.origin, ent->s.pos.trBase); VectorCopy(ent->s.origin, ent->r.currentOrigin); + VectorCopy(ent->s.apos.trBase, ent->r.currentAngles); //Makro - added ent->use = use_func_static; ent->reset = reset_func_static; ent->reset(ent); + trap_RQ3LinkEntity(ent, __LINE__, __FILE__); } /* diff --git a/reaction/game/g_rankings.c b/reaction/game/g_rankings.c index 441ff5cc..1fd2def2 100644 --- a/reaction/game/g_rankings.c +++ b/reaction/game/g_rankings.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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: return; default: + //Makro - custom death message implies a trigger_hurt + if (means_of_death >= MOD_CUSTOM) + return; 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); break; 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; } } else if (attacker == self) { diff --git a/reaction/game/g_spawn.c b/reaction/game/g_spawn.c index 003466c8..79cc05c9 100644 --- a/reaction/game/g_spawn.c +++ b/reaction/game/g_spawn.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -253,6 +256,9 @@ field_t fields[] = { {"pathtarget", FOFS(pathtarget), F_LSTRING}, // Makro - for func_trains {"inactive", FOFS(inactive), F_INT}, // Makro - for inactive objects {"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 {NULL} }; diff --git a/reaction/game/g_trigger.c b/reaction/game/g_trigger.c index 31f8c10a..9d5ebec4 100644 --- a/reaction/game/g_trigger.c +++ b/reaction/game/g_trigger.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -132,13 +135,6 @@ void multi_trigger(gentity_t * ent, gentity_t * activator) if (ent->nextthink) { 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 ? if (ent->inactive) { //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) { - if (!other->client) { + if (!other || !other->client) { 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); } @@ -581,7 +582,12 @@ void hurt_touch(gentity_t * self, gentity_t * other, trace_t * trace) dflags = DAMAGE_NO_PROTECTION; else 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) @@ -597,6 +603,9 @@ void SP_trigger_hurt(gentity_t * self) self->r.contents = CONTENTS_TRIGGER; + //Makro - custom death message + G_InitCustomDeathMessage(self, &self->methodOfDeath); + //Makro - removed this check //if ( self->spawnflags & 2 ) { self->use = hurt_use; diff --git a/reaction/game/g_utils.c b/reaction/game/g_utils.c index 0eb5520a..a5fc34ba 100644 --- a/reaction/game/g_utils.c +++ b/reaction/game/g_utils.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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; } +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 @@ -310,7 +370,12 @@ void G_UseEntities(gentity_t * ent, char *target, gentity_t * activator) } 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

Build Log

---------------------Configuration: cgame - Win32 Release-------------------- +--------------------Configuration: game - Win32 Debug--------------------

Command Lines

-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 -"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" -

Output Window

-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... -

Output Window

- - - -

Results

-cgamex86.dll - 0 error(s), 6 warning(s) -

---------------------Configuration: game - Win32 Release-------------------- -

-

Command Lines

-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" +/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\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 temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP52D.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP375B.tmp" +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" -\Work\rq3source\reaction\Release\ai_chat.obj -\Work\rq3source\reaction\Release\ai_cmd.obj -\Work\rq3source\reaction\Release\ai_dmnet.obj -\Work\rq3source\reaction\Release\ai_dmq3.obj -\Work\rq3source\reaction\Release\ai_main.obj -\Work\rq3source\reaction\Release\ai_team.obj -\Work\rq3source\reaction\Release\ai_vcmd.obj -\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\g_active.obj -\Work\rq3source\reaction\Release\g_arenas.obj -\Work\rq3source\reaction\Release\g_bot.obj -\Work\rq3source\reaction\Release\g_client.obj -\Work\rq3source\reaction\Release\g_cmds.obj -\Work\rq3source\reaction\Release\g_combat.obj -\Work\rq3source\reaction\Release\g_fileio.obj -\Work\rq3source\reaction\Release\g_items.obj -\Work\rq3source\reaction\Release\g_main.obj -\Work\rq3source\reaction\Release\g_matchmode.obj -\Work\rq3source\reaction\Release\g_mem.obj -\Work\rq3source\reaction\Release\g_misc.obj -\Work\rq3source\reaction\Release\g_missile.obj -\Work\rq3source\reaction\Release\g_mover.obj -\Work\rq3source\reaction\Release\g_session.obj -\Work\rq3source\reaction\Release\g_spawn.obj -\Work\rq3source\reaction\Release\g_svcmds.obj -\Work\rq3source\reaction\Release\g_syscalls.obj -\Work\rq3source\reaction\Release\g_target.obj -\Work\rq3source\reaction\Release\g_team.obj -\Work\rq3source\reaction\Release\g_teamplay.obj -\Work\rq3source\reaction\Release\g_trigger.obj -\Work\rq3source\reaction\Release\g_unlagged.obj -\Work\rq3source\reaction\Release\g_utils.obj -\Work\rq3source\reaction\Release\g_weapon.obj -\Work\rq3source\reaction\Release\q_math.obj -\Work\rq3source\reaction\Release\q_shared.obj -\Work\rq3source\reaction\Release\rxn_game.obj -\Work\rq3source\reaction\Release\zcam.obj -\Work\rq3source\reaction\Release\zcam_target.obj +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" +c:\reactionoutput\ai_chat.obj +c:\reactionoutput\ai_cmd.obj +c:\reactionoutput\ai_dmnet.obj +c:\reactionoutput\ai_dmq3.obj +c:\reactionoutput\ai_main.obj +c:\reactionoutput\ai_team.obj +c:\reactionoutput\ai_vcmd.obj +c:\reactionoutput\bg_misc.obj +c:\reactionoutput\bg_pmove.obj +c:\reactionoutput\bg_slidemove.obj +c:\reactionoutput\g_active.obj +c:\reactionoutput\g_arenas.obj +c:\reactionoutput\g_bot.obj +c:\reactionoutput\g_client.obj +c:\reactionoutput\g_cmds.obj +c:\reactionoutput\g_combat.obj +c:\reactionoutput\g_fileio.obj +c:\reactionoutput\g_items.obj +c:\reactionoutput\g_main.obj +c:\reactionoutput\g_matchmode.obj +c:\reactionoutput\g_mem.obj +c:\reactionoutput\g_misc.obj +c:\reactionoutput\g_missile.obj +c:\reactionoutput\g_mover.obj +c:\reactionoutput\g_session.obj +c:\reactionoutput\g_spawn.obj +c:\reactionoutput\g_svcmds.obj +c:\reactionoutput\g_syscalls.obj +c:\reactionoutput\g_target.obj +c:\reactionoutput\g_team.obj +c:\reactionoutput\g_teamplay.obj +c:\reactionoutput\g_trigger.obj +c:\reactionoutput\g_unlagged.obj +c:\reactionoutput\g_utils.obj +c:\reactionoutput\g_weapon.obj +c:\reactionoutput\q_math.obj +c:\reactionoutput\q_shared.obj +c:\reactionoutput\rxn_game.obj +c:\reactionoutput\zcam.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"

Output Window

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 -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... - 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... -

Output Window

Results

-qagamex86.dll - 0 error(s), 4 warning(s) -

---------------------Configuration: ui - Win32 Release TA-------------------- -

-

Command Lines

-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" -

Output Window

-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... -

Output Window

- - - -

Results

-uix86.dll - 0 error(s), 0 warning(s) +qagamex86.dll - 0 error(s), 0 warning(s) diff --git a/reaction/game/q_math.c b/reaction/game/q_math.c index 71833283..56232a01 100644 --- a/reaction/game/q_math.c +++ b/reaction/game/q_math.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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] = { {-0.525731f, 0.000000f, 0.850651f} , {-0.442863f, 0.238856f, 0.864188f} @@ -311,6 +577,8 @@ vec3_t bytedirs[NUMVERTEXNORMALS] = { {-0.587785f, -0.425325f, -0.688191f} , {-0.688191f, -0.587785f, -0.425325f} }; +*/ + //============================================================== @@ -418,7 +686,17 @@ signed short ClampShort(int 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! +/* int DirToByte(vec3_t dir) { int i, best; @@ -440,6 +718,7 @@ int DirToByte(vec3_t dir) return best; } +*/ void ByteToDir(int b, vec3_t dir) { @@ -1487,3 +1766,125 @@ int ReflectVectorByte(vec3_t dir, vec3_t plane) 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; +} + diff --git a/reaction/game/q_shared.h b/reaction/game/q_shared.h index f57f1164..330a00ec 100644 --- a/reaction/game/q_shared.h +++ b/reaction/game/q_shared.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -414,9 +417,14 @@ typedef int clipHandle_t; #define MIN_QINT (-MAX_QINT-1) // angle indexes -#define PITCH 0 // up / down -#define YAW 1 // left / right -#define ROLL 2 // fall over +#define PITCH 0 // up / down +#define YAW 1 // left / right +#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 // exceed MAX_STRING_CHARS @@ -562,7 +570,8 @@ typedef int fixed16_t; #define M_PI 3.14159265358979323846f // matches value in gcc v2 math.h #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]; // 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_MAGENTA "^6" #define S_COLOR_WHITE "^7" +//Makro - reset color +#define S_COLOR_RESET "^*" extern vec4_t g_color_table[8]; #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 +//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 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); 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); diff --git a/reaction/game/surfaceflags.h b/reaction/game/surfaceflags.h index ae11d2e0..dc29f9e9 100644 --- a/reaction/game/surfaceflags.h +++ b/reaction/game/surfaceflags.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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_WOOD2 0x8000000 #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 ) ) ) diff --git a/reaction/ta_ui/menudef.h b/reaction/ta_ui/menudef.h index 92e92cd6..747e2ce0 100644 --- a/reaction/ta_ui/menudef.h +++ b/reaction/ta_ui/menudef.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Replacements and stuff // @@ -248,6 +251,9 @@ #define CG_2NDPLACE 68 #define CG_CAPTURES 69 +//Makro - clock +#define UI_CLOCK 149 + //Makro - for SSG crosshair selection #define UI_SSG_CROSSHAIR 150 diff --git a/reaction/ta_ui/ta_ui.dsp b/reaction/ta_ui/ta_ui.dsp index 552cfbe1..27dd664b 100644 --- a/reaction/ta_ui/ta_ui.dsp +++ b/reaction/ta_ui/ta_ui.dsp @@ -44,7 +44,8 @@ RSC=rc.exe # PROP Ignore_Export_Lib 0 # 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 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 MTL /nologo /D "NDEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "NDEBUG" @@ -66,12 +67,13 @@ LINK32=link.exe # PROP BASE Target_Dir "" # PROP Use_MFC 0 # PROP Use_Debug_Libraries 1 -# PROP Output_Dir "Debug" -# PROP Intermediate_Dir "Debug" +# PROP Output_Dir "D:\Work\rq3source\reaction\Release" +# PROP Intermediate_Dir "D:\Work\rq3source\reaction\Release" # PROP Ignore_Export_Lib 0 # 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 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 MTL /nologo /D "_DEBUG" /mktyplib203 /win32 # ADD BASE RSC /l 0x409 /d "_DEBUG" @@ -82,7 +84,7 @@ BSC32=bscmake.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 # 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 !ENDIF diff --git a/reaction/ta_ui/ta_ui.plg b/reaction/ta_ui/ta_ui.plg index a04dd423..caa390c6 100644 --- a/reaction/ta_ui/ta_ui.plg +++ b/reaction/ta_ui/ta_ui.plg @@ -3,12 +3,12 @@
 

Build Log

---------------------Configuration: ui - Win32 Release TA-------------------- +--------------------Configuration: ui - Win32 Debug TA--------------------

Command Lines

-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\q_math.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_util.c" ] -Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BD.tmp" -Creating temporary file "C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP4BE.tmp" with contents +Creating command line "cl.exe @C:\DOCUME~1\Andrei\LOCALS~1\Temp\RSP17B.tmp" +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\q_math.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_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"

Output Window

Compiling... bg_misc.c q_math.c +d:\work\rq3source\reaction\game\q_math.c(1885) : warning C4101: 'result' : unreferenced local variable q_shared.c ui_atoms.c ui_gameinfo.c @@ -50,27 +51,11 @@ 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\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... -

Output Window

Results

-uix86.dll - 0 error(s), 0 warning(s) +uix86.dll - 0 error(s), 1 warning(s)
diff --git a/reaction/ta_ui/ui.bat b/reaction/ta_ui/ui.bat index 7a979cdc..69d0259e 100644 --- a/reaction/ta_ui/ui.bat +++ b/reaction/ta_ui/ui.bat @@ -1,7 +1,8 @@ +@echo off mkdir 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 @if errorlevel 1 goto quit diff --git a/reaction/ta_ui/ui_atoms.c b/reaction/ta_ui/ui_atoms.c index 1e2f58f6..2a048c3e 100644 --- a/reaction/ta_ui/ui_atoms.c +++ b/reaction/ta_ui/ui_atoms.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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); 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) @@ -644,7 +648,8 @@ void UI_DrawHandlePic(float x, float y, float w, float h, qhandle_t hShader) } 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); 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); } @@ -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) { UI_AdjustFrom640(&x, &y, &w, &h); - 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, 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) { 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 + h - 1, 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); + 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); } /* diff --git a/reaction/ta_ui/ui_local.h b/reaction/ta_ui/ui_local.h index c5c35687..8dc98f68 100644 --- a/reaction/ta_ui/ui_local.h +++ b/reaction/ta_ui/ui_local.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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_teamModel; +//Makro - maxpolys hack +extern vmCvar_t ui_maxpolys; + // // ui_qmenu.c // @@ -1005,7 +1011,6 @@ typedef struct { //Makro - weapon/item bans int weapBan, itemBan; - } uiInfo_t; extern uiInfo_t uiInfo; diff --git a/reaction/ta_ui/ui_main.c b/reaction/ta_ui/ui_main.c index d5d844ca..092cfffc 100644 --- a/reaction/ta_ui/ui_main.c +++ b/reaction/ta_ui/ui_main.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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_debug; +//Makro - renamed to ui_developer +//vmCvar_t ui_debug; +vmCvar_t ui_developer; vmCvar_t ui_initialized; vmCvar_t ui_teamArenaFirstRun; @@ -588,20 +593,44 @@ void AssetCache() 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) { UI_AdjustFrom640(&x, &y, &w, &h); size *= uiInfo.uiDC.xscale; - 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, 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) { UI_AdjustFrom640(&x, &y, &w, &h); size *= uiInfo.uiDC.yscale; - 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, 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 count, len; + int count, len, maxPixels = 0; float out; glyphInfo_t *glyph; float useScale; @@ -639,8 +668,12 @@ int Text_Width(const char *text, float scale, int limit) useScale = scale * font->glyphScale; out = 0; if (text) { - len = strlen(text); - if (limit > 0 && len > limit) { + //Makro - strlen doesn't take into account color escape sequences + len = Q_PrintStrlen(text); + //Makro - new feature: negative limit = -max pixels + if (limit < 0) { + maxPixels = -limit; + } else if (limit > 0 && len > limit) { len = limit; } count = 0; @@ -651,6 +684,10 @@ int Text_Width(const char *text, float scale, int limit) } else { glyph = &font->glyphs[(int) *s]; out += glyph->xSkip; + //Makro - added + if (maxPixels) + if (out > maxPixels) + break; s++; count++; } @@ -699,6 +736,8 @@ int Text_Height(const char *text, float scale, int limit) } //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) { char buf[1024]; @@ -723,16 +762,20 @@ void Text_PaintChar(float x, float y, float width, float height, float scale, fl w = width * scale; h = height * scale; 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) { int len, count; + qboolean underlined = qfalse; vec4_t newColor; - glyphInfo_t *glyph; float useScale; 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; @@ -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; //float yadj = scale * (Assets.textFont.glyphs[text[i]].imageHeight - Assets.textFont.glyphs[text[i]].height); if (Q_IsColorString(s)) { - memcpy(newColor, g_color_table[ColorIndex(*(s + 1))], sizeof(newColor)); - newColor[3] = color[3]; - trap_R_SetColor(newColor); + //Makro - new tricks + if (*(s+1) == '*') + { + 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; continue; } else { float yadj = useScale * glyph->top; - if (style == ITEM_TEXTSTYLE_SHADOWED || style == ITEM_TEXTSTYLE_SHADOWEDMORE) { 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->imageHeight, 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; 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, int limit, int style) { @@ -946,6 +1159,10 @@ void UI_ShowPostGame(qboolean newHigh) _UI_SetActiveMenu(UIMENU_POSTGAME); } + +//Makro - added +int GMemory(); + /* ================= _UI_Refresh @@ -967,20 +1184,28 @@ void UI_DrawCenteredPic(qhandle_t image, int w, int h) UI_DrawHandlePic(x, y, w, h, image); } -int frameCount = 0; -int startTime; +//int frameCount = 0; +//int startTime; #define UI_FPS_FRAMES 4 void _UI_Refresh(int realtime) { static int index; static int previousTimes[UI_FPS_FRAMES]; + //Makro - smoother version + static int FPSCheckTime = 0, frameCount = 0; int modelModCount; + //Makro - added + uiClientState_t cstate; //if ( !( trap_Key_GetCatcher() & KEYCATCH_UI ) ) { // return; //} + uiInfo.uiDC.pendingPolys = 0; + uiInfo.uiDC.polyZ = 0; + uiInfo.uiDC.scene2D.time = realtime; + uiInfo.uiDC.frameTime = realtime - uiInfo.uiDC.realTime; uiInfo.uiDC.realTime = realtime; @@ -999,6 +1224,14 @@ void _UI_Refresh(int realtime) } 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; UI_UpdateCvars(); @@ -1023,14 +1256,89 @@ void _UI_Refresh(int realtime) // refresh find player list 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 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; if (!size) 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 if (uiInfo.uiDC.debug) { // cursor coordinates @@ -2439,6 +2747,25 @@ static void UI_DrawCrosshair(rectDef_t * rect, float scale, vec4_t color) 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 static void UI_DrawSSGCrosshair(rectDef_t * rect) { @@ -2725,7 +3052,7 @@ void UI_SelectReplacement(void) void UI_BuildReplacementList(const char *type) { int i, numfiles, filelen; - char filelist[2048], *fileptr; + char filelist[8192], *fileptr; if (!type || !*type) return; @@ -3101,49 +3428,6 @@ static void UI_DrawReplacementSubtype(rectDef_t * rect, float scale, vec4_t colo } 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; refdef_t refdef; @@ -3229,16 +3513,31 @@ static void UI_DrawReplacementModel(rectDef_t *rect) // 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 textStyle) { rectDef_t rect; - rect.x = x + text_x; - rect.y = y + text_y; rect.w = w; 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) { 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: UI_DrawSSGCrosshair(&rect); break; + case UI_CLOCK: + UI_DrawClock(item, &rect, scale, color, textStyle); + break; //Makro - radio presets case UI_RQ3_RADIOPRESET1: case UI_RQ3_RADIOPRESET2: @@ -5775,7 +6077,7 @@ static void UI_BuildServerDisplayList(qboolean force) if (len == 0) { //Makro - changing from Team Arena to RQ3 beta2 //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); } 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 @@ -7253,9 +7586,16 @@ void _UI_Init(qboolean inGameLoad) UI_RegisterCvars(); UI_InitMemory(); + // cache redundant calulations 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 uiInfo.uiDC.yscale = uiInfo.uiDC.glconfig.vidHeight * (1.0 / 480.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; } + 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(); uiInfo.uiDC.registerShaderNoMip = &trap_R_RegisterShaderNoMip; uiInfo.uiDC.setColor = &UI_SetColor; 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; + //Makro - angled text + uiInfo.uiDC.drawAngledText = &Text_PaintAngled; uiInfo.uiDC.textWidth = &Text_Width; uiInfo.uiDC.textHeight = &Text_Height; uiInfo.uiDC.registerModel = &trap_R_RegisterModel; @@ -7282,10 +7638,14 @@ void _UI_Init(qboolean inGameLoad) uiInfo.uiDC.drawRect = &_UI_DrawRect; uiInfo.uiDC.drawSides = &_UI_DrawSides; uiInfo.uiDC.drawTopBottom = &_UI_DrawTopBottom; - uiInfo.uiDC.clearScene = &trap_R_ClearScene; - uiInfo.uiDC.drawSides = &_UI_DrawSides; + //Makro - angled rectangles + 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.renderScene = &trap_R_RenderScene; + //uiInfo.uiDC.renderScene = &trap_R_RenderScene; + uiInfo.uiDC.renderScene = &UI_RenderScene; uiInfo.uiDC.registerFont = &trap_R_RegisterFont; uiInfo.uiDC.ownerDrawItem = &UI_OwnerDraw; 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.whiteShader = trap_R_RegisterShaderNoMip("white"); + //Makro - added; almost useless + uiInfo.uiDC.selectShader = trap_R_RegisterShaderNoMip("selectshader"); AssetCache(); @@ -7406,6 +7768,9 @@ void _UI_Init(qboolean inGameLoad) trap_Cvar_Register(NULL, "debug_protocol", "", 0); 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) { + //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) { 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); Display_MouseMove(NULL, uiInfo.uiDC.cursorx, uiInfo.uiDC.cursory); } - } void UI_LoadNonIngame() @@ -8010,6 +8386,8 @@ vmCvar_t ui_RQ3_joinAddress; vmCvar_t ui_RQ3_joinPort; //Makro - demo name vmCvar_t ui_RQ3_demoName; +//Makro - maxpolys hack +vmCvar_t ui_maxpolys; //Makro - matchmode settings vmCvar_t ui_RQ3_timelimit; vmCvar_t ui_RQ3_roundlimit; @@ -8119,7 +8497,9 @@ static cvarTable_t cvarTable[] = { {&ui_server16, "server16", "", CVAR_ARCHIVE}, {&ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM}, {&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_teamName, "ui_teamName", "Pagans", 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}, //Makro - demo name {&ui_RQ3_demoName, "ui_RQ3_demoName", "", 0}, + //Makro - maxpolys hack + {&ui_maxpolys, "r_maxpolys", "4096", CVAR_ARCHIVE}, //Makro - matchmode settings {&ui_RQ3_timelimit, "ui_RQ3_timelimit", "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); } } - /* ================= UI_UpdateCvars @@ -8427,3 +8808,4 @@ static void UI_StartServerRefresh(qboolean full) } } } + diff --git a/reaction/ta_ui/ui_players.c b/reaction/ta_ui/ui_players.c index 0690d008..92c98735 100644 --- a/reaction/ta_ui/ui_players.c +++ b/reaction/ta_ui/ui_players.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // 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; - trap_R_ClearScene(); + //trap_R_ClearScene(); + uiInfo.uiDC.clearScene(); + // get the rotation information 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; trap_R_AddLightToScene(origin, 500, 1.0, 0.0, 0.0); - trap_R_RenderScene(&refdef); + //trap_R_RenderScene(&refdef); + uiInfo.uiDC.renderScene(&refdef); } /* diff --git a/reaction/ta_ui/ui_shared.c b/reaction/ta_ui/ui_shared.c index 63c37011..5998f15c 100644 --- a/reaction/ta_ui/ui_shared.c +++ b/reaction/ta_ui/ui_shared.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $Log$ +// Revision 1.31 2005/02/15 16:33:39 makro +// Tons of updates (entity tree attachment system, UI vectors) +// // Revision 1.30 2003/04/19 17:41:26 jbravo // Applied changes that where in 1.29h -> 1.32b gamecode. // @@ -141,8 +144,15 @@ static itemDef_t *g_editItem = NULL; menuDef_t Menus[MAX_MENUS]; // defined menus int menuCount = 0; // how many +int GMemory() +{ + return sizeof(Menus); +} + menuDef_t *menuStack[MAX_OPEN_MENUS]; int openMenuCount = 0; +//Makro - previous menu +static menuDef_t *prevMenu = NULL; static qboolean debugMode = qfalse; @@ -253,20 +263,8 @@ int UI_RQ3_KeyNumFromChar(const char *keystr) } //Makro - check whether or not a key is MOUSE1/2/3 -qboolean UI_IsMouse(int key) -{ - return (key == K_MOUSE1 || key == K_MOUSE2 || key == K_MOUSE3); -} - -//Makro - copy colors -void UI_RQ3_ColorCopy(vec4_t dest, vec4_t src) -{ - int i; - - for (i = 0; i < 4; i++) { - dest[i] = src[i]; - } -} +//No need for a function +#define UI_IsMouse(key) ((key) == K_MOUSE1 || (key) == K_MOUSE2 || (key) == K_MOUSE3) #define HASH_TABLE_SIZE 2048 /* @@ -596,6 +594,8 @@ Rect_Parse */ qboolean Rect_Parse(char **p, rectDef_t * r) { + //Makro - this is safer + r->hasVectors = qfalse; if (Float_Parse(p, &r->x)) { if (Float_Parse(p, &r->y)) { if (Float_Parse(p, &r->w)) { @@ -615,6 +615,8 @@ PC_Rect_Parse */ qboolean PC_Rect_Parse(int handle, rectDef_t * r) { + //Makro - this is safer + r->hasVectors = qfalse; if (PC_Float_Parse(handle, &r->x)) { if (PC_Float_Parse(handle, &r->y)) { if (PC_Float_Parse(handle, &r->w)) { @@ -738,8 +740,6 @@ void Window_Init(Window * w) w->borderSize = 1; w->foreColor[0] = w->foreColor[1] = w->foreColor[2] = w->foreColor[3] = 1.0; w->cinematic = -1; - //Makro - no shortcutKey by default - w->shortcutKey = -1; } void Fade(int *flags, float *f, float clamp, int *nextTime, int offsetTime, qboolean bFlags, float fadeAmount) @@ -769,39 +769,30 @@ void Fade(int *flags, float *f, float clamp, int *nextTime, int offsetTime, qboo void UI_RQ3_HandleFading(Window * w) { if (w) { - //DC->Print("^4Entering fading proc^7\n"); if ((w->timeFade.active)) { - //DC->Print(va("^4Found active fading window; time = %i^7\n", DC->realTime)); if (DC->realTime > w->timeFade.endTime) { - //DC->Print("^4Turning fading timer off^7\n"); w->timeFade.active = qfalse; if ((w->timeFade.forecolor)) { - UI_RQ3_ColorCopy(w->foreColor, w->timeFade.color2); - //Makro - autohide + memcpy(w->foreColor, w->timeFade.color2, sizeof(vec4_t)); + //autohide if (w->foreColor[3] == 0) w->flags &= ~WINDOW_VISIBLE; } else { - UI_RQ3_ColorCopy(w->backColor, w->timeFade.color2); - //Makro - autohide + memcpy(w->backColor, w->timeFade.color2, sizeof(vec4_t)); + //autohide if (w->backColor[3] == 0) w->flags &= ~WINDOW_VISIBLE; } } else { if (DC->realTime >= w->timeFade.startTime) { - float percent = + float frac = ((float) (DC->realTime - w->timeFade.startTime)) / ((float) (w->timeFade.endTime - w->timeFade.startTime)); qboolean forecolor = w->timeFade.forecolor; - - //DC->Print(va("^4Percent: %f^7 Time: %i\n", percent, DC->realTime)); if (forecolor) { - LerpColor(w->timeFade.color1, w->timeFade.color2, w->foreColor, - percent); - //DC->Print(va("^4New forecolor: %f %f %f %f^7\n", w->foreColor[0], w->foreColor[1], w->foreColor[2], w->foreColor[3])); + LerpColor(w->timeFade.color1, w->timeFade.color2, w->foreColor, frac); } else { - LerpColor(w->timeFade.color1, w->timeFade.color2, w->backColor, - percent); - //DC->Print(va("^5New backcolor: %f %f %f %f^7\n", w->backColor[0], w->backColor[1], w->backColor[2], w->backColor[3])); + LerpColor(w->timeFade.color1, w->timeFade.color2, w->backColor, frac); } } } @@ -812,17 +803,18 @@ void UI_RQ3_HandleFading(Window * w) void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle) { //float bordersize = 0; - vec4_t color; + vec4_t color = {1, 1, 1, 1}; rectDef_t fillRect = w->rect; if (debugMode) { - color[0] = color[1] = color[2] = color[3] = 1; + //color[0] = color[1] = color[2] = color[3] = 1; DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, 1, color); } if (w == NULL) { return; } + //Makro - fade forecolor/backcolor if needed UI_RQ3_HandleFading(w); @@ -865,10 +857,22 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle if (w->background) { Fade(&w->flags, &w->backColor[3], fadeClamp, &w->nextTime, fadeCycle, qtrue, fadeAmount); DC->setColor(w->backColor); - DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); + //Makro - angled? + if (w->rectClient.hasVectors) + { + DC->drawAngledPic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->rectClient.u, w->rectClient.v, w->backColor, 0, 0, 1, 1, w->background); + } else { + DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); + } DC->setColor(NULL); } else { - DC->fillRect(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->backColor); + //angled? + if (w->rectClient.hasVectors) + { + DC->drawAngledPic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->rectClient.u, w->rectClient.v, w->backColor, 0, 0, 1, 1, DC->whiteShader); + } else { + DC->fillRect(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->backColor); + } } } else if (w->style == WINDOW_STYLE_GRADIENT) { GradientBar_Paint(&fillRect, w->backColor); @@ -876,8 +880,15 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle } else if (w->style == WINDOW_STYLE_SHADER) { if (w->flags & WINDOW_FORECOLORSET) { DC->setColor(w->foreColor); + memcpy(&color[0], &w->foreColor[0], sizeof(color)); + } + //Makro - angled? + if (w->rectClient.hasVectors) + { + DC->drawAngledPic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->rectClient.u, w->rectClient.v, w->foreColor, 0, 0, 1, 1, w->background); + } else { + DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); } - DC->drawHandlePic(fillRect.x, fillRect.y, fillRect.w, fillRect.h, w->background); DC->setColor(NULL); } else if (w->style == WINDOW_STYLE_TEAMCOLOR) { if (DC->getTeamColor) { @@ -887,7 +898,7 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle } else if (w->style == WINDOW_STYLE_CINEMATIC) { if (w->cinematic == -1) { w->cinematic = - DC->playCinematic(w->cinematicName, fillRect.x, fillRect.y, fillRect.w, fillRect.h); + DC->playCinematic(w->cinematicName, fillRect.x, fillRect.y, fillRect.w, fillRect.h); if (w->cinematic == -1) { w->cinematic = -2; } @@ -901,7 +912,8 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle if (w->border == WINDOW_BORDER_FULL) { // full // HACK HACK HACK - if (w->style == WINDOW_STYLE_TEAMCOLOR) { + if (w->style == WINDOW_STYLE_TEAMCOLOR) + { if (color[0] > 0) { // red color[0] = 1; @@ -912,9 +924,21 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle color[0] = color[1] = .5; } color[3] = 1; - DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, color); + if (w->rectClient.hasVectors) + { + DC->drawAngledRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->rect.u, w->rect.v, + w->borderSize, color, RECT_FULL); + } else { + DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, color); + } } else { - DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, w->borderColor); + if (w->rectClient.hasVectors) + { + DC->drawAngledRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->rect.u, w->rect.v, + w->borderSize, w->borderColor, RECT_FULL); + } else { + DC->drawRect(w->rect.x, w->rect.y, w->rect.w, w->rect.h, w->borderSize, w->borderColor); + } } } else if (w->border == WINDOW_BORDER_HORZ) { // top/bottom @@ -935,7 +959,6 @@ void Window_Paint(Window * w, float fadeAmount, float fadeClamp, float fadeCycle r.y = w->rect.y + w->rect.h - 1; GradientBar_Paint(&r, w->borderColor); } - } void Item_SetScreenCoords(itemDef_t * item, float x, float y) @@ -946,8 +969,14 @@ void Item_SetScreenCoords(itemDef_t * item, float x, float y) } if (item->window.border != 0) { - x += item->window.borderSize; - y += item->window.borderSize; + if (item->window.rectClient.hasVectors) + { + x += item->window.borderSize * (item->window.rectClient.u[0] + item->window.rectClient.v[0]); + y += item->window.borderSize * (item->window.rectClient.u[1] + item->window.rectClient.v[1]); + } else { + x += item->window.borderSize; + y += item->window.borderSize; + } } item->window.rect.x = x + item->window.rectClient.x; @@ -976,8 +1005,15 @@ void Item_UpdatePosition(itemDef_t * item) y = menu->window.rect.y; if (menu->window.border != 0) { - x += menu->window.borderSize; - y += menu->window.borderSize; + //Makro - got vectors? + if (menu->window.rectClient.hasVectors) + { + x += menu->window.borderSize * (menu->window.rectClient.u[0] + menu->window.rectClient.v[0]); + y += menu->window.borderSize * (menu->window.rectClient.u[1] + menu->window.rectClient.v[1]); + } else { + x += menu->window.borderSize; + y += menu->window.borderSize; + } } Item_SetScreenCoords(item, x, y); @@ -1055,8 +1091,22 @@ qboolean IsVisible(int flags) qboolean Rect_ContainsPoint(rectDef_t * rect, float x, float y) { if (rect) { - if (x > rect->x && x < rect->x + rect->w && y > rect->y && y < rect->y + rect->h) { - return qtrue; + //Makro - twisted rectangle? + if (rect->hasVectors) + { + float dx = x - rect->x; + float dy = y - rect->y; + float px = dx * rect->u[0] + dy * rect->u[1]; + float py = dx * rect->v[0] + dy * rect->v[1]; + if (px > 0 && px < rect->w && py > 0 && py < rect->h) + { + return qtrue; + } + } else { + if (x > rect->x && x < rect->x + rect->w && y > rect->y && y < rect->y + rect->h) + { + return qtrue; + } } } return qfalse; @@ -1097,6 +1147,47 @@ itemDef_t *Menu_GetMatchingItemByNumber(menuDef_t * menu, int index, const char return NULL; } +//Makro - fade overlay +void Script_FadeOverlay(itemDef_t *item, char **args) +{ + int offset, duration; + float f; + + for (offset=0; offset<4; offset++) + { + if (!Float_Parse(args, &f)) { + return; + } + DC->overlayColor[offset] = DC->overlayColor2[offset]; + if (IsBetween(f, 0, 1)) { + DC->overlayColor2[offset] = f; + } + } + //offset & duration + if (!Int_Parse(args, &offset) || !Int_Parse(args, &duration)) { + return; + } + DC->overlayFadeStart = DC->realTime + offset; + DC->overlayFadeEnd = DC->overlayFadeStart + duration; +} + +void Script_SetOverlayColor(itemDef_t *item, char **args) +{ + int i; + float f; + + for (i=0; i<4; i++) + { + if (!Float_Parse(args, &f)) { + return; + } + if (IsBetween(f, 0, 1)) { + DC->overlayColor2[i] = f; + } + } + DC->overlayFadeStart = DC->overlayFadeEnd = 0; +} + void Script_SetColor(itemDef_t * item, char **args) { const char *name; @@ -1122,7 +1213,9 @@ void Script_SetColor(itemDef_t * item, char **args) if (!Float_Parse(args, &f)) { return; } - (*out)[i] = f; + //Makro - new feature: out of range = ignore + if (IsBetween(f, 0, 1)) + (*out)[i] = f; } //Makro - if the item was fading, stop the fading process if (item->window.timeFade.active) @@ -1131,6 +1224,56 @@ void Script_SetColor(itemDef_t * item, char **args) } } +//Makro - sets random color +//setrandomcolor ... +void Script_SetRandomColor(itemDef_t * item, char **args) +{ + const char *name; + int i, count, rnd; + float f; + vec4_t *out; + + if (String_Parse(args, &name)) { + out = NULL; + if (Q_stricmp(name, "backcolor") == 0) { + out = &item->window.backColor; + item->window.flags |= WINDOW_BACKCOLORSET; + } else if (Q_stricmp(name, "forecolor") == 0) { + out = &item->window.foreColor; + item->window.flags |= WINDOW_FORECOLORSET; + } else if (Q_stricmp(name, "bordercolor") == 0) { + out = &item->window.borderColor; + } + + //Makro - if the item was fading, stop the fading process + if (item->window.timeFade.active) { + item->window.timeFade.active = qfalse; + } + if (!Int_Parse(args, &count)) { + return; + } + rnd = rand() % count; + + for (i=0; i ... +void Script_SetRandomItemColor(itemDef_t * item, char **args) +{ + const char *itemname; + const char *name; + vec4_t tempColor, color; + int i, colorCount; + vec4_t *out; + + if (String_Parse(args, &itemname) && String_Parse(args, &name) && Int_Parse(args, &colorCount)) { + itemDef_t *item2; + int j, k, rnd = rand() % colorCount; + int count = Menu_ItemsMatchingGroup(item->parent, itemname); + + for (k=0; kparent, j, itemname); + if (item2 != NULL) { + out = NULL; + if (Q_stricmp(name, "backcolor") == 0) { + out = &item2->window.backColor; + } else if (Q_stricmp(name, "forecolor") == 0) { + out = &item2->window.foreColor; + item2->window.flags |= WINDOW_FORECOLORSET; + } else if (Q_stricmp(name, "bordercolor") == 0) { + out = &item2->window.borderColor; + } + + if (out) { + for (i = 0; i < 4; i++) { + //Makro - new feature: out of range = ignore + if (IsBetween(color[i], 0, 1)) + (*out)[i] = color[i]; + } + //Makro - if the item was fading, stop the fading process + if (item2->window.timeFade.active) + item2->window.timeFade.active = qfalse; + } + } + } + } +} + void Script_SetItemColor(itemDef_t * item, char **args) { const char *itemname; @@ -1216,7 +1412,9 @@ void Script_SetItemColor(itemDef_t * item, char **args) if (out) { for (i = 0; i < 4; i++) { - (*out)[i] = color[i]; + //Makro - new feature: out of range = ignore + if (IsBetween(color[i], 0, 1)) + (*out)[i] = color[i]; } //Makro - if the item was fading, stop the fading process if (item2->window.timeFade.active) @@ -1227,6 +1425,23 @@ void Script_SetItemColor(itemDef_t * item, char **args) } } +//Makro - added +void Menu_ShowItem(itemDef_t *item, qboolean bShow) +{ + if (item != NULL) { + if (bShow) { + item->window.flags |= WINDOW_VISIBLE; + } else { + item->window.flags &= ~WINDOW_VISIBLE; + // stop cinematics playing in the window + if (item->window.cinematic >= 0) { + DC->stopCinematic(item->window.cinematic); + item->window.cinematic = -1; + } + } + } +} + void Menu_ShowItemByName(menuDef_t * menu, const char *p, qboolean bShow) { itemDef_t *item; @@ -1235,18 +1450,7 @@ void Menu_ShowItemByName(menuDef_t * menu, const char *p, qboolean bShow) for (i = 0; i < count; i++) { item = Menu_GetMatchingItemByNumber(menu, i, p); - if (item != NULL) { - if (bShow) { - item->window.flags |= WINDOW_VISIBLE; - } else { - item->window.flags &= ~WINDOW_VISIBLE; - // stop cinematics playing in the window - if (item->window.cinematic >= 0) { - DC->stopCinematic(item->window.cinematic); - item->window.cinematic = -1; - } - } - } + Menu_ShowItem(item, bShow); } } @@ -1331,7 +1535,12 @@ void Script_Show(itemDef_t * item, char **args) const char *name; if (String_Parse(args, &name)) { - Menu_ShowItemByName(item->parent, name, qtrue); + //Makro - if name is "_self", show current item + if (!Q_stricmp(name, "_self")) { + Menu_ShowItem(item, qtrue); + } else { + Menu_ShowItemByName(item->parent, name, qtrue); + } } } @@ -1340,33 +1549,45 @@ void Script_Hide(itemDef_t * item, char **args) const char *name; if (String_Parse(args, &name)) { - Menu_ShowItemByName(item->parent, name, qfalse); + //Makro - if name is "_self", hide current item + if (!Q_stricmp(name, "_self")) { + Menu_ShowItem(item, qfalse); + } else { + Menu_ShowItemByName(item->parent, name, qfalse); + } } } //Makro - for the new fading method void UI_RQ3_TimeFadeItem(itemDef_t * item, vec4_t endColor, int offset, int duration, qboolean forecolor) { - int start, end; + int i; if (duration <= 0) { duration = 1; } - start = DC->realTime + offset; - end = start + duration; - item->window.timeFade.active = qtrue; - item->window.timeFade.forecolor = forecolor; if (forecolor) { - UI_RQ3_ColorCopy(item->window.timeFade.color1, item->window.foreColor); + memcpy(item->window.timeFade.color1, item->window.foreColor, sizeof(vec4_t)); item->window.flags |= WINDOW_FORECOLORSET; } else { - UI_RQ3_ColorCopy(item->window.timeFade.color1, item->window.backColor); + memcpy(item->window.timeFade.color1, item->window.backColor, sizeof(vec4_t)); item->window.flags |= WINDOW_BACKCOLORSET; } - UI_RQ3_ColorCopy(item->window.timeFade.color2, endColor); - item->window.timeFade.startTime = start; - item->window.timeFade.endTime = end; + for (i=0; i<4; i++) + { + //Makro - new feature: out of range = ignore + if (IsBetween(endColor[i], 0, 1)) { + item->window.timeFade.color2[i] = endColor[i]; + } else { + item->window.timeFade.color2[i] = item->window.timeFade.color1[i]; + } + } + + item->window.timeFade.active = qtrue; + item->window.timeFade.forecolor = forecolor; + item->window.timeFade.startTime = DC->realTime + offset; + item->window.timeFade.endTime = item->window.timeFade.startTime + duration; /* if (item->window.timeFade.forecolor) { DC->Print(va("^3Fading forecolor %s: src=(%f %f %f %f) dst=(%f %f %f %f) offset=%i duration=%i start=%i end=%i^7\n", item->window.name, item->window.timeFade.color1[0], item->window.timeFade.color1[1], item->window.timeFade.color1[2], item->window.timeFade.color1[3], endColor[0], endColor[1], endColor[2], endColor[3], offset, duration, item->window.timeFade.startTime, item->window.timeFade.endTime)); @@ -1462,7 +1683,13 @@ void Script_Open(itemDef_t * item, char **args) const char *name; if (String_Parse(args, &name)) { - Menus_OpenByName(name); + //Makro - previous menu + if ( (!Q_stricmp(name, "_previous") || !Q_stricmp(name, "_prev")) && prevMenu) { + Menus_OpenByName(prevMenu->window.name); + } else { + Menus_OpenByName(name); + } + prevMenu = (menuDef_t*)item->parent; } } @@ -1488,7 +1715,14 @@ void Script_Close(itemDef_t * item, char **args) const char *name; if (String_Parse(args, &name)) { - Menus_CloseByName(name); + //Makro - if name is "_self", close current menu + if (Q_stricmp(name, "_self") == 0) + { + menuDef_t *menu = (menuDef_t*)item->parent; + Menus_CloseByName(menu->window.name); + } else { + Menus_CloseByName(name); + } } } @@ -1504,6 +1738,7 @@ void Menu_TransitionItemByName(menuDef_t * menu, const char *p, rectDef_t rectFr if (item != NULL) { item->window.flags |= (WINDOW_INTRANSITION | WINDOW_VISIBLE); item->window.offsetTime = time; + //FIXME: this is probably breaking vectors memcpy(&item->window.rectClient, &rectFrom, sizeof(rectDef_t)); memcpy(&item->window.rectEffects, &rectTo, sizeof(rectDef_t)); item->window.rectEffects2.x = abs(rectTo.x - rectFrom.x) / amt; @@ -1522,6 +1757,9 @@ void Script_Transition(itemDef_t * item, char **args) int time; float amt; + memset(&rectFrom, 0, sizeof(rectFrom)); + memset(&rectTo, 0, sizeof(rectTo)); + if (String_Parse(args, &name)) { if (Rect_Parse(args, &rectFrom) && Rect_Parse(args, &rectTo) && Int_Parse(args, &time) && Float_Parse(args, &amt)) { @@ -1662,10 +1900,12 @@ void Script_StartTimer(itemDef_t * item, char **args) if (menu) { if (menu->timedItems > 0) { menu->timerEnabled = qtrue; - menu->timerPos = 0; + menu->timerPos = 1; if (menu->timerInterval <= 0) { menu->timerInterval = 1000; } + //go ahead and show the first item + menu->nextTimer = 0; } } } @@ -1680,64 +1920,84 @@ void Script_StopTimer(itemDef_t * item, char **args) } } +//Makro - for the exit menu +static const char *quitMessages[] = +{ + "Done playing ?", + + "Out already ?", + + "Going somewhere ?", + + "Bed time already ?", + + "Exit Reaction ?", + + "Back to the\n" + "real world ?", + + "Action heroes\n" + "never press 'yes'" +}; +static const int quitMessageCount = sizeof(quitMessages) / sizeof(const char*); + +void Script_SetQuitText(itemDef_t * item, char **args) +{ + menuDef_t *menu = (menuDef_t *) item->parent; + const char *val; + if (menu) { + if (String_Parse(args, &val)) + { + itemDef_t *toitem = Menu_FindItemByName(menu, val); + if (toitem) + { + toitem->text = quitMessages[rand() % quitMessageCount]; + toitem->textRect.w = 0; + } + } + } +} + commandDef_t commandList[] = { //Makro - for timers - {"startTimer", &Script_StartTimer} - , // group/name - {"restartTimer", &Script_StartTimer} - , // group/name - {"stopTimer", &Script_StopTimer} - , // group/name + {"startTimer", &Script_StartTimer}, // group/name + {"restartTimer", &Script_StartTimer}, // group/name + {"stopTimer", &Script_StopTimer}, // group/name //Makro - for the new fading method - {"timeFade", &Script_TimeFade} - , - {"timeFadeSelf", &Script_TimeFadeSelf} - , - - {"fadein", &Script_FadeIn} - , // group/name - {"fadeout", &Script_FadeOut} - , // group/name - {"show", &Script_Show} - , // group/name - {"hide", &Script_Hide} - , // group/name - {"setcolor", &Script_SetColor} - , // works on this - {"open", &Script_Open} - , // nenu - {"conditionalopen", &Script_ConditionalOpen} - , // menu - {"close", &Script_Close} - , // menu - {"setasset", &Script_SetAsset} - , // works on this - {"setbackground", &Script_SetBackground} - , // works on this - {"setitemcolor", &Script_SetItemColor} - , // group/name - {"setteamcolor", &Script_SetTeamColor} - , // sets this background color to team color - {"setfocus", &Script_SetFocus} - , // sets this background color to team color - {"setplayermodel", &Script_SetPlayerModel} - , // sets this background color to team color - {"setplayerhead", &Script_SetPlayerHead} - , // sets this background color to team color - {"transition", &Script_Transition} - , // group/name - {"setcvar", &Script_SetCvar} - , // group/name - {"exec", &Script_Exec} - , // group/name - {"play", &Script_Play} - , // group/name - {"playlooped", &Script_playLooped} - , // group/name + {"timeFade", &Script_TimeFade}, + {"timeFadeSelf", &Script_TimeFadeSelf}, + {"fadein", &Script_FadeIn}, // group/name + {"fadeout", &Script_FadeOut}, // group/name + {"show", &Script_Show}, // group/name + {"hide", &Script_Hide}, // group/name + {"setcolor", &Script_SetColor}, // works on this + //Makro - fade in/out overlay + {"fadeoverlay", &Script_FadeOverlay}, + {"setoverlaycolor", &Script_SetOverlayColor}, + //Makro - sets random color + {"setrandomcolor", &Script_SetRandomColor}, + {"open", &Script_Open}, // nenu + {"conditionalopen", &Script_ConditionalOpen}, // menu + {"close", &Script_Close}, // menu + {"setasset", &Script_SetAsset}, // works on this + {"setbackground", &Script_SetBackground}, // works on this + {"setitemcolor", &Script_SetItemColor}, // group/name + //Makro - sets random color + {"setrandomitemcolor", &Script_SetRandomItemColor}, + {"setteamcolor", &Script_SetTeamColor}, // sets this background color to team color + {"setfocus", &Script_SetFocus}, // sets this background color to team color + {"setplayermodel", &Script_SetPlayerModel}, // sets this background color to team color + {"setplayerhead", &Script_SetPlayerHead}, // sets this background color to team color + {"transition", &Script_Transition}, // group/name + {"setcvar", &Script_SetCvar}, // group/name + {"exec", &Script_Exec}, // group/name + {"play", &Script_Play}, // group/name + {"playlooped", &Script_playLooped}, // group/name //Makro - stop background track - {"stopMusic", &Script_stopMusic} - , - {"orbit", &Script_Orbit} // group/name + {"stopMusic", &Script_stopMusic}, + {"orbit", &Script_Orbit}, // group/name + //Makro - for the exit menu + {"setquittext", &Script_SetQuitText} }; int scriptCommandCount = sizeof(commandList) / sizeof(commandDef_t); @@ -1964,19 +2224,32 @@ int Item_ListBox_ThumbDrawPosition(itemDef_t * item) } } -float Item_Slider_ThumbPosition(itemDef_t * item) +Point Item_Slider_ThumbPosition(itemDef_t * item) { - float value, range, x; + float value, range; editFieldDef_t *editDef = item->typeData; + Point p; if (item->text) { - x = item->textRect.x + item->textRect.w + 8; + //Makro - vectors ? + if (item->textRect.hasVectors) + { + float xoffset = item->textRect.w + 8, yoffset = -(item->textRect.h + SLIDER_THUMB_HEIGHT)/2; + //p.x = item->textRect.x + item->textRect.u[0]*(item->textRect.w + 8) - item->textRect.v[0]*2; + p.x = item->textRect.x + item->textRect.u[0]*xoffset + item->textRect.v[0]*yoffset; + //p.y = item->window.rect.y + item->textRect.u[1] * (item->textRect.w + 8) - item->textRect.v[1]*2; + p.y = item->textRect.y + item->textRect.u[1]*xoffset + item->textRect.v[1]*yoffset; + } else { + p.x = item->textRect.x + item->textRect.w + 8; + p.y = item->textRect.y - (item->textRect.h + SLIDER_THUMB_HEIGHT)/2; + } } else { - x = item->window.rect.x; + p.x = item->window.rect.x; + p.y = item->window.rect.y - 2; } if (editDef == NULL && item->cvar) { - return x; + return p; } value = DC->getCVarValue(item->cvar); @@ -1992,18 +2265,39 @@ float Item_Slider_ThumbPosition(itemDef_t * item) value /= range; //value /= (editDef->maxVal - editDef->minVal); value *= SLIDER_WIDTH; - x += value; + //vectors + if (item->textRect.hasVectors) + { + p.x += value * item->textRect.u[0]; + p.y += value * item->textRect.u[1]; + } else { + p.x += value; + } // vm fuckage //x = x + (((float)value / editDef->maxVal) * SLIDER_WIDTH); - return x; + return p; } int Item_Slider_OverSlider(itemDef_t * item, float x, float y) { rectDef_t r; + Point p; - r.x = Item_Slider_ThumbPosition(item) - (SLIDER_THUMB_WIDTH / 2); - r.y = item->window.rect.y - 2; + //Makro - copy all info (including vector info) + //relevant fields will get overwritten + r = item->textRect; + + //Makro - vectors + p = Item_Slider_ThumbPosition(item); + + if (r.hasVectors) + { + r.x = p.x - (SLIDER_THUMB_WIDTH / 2) * r.u[0]; + r.y = p.y - (SLIDER_THUMB_WIDTH / 2) * r.u[1]; + } else { + r.x = p.x - (SLIDER_THUMB_WIDTH / 2); + r.y = p.y; + } r.w = SLIDER_THUMB_WIDTH; r.h = SLIDER_THUMB_HEIGHT; @@ -2020,6 +2314,8 @@ int Item_ListBox_OverLB(itemDef_t * item, float x, float y) int thumbstart; int count; + r.hasVectors = qfalse; + count = DC->feederCount(item->special); listPtr = (listBoxDef_t *) item->typeData; if (item->window.flags & WINDOW_HORIZONTAL) { @@ -2086,14 +2382,14 @@ void Item_ListBox_MouseEnter(itemDef_t * item, float x, float y) rectDef_t r; listBoxDef_t *listPtr = (listBoxDef_t *) item->typeData; + r.hasVectors = qfalse; + item->window.flags &= ~(WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN); item->window.flags |= Item_ListBox_OverLB(item, x, y); if (item->window.flags & WINDOW_HORIZONTAL) { - if (! - (item->window. - flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | + if (!(item->window.flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN))) { // check for selection hit as we have exausted buttons and thumb if (listPtr->elementStyle == LISTBOX_IMAGE) { @@ -2113,9 +2409,7 @@ void Item_ListBox_MouseEnter(itemDef_t * item, float x, float y) } } } else - if (! - (item->window. - flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | + if (!(item->window.flags & (WINDOW_LB_LEFTARROW | WINDOW_LB_RIGHTARROW | WINDOW_LB_THUMB | WINDOW_LB_PGUP | WINDOW_LB_PGDN))) { r.x = item->window.rect.x; r.y = item->window.rect.y; @@ -2369,7 +2663,8 @@ qboolean Item_ListBox_HandleKey(itemDef_t * item, int key, qboolean down, qboole listPtr->startPos = max; return qtrue; } - if (key == K_PGUP || key == K_KP_PGUP) { + //Makro - support for mouse wheel + if (key == K_PGUP || key == K_KP_PGUP || key == K_MWHEELUP) { // page up if (!listPtr->notselectable) { listPtr->cursorPos -= viewmax; @@ -2392,7 +2687,8 @@ qboolean Item_ListBox_HandleKey(itemDef_t * item, int key, qboolean down, qboole } return qtrue; } - if (key == K_PGDN || key == K_KP_PGDN) { + //Makro - support for mouse wheel + if (key == K_PGDN || key == K_KP_PGDN || key == K_MWHEELDOWN) { // page down if (!listPtr->notselectable) { listPtr->cursorPos += viewmax; @@ -2778,6 +3074,8 @@ static void Scroll_ListBox_ThumbFunc(void *p) listBoxDef_t *listPtr = (listBoxDef_t *) si->item->typeData; + r.hasVectors = qfalse; + if (si->item->window.flags & WINDOW_HORIZONTAL) { if (DC->cursorx == si->xStart) { return; @@ -2832,24 +3130,47 @@ static void Scroll_ListBox_ThumbFunc(void *p) static void Scroll_Slider_ThumbFunc(void *p) { - float x, value, cursorx; + float x, y, value, cursorx, cursory; scrollInfo_t *si = (scrollInfo_t *) p; editFieldDef_t *editDef = si->item->typeData; if (si->item->text) { - x = si->item->textRect.x + si->item->textRect.w + 8; + if (si->item->textRect.hasVectors) + { + float xoffset = si->item->textRect.w+8, yoffset = -(si->item->textRect.h/2); + x = si->item->textRect.x + xoffset*si->item->textRect.u[0] + yoffset*si->item->textRect.v[0]; + y = si->item->textRect.y + xoffset*si->item->textRect.u[1] + yoffset*si->item->textRect.v[1]; + } else { + x = si->item->textRect.x + si->item->textRect.w + 8; + y = si->item->textRect.y; + } } else { x = si->item->window.rect.x; + y = si->item->window.rect.y; } + //FIXME: there's a -2 offset that should be taken care of + //too small to fix right now + //y = si->item->window.rect.y; cursorx = DC->cursorx; - - if (cursorx < x) { - cursorx = x; - } else if (cursorx > x + SLIDER_WIDTH) { - cursorx = x + SLIDER_WIDTH; + cursory = DC->cursory; + //vectors + if (si->item->textRect.hasVectors) + { + value = (cursorx - x) * si->item->textRect.u[0] + (cursory - y) * si->item->textRect.u[1]; + if (value < 0) { + value = 0; + } else if (value > SLIDER_WIDTH) { + value = SLIDER_WIDTH; + } + } else { + if (cursorx < x) { + cursorx = x; + } else if (cursorx > x + SLIDER_WIDTH) { + cursorx = x + SLIDER_WIDTH; + } + value = cursorx - x; } - value = cursorx - x; value /= SLIDER_WIDTH; value *= (editDef->maxVal - editDef->minVal); value += editDef->minVal; @@ -2912,33 +3233,65 @@ void Item_StopCapture(itemDef_t * item) qboolean Item_Slider_HandleKey(itemDef_t * item, int key, qboolean down) { - float x, value, width, work; + float x, y, value, width, work; //DC->Print("slider handle key\n"); if (item->window.flags & WINDOW_HASFOCUS && item->cvar) { - if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) { - if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) { + if (key == K_MOUSE1 || key == K_ENTER || key == K_MOUSE2 || key == K_MOUSE3) + { + if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory)) + { editFieldDef_t *editDef = item->typeData; if (editDef) { + //Makro - copy all info (including vectors) + //make sure relevant info is set afterwards rectDef_t testRect; width = SLIDER_WIDTH; if (item->text) { - x = item->textRect.x + item->textRect.w + 8; + //vectors? + if (item->textRect.hasVectors) + { + float xoffset = item->textRect.w+8, yoffset = -(item->textRect.h/2); + x = item->textRect.x + xoffset*item->textRect.u[0] + yoffset*item->textRect.v[0]; + //y = item->textRect.y + (item->textRect.w + 8) * item->textRect.u[1]; + //y = item->window.rect.y + (item->textRect.w + 8) * item->textRect.u[1]; + y = item->textRect.y + xoffset*item->textRect.u[1] + yoffset*item->textRect.v[1]; + } else { + x = item->textRect.x + item->textRect.w + 8; + y = item->textRect.y - item->textRect.h/2; + } } else { x = item->window.rect.x; + y = item->window.rect.y; + //y = item->textRect.y; } testRect = item->window.rect; testRect.x = x; + //testRect.y = y; value = (float) SLIDER_THUMB_WIDTH / 2; - testRect.x -= value; + //vectors? + if (testRect.hasVectors) + { + testRect.x -= value * testRect.u[0]; + testRect.y -= value * testRect.u[1]; + } else { + testRect.x -= value; + } + //FIXME: ugly code, rewrite some day //DC->Print("slider x: %f\n", testRect.x); testRect.w = (SLIDER_WIDTH + (float) SLIDER_THUMB_WIDTH / 2); //DC->Print("slider w: %f\n", testRect.w); if (Rect_ContainsPoint(&testRect, DC->cursorx, DC->cursory)) { - work = DC->cursorx - x; + //Makro - use a dotproduct if using vectors + if (testRect.hasVectors) + { + work = (DC->cursorx - x) * testRect.u[0] + (DC->cursory - y) * testRect.u[1]; + } else { + work = DC->cursorx - x; + } value = work / width; value *= (editDef->maxVal - editDef->minVal); // vm fuckage @@ -2950,18 +3303,22 @@ qboolean Item_Slider_HandleKey(itemDef_t * item, int key, qboolean down) } } //Makro - adding left/right key handling - } else if (key == K_LEFTARROW || key == K_RIGHTARROW || key == K_HOME || key == K_END) { + } else if (key == K_LEFTARROW || key == K_RIGHTARROW || key == K_MWHEELUP || key == K_MWHEELDOWN + || key == K_HOME || key == K_END) { editFieldDef_t *editDef = item->typeData; + //DC->Print("slider LEFT/RIGHT\n"); if (editDef) { value = DC->getCVarValue(item->cvar); work = (editDef->maxVal - editDef->minVal) / 10; switch (key) { case K_RIGHTARROW: + case K_MWHEELUP: value = Com_Clamp(editDef->minVal, editDef->maxVal, value + work); break; case K_LEFTARROW: + case K_MWHEELDOWN: value = Com_Clamp(editDef->minVal, editDef->maxVal, value - work); break; case K_HOME: @@ -2970,12 +3327,14 @@ qboolean Item_Slider_HandleKey(itemDef_t * item, int key, qboolean down) case K_END: value = editDef->maxVal; break; + default: + return qfalse; } - + + //DC->Print("SLIDER: value = %f\n", value); DC->setCVar(item->cvar, va("%f", value)); return qtrue; } - //DC->Print("slider LEFT/RIGHT\n"); } } //DC->Print("slider handle key exit\n"); @@ -3333,7 +3692,7 @@ qboolean UI_RQ3_IsActiveItem(itemDef_t * item) return qfalse; } - return (item->window.flags & WINDOW_VISIBLE); + return ((item->window.flags & WINDOW_VISIBLE) != 0); } //Makro - search for items that have shortcuts @@ -3346,17 +3705,22 @@ qboolean UI_RQ3_TriggerShortcut(menuDef_t * menu, int key) } if (DC->realTime >= UI_RQ3_lastCheckForShortcuts + UI_RQ3_ShortcutCheckDelay) { + UI_RQ3_lastCheckForShortcuts = DC->realTime; for (i = 0; i < menu->itemCount; i++) { - if (menu->items[i]->window.shortcutKey == key && UI_RQ3_IsActiveItem(menu->items[i])) { - Item_Action(menu->items[i]); - //Item_HandleKey(menu->items[i], K_ENTER, qtrue); - return qtrue; + if (UI_RQ3_IsActiveItem(menu->items[i])) + { + int j; + for (j=0; jitems[i]->window.shortcutKey[j]; j++) + { + if (menu->items[i]->window.shortcutKey[j] == key) { + Item_HandleKey(menu->items[i], K_ENTER, qtrue); + Item_Action(menu->items[i]); + return qtrue; + } + } } } - - UI_RQ3_lastCheckForShortcuts = DC->realTime; } - return qfalse; } @@ -3542,12 +3906,23 @@ void Menu_HandleKey(menuDef_t * menu, int key, qboolean down) void ToWindowCoords(float *x, float *y, windowDef_t * window) { - if (window->border != 0) { - *x += window->borderSize; - *y += window->borderSize; + //Makro - vectors + if (window->rectClient.hasVectors) + { + if (window->border != 0) { + *x += window->borderSize * (window->rectClient.u[0] + window->rectClient.v[0]); + *y += window->borderSize * (window->rectClient.u[1] + window->rectClient.v[1]); + } + *x += window->rect.x; + *y += window->rect.y; + } else { + if (window->border != 0) { + *x += window->borderSize; + *y += window->borderSize; + } + *x += window->rect.x; + *y += window->rect.y; } - *x += window->rect.x; - *y += window->rect.y; } void Rect_ToWindowCoords(rectDef_t * rect, windowDef_t * window) @@ -3566,6 +3941,10 @@ void Item_SetTextExtents(itemDef_t * item, int *width, int *height, const char * *width = item->textRect.w; *height = item->textRect.h; + //TODO: find out where hasVectors gets reset + //this is a pretty nasty fix + item->window.rectClient.hasVectors = item->textRect.hasVectors; + // keeps us from computing the widths and heights more than once if (*width == 0 || (item->type == ITEM_TYPE_OWNERDRAW && item->textalignment == ITEM_ALIGN_CENTER)) { int originalWidth = DC->textWidth(item->text, item->textscale, 0); @@ -3584,12 +3963,32 @@ void Item_SetTextExtents(itemDef_t * item, int *width, int *height, const char * *height = DC->textHeight(textPtr, item->textscale, 0); item->textRect.w = *width; item->textRect.h = *height; - item->textRect.x = item->textalignx; - item->textRect.y = item->textaligny; + //Makro - check for vectors + if (item->textRect.hasVectors) + { + item->textRect.x = item->textalignx * item->textRect.u[0] + item->textaligny*item->textRect.v[0]; + item->textRect.y = item->textalignx * item->textRect.u[1] + item->textaligny*item->textRect.v[1]; + } else { + item->textRect.x = item->textalignx; + item->textRect.y = item->textaligny; + } if (item->textalignment == ITEM_ALIGN_RIGHT) { - item->textRect.x = item->textalignx - originalWidth; + //Makro - check for vectors + if (item->textRect.hasVectors) + { + item->textRect.x -= originalWidth * item->textRect.u[0]; + item->textRect.y -= originalWidth * item->textRect.u[1]; + } else { + item->textRect.x = item->textalignx - originalWidth; + } } else if (item->textalignment == ITEM_ALIGN_CENTER) { - item->textRect.x = item->textalignx - originalWidth / 2; + if (item->textRect.hasVectors) + { + item->textRect.x -= (originalWidth >> 1) * item->textRect.u[0]; + item->textRect.y -= (originalWidth >> 1) * item->textRect.u[1]; + } else { + item->textRect.x = item->textalignx - originalWidth / 2; + } } ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window); @@ -3610,7 +4009,7 @@ void Item_TextColor(itemDef_t * item, vec4_t * newColor) //lowLight[1] = 0.8 * parent->focusColor[1]; //lowLight[2] = 0.8 * parent->focusColor[2]; //lowLight[3] = 0.8 * parent->focusColor[3]; - memcpy(lowLight, &item->window.foreColor, sizeof(vec4_t)); + memcpy(lowLight, item->window.foreColor, sizeof(vec4_t)); LerpColor(parent->focusColor, lowLight, *newColor, 0.5 + 0.5 * sin(DC->realTime / PULSE_DIVISOR)); } else if (item->textStyle == ITEM_TEXTSTYLE_BLINK && !((DC->realTime / BLINK_DIVISOR) & 1)) { lowLight[0] = 0.8 * item->window.foreColor[0]; @@ -3619,7 +4018,7 @@ void Item_TextColor(itemDef_t * item, vec4_t * newColor) lowLight[3] = 0.8 * item->window.foreColor[3]; LerpColor(item->window.foreColor, lowLight, *newColor, 0.5 + 0.5 * sin(DC->realTime / PULSE_DIVISOR)); } else { - memcpy(newColor, &item->window.foreColor, sizeof(vec4_t)); + memcpy(newColor, item->window.foreColor, sizeof(vec4_t)); // items can be enabled and disabled based on cvars } @@ -3664,7 +4063,9 @@ void Item_Text_AutoWrapped_Paint(itemDef_t * item) newLine = 0; newLineWidth = 0; p = textPtr; - while (p) { + + while (p) + { if (*p == ' ' || *p == '\t' || *p == '\n' || *p == '\0') { newLine = len; newLinePtr = p + 1; @@ -3673,19 +4074,46 @@ void Item_Text_AutoWrapped_Paint(itemDef_t * item) textWidth = DC->textWidth(buff, item->textscale, 0); if ((newLine && textWidth > item->window.rect.w) || *p == '\n' || *p == '\0') { if (len) { - if (item->textalignment == ITEM_ALIGN_LEFT) { + //Makro - check for vectors + if (item->textRect.hasVectors) + { + item->textRect.x = item->textalignx * item->textRect.u[0] + y*item->textRect.v[0]; + item->textRect.y = item->textalignx * item->textRect.u[1] + y*item->textRect.v[1]; + } else { item->textRect.x = item->textalignx; - } else if (item->textalignment == ITEM_ALIGN_RIGHT) { - item->textRect.x = item->textalignx - newLineWidth; - } else if (item->textalignment == ITEM_ALIGN_CENTER) { - item->textRect.x = item->textalignx - newLineWidth / 2; + item->textRect.y = y; } - item->textRect.y = y; + if (item->textalignment == ITEM_ALIGN_RIGHT) { + //item->textRect.x = item->textalignx - newLineWidth; + if (item->textRect.hasVectors) + { + item->textRect.x -= newLineWidth * item->textRect.u[0]; + item->textRect.y -= newLineWidth * item->textRect.u[1]; + } else { + item->textRect.x -= newLineWidth; + } + } else if (item->textalignment == ITEM_ALIGN_CENTER) { + //item->textRect.x = item->textalignx - newLineWidth / 2; + if (item->textRect.hasVectors) + { + item->textRect.x -= (newLineWidth >> 1) * item->textRect.u[0]; + item->textRect.y -= (newLineWidth >> 1) * item->textRect.u[1]; + } else { + item->textRect.x -= newLineWidth >> 1; + } + } + //item->textRect.y = y; ToWindowCoords(&item->textRect.x, &item->textRect.y, &item->window); // buff[newLine] = '\0'; - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, buff, 0, 0, - item->textStyle); + if (item->textRect.hasVectors) + { + DC->drawAngledText(item->textRect.x, item->textRect.y, item->textRect.u, item->textRect.v, item->textscale, + color, buff, 0, 0, item->textStyle); + } else { + DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, buff, 0, 0, + item->textStyle); + } } if (*p == '\0') { break; @@ -3815,7 +4243,18 @@ void Item_Text_Paint(itemDef_t * item) // DC->drawText(item->textRect.x - 1, item->textRect.y + 1, item->textscale * 1.02, item->window.outlineColor, textPtr, adjust); // } - DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, textPtr, 0, 0, item->textStyle); + if (item->window.rectClient.hasVectors) + { + DC->drawAngledText(item->textRect.x, item->textRect.y, item->window.rectClient.u, item->window.rectClient.v, + item->textscale, color, textPtr, 0, 0, item->textStyle); + //debug + //DC->drawAngledRect(item->textRect.x, item->textRect.y, item->textRect.w, item->textRect.h, + // item->textRect.u, item->textRect.v, 2, colorYellow, RECT_FULL); + } else { + DC->drawText(item->textRect.x, item->textRect.y, item->textscale, color, textPtr, 0, 0, item->textStyle); + //debug + //DC->drawRect(item->textRect.x, item->textRect.y, item->textRect.w, item->textRect.h, 2, colorYellow); + } } //float trap_Cvar_VariableValue( const char *var_name ); @@ -4197,6 +4636,7 @@ void Item_Slider_Paint(itemDef_t * item) vec4_t newColor, lowLight; float x, y, value; menuDef_t *parent = (menuDef_t *) item->parent; + Point pt; value = (item->cvar) ? DC->getCVarValue(item->cvar) : 0; @@ -4212,20 +4652,43 @@ void Item_Slider_Paint(itemDef_t * item) memcpy(&newColor, &item->window.foreColor, sizeof(vec4_t)); } - y = item->window.rect.y; if (item->text) { Item_Text_Paint(item); - x = item->textRect.x + item->textRect.w + 8; + //Makro - vectors? + if (item->textRect.hasVectors) + { + float xoffset = item->textRect.w + 8, yoffset = -(item->textRect.h + SLIDER_HEIGHT)/2; + x = item->textRect.x + xoffset*item->textRect.u[0] + yoffset*item->textRect.v[0]; + y = item->textRect.y + xoffset*item->textRect.u[1] + yoffset*item->textRect.v[1]; + } else { + x = item->textRect.x + item->textRect.w + 8; + y = item->textRect.y - (item->textRect.h + SLIDER_HEIGHT)/2; + } } else { x = item->window.rect.x; + y = item->window.rect.y; } DC->setColor(newColor); - DC->drawHandlePic(x, y, SLIDER_WIDTH, SLIDER_HEIGHT, DC->Assets.sliderBar); - - x = Item_Slider_ThumbPosition(item); - DC->drawHandlePic(x - (SLIDER_THUMB_WIDTH / 2), y - 2, SLIDER_THUMB_WIDTH, SLIDER_THUMB_HEIGHT, - DC->Assets.sliderThumb); + if (item->textRect.hasVectors) + { + DC->drawAngledPic(x, y, SLIDER_WIDTH, SLIDER_HEIGHT, item->textRect.u, item->textRect.v, + newColor, 0, 0, 1, 1, DC->Assets.sliderBar); + } else { + DC->drawHandlePic(x, y, SLIDER_WIDTH, SLIDER_HEIGHT, DC->Assets.sliderBar); + } + //paint the slider + pt = Item_Slider_ThumbPosition(item); + if (item->textRect.hasVectors) + { + float srx = pt.x - (SLIDER_THUMB_WIDTH / 2) * item->textRect.u[0]; + float sry = pt.y - (SLIDER_THUMB_WIDTH / 2) * item->textRect.u[1]; + DC->drawAngledPic(srx, sry, SLIDER_THUMB_WIDTH, SLIDER_THUMB_HEIGHT, item->textRect.u, item->textRect.v, + newColor, 0, 0, 1, 1, DC->Assets.sliderThumb); + } else { + pt.x -= (SLIDER_THUMB_WIDTH / 2); + DC->drawHandlePic(pt.x, pt.y, SLIDER_THUMB_WIDTH, SLIDER_THUMB_HEIGHT, DC->Assets.sliderThumb); + } } void Item_Bind_Paint(itemDef_t * item) @@ -4721,23 +5184,33 @@ void Item_OwnerDraw_Paint(itemDef_t * item) } if (item->text) { + float p[2]; + + p[0] = item->textRect.x; + p[1] = item->window.rect.y; Item_Text_Paint(item); - if (item->text[0]) { - // +8 is an offset kludge to properly align owner draw items that have text combined with them - DC->ownerDrawItem(item->textRect.x + item->textRect.w + 8, item->window.rect.y, - item->window.rect.w, item->window.rect.h, 0, item->textaligny, - item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, - item->special, item->textscale, color, item->window.background, - item->textStyle); + + // +8 is an offset kludge to properly align owner draw items that have text combined with them + if (item->window.rectClient.hasVectors) { + if (item->text[0]) { + Vector2MA(p, item->textRect.w+8, item->window.rectClient.u, p); + } else { + Vector2MA(p, item->textRect.w, item->window.rectClient.u, p); + } } else { - DC->ownerDrawItem(item->textRect.x + item->textRect.w, item->window.rect.y, - item->window.rect.w, item->window.rect.h, 0, item->textaligny, - item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, - item->special, item->textscale, color, item->window.background, - item->textStyle); + if (item->text[0]) { + p[0] += item->textRect.w + 8; + } else { + p[0] += item->textRect.w; + } } + DC->ownerDrawItem(item, p[0], p[1], + item->window.rect.w, item->window.rect.h, 0, item->textaligny, + item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, + item->special, item->textscale, color, item->window.background, + item->textStyle); } else { - DC->ownerDrawItem(item->window.rect.x, item->window.rect.y, item->window.rect.w, + DC->ownerDrawItem(item, item->window.rect.x, item->window.rect.y, item->window.rect.w, item->window.rect.h, item->textalignx, item->textaligny, item->window.ownerDraw, item->window.ownerDrawFlags, item->alignment, item->special, item->textscale, color, item->window.background, @@ -4758,6 +5231,30 @@ void Item_Paint(itemDef_t * item) return; } + if (item->window.flags & WINDOW_RENDERPOINT) + { + if (DC->pendingPolys) + { + UI_Render2DScene(); + } + } + + //Makro - debug + /* + if (0) + { + if (item->text && item->textRect.w) + { + if (Rect_ContainsPoint(&item->textRect, DC->cursorx, DC->cursory)) + { + DC->drawText(DC->cursorx, DC->cursory, 0.3f, colorYellow, + va("%.0f %.0f %.0f %.0f", item->textRect.x, item->textRect.y, item->textRect.w, item->textRect.h), + 0, 0, ITEM_TEXTSTYLE_SHADOWED); + } + } + } + */ + if (item->window.flags & WINDOW_ORBITING) { if (DC->realTime > item->window.nextTime) { float rx, ry, a, c, s, w, h; @@ -4883,6 +5380,7 @@ void Item_Paint(itemDef_t * item) if (!(item->window.flags & WINDOW_VISIBLE)) { return; } + // paint the rect first.. Window_Paint(&item->window, parent->fadeAmount, parent->fadeClamp, parent->fadeCycle); @@ -4938,7 +5436,6 @@ void Item_Paint(itemDef_t * item) default: break; } - } void Menu_Init(menuDef_t * menu) @@ -5136,34 +5633,70 @@ void Menu_HandleMouseMove(menuDef_t * menu, float x, float y) } +//Makro - let's make things easier +int UI_GetIndexInTimer(itemDef_t *item) +{ + if (!item) + return 0; + if (!item->window.name) + return 0; + if (Q_stricmpn(item->window.name, "timer", 5) != 0) + return 0; + return atoi(item->window.name+5); +} + + //Makro - timer actions void UI_RQ3_HandleTimer(menuDef_t * menu) { if (menu) { if (menu->timerEnabled) { if (DC->realTime > menu->nextTimer) { - if (menu->timerPos + 1 > menu->timedItems) { + if (menu->timerPos > menu->timedItems) { menu->timerEnabled = qfalse; if (menu->onFinishTimer && menu->itemCount > 0) { Item_RunScript(menu->items[0], menu->onFinishTimer); } } else { int i; + int toShow = menu->timerPos; + int toHide = menu->timerPos - menu->timerMaxDisplay; menu->nextTimer = DC->realTime + menu->timerInterval; for (i = 0; i < menu->itemCount; i++) { - if (!Q_stricmp(menu->items[i]->window.group, "timer")) { - if (!Q_stricmp - (menu->items[i]->window.name, - va("timer%i", menu->timerPos + 1))) { - menu->items[i]->window.flags |= WINDOW_VISIBLE; - if (menu->items[i]->onTimer) { - Item_RunScript(menu->items[i], - menu->items[i]->onTimer); + itemDef_t *item = menu->items[i]; + if (!Q_stricmp(item->window.group, "timer")) { + int tIndex = UI_GetIndexInTimer(item); + + //item to be shown + if ( tIndex == toShow ) { + //manual show + if (item->onTimerShow) { + Item_RunScript(item, item->onTimerShow); + //menu default + } else if (menu->onTimerShow) { + Item_RunScript(item, menu->onTimerShow); + //simply hide + } else { + item->window.flags |= WINDOW_VISIBLE; + } + //item to be hidden + } else if ( toHide > 0 && tIndex == toHide) { + //manual hide + if (item->onTimerHide) { + Item_RunScript(item, item->onTimerHide); + //menu default + } else if (menu->onTimerHide) { + Item_RunScript(item, menu->onTimerHide); + //simply hide + } else { + item->window.flags &= ~WINDOW_VISIBLE; } } else { - menu->items[i]->window.flags &= ~WINDOW_VISIBLE; + //hide all items between those two + if (tIndex < toHide || tIndex > toShow) + menu->items[i]->window.flags &= ~WINDOW_VISIBLE; } } } @@ -5182,6 +5715,14 @@ void Menu_Paint(menuDef_t * menu, qboolean forcePaint) return; } + if (menu->window.flags & WINDOW_RENDERPOINT) + { + if (DC->pendingPolys) + { + UI_Render2DScene(); + } + } + if (!(menu->window.flags & WINDOW_VISIBLE) && !forcePaint) { return; } @@ -5353,20 +5894,23 @@ qboolean ItemParse_name(itemDef_t * item, int handle) qboolean ItemParse_shortcutKey(itemDef_t * item, int handle) { const char *temp; - int c; - if (!PC_String_Parse(handle, &temp)) { - item->window.shortcutKey = -1; - return qfalse; + if (PC_String_Parse(handle, &temp)) + { + int c, i; + + //key buffer already full? + for (i=0; iwindow.shortcutKey[i]; i++); + if (i == MAX_SHORTCUT_KEYS) + return qfalse; + + c = (strlen(temp) == 1) ? temp[0] : UI_RQ3_KeyNumFromChar(temp); + if (c>='A' && c<='Z') + c -= 'A'-'a'; + item->window.shortcutKey[i] = c; + return qtrue; } - //Com_Printf(S_COLOR_BLUE "^4MDEBUG: Shortcut key read: %s\n^7", item->window.shortcutKey); - - c = (strlen(temp) == 1) ? temp[0] : UI_RQ3_KeyNumFromChar(temp); - if (c>='A' && c<='Z') - c -= 'A'-'a'; - item->window.shortcutKey = c; - - return qtrue; + return qfalse; } //Makro - fixed height for autowrapped text @@ -5509,7 +6053,7 @@ qboolean ItemParse_model_rotation(itemDef_t * item, int handle) return qtrue; } -// Makro - I'm going to make it so that we can rotate models around all 3 axis +// Makro - rotate models around all 3 axis // model_angle - old one qboolean ItemParse_model_angle(itemDef_t * item, int handle) { @@ -5525,6 +6069,188 @@ qboolean ItemParse_model_angle(itemDef_t * item, int handle) return qtrue; } +//Makro - angled items +//vectors +qboolean ItemParse_vectors(itemDef_t *item, int handle) +{ + float u[2], v[2]; + if (PC_Float_Parse(handle, &u[0])) + { + if (PC_Float_Parse(handle, &u[1])) + { + if (PC_Float_Parse(handle, &v[0])) + { + if (PC_Float_Parse(handle, &v[1])) + { + Vector2Copy(u, item->window.rectClient.u); + Vector2Copy(v, item->window.rectClient.v); + Vector2Copy(u, item->window.rect.u); + Vector2Copy(v, item->window.rect.v); + Vector2Copy(u, item->textRect.u); + Vector2Copy(v, item->textRect.v); + item->window.rectClient.hasVectors=qtrue; + item->window.rect.hasVectors=qtrue; + item->textRect.hasVectors=qtrue; + return qtrue; + } + } + } + } + return qfalse; +} + +//alignrect +qboolean ItemParse_alignrect(itemDef_t *item, int handle) +{ + int w, h, align, vdist, hdist; + const char *to; + if (PC_String_Parse(handle, &to)) + { + if (PC_Int_Parse(handle, &align)) + { + if (PC_Int_Parse(handle, &hdist)) + { + if (PC_Int_Parse(handle, &vdist)) + { + if (PC_Int_Parse(handle, &w)) + { + if (PC_Int_Parse(handle, &h)) + { + itemDef_t *toitem = (itemDef_t*)Menu_GetMatchingItemByNumber((menuDef_t*)item->parent,0, to); + if (toitem) + { + //got milk... err, vectors? + if (toitem->window.rectClient.hasVectors) + { + //set co-ords + float p[2]; + + p[0] = toitem->window.rectClient.x; + p[1] = toitem->window.rectClient.y; + Vector2MA(p, vdist, toitem->window.rectClient.v, p); + if (align == ITEM_ALIGN_RIGHT) { + Vector2MA(p, (toitem->window.rectClient.w - w) - hdist, toitem->window.rectClient.u, p); + } else if (align == ITEM_ALIGN_CENTER) { + Vector2MA(p, (toitem->window.rectClient.w - w)/2 + hdist, toitem->window.rectClient.u, p); + } else { + Vector2MA(p, hdist, toitem->window.rectClient.u, p); + } + item->window.rectClient.x = p[0]; + item->window.rectClient.y = p[1]; + item->window.rectClient.w = w; + item->window.rectClient.h = h; + //copy vector info + Vector2Copy(toitem->window.rect.u, item->window.rect.u); + Vector2Copy(toitem->window.rect.v, item->window.rect.v); + item->window.rect.hasVectors = qtrue; + Vector2Copy(toitem->window.rect.u, item->window.rectClient.u); + Vector2Copy(toitem->window.rect.v, item->window.rectClient.v); + item->window.rectClient.hasVectors = qtrue; + Vector2Copy(toitem->window.rect.u, item->textRect.u); + Vector2Copy(toitem->window.rect.v, item->textRect.v); + item->textRect.hasVectors = qtrue; + } else { + int x = toitem->window.rectClient.x, y = toitem->window.rectClient.y + vdist; + if (align == ITEM_ALIGN_RIGHT) + { + x += toitem->window.rectClient.w - w - hdist; + } else if (align == ITEM_ALIGN_CENTER) { + x += (toitem->window.rectClient.w - w) / 2 + hdist; + } else { + x += hdist; + } + item->window.rectClient.x = x; + item->window.rectClient.y = y; + item->window.rectClient.w = w; + item->window.rectClient.h = h; + } + } + return qtrue; + } + } + } + } + } + } + return qfalse; +} + +//normalizevectors +qboolean ItemParse_normalizevectors(itemDef_t *item, int handle) +{ + float norm; + + if (!item->window.rectClient.hasVectors) + return qtrue; + + norm = Vector2Norm2(item->window.rectClient.u); + if (!norm) + return qtrue; + Vector2Scale(item->window.rectClient.u, 1.0f/norm, item->window.rectClient.u); + Vector2Copy(item->window.rectClient.u, item->window.rect.u); + Vector2Copy(item->window.rectClient.u, item->textRect.u); + + norm = Vector2Norm2(item->window.rectClient.v); + if (!norm) + return qtrue; + Vector2Scale(item->window.rectClient.v, 1.0f/norm, item->window.rectClient.v); + Vector2Copy(item->window.rectClient.v, item->window.rect.u); + Vector2Copy(item->window.rectClient.v, item->textRect.u); + return qtrue; +} + +//anglevectors +qboolean ItemParse_anglevectors(itemDef_t *item, int handle) +{ + float u, v; + if (PC_Float_Parse(handle, &u)) + { + if (PC_Float_Parse(handle, &v)) + { + u = DEG2RAD(-u); + v = DEG2RAD(-v); + Vector2Set(item->window.rectClient.u, cos(u), sin(u)); + Vector2Set(item->window.rectClient.v, cos(v), sin(v)); + Vector2Copy(item->window.rectClient.u, item->window.rect.u); + Vector2Copy(item->window.rectClient.v, item->window.rect.v); + Vector2Copy(item->window.rectClient.u, item->textRect.u); + Vector2Copy(item->window.rectClient.v, item->textRect.v); + item->window.rectClient.hasVectors=qtrue; + item->window.rect.hasVectors=qtrue; + item->textRect.hasVectors=qtrue; + return qtrue; + } + } + return qfalse; +} + +//adjustrect +qboolean ItemParse_adjustrect(itemDef_t * item, int handle) +{ + if (item && item->parent) + { + menuDef_t *menu = (menuDef_t*)item->parent; + if (menu->window.rect.hasVectors) + { + int ox = item->window.rectClient.x, oy = item->window.rectClient.y; + //copy vector info + Vector2Copy(menu->window.rect.u, item->window.rect.u); + Vector2Copy(menu->window.rect.v, item->window.rect.v); + item->window.rect.hasVectors = qtrue; + Vector2Copy(menu->window.rect.u, item->window.rectClient.u); + Vector2Copy(menu->window.rect.v, item->window.rectClient.v); + item->window.rectClient.hasVectors = qtrue; + Vector2Copy(menu->window.rect.u, item->textRect.u); + Vector2Copy(menu->window.rect.v, item->textRect.v); + item->textRect.hasVectors = qtrue; + //adjust co-ords + item->window.rectClient.x = ox * item->window.rectClient.u[0] + oy * item->window.rectClient.v[0]; + item->window.rectClient.y = ox * item->window.rectClient.u[1] + oy * item->window.rectClient.v[1]; + } + } + return qtrue; +} + // model_angles qboolean ItemParse_model_angles(itemDef_t * item, int handle) { @@ -5543,6 +6269,12 @@ qboolean ItemParse_model_angles(itemDef_t * item, int handle) return qfalse; } +qboolean ItemParse_renderpoint(itemDef_t * item, int handle) +{ + item->window.flags |= WINDOW_RENDERPOINT; + return qtrue; +} + // rect qboolean ItemParse_rect(itemDef_t * item, int handle) { @@ -5897,9 +6629,18 @@ qboolean ItemParse_leaveFocus(itemDef_t * item, int handle) } //Makro - extra action executed when the timer shows this item -qboolean ItemParse_onTimer(itemDef_t * item, int handle) +qboolean ItemParse_onTimerShow(itemDef_t * item, int handle) { - if (!PC_Script_Parse(handle, &item->onTimer)) { + if (!PC_Script_Parse(handle, &item->onTimerShow)) { + return qfalse; + } + return qtrue; +} + +//Makro - extra action executed when the timer hides this item +qboolean ItemParse_onTimerHide(itemDef_t * item, int handle) +{ + if (!PC_Script_Parse(handle, &item->onTimerHide)) { return qfalse; } return qtrue; @@ -6206,6 +6947,14 @@ keywordHash_t itemParseKeywords[] = { //Makro - support for 3 angles {"model_angles", ItemParse_model_angles, NULL}, {"rect", ItemParse_rect, NULL}, + //Makro - ugliest hack ever... by far + {"renderpoint", ItemParse_renderpoint, NULL}, + //Makro - angled items + {"alignrect", ItemParse_alignrect, NULL}, + {"adjustrect", ItemParse_adjustrect, NULL}, + {"vectors", ItemParse_vectors, NULL}, + {"anglevectors", ItemParse_anglevectors, NULL}, + {"normalizevectors", ItemParse_normalizevectors, NULL}, {"style", ItemParse_style, NULL}, {"decoration", ItemParse_decoration, NULL}, {"notselectable", ItemParse_notselectable, NULL}, @@ -6238,7 +6987,8 @@ keywordHash_t itemParseKeywords[] = { {"onFocus", ItemParse_onFocus, NULL}, {"leaveFocus", ItemParse_leaveFocus, NULL}, //Makro - for timers - {"onTimer", ItemParse_onTimer, NULL}, + {"onTimerShow", ItemParse_onTimerShow, NULL}, + {"onTimerHide", ItemParse_onTimerHide, NULL}, {"mouseEnter", ItemParse_mouseEnter, NULL}, {"mouseExit", ItemParse_mouseExit, NULL}, {"mouseEnterText", ItemParse_mouseEnterText, NULL}, @@ -6384,6 +7134,13 @@ qboolean MenuParse_fullscreen(itemDef_t * item, int handle) return qtrue; } +qboolean MenuParse_renderpoint(itemDef_t *item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + menu->window.flags |= WINDOW_RENDERPOINT; + return qtrue; +} + qboolean MenuParse_rect(itemDef_t * item, int handle) { menuDef_t *menu = (menuDef_t *) item; @@ -6394,6 +7151,77 @@ qboolean MenuParse_rect(itemDef_t * item, int handle) return qtrue; } +//Makro - angled items +qboolean MenuParse_vectors(itemDef_t *item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + float u[2], v[2]; + if (PC_Float_Parse(handle, &u[0])) + { + if (PC_Float_Parse(handle, &u[1])) + { + if (PC_Float_Parse(handle, &v[0])) + { + if (PC_Float_Parse(handle, &v[1])) + { + Vector2Copy(u, menu->window.rectClient.u); + Vector2Copy(v, menu->window.rectClient.v); + Vector2Copy(u, menu->window.rect.u); + Vector2Copy(v, menu->window.rect.v); + menu->window.rectClient.hasVectors=qtrue; + menu->window.rect.hasVectors=qtrue; + return qtrue; + } + } + } + } + return qfalse; +} + +qboolean MenuParse_normalizevectors(itemDef_t *item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + float norm; + + if (!menu->window.rectClient.hasVectors) + return qfalse; + + norm = Vector2Norm2(menu->window.rectClient.u); + if (!norm) + return qfalse; + Vector2Scale(menu->window.rectClient.u, 1.0f/norm, menu->window.rectClient.u); + Vector2Copy(menu->window.rectClient.u, menu->window.rect.u); + + norm = Vector2Norm2(menu->window.rectClient.v); + if (!norm) + return qfalse; + Vector2Scale(menu->window.rectClient.v, 1.0f/norm, menu->window.rectClient.v); + Vector2Copy(menu->window.rectClient.v, menu->window.rect.u); + return qtrue; +} + +qboolean MenuParse_anglevectors(itemDef_t *item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + float u, v; + if (PC_Float_Parse(handle, &u)) + { + if (PC_Float_Parse(handle, &v)) + { + u = DEG2RAD(-u); + v = DEG2RAD(-v); + Vector2Set(menu->window.rectClient.u, cos(u), sin(u)); + Vector2Set(menu->window.rectClient.v, cos(v), sin(v)); + Vector2Copy(menu->window.rectClient.u, menu->window.rect.u); + Vector2Copy(menu->window.rectClient.v, menu->window.rect.v); + menu->window.rectClient.hasVectors=qtrue; + menu->window.rect.hasVectors=qtrue; + return qtrue; + } + } + return qfalse; +} + qboolean MenuParse_style(itemDef_t * item, int handle) { menuDef_t *menu = (menuDef_t *) item; @@ -6449,6 +7277,28 @@ qboolean MenuParse_onFirstShow(itemDef_t * item, int handle) return qtrue; } +//Makro - executed in addition to the item script +qboolean MenuParse_onTimerShow(itemDef_t * item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + + if (!PC_Script_Parse(handle, &menu->onTimerShow)) { + return qfalse; + } + return qtrue; +} + +//Makro - executed in addition to the item script +qboolean MenuParse_onTimerHide(itemDef_t * item, int handle) +{ + menuDef_t *menu = (menuDef_t *) item; + + if (!PC_Script_Parse(handle, &menu->onTimerHide)) { + return qfalse; + } + return qtrue; +} + qboolean MenuParse_onClose(itemDef_t * item, int handle) { menuDef_t *menu = (menuDef_t *) item; @@ -6502,6 +7352,17 @@ qboolean MenuParse_timedItems(itemDef_t * item, int handle) return qtrue; } +//number of items to be shown at a time +qboolean MenuParse_timerMaxDisplay(itemDef_t *item, int handle) +{ + menuDef_t *menu = (menuDef_t*) item; + if (!PC_Int_Parse(handle, &menu->timerMaxDisplay)) { + menu->timerMaxDisplay = 1; + return qfalse; + } + return qtrue; +} + qboolean MenuParse_border(itemDef_t * item, int handle) { menuDef_t *menu = (menuDef_t *) item; @@ -6732,101 +7593,78 @@ qboolean MenuParse_fadeCycle(itemDef_t * item, int handle) return qtrue; } -qboolean MenuParse_itemDef(itemDef_t * item, int handle) -{ - menuDef_t *menu = (menuDef_t *) item; - +qboolean MenuParse_itemDef( itemDef_t *item, int handle ) { + menuDef_t *menu = (menuDef_t*)item; if (menu->itemCount < MAX_MENUITEMS) { menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t)); Item_Init(menu->items[menu->itemCount]); + //was below + menu->items[menu->itemCount]->parent = menu; if (!Item_Parse(handle, menu->items[menu->itemCount])) { return qfalse; } 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; } keywordHash_t menuParseKeywords[] = { - {"font", MenuParse_font, NULL} - , - {"name", MenuParse_name, NULL} - , - {"fullscreen", MenuParse_fullscreen, NULL} - , - {"rect", MenuParse_rect, NULL} - , - {"style", MenuParse_style, NULL} - , - {"visible", MenuParse_visible, NULL} - , - {"onOpen", MenuParse_onOpen, NULL} - , + {"font", MenuParse_font, NULL}, + {"name", MenuParse_name, NULL}, + {"fullscreen", MenuParse_fullscreen, NULL}, + {"rect", MenuParse_rect, NULL}, + //Makro - ugliest hack ever... by far + {"renderpoint", MenuParse_renderpoint, NULL}, + //Makro - angled items + {"vectors", MenuParse_vectors, NULL}, + {"anglevectors", MenuParse_anglevectors, NULL}, + {"normalizevectors", MenuParse_normalizevectors, NULL}, + {"style", MenuParse_style, NULL}, + {"visible", MenuParse_visible, NULL}, + {"onOpen", MenuParse_onOpen, NULL}, //Makro - executed when the menu is shown - {"onShow", MenuParse_onShow, NULL} - , - {"onFirstShow", MenuParse_onFirstShow, NULL} - , - {"onClose", MenuParse_onClose, NULL} - , - {"onESC", MenuParse_onESC, NULL} - , + {"onShow", MenuParse_onShow, NULL}, + {"onFirstShow", MenuParse_onFirstShow, NULL}, + {"onClose", MenuParse_onClose, NULL}, + {"onESC", MenuParse_onESC, NULL}, //Makro - executed when all the items in a timed sequence have been shown - {"onFinishTimer", MenuParse_onFinishTimer, NULL} - , + {"onFinishTimer", MenuParse_onFinishTimer, NULL}, + //Makro - executed in addition to the item script + {"onTimerShow", MenuParse_onTimerShow}, + {"onTimerHide", MenuParse_onTimerHide}, //Makro - timer interval - {"timerInterval", MenuParse_timerInterval, NULL} - , + {"timerInterval", MenuParse_timerInterval, NULL}, //Makro - total items in timed sequence - {"timedItems", MenuParse_timedItems, NULL} - , - {"border", MenuParse_border, NULL} - , + {"timedItems", MenuParse_timedItems, NULL}, + //number of items to be shown at a time + {"timermaxdisplay", MenuParse_timerMaxDisplay, NULL}, + {"border", MenuParse_border, NULL}, //Makro - for drop shadow effects - {"shadowStyle", MenuParse_shadowStyle, NULL} - , - {"dropShadowStyle", MenuParse_shadowStyle, NULL} - , - {"borderSize", MenuParse_borderSize, NULL} - , - {"backcolor", MenuParse_backcolor, NULL} - , - {"forecolor", MenuParse_forecolor, NULL} - , - {"bordercolor", MenuParse_bordercolor, NULL} - , - {"focuscolor", MenuParse_focuscolor, NULL} - , - {"disablecolor", MenuParse_disablecolor, NULL} - , - {"outlinecolor", MenuParse_outlinecolor, NULL} - , - {"background", MenuParse_background, NULL} - , - {"ownerdraw", MenuParse_ownerdraw, NULL} - , - {"ownerdrawFlag", MenuParse_ownerdrawFlag, NULL} - , - {"outOfBoundsClick", MenuParse_outOfBounds, NULL} - , - {"soundLoop", MenuParse_soundLoop, NULL} - , + {"shadowStyle", MenuParse_shadowStyle, NULL}, + {"dropShadowStyle", MenuParse_shadowStyle, NULL}, + {"borderSize", MenuParse_borderSize, NULL}, + {"backcolor", MenuParse_backcolor, NULL}, + {"forecolor", MenuParse_forecolor, NULL}, + {"bordercolor", MenuParse_bordercolor, NULL}, + {"focuscolor", MenuParse_focuscolor, NULL}, + {"disablecolor", MenuParse_disablecolor, NULL}, + {"outlinecolor", MenuParse_outlinecolor, NULL}, + {"background", MenuParse_background, NULL}, + {"ownerdraw", MenuParse_ownerdraw, NULL}, + {"ownerdrawFlag", MenuParse_ownerdrawFlag, NULL}, + {"outOfBoundsClick", MenuParse_outOfBounds, NULL}, + {"soundLoop", MenuParse_soundLoop, NULL}, //Makro - support for music with intro - {"soundIntro", MenuParse_soundIntro, NULL} - , - {"itemDef", MenuParse_itemDef, NULL} - , - {"cinematic", MenuParse_cinematic, NULL} - , - {"popup", MenuParse_popup, NULL} - , - {"fadeClamp", MenuParse_fadeClamp, NULL} - , - {"fadeCycle", MenuParse_fadeCycle, NULL} - , - {"fadeAmount", MenuParse_fadeAmount, NULL} - , + {"soundIntro", MenuParse_soundIntro, NULL}, + {"itemDef", MenuParse_itemDef, NULL}, + {"cinematic", MenuParse_cinematic, NULL}, + {"popup", MenuParse_popup, NULL}, + {"fadeClamp", MenuParse_fadeClamp, NULL}, + {"fadeCycle", MenuParse_fadeCycle, NULL}, + {"fadeAmount", MenuParse_fadeAmount, NULL}, {NULL, NULL, NULL} }; @@ -7102,4 +7940,4 @@ static qboolean Menu_OverActiveItem(menuDef_t * menu, float x, float y) } } return qfalse; -} +} \ No newline at end of file diff --git a/reaction/ta_ui/ui_shared.h b/reaction/ta_ui/ui_shared.h index 92376b3a..c3f44039 100644 --- a/reaction/ta_ui/ui_shared.h +++ b/reaction/ta_ui/ui_shared.h @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // no message // @@ -76,8 +79,9 @@ #define MAX_MENUDEFFILE 4096 #define MAX_MENUFILE 32768 #define MAX_MENUS 64 -//Makro - changed max item count from 96 -#define MAX_MENUITEMS 100 +//Makro - changed max item count from 96 to 100 +//Makro - changed to 192 +#define MAX_MENUITEMS 192 #define MAX_COLOR_RANGES 10 #define MAX_OPEN_MENUS 16 @@ -105,6 +109,9 @@ #define WINDOW_POPUP 0x00200000 // popup #define WINDOW_BACKCOLORSET 0x00400000 // backcolor was explicitly set #define WINDOW_TIMEDVISIBLE 0x00800000 // visibility timing ( NOT implemented ) +//Makro - ugliest hack ever... by far +#define WINDOW_RENDERPOINT 0x01000000 + // CGAME cursor type bits #define CURSOR_NONE 0x00000001 @@ -160,10 +167,19 @@ typedef struct { float y; // vert position float w; // width float h; // height; + qboolean hasVectors; + float u[2], v[2]; } rectDef_t; typedef rectDef_t Rectangle; +//Makro - point +typedef struct { + float x; + float y; +} pointDef_t; +typedef pointDef_t Point; + //Makro - for the new fading method typedef struct { vec4_t color1; @@ -173,6 +189,11 @@ typedef struct { int startTime, endTime; } timeFade_t; +#define MAX_SHORTCUT_KEYS 8 + +//----------------------------------------------- + + // FIXME: do something to separate text vs window stuff typedef struct { Rectangle rect; // client coord rectangle @@ -180,7 +201,7 @@ typedef struct { const char *name; // //Makro - adding support for shortcut keys //const char *shortcutKey; - int shortcutKey; + int shortcutKey[MAX_SHORTCUT_KEYS]; //Makro - drop shadow effect int shadowStyle; const char *group; // if it belongs to a group @@ -204,7 +225,7 @@ typedef struct { vec4_t backColor; // border color vec4_t borderColor; // border color vec4_t outlineColor; // border color - qhandle_t background; // background asset + qhandle_t background; // background asset } windowDef_t; typedef windowDef_t Window; @@ -305,8 +326,8 @@ typedef struct itemDef_s { const char *action; // select script const char *onFocus; // select script const char *leaveFocus; // select script - //Makro - extra action executed when the timer shows this item - const char *onTimer; + //Makro - action executed when the timer shows/hides this item + const char *onTimerShow, *onTimerHide; const char *cvar; // associated cvar const char *cvarTest; // associated cvar for enable actions const char *enableCvar; // enable, disable, show, or hide based on value, this can contain a list @@ -316,7 +337,8 @@ typedef struct itemDef_s { colorRangeDef_t colorRanges[MAX_COLOR_RANGES]; float special; // used for feeder id's etc.. diff per type 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; typedef struct { @@ -334,6 +356,8 @@ typedef struct { const char *onESC; // run when the menu is closed //Makro - executed when all the items in a timed sequence have been shown 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 const char *onShow; const char *onFirstShow; @@ -349,7 +373,7 @@ typedef struct { //Makro - timer is on/off qboolean timerEnabled; - int nextTimer, timerInterval, timedItems, timerPos; + int nextTimer, timerInterval, timedItems, timerPos, timerMaxDisplay; } menuDef_t; typedef struct { @@ -402,14 +426,29 @@ typedef struct { void (*handler) (itemDef_t * item, char **args); } 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 { qhandle_t(*registerShaderNoMip) (const char *p); void (*setColor) (const vec4_t v); 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, 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, 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 (*textHeight) (const char *text, float scale, int limit); 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 (*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 (*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 (*clearScene) (); void (*addRefEntityToScene) (const refEntity_t * re); void (*renderScene) (const refdef_t * fd); 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, qhandle_t shader, int textStyle); float (*getValue) (int ownerDraw); @@ -467,6 +508,9 @@ typedef struct { int cursory; //Makro - added cursor size int cursorSize; + //Makro - mouse down + qboolean mouseDown[3]; + int mouseDownPos[2]; qboolean debug; cachedAssets_t Assets; @@ -475,8 +519,21 @@ typedef struct { qhandle_t whiteShader; qhandle_t gradientImage; qhandle_t cursor; + //Makro - added; almost useless + qhandle_t selectShader; 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; 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_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 diff --git a/reaction/ui/ui_shared.c b/reaction/ui/ui_shared.c index 7469f1ea..2b466a8e 100644 --- a/reaction/ui/ui_shared.c +++ b/reaction/ui/ui_shared.c @@ -5,6 +5,9 @@ //----------------------------------------------------------------------------- // // $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 // Formatted the source in non DOS format. // @@ -5474,11 +5477,15 @@ qboolean MenuParse_itemDef( itemDef_t *item, int handle ) { if (menu->itemCount < MAX_MENUITEMS) { menu->items[menu->itemCount] = UI_Alloc(sizeof(itemDef_t)); Item_Init(menu->items[menu->itemCount]); + //was below + menu->items[menu->itemCount]->parent = menu; if (!Item_Parse(handle, menu->items[menu->itemCount])) { return qfalse; } 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; } diff --git a/reaction/uifiles/cdkey.menu b/reaction/uifiles/cdkey.menu index 4c818fb8..d1c9d83e 100644 --- a/reaction/uifiles/cdkey.menu +++ b/reaction/uifiles/cdkey.menu @@ -308,26 +308,26 @@ decoration } -//Back +///Back itemdef { name "btn_back" - style WINDOW_STYLE_SHADER + shortcutKey "B" rect 12 432 32 32 - type 1 + style WINDOW_STYLE_SHADER 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; timeFade back_hint forecolor .9 .9 .9 0 0 250 } - visible 1 } - itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -341,4 +341,4 @@ } } -} \ No newline at end of file +} diff --git a/reaction/uifiles/controls_look.menu b/reaction/uifiles/controls_look.menu index d9a05671..0d1048d6 100644 --- a/reaction/uifiles/controls_look.menu +++ b/reaction/uifiles/controls_look.menu @@ -658,12 +658,13 @@ itemdef { name "btn_back" + shortcutKey "B" rect 12 432 32 32 style WINDOW_STYLE_SHADER background "menu/art/rq3-menu-back.tga" type 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -672,7 +673,7 @@ itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/controls_misc.menu b/reaction/uifiles/controls_misc.menu index 3791131f..3bcf6f97 100644 --- a/reaction/uifiles/controls_misc.menu +++ b/reaction/uifiles/controls_misc.menu @@ -618,12 +618,13 @@ itemdef { name "btn_back" + shortcutKey "B" rect 12 432 32 32 style WINDOW_STYLE_SHADER background "menu/art/rq3-menu-back.tga" type 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -632,7 +633,7 @@ itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/controls_move.menu b/reaction/uifiles/controls_move.menu index dece8b72..8df052f2 100644 --- a/reaction/uifiles/controls_move.menu +++ b/reaction/uifiles/controls_move.menu @@ -682,12 +682,13 @@ itemdef { name "btn_back" + shortcutKey "B" rect 12 432 32 32 style WINDOW_STYLE_SHADER background "menu/art/rq3-menu-back.tga" type 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -696,7 +697,7 @@ itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/controls_reaction.menu b/reaction/uifiles/controls_reaction.menu index 2921ebc4..ebd4022d 100644 --- a/reaction/uifiles/controls_reaction.menu +++ b/reaction/uifiles/controls_reaction.menu @@ -668,12 +668,13 @@ itemdef { name "btn_back" + shortcutKey "B" rect 12 432 32 32 style WINDOW_STYLE_SHADER background "menu/art/rq3-menu-back.tga" type 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -682,7 +683,7 @@ itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/controls_weapon.menu b/reaction/uifiles/controls_weapon.menu index 146d3945..88df0c17 100644 --- a/reaction/uifiles/controls_weapon.menu +++ b/reaction/uifiles/controls_weapon.menu @@ -703,12 +703,13 @@ itemdef { name "btn_back" + shortcutKey "B" rect 12 432 32 32 style WINDOW_STYLE_SHADER background "menu/art/rq3-menu-back.tga" type 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -717,7 +718,7 @@ itemdef { name back_hint - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/createserver.menu b/reaction/uifiles/createserver.menu index a92f5cf7..436c5421 100644 --- a/reaction/uifiles/createserver.menu +++ b/reaction/uifiles/createserver.menu @@ -1095,6 +1095,7 @@ itemdef { name "btn_start" + shortcutKey "G" style WINDOW_STYLE_SHADER rect 560 432 64 32 type 1 @@ -1124,29 +1125,33 @@ //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 { name "btn_join" style WINDOW_STYLE_FILLED type ITEM_TYPE_BUTTON rect 540 20 80 20 - //border 1 - //bordersize 1 - //bordercolor .5 .5 .5 1 backcolor Ig_Sub_Color1 forecolor 1 1 1 1 textscale .25 textalign ITEM_ALIGN_CENTER textalignx 40 textaligny 14 - text "Connect >" + textstyle ITEM_TEXTSTYLE_SHADOWED + text "^_C^_onnect >" + shortcutKey "C" visible 1 action { close createserver ; open joinserver } - //onFocus { setcolor backcolor Ig_Sub_Color2 ; show join_hint } - //leaveFocus { setcolor backcolor Ig_Sub_Color1 ; hide join_hint } - 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 } + onFocus { show join_hint ; timeFade join_hint forecolor .9 .9 .9 1 0 250 } + leaveFocus { timeFade join_hint forecolor .9 .9 .9 0 0 250 } } itemdef { @@ -1168,11 +1173,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type 1 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -1180,9 +1186,10 @@ visible 1 } + itemdef { name back_hint - text "Go back to main menu" + text "Go ^_b^_ack to main menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -1196,3 +1203,4 @@ } } +} \ No newline at end of file diff --git a/reaction/uifiles/credit.menu b/reaction/uifiles/credit.menu index 06251681..a8d4c4c6 100644 --- a/reaction/uifiles/credit.menu +++ b/reaction/uifiles/credit.menu @@ -4,13 +4,11 @@ menuDef { name "credit" - background "rq3-ta-menuback" // Makro: replace "rq3-ta-menuback" with "rq3-menuback" + background UI_ASSETS"/main" // Makro: replace "rq3-ta-menuback" with "rq3-menuback" // to use the current background fullScreen 1 visible 0 // Visible on open focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items - timedItems 39 - timerInterval 3500 fadeCycle 500 // how often fade happens in milliseconds fadeAmount 0.01 // amount to adjust alpha per cycle @@ -18,99 +16,49 @@ onOpen { uiScript "backupMusicVolume" ; - play "sound/misc/menu1.wav" ; + play "sound/ui/whoosh3.wav" ; //exec "s_musicvolume 1" ; playlooped "music/sonic1" ; - transition hint 0 480 640 40 0 420 640 40 20 10 ; - startTimer + //transition hint 0 -40 640 40 0 10 640 40 20 10 ; + //hide timer ; + startTimer ; } - onFinishTimer { uiScript "restoreMusicVolume" ; close credit ; uiScript "quit" } - //onFinishTimer { restartTimer } - onShow { - setitemcolor overlay backcolor 0 0 0 .5 ; + setitemcolor main forecolor 5 5 5 0 ; + timefade main forecolor 5 5 5 1 0 500 ; + setitemcolor overlay backcolor 0 0 0 .5 ; timeFade overlay backcolor 0 0 0 1 0 20000 ; } //onClose { uiScript "restoreMusicVolume" } - onEsc { uiScript "restoreMusicVolume" ; stopTimer ; close credit ; uiScript "quit" } + //onEsc { uiScript "restoreMusicVolume" ; stopTimer ; close credit ; uiScript "quit" } //onEsc { uiScript "restoreMusicVolume" ; stopTimer ; close credit ; open main } + onEsc { uiScript "restoreMusicVolume" ; stopTimer ; close _self ; open _prev } -//=================== -// RQ3 stuff -//=================== - //Faded in at startup + // Timer // - itemDef { - name overlay - style WINDOW_STYLE_FILLED - background "ui/assets/alpha" - forecolor RQ3_MENU_OVERLAY_COLOR - backcolor RQ3_MENU_OVERLAY_COLOR - rect 0 0 640 480 - visible 1 - decoration - } + timedItems 39 + timerInterval 2500 + timerMaxDisplay 1 + onFinishTimer { uiScript "restoreMusicVolume" ; uiScript "quit" } + //onFinishTimer { restartTimer } + onTimerShow { + show _self ; + setcolor forecolor 5 5 5 0 ; + timeFadeSelf forecolor 5 5 5 1 0 500 ; + } + onTimerHide { + setcolor forecolor 5 5 5 1 ; + timeFadeSelf forecolor 5 5 5 0 0 500; + } - itemDef { - name top_bar //rq3: Top bar - rect 0 0 640 56 - style 1 - backcolor RQ3_MAIN_BAR_COLOR - //border 2 - //bordersize 1 - //bordercolor 1 0 0 1 - decoration - visible 1 - } - itemDef { - name top_bar //rq3: Top bar - rect 0 58 640 12 - style WINDOW_STYLE_SHADER - background "ui/assets/rq3-main-shadow-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 { - 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_bar2 //rq3: bottom bar - border - rect 0 418 640 2 - style 1 - backcolor RQ3_MAIN_BAR_COLOR2 - //border 2 - //bordersize 1 - //bordercolor 1 0 0 1 - decoration - visible 1 - } +//-------------------------------------------- +#include "ui/shared.h" +//-------------------------------------------- //============= @@ -118,70 +66,103 @@ //============= -//Timed items + //Boomstick logo - // REACTION QUAKE 3 VERSION 3.0 // - - itemDef { - name "timer1" - group timer - rect 100 100 440 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .45 - textalignx 220 - textaligny 100 - text "REACTION QUAKE 3 v3.2" - autowrapped - visible 1 + itemDef { + style WINDOW_STYLE_SHADER + rect 280 288 120 120 + anglevectors 9 -81 + background UI_ASSETS"/logo" + forecolor 1 1 1 0.2 decoration - } + visible 1 + } + + // REACTION QUAKE 3 VERSION 3.3 // + + itemdef { + group main + subgroup "main_title" + text "REACTION QUAKE 3 v3.3" + forecolor 0 0 .05 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .4 + textalignx 120 + textaligny 24 + rect 108 144 240 36 + anglevectors 9 -81 + visible 1 + autowrapped + decoration + } itemDef { - name "timer1" - group timer - rect 100 100 440 280 + group main + //rect 100 100 440 280 + alignrect "main_title" ITEM_ALIGN_LEFT 0 20 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_CENTER - textscale .3 - textalignx 220 - textaligny 120 - text "(c) 2000 - 2004 Boomstick Studios\n\n\n" + textscale .275 + textalignx 120 + textaligny 24 + forecolor 0 0 0.05 1 + text "(c) 2000-2005 Boomstick Studios\n\n\n\n\n" "www.reactionquake3.com" autowrapped visible 1 decoration } + +//Timed items + + + // PROGRAMMING // - itemDef { + itemDef { + name "timer2" + group timer + subgroup t2_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 1 1 + rect 220 60 320 420 + anglevectors -3 -93 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer2" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 40 + subgroup "t2_title" text "PROGRAMMING" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t2_paper ITEM_ALIGN_CENTER -20 80 240 36 visible 1 + autowrapped decoration } itemDef { name "timer2" group timer - rect 200 100 240 280 + alignrect "t2_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 80 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Richard Allen\n" "Bryce Hutchings\n" "Scott Brooks\n" @@ -190,7 +171,6 @@ "Bruno Covacha\n" "Daniel Simoes" autowrapped - textheight 24 visible 1 decoration } @@ -198,13 +178,13 @@ itemDef { name "timer2" group timer - rect 200 100 240 280 + alignrect "t2_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 80 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "JBravo\n" "NiceAss\n" "Blaze\n" @@ -213,44 +193,61 @@ "aasimon\n" "sLiCeR" autowrapped - textheight 24 visible 1 decoration } + + // ADDITIONAL PROGRAMMING // - itemDef { + itemDef { + name "timer3" + group timer + subgroup t3_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 36 104 320 260 + anglevectors 5 -85 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer3" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 60 + subgroup "t3_title" text "ADDITIONAL PROGRAMMING" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t3_paper" ITEM_ALIGN_CENTER -28 40 240 36 visible 1 + autowrapped decoration } itemDef { name "timer3" group timer - rect 200 100 240 280 + alignrect "t3_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 100 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Michael Bruce\n" "Dan Chin\n" "Malcolm Bechard\n" "Tomas Edwardsson\n" autowrapped - textheight 24 visible 1 decoration } @@ -258,50 +255,68 @@ itemDef { name "timer3" group timer - rect 200 100 240 280 + alignrect "t3_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 100 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "AgtOrange\n" "Lt. Hawkins\n" "Tsunami\n" "Freud\n" autowrapped - textheight 24 visible 1 decoration } + + // ARTWORK // - itemDef { + itemDef { + name "timer4" + group timer + subgroup t4_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 1 .95 1 + rect 180 60 320 420 + anglevectors -10 -100 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer4" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 60 + subgroup "t4_title" text "ARTWORK" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t4_paper" ITEM_ALIGN_CENTER -20 80 240 36 visible 1 + autowrapped decoration } itemDef { name "timer4" group timer - rect 200 100 240 280 + alignrect "t4_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 100 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Ian McEachern\n" "Brian Mills\n" "Linh Nguyen\n" @@ -309,7 +324,6 @@ "Ryan Vance\n" "Paul Greveson\n" autowrapped - textheight 24 visible 1 decoration } @@ -317,13 +331,13 @@ itemDef { name "timer4" group timer - rect 200 100 240 280 + alignrect "t4_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 100 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Frost\n" "Birdman\n" "Sonique128\n" @@ -331,41 +345,59 @@ "BraGoblin\n" "MoP\n" autowrapped - textheight 24 visible 1 decoration } + + // ADDITIONAL ARTWORK // - itemDef { + itemDef { + name "timer5" + group timer + subgroup t5_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 1 1 + rect 36 104 320 420 + anglevectors 12 -78 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer5" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 10 + subgroup "t5_title" text "ADDITIONAL ARTWORK" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t5_paper" ITEM_ALIGN_CENTER -20 40 240 36 visible 1 + autowrapped decoration } itemDef { name "timer5" group timer - rect 200 100 240 280 + alignrect "t5_title" ITEM_ALIGN_LEFT 16 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 50 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Scott DeLeury\n" "Tomi Isoaho\n" - "Christopher Jayawardena\n" + "Christopher\nJayawardena\n" "Shay McCarty\n" "Malcolm Ramsay\n" "Jesse Smith\n" @@ -375,7 +407,6 @@ "Julien\n" "Kyle VanMeurs" autowrapped - textheight 24 visible 1 decoration } @@ -383,16 +414,16 @@ itemDef { name "timer5" group timer - rect 200 100 240 280 + alignrect "t5_title" ITEM_ALIGN_LEFT 16 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 50 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "CannonFodder\n" "T.T.I.\n" - "EvilFutsin\n" + "EvilFutsin\n\n" "Shaymon\n" "shenka\n" "Spyder\n" @@ -402,38 +433,56 @@ "Zenogaist-Zero\n" "R0oK" autowrapped - textheight 24 visible 1 decoration } + + // LEVEL DESIGN // - itemDef { + itemDef { + name "timer6" + group timer + subgroup t6_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 220 64 320 420 + anglevectors -4 -94 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer6" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 10 + subgroup "t6_title" text "LEVEL DESIGN" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t6_paper" ITEM_ALIGN_CENTER -16 44 240 36 visible 1 + autowrapped decoration } itemDef { name "timer6" group timer - rect 200 100 240 280 + alignrect "t6_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 + textscale .3 textalignx 112 - textaligny 50 + textaligny 24 + forecolor 0 0 0.1 1 text "David Costello\n" "Andrei Drexler\n" "Alexander Axelsson\n" @@ -446,7 +495,6 @@ "Jordan Zylstra\n" "Geraldo Espinal\n" autowrapped - textheight 24 visible 1 decoration } @@ -454,13 +502,13 @@ itemDef { name "timer6" group timer - rect 200 100 240 280 + alignrect "t6_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 92 - textaligny 50 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Sze\n" "Makro\n" "Lognoreng\n" @@ -473,45 +521,62 @@ "Guy Incognito\n" "WarMachine\n" autowrapped - textheight 24 visible 1 decoration } + + // ADDITIONAL LEVEL DESIGN // - itemDef { + itemDef { + name "timer7" + group timer + subgroup t7_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 .95 1 + rect 156 84 320 420 + anglevectors 5 -85 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer7" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 + subgroup "t7_title" text "ADDITIONAL LEVEL DESIGN" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t7_paper" ITEM_ALIGN_CENTER -28 80 240 36 visible 1 + autowrapped decoration } itemDef { name "timer7" group timer - rect 200 100 240 280 + alignrect "t7_title" ITEM_ALIGN_LEFT 16 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 120 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Jason Irby\n" "Gregory Simmons\n" "John Gilbertson\n" "Tomi Vainikka\n" "Chris Polan\n" autowrapped - textheight 24 visible 1 decoration } @@ -519,56 +584,74 @@ itemDef { name "timer7" group timer - rect 200 100 240 280 + alignrect "t7_title" ITEM_ALIGN_LEFT 16 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 120 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Irby\n" "Smoke\n" "Homicide\n" "Zakath\n" "God Incarnate\n" autowrapped - textheight 24 visible 1 decoration } + + // SOUND DESIGN // - itemDef { + itemDef { + name "timer8" + group timer + subgroup t8_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 0 128 360 280 + anglevectors 15 -75 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer8" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 100 + subgroup "t8_title" text "SOUND DESIGN" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t8_paper ITEM_ALIGN_CENTER -48 60 240 36 visible 1 + autowrapped decoration } itemDef { name "timer8" group timer - rect 200 100 240 280 + //rect 100 100 440 280 + alignrect "t8_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 140 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Erwin Peil\n" "Andre Beardsley-Dusette\n" "Caryn Law" autowrapped - textheight 24 visible 1 decoration } @@ -576,52 +659,70 @@ itemDef { name "timer8" group timer - rect 200 100 240 280 + //rect 100 100 440 280 + alignrect "t8_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 140 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "SpecOps\n" "Nicodem-X\n" "Hellchick" autowrapped - textheight 24 visible 1 decoration } + + // ADDITIONAL SOUND DESIGN // - itemDef { + itemDef { + name "timer9" + group timer + subgroup t9_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 .95 1 + rect 120 108 280 220 + anglevectors -3 -93 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer9" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 100 + subgroup "t9_title" text "ADDITIONAL SOUND DESIGN" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t9_paper ITEM_ALIGN_CENTER -20 48 240 36 visible 1 + autowrapped decoration } itemDef { name "timer9" group timer - rect 200 100 240 280 + alignrect "t9_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 140 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Jesse Smith" autowrapped - textheight 24 visible 1 decoration } @@ -629,51 +730,69 @@ itemDef { name "timer9" group timer - rect 200 100 240 280 + alignrect "t9_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 140 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Spyder" autowrapped - textheight 24 visible 1 decoration } + + // ORGANIZATION // - itemDef { + itemDef { + name "timer10" + group timer + subgroup t10_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 .88 .88 1 + rect 148 160 300 220 + anglevectors 15 -75 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer10" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 100 + subgroup "t10_title" text "ORGANIZATION" - visible 1 - decoration - } - - itemDef { - name "timer10" - group timer - rect 200 100 240 280 + forecolor 0 0 .1 1 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_LEFT - textscale .35 + textalign ITEM_ALIGN_CENTER + textscale .5 textalignx 120 - textaligny 140 - text "Andrew Prosnik\n" - "Scott DeLeury" + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t10_paper ITEM_ALIGN_CENTER -20 40 240 36 + visible 1 + autowrapped + decoration + } + + itemDef { + name "timer10" + group timer + //rect 100 100 440 280 + alignrect "t10_title" ITEM_ALIGN_LEFT 20 40 240 36 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_LEFT + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 + text "Andrew Prosnik\n" + "Scott DeLeury" autowrapped - textheight 24 visible 1 decoration } @@ -681,56 +800,75 @@ itemDef { name "timer10" group timer - rect 200 100 240 280 + //rect 100 100 440 280 + alignrect "t10_title" ITEM_ALIGN_LEFT 20 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 140 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Black Monk\n" - "CannonFodder" + "CannonFodder" autowrapped - textheight 24 visible 1 decoration } + + // WEBSITE DESIGN // - itemDef { + itemDef { + name "timer11" + group timer + subgroup t11_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 1 .95 1 + rect 180 48 320 420 + anglevectors -3 -93 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer11" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 + subgroup "t11_title" text "WEBSITE DESIGN" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t11_paper" ITEM_ALIGN_CENTER -16 80 240 36 visible 1 + autowrapped decoration } itemDef { name "timer11" group timer - rect 200 100 240 280 + alignrect "t11_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 120 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Victor Chow\n" - "Christopher A Strickler\n" + "Christopher A.\n" + "Strickler\n" "Malcolm Ramsay\n" "Scott Brooks\n" "Andrew Prosnik\n" "Richard Watt" autowrapped - textheight 24 visible 1 decoration } @@ -738,58 +876,76 @@ itemDef { name "timer11" group timer - rect 200 100 240 280 + alignrect "t11_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 120 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Elder_MMHS\n" "Preacher\n" + "\n" "shenka\n" "Blaze\n" "Black Monk\n" "C00T" autowrapped - textheight 24 visible 1 decoration } + + // TESTERS AND ADVISORS // - itemDef { + itemDef { + name "timer12" + group timer + subgroup t12_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 56 112 320 260 + anglevectors 5 -85 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer12" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 60 + subgroup "t12_title" text "TESTERS AND ADVISORS" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t12_paper" ITEM_ALIGN_CENTER -12 40 240 36 visible 1 + autowrapped decoration } itemDef { name "timer12" group timer - rect 200 100 240 280 + alignrect "t12_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 100 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Non Fiction\n" "Seth Chabot\n" "Steve Ewald\n" "Luke Paul" autowrapped - textheight 24 visible 1 decoration } @@ -797,61 +953,79 @@ itemDef { name "timer12" group timer - rect 200 100 240 280 + alignrect "t12_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 100 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Fiction\n" "Wook!eBoy\n" "Psychotakes\n" "Alice" autowrapped - textheight 24 visible 1 decoration } + + // BETA TESTERS // - itemDef { + itemDef { + name "timer13" + group timer + subgroup t13_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 1 1 + rect 180 72 328 440 + anglevectors 3 -87 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer13" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 40 + subgroup "t13_title" text "BETA TESTERS" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t13_paper ITEM_ALIGN_CENTER -30 60 240 36 visible 1 + autowrapped decoration } itemDef { name "timer13" group timer - rect 200 100 240 280 + alignrect "t13_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 80 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Alexander Bergereau\n" "Mark Somol\n" "Andrew Harrell\n" - "Christopher Jayawardena\n" + "Christopher\n" + "Jayawardena\n" "Justin Pickles\n" "Michael Morris\n" "Paul Greveson\n" "Paul Witt\n" "Fredrik Nilsskog Ravlo" autowrapped - textheight 24 visible 1 decoration } @@ -859,55 +1033,74 @@ itemDef { name "timer13" group timer - rect 200 100 240 280 + alignrect "t13_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 80 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Arild\n" "ColdMiser\n" "EdgeCrusher\n" "EvilFutsin\n" - "GoKu^^7L\n" + "\n" + "GoKu^^*L\n" "JesterRace\n" "MoP\n" "Karmann\n" - "^^7Proto" + "^^*Proto" autowrapped - textheight 24 visible 1 decoration } + + // BETA TESTERS // - itemDef { + itemDef { + name "timer14" + group timer + subgroup t14_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 56 88 328 440 + anglevectors 5 -85 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer14" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 40 + subgroup "t14_title" text "BETA TESTERS" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t14_paper" ITEM_ALIGN_CENTER -20 80 240 36 visible 1 + autowrapped decoration } itemDef { name "timer14" group timer - rect 200 100 240 280 + alignrect "t14_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_LEFT - textscale .35 - textalignx 120 - textaligny 80 + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 text "Andrew Weidlich\n" "Stephen Looi\n" "Marcus Varland\n" @@ -917,7 +1110,6 @@ "Tomi Vainikka\n" "Winston Chow" autowrapped - textheight 24 visible 1 decoration } @@ -925,13 +1117,13 @@ itemDef { name "timer14" group timer - rect 200 100 240 280 + alignrect "t14_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 80 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Commodore\n" "DuD\n" "FragBait\n" @@ -941,59 +1133,96 @@ "Zakath\n" "ShishKabob" autowrapped - textheight 24 visible 1 decoration } + + // REACTION QUAKE 3 CONTRIBUTIONS // - itemDef { + itemDef { name "timer15" - group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 120 - text "REACTION QUAKE 3 CONTRIBUTIONS" + group timer + subgroup t15_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/post_it" + forecolor 1 .95 .8 1 + rect 200 160 200 160 + anglevectors -3 -93 visible 1 decoration } + itemdef { + renderpoint + name "timer15" + group timer + subgroup "t15_title" + text "Reaction Quake 3\n" + "contributions" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t15_paper ITEM_ALIGN_CENTER -4 36 240 36 + visible 1 + autowrapped + decoration + } + + + // ADDITIONAL ARTWORK // - itemDef { + itemDef { + name "timer16" + group timer + subgroup t16_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 .95 1 + rect 40 108 280 220 + anglevectors 11 -79 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer16" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 + subgroup "t16_title" text "ADDITIONAL ARTWORK" - visible 1 - decoration - } - - itemDef { - name "timer16" - group timer - rect 200 100 240 280 + forecolor 0 0 .1 1 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_LEFT - textscale .35 + textalign ITEM_ALIGN_CENTER + textscale .5 textalignx 120 - textaligny 120 - text "Dwayne Douglass\n" - "Paul Greveson\n" + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t16_paper ITEM_ALIGN_CENTER -20 48 240 36 + visible 1 + autowrapped + decoration + } + + itemDef { + name "timer16" + group timer + alignrect "t16_title" ITEM_ALIGN_LEFT 0 40 240 36 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_LEFT + textscale .3 + textalignx 112 + textaligny 24 + forecolor 0 0 0.1 1 + text "Dwayne Douglass\n" + "Paul Greveson\n" autowrapped - textheight 24 visible 1 decoration } @@ -1001,76 +1230,165 @@ itemDef { name "timer16" group timer - rect 200 100 240 280 + alignrect "t16_title" ITEM_ALIGN_LEFT 0 40 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_RIGHT - textscale .35 - textalignx 100 - textaligny 120 + textscale .3 + textalignx 96 + textaligny 24 + forecolor 0 0 0.1 1 text "Oddjob\n" - "MoP\n" + "MoP\n" autowrapped - textheight 24 visible 1 decoration } + + // REACTION QUAKE 3 TITLE SCORE // - itemDef { + itemDef { name "timer17" - group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 - text "REACTION QUAKE 3 TITLE SCORE\n\nJesper Kyd" - autowrapped + group timer + subgroup t17_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 1 .95 1 + rect 140 108 280 220 + anglevectors -6 -96 visible 1 decoration } + itemdef { + renderpoint + name "timer17" + group timer + subgroup "t17_title" + text "REACTION QUAKE 3\n" + "TITLE SCORE\n" + "\n" + "\n" + "Jesper Kyd" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t17_paper ITEM_ALIGN_CENTER -12 40 240 36 + visible 1 + autowrapped + decoration + } + + + // BOOMSTICK STUDIOS THANKS // - itemDef { + itemDef { name "timer18" - group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 100 - text "BOOMSTICK STUDIOS THANKS" - autowrapped + group timer + subgroup t18_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/post_it" + forecolor .94 .94 .82 1 + rect 80 200 200 160 + anglevectors -7 -97 visible 1 decoration } + itemdef { + renderpoint + name "timer18" + group timer + subgroup "t18_title" + text "Boomstick Studios\n" + "thanks..." + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t18_paper ITEM_ALIGN_CENTER -4 36 240 36 + visible 1 + autowrapped + decoration + } + + + // INDIVIDUALS // + itemDef { + name "timer19" + group timer + subgroup t19_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 220 64 320 420 + anglevectors -4 -94 + visible 1 + decoration + } + + itemdef { + renderpoint + name "timer19" + group timer + subgroup "t19_title" + text "INDIVIDUALS" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t19_paper ITEM_ALIGN_CENTER -20 48 240 36 + visible 1 + autowrapped + decoration + } + itemDef { name "timer19" group timer - rect 200 100 240 280 + alignrect "t19_title" ITEM_ALIGN_LEFT 0 56 240 36 style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 40 - text "A-TEAM Representative\n" - "Dwayne Douglass\n\n" - "ZCam Author\n" - "Avi 'Zung!' Rozen\n\n" - "Unlagged Autor\n" - "Neil 'haste' Toronto\n\n" - "Our Installer makers\n" + textalign ITEM_ALIGN_RIGHT + textscale .3 + textalignx 76 + textaligny 24 + forecolor 0 0 0.1 1 + text "A-TEAM\n" + "ZCam\n" + "Unlagged\n" + "Installers\n" + autowrapped + visible 1 + decoration + } + + itemDef { + name "timer19" + group timer + alignrect "t19_title" ITEM_ALIGN_LEFT 0 56 240 36 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_LEFT + textscale .3 + textalignx 100 + textaligny 24 + forecolor 0 0 0.1 1 + text "Dwayne Douglass\n" + "Avi 'Zung!' Rozen\n" + "Neil 'haste' Toronto\n" "Karmann (Windows)\n" "Freud (Linux)\n" "CannonFodder (Mac)" @@ -1079,18 +1397,28 @@ decoration } + + // CODING RESOURCES // - itemDef { + itemDef { + name "timer20" + group timer + subgroup t20_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 1 1 + rect 120 64 320 420 + anglevectors 4 -86 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer20" group timer - rect 100 100 440 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 220 - textaligny 40 + subgroup "t20_title" text "CODING RESOURCES\n\n" "Code3Arena\n" "Iain McGinnis\n" @@ -1100,84 +1428,158 @@ "Wang (ATF)\n" "Johann Thorir Johannsson (Vondikall)\n" "Tomas Edwardsson (Freud)" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t20_paper ITEM_ALIGN_CENTER -20 64 240 36 + visible 1 autowrapped + decoration + } + + + + // ART RESOURCES // + + itemDef { + name "timer21" + group timer + subgroup t21_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 .95 1 + rect 56 112 320 260 + anglevectors 5 -85 visible 1 decoration } - // ART RESOURCES // - - itemDef { + itemdef { + renderpoint name "timer21" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 60 + subgroup "t21_title" text "ART RESOURCES\n\n" "Mastaba Solutions\n" "PolyCount\n" "QWorkShop3\n" "ShaderLab" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t21_paper" ITEM_ALIGN_CENTER -12 48 240 36 + visible 1 autowrapped + decoration + } + + + + // MAPPING RESOURCES // + + itemDef { + name "timer22" + group timer + subgroup t22_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .96 1 .96 1 + rect 112 112 320 260 + anglevectors -5 -95 visible 1 decoration } - // MAPPING RESOURCES // - - itemDef { + itemdef { + renderpoint name "timer22" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 + subgroup "t22_title" text "MAPPING RESOURCES\n\n" "Gamedesign.net\n" "QERadiant.com\n" "Quake3World Forums" - autowrapped + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t22_paper" ITEM_ALIGN_CENTER -12 48 240 36 visible 1 + autowrapped decoration } + + // PRE-RELEASE MESSAGEBOARD GOD // - itemDef { + itemDef { name "timer23" - group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 - text "PRE-RELEASE\nMESSAGEBOARD GOD\n\nThe great Fex" - autowrapped + group timer + subgroup t23_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 148 108 280 220 + anglevectors 7 -83 visible 1 decoration } + itemdef { + renderpoint + name "timer23" + group timer + subgroup "t23_title" + text "PRE-RELEASE\n" + "MESSAGEBOARD GOD\n\n" + "The great Fex" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t23_paper ITEM_ALIGN_CENTER -12 44 240 36 + visible 1 + autowrapped + decoration + } + + + // GROUPS // - itemDef { + itemDef { + name "timer24" + group timer + subgroup t24_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .95 .95 1 1 + rect 120 64 320 420 + anglevectors 2 -88 + visible 1 + decoration + } + + itemdef { + renderpoint name "timer24" group timer - rect 100 100 440 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 220 - textaligny 20 + subgroup "t24_title" text "GROUPS\n\n" "Above Intelligence\n" "All the little people\n" @@ -1185,28 +1587,45 @@ "Fear.net frequenters\n" "OGL and Activision\n" "id Software\n" - "Opin Kerfi HF\n" - "Simnet (Landssíminn)\n" + "Opin Kerfi HF\n" + "Simnet (Landssiminn)\n" "The A-Team (AQ2 developers)\n" "The Grammar Rangers\n" "#model_design on ProGamePlayer" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t24_paper ITEM_ALIGN_CENTER -20 48 240 36 + visible 1 autowrapped + decoration + } + + + // COMMODITIES // + + itemDef { + name "timer25" + group timer + subgroup t25_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor 1 1 1 1 + rect 144 64 320 420 + anglevectors 5 -85 visible 1 decoration } - // COMMODITIES // - - itemDef { + itemdef { + renderpoint name "timer25" group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 20 + subgroup "t25_title" text "COMMODITIES\n\n" "Caffeine\n" "Chex Mix\n" @@ -1218,31 +1637,90 @@ "Pho\n" "Various pizza places\n" "Wacom Tablets" - autowrapped + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect t25_paper ITEM_ALIGN_CENTER -20 48 240 36 visible 1 + autowrapped decoration } + + // WEB HOSTS // - itemDef { + itemDef { name "timer26" - group timer - rect 200 100 240 280 - style WINDOW_STYLE_EMPTY - textstyle ITEM_TEXTSTYLE_SHADOWED - textalign ITEM_ALIGN_CENTER - textscale .35 - textalignx 120 - textaligny 80 - text "WEB HOSTS\n\n" - "All mirrors (too many to list)\n" - "Simnet (Landssíminn)" - autowrapped + group timer + subgroup t26_paper + style WINDOW_STYLE_SHADER + background UI_ASSETS"/paper_1" + forecolor .96 1 .96 1 + rect 112 112 320 240 + anglevectors -5 -95 visible 1 decoration } + itemdef { + renderpoint + name "timer26" + group timer + subgroup "t26_title" + text "WEB HOSTS\n\n" + "All mirrors (too many to list)\n" + "Simnet (Landssiminn)" + forecolor 0 0 .1 1 + style WINDOW_STYLE_EMPTY + textalign ITEM_ALIGN_CENTER + textscale .5 + textalignx 120 + textaligny 24 + textscale RQ3_MAIN_TEXTSIZE + alignrect "t26_paper" ITEM_ALIGN_CENTER -12 52 240 36 + visible 1 + autowrapped + decoration + } + + + // Black background // + + itemDef { + name "timer27" + group timer + rect 0 0 640 480 + style WINDOW_STYLE_EMPTY + backcolor 0 0 0 1 + visible 0 + decoration + onTimerShow { + setitemcolor blackBackground backcolor 5 5 5 0 ; + show blackBackground ; + timeFade blackBackground backcolor 5 5 5 1 0 1000 ; + timeFade hint forecolor .25 .25 .25 5 0 1000 ; + } + onTimerHide { + } + } + + itemDef { + name "blackBackground" + rect 0 0 640 480 + style WINDOW_STYLE_FILLED + backcolor 0 0 0 1 + visible 0 + decoration + } + + + + // id SOFTWARE // itemDef { @@ -1266,11 +1744,13 @@ group timer rect 248 172 32 40 style WINDOW_STYLE_SHADER - background "ui/assets/idlogo.tga" + background UI_ASSETS"/idlogo.tga" visible 1 decoration } + + // PROGRAMMING // itemDef { @@ -1445,11 +1925,16 @@ textalignx 220 textaligny 80 text "THIS HAS BEEN A BOOMSTICK STUDIOS\nPRODUCTION\n\n" - "Copyright 2000 - 2003" + "Copyright 2000 - 2005" autowrapped visible 1 decoration - onTimer { timeFade hint forecolor 1 1 1 0 500 1500 } + onTimerShow { + show _self ; + setcolor forecolor 5 5 5 0 ; + timeFadeSelf forecolor 5 5 5 1 0 500 ; + timeFade hint forecolor 5 5 5 0 500 1500 ; + } } itemDef { @@ -1459,24 +1944,7 @@ style WINDOW_STYLE_EMPTY visible 1 decoration - onTimer { show static ; stopMusic ; play "sound/ui/tvnoise.wav" } - } - - //Hint - - itemDef { - name "hint" - text "ESC to exit" - rect 0 420 640 40 - forecolor 1 1 1 1 - textalign ITEM_ALIGN_RIGHT - textalignx 628 - textaligny 20 - textscale .225 - type ITEM_TYPE_TEXT - style WINDOW_STYLE_EMPTY - visible 1 - decoration + onTimerShow { show static ; stopMusic ; play "sound/ui/tvnoise.wav" } } //Screen static @@ -1491,6 +1959,23 @@ decoration } + //Hint + + itemDef { + name "hint" + text "ESC to exit" + rect 0 8 640 40 + forecolor 0 0 0 1 + textalign ITEM_ALIGN_RIGHT + textalignx 632 + textaligny 12 + textscale .2 + type ITEM_TYPE_TEXT + style WINDOW_STYLE_EMPTY + visible 1 + decoration + } + } } diff --git a/reaction/uifiles/demo.menu b/reaction/uifiles/demo.menu index 272155b1..5f36586b 100644 --- a/reaction/uifiles/demo.menu +++ b/reaction/uifiles/demo.menu @@ -200,6 +200,7 @@ itemdef { name "btn_play" + shortcutKey "P" style WINDOW_STYLE_SHADER rect 592 432 32 32 type 1 @@ -215,7 +216,7 @@ itemdef { name play_hint - text "Play the selected demo" + text "^_P^_lay the selected demo" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -232,11 +233,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type 1 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -244,9 +246,10 @@ visible 1 } + itemdef { name back_hint - text "Go back to main menu" + text "Go ^_b^_ack to main menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -259,6 +262,5 @@ decoration } - } } \ No newline at end of file diff --git a/reaction/uifiles/error.menu b/reaction/uifiles/error.menu index 005dea7e..b1e13cd0 100644 --- a/reaction/uifiles/error.menu +++ b/reaction/uifiles/error.menu @@ -97,10 +97,10 @@ textalign ITEM_ALIGN_CENTER textalignx 30 textaligny 12 - text "Close" + text "^_C^_lose" shortcutKey "C" visible 1 - action { close error_popmenu ; open main } + action { close _self ; open main } } } } diff --git a/reaction/uifiles/ingame.menu b/reaction/uifiles/ingame.menu index 5be3b409..8c5deb2c 100644 --- a/reaction/uifiles/ingame.menu +++ b/reaction/uifiles/ingame.menu @@ -9,7 +9,7 @@ cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor cursorSize 64 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 fadeCycle 1 // how often fade happens in milliseconds @@ -88,7 +88,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Player" + text "^_P^_layer" shortcutKey "P" border 1 bordersize 1 @@ -113,7 +113,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Options" + text "^_O^_ptions" shortcutKey "O" border 1 bordersize 1 @@ -139,7 +139,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "About" + text "^_A^_bout" shortcutKey "A" border 1 bordersize 1 @@ -164,7 +164,7 @@ textalign ITEM_ALIGN_CENTER textalignx 34 textaligny 12 - text "Matchmode" + text "^_M^_atchmode" shortcutKey "M" border 1 bordersize 1 @@ -191,7 +191,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Vote" + text "^_V^_ote" shortcutKey "V" border 1 bordersize 1 @@ -218,7 +218,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Add bot" + text "Add ^_b^_ot" shortcutKey "B" border 1 bordersize 1 @@ -245,7 +245,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Devmode" + text "^_D^_evmode" shortcutKey "D" border 1 bordersize 1 @@ -273,7 +273,7 @@ textalign ITEM_ALIGN_CENTER textalignx 26 textaligny 12 - text "Quit" + text "^_Q^_uit" shortcutKey "Q" border 1 bordersize 1 diff --git a/reaction/uifiles/ingame_about.menu b/reaction/uifiles/ingame_about.menu index 3e471f68..dc13b5ee 100644 --- a/reaction/uifiles/ingame_about.menu +++ b/reaction/uifiles/ingame_about.menu @@ -56,7 +56,7 @@ rect 12 32 256 20 style WINDOW_STYLE_EMPTY textalign ITEM_ALIGN_LEFT - text "View: summary" + text "^_V^_iew: summary" shortcutKey "V" type ITEM_TYPE_BUTTON cvarTest "ui_RQ3_ingameDetails" @@ -75,7 +75,7 @@ rect 12 32 256 20 style WINDOW_STYLE_EMPTY textalign ITEM_ALIGN_LEFT - text "View: details" + text "^_V^_iew: details" shortcutKey "V" type ITEM_TYPE_BUTTON cvarTest "ui_RQ3_ingameDetails" diff --git a/reaction/uifiles/ingame_addbot.menu b/reaction/uifiles/ingame_addbot.menu index 6297ff07..9e805c42 100644 --- a/reaction/uifiles/ingame_addbot.menu +++ b/reaction/uifiles/ingame_addbot.menu @@ -54,7 +54,8 @@ itemdef { name "ig-bot-name" style WINDOW_STYLE_EMPTY - text "Name:" + text "^_N^_ame:" + shortcutKey "N" ownerdraw UI_BOTNAME rect 0 32 128 20 textalign ITEM_ALIGN_RIGHT @@ -70,7 +71,8 @@ itemdef { name "ig-bot-team" style WINDOW_STYLE_EMPTY - text "Team:" + text "^_T^_eam:" + shortcutKey "T" ownerdraw UI_REDBLUE rect 0 52 128 20 textalign ITEM_ALIGN_RIGHT @@ -88,7 +90,8 @@ itemdef { name "ig-bot-skill" style WINDOW_STYLE_EMPTY - text "Skill:" + text "^_S^_kill:" + shortcutKey "S" ownerdraw UI_BOTSKILL rect 0 72 128 20 textalign ITEM_ALIGN_RIGHT @@ -111,7 +114,7 @@ textalign ITEM_ALIGN_CENTER textalignx 32 textaligny 14 - text "Ok" + text "^_O^_k" shortcutKey "O" border 1 bordersize 1 @@ -120,7 +123,6 @@ bordercolor Ig_Sub_BorderColor1 visible 1 action { play "sound/misc/menu1.wav" ; uiScript addBot ; uiScript closeingame } - //action { exec "screenshotJPEG" } onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 } leaveFocus { setcolor backcolor Ig_Sub_Color1 ; setcolor bordercolor Ig_Sub_BorderColor1 } } diff --git a/reaction/uifiles/ingame_leave.menu b/reaction/uifiles/ingame_leave.menu index d0011625..69b68fb0 100644 --- a/reaction/uifiles/ingame_leave.menu +++ b/reaction/uifiles/ingame_leave.menu @@ -54,7 +54,7 @@ itemdef { name leave - text "Main Menu" + text "^_M^_ain Menu" shortcutKey "M" group grpMenu style WINDOW_STYLE_EMPTY @@ -72,7 +72,7 @@ itemdef { name leave group grpMenu - text "Restart" + text "^_R^_estart" shortcutKey "R" style WINDOW_STYLE_EMPTY type ITEM_TYPE_BUTTON @@ -90,7 +90,7 @@ name leave group grpMenu type ITEM_TYPE_BUTTON - text "Quit" + text "^_Q^_uit" shortcutKey "Q" style WINDOW_STYLE_EMPTY rect 0 74 128 20 @@ -137,7 +137,7 @@ itemdef { name leaveConfirm - text "Yes" + text "^_Y^_es" shortcutKey "Y" group grpConfirm type ITEM_TYPE_BUTTON @@ -161,7 +161,7 @@ itemdef { name leaveConfirm - text "No" + text "^_N^_o" shortcutKey "N" group grpConfirm type ITEM_TYPE_BUTTON @@ -215,7 +215,7 @@ itemdef { name restartConfirm - text "Yes" + text "^_Y^_es" shortcutKey "Y" group grpConfirm type ITEM_TYPE_BUTTON @@ -239,7 +239,7 @@ itemdef { name restartConfirm - text "No" + text "^_N^_o" shortcutKey "N" group grpConfirm type ITEM_TYPE_BUTTON @@ -293,7 +293,7 @@ itemdef { name quitConfirm - text "Yes" + text "^_Y^_es" shortcutKey "Y" group grpConfirm type ITEM_TYPE_BUTTON @@ -317,7 +317,7 @@ itemdef { name quitConfirm - text "No" + text "^_N^_o" shortcutKey "N" group grpConfirm type ITEM_TYPE_BUTTON diff --git a/reaction/uifiles/ingame_options.menu b/reaction/uifiles/ingame_options.menu index 82cdf2a5..fb838232 100644 --- a/reaction/uifiles/ingame_options.menu +++ b/reaction/uifiles/ingame_options.menu @@ -614,10 +614,10 @@ itemdef { name page3 group grpGame - rect 103 63 96 96 + rect 95 55 114 128 style WINDOW_STYLE_SHADER background "ui/assets/rq3-ingame-loadout" - border 1 + border 0 bordersize 1 bordercolor Ig_Window_BorderColor //backcolor .5 .5 .5 .4 @@ -676,13 +676,13 @@ group grpGame style 1 ownerdraw UI_RQ3_REPLACEMENTNAME - rect 103 158 96 16 + rect 107 150 80 16 textalign ITEM_ALIGN_LEFT textalignx 5 textaligny 12 textscale .18 - forecolor .75 .75 .75 1 - border 1 + forecolor 0 0 0 1 + border 0 bordersize 1 bordercolor Ig_Window_BorderColor visible 0 @@ -691,10 +691,22 @@ //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 { name page3 group grpGame - text "Select" + text "^_S^_elect" + shortcutKey "S" type ITEM_TYPE_BUTTON textscale .225 style WINDOW_STYLE_FILLED @@ -702,6 +714,7 @@ textalign ITEM_ALIGN_CENTER textalignx 48 textaligny 12 + textstyle ITEM_TEXTSTYLE_SHADOWED border 1 bordersize 1 backcolor Ig_Sub_Color1 @@ -709,8 +722,6 @@ bordercolor Ig_Sub_BorderColor1 visible 0 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 diff --git a/reaction/uifiles/ingame_player.menu b/reaction/uifiles/ingame_player.menu index 94d9dedb..28799590 100644 --- a/reaction/uifiles/ingame_player.menu +++ b/reaction/uifiles/ingame_player.menu @@ -110,7 +110,7 @@ textalign ITEM_ALIGN_LEFT textalignx 6 textaligny 12 - text "W. Weapon/item" + text "^_W^_eapon/item" shortcutKey "W" border 1 bordersize 1 @@ -139,7 +139,7 @@ textalign ITEM_ALIGN_LEFT textalignx 6 textaligny 12 - text "J. Join team" + text "^_J^_oin team" shortcutKey "J" border 1 bordersize 1 @@ -163,7 +163,7 @@ textalign ITEM_ALIGN_LEFT textalignx 6 textaligny 12 - text "I. Ignore players" + text "^_I^_gnore players" shortcutKey "I" border 1 bordersize 1 @@ -181,7 +181,7 @@ rect 138 122 160 16 style WINDOW_STYLE_FILLED type ITEM_TYPE_MULTI - text "M. Male Radio voice:" + text "^_M^_ale Radio voice:" shortcutKey "M" border 1 bordersize 1 @@ -203,7 +203,7 @@ rect 138 138 160 16 style WINDOW_STYLE_FILLED type ITEM_TYPE_MULTI - text "D. Dynamic Radio:" + text "^_D^_ynamic Radio:" shortcutKey "D" border 1 bordersize 1 diff --git a/reaction/uifiles/ingame_vote.menu b/reaction/uifiles/ingame_vote.menu index b3a11026..59370daf 100644 --- a/reaction/uifiles/ingame_vote.menu +++ b/reaction/uifiles/ingame_vote.menu @@ -55,7 +55,7 @@ itemdef { name yes - text "Yes" + text "^_Y^_es" shortcutKey "Y" type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY @@ -73,7 +73,7 @@ itemdef { name no - text "No" + text "^_N^_o" shortcutKey "N" type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY @@ -91,7 +91,7 @@ itemdef { name call - text "Call vote" + text "^_C^_all vote" shortcutKey "C" type ITEM_TYPE_BUTTON style WINDOW_STYLE_EMPTY @@ -125,7 +125,7 @@ itemdef { name yes - text "TeamYes" + text "Team^_Y^_es" shortcutKey "Y" type 1 //ownerdrawflag UI_SHOW_ANYTEAMGAME @@ -143,7 +143,7 @@ itemdef { name no - text "TeamNo" + text "Team^_N^_o" shortcutKey "N" type 1 //ownerdrawflag UI_SHOW_ANYTEAMGAME diff --git a/reaction/uifiles/joinserver.menu b/reaction/uifiles/joinserver.menu index 6f0904ba..0714832a 100644 --- a/reaction/uifiles/joinserver.menu +++ b/reaction/uifiles/joinserver.menu @@ -908,6 +908,7 @@ itemdef { name "btn_join" + shortcutKey "G" style WINDOW_STYLE_SHADER rect 560 432 64 32 type 1 @@ -952,29 +953,33 @@ //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 { name "btn_create" style WINDOW_STYLE_FILLED type ITEM_TYPE_BUTTON rect 540 20 80 20 - //border 1 - //bordersize 1 - //bordercolor .5 .5 .5 1 backcolor Ig_Sub_Color1 forecolor 1 1 1 1 textscale .25 textalign ITEM_ALIGN_CENTER textalignx 40 textaligny 14 - text "Create >" + textstyle ITEM_TEXTSTYLE_SHADOWED + text "^_C^_reate >" + shortcutKey "C" visible 1 action { close joinserver ; open createserver } - //onFocus { setcolor backcolor Ig_Sub_Color2 ; show create_hint } - //leaveFocus { setcolor backcolor Ig_Sub_Color1 ; hide create_hint } - 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 } + onFocus { show create_hint ; timeFade create_hint forecolor .9 .9 .9 1 0 250 } + leaveFocus { timeFade create_hint forecolor .9 .9 .9 0 0 250 } } itemdef { @@ -996,11 +1001,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type 1 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -1008,9 +1014,10 @@ visible 1 } + itemdef { name back_hint - text "Go back to main menu" + text "Go ^_b^_ack to main menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -1022,5 +1029,6 @@ visible 0 decoration } + } } \ No newline at end of file diff --git a/reaction/uifiles/main.menu b/reaction/uifiles/main.menu index b3c1d017..3baab4e6 100644 --- a/reaction/uifiles/main.menu +++ b/reaction/uifiles/main.menu @@ -7,8 +7,8 @@ bigFont "fonts/bigfont" 20 // font cursor "gfx/rq3_ta_hud/3_cursor2.tga" // cursor cursorSize 64 - gradientBar "ui/assets/gradientbar2.tga" // gradient bar - itemFocusSound "sound/misc/menu2.wav" // sound for item getting focus (via keyboard or mouse ) + gradientBar UI_ASSETS"/gradientbar2.tga" // gradient bar + itemFocusSound "sound/ui/whoosh2.wav" // sound for item getting focus (via keyboard or mouse ) fadeCycle 2 // how often fade happens in milliseconds fadeAmount 0.05 // amount to adjust alpha per cycle @@ -20,7 +20,8 @@ menuDef { 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 //rect 0 0 640 480 // Size and position of the menu @@ -31,380 +32,327 @@ onOpen { - //setitemcolor fadebox backcolor 0 0 0 1 ; - //fadeout fadebox ; - play "sound/misc/menu1.wav" ; + play "sound/ui/whoosh3.wav" ; uiScript stopRefresh ; } - onFirstShow { - hide overlay ; show fadebox ; - setitemcolor fadebox backcolor 0 0 0 1 ; - timeFade fadebox backcolor 0 0 0 0 0 1000 ; - setfocus rq3_start ; + onFirstShow { + setoverlaycolor 0 0 0 1 ; + fadeoverlay 0 0 0 0 0 1000 ; + setfocus btn_join ; } - onShow { - 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 } + onESC { open quit_popmenu } -//=================== -// RQ3 stuff -//=================== +//-------------------------------------------- +#include "ui/shared.h" +//-------------------------------------------- - itemDef { - 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 - } + //Boomstick logo - itemDef { - name top_bar //rq3: Top bar - rect 0 58 640 12 + itemDef { 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 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 { - name bottom_bar2 //rq3: bottom bar - border - rect 0 418 640 2 - style 1 - backcolor RQ3_MAIN_BAR_COLOR2 - //border 2 - //bordersize 1 - //bordercolor 1 0 0 1 - decoration - visible 1 - } +#define UI_MAIN_ITEM_SPACING_Y 36 +#define UI_MAIN_HINT_OFFSET_Y 20 +#define UI_MAIN_TEXTSIZE .28 - itemdef { - name overlay - style 1 + + +//Join server + + itemdef { + name "btn_join" + text "> ^_J^_oin server " + shortcutKey "J" 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 - textaligny 24 - textalignx 8 - forecolor .5 .5 .5 1 + textalignx 0 + textaligny 20 + 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 decoration } -//================ -// Buttons -//================ +//Create server - -//Start game - - itemDef { - name RQ3_start - 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 + itemdef { + name "btn_create" + text "> ^_C^_reate server" + shortcutKey "C" + forecolor 0 0 0 1 textalign 0 - textalignx 8 - textaligny 16 - textscale RQ3_MAIN_TEXTSIZE - rect 0 410 260 24 + textalignx 0 + textaligny 20 + textscale UI_MAIN_TEXTSIZE + 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 - visible 0 + visible 1 decoration - } + } + //Setup - itemDef { - name RQ3_Setup - group "topmenu" - type 1 - background "menu/art/rq3-menu-setup" - 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 + itemdef { + name "btn_setup" + text "> ^_O^_ptions" + shortcutKey "O" + forecolor 0 0 0 1 textalign 0 - textalignx 8 - textaligny 16 - textscale RQ3_MAIN_TEXTSIZE - rect 0 410 260 24 + textalignx 0 + textaligny 20 + textscale UI_MAIN_TEXTSIZE + 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 - visible 0 + visible 1 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 - itemDef { - name RQ3_demos - group "topmenu" - type 1 - background "menu/art/rq3-menu-demos" - 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 + itemdef { + text "> ^_D^_emos" + shortcutKey "D" + name "btn_demo" + forecolor 0 0 0 1 textalign 0 - textalignx 8 - textaligny 16 - textscale RQ3_MAIN_TEXTSIZE - rect 0 410 260 24 + textalignx 0 + textaligny 20 + textscale UI_MAIN_TEXTSIZE + 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 - visible 0 + visible 1 decoration } + //Mods - itemDef { - name RQ3_mods - group "topmenu" - type 1 - background "menu/art/rq3-menu-mods" - 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 + itemdef { + text "> ^_M^_ods" + shortcutKey "M" + name "btn_mod" + forecolor 0 0 0 1 textalign 0 - textalignx 8 - textaligny 16 - textscale RQ3_MAIN_TEXTSIZE - rect 0 410 260 24 + textalignx 0 + textaligny 20 + textscale UI_MAIN_TEXTSIZE + 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 - visible 0 + visible 1 decoration } //Quit - itemDef { - name RQ3_quit - group "topmenu" - type 1 - background "menu/art/rq3-menu-exit" - 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 + itemdef { + text "> ^_Q^_uit" + shortcutKey "Q" + name "btn_quit" + forecolor 0 0 0 1 textalign 0 - textalignx 8 - textaligny 16 - textscale RQ3_MAIN_TEXTSIZE - rect 0 410 260 24 - style 0 - visible 0 - decoration + textalignx 0 + textaligny 20 + textscale UI_MAIN_TEXTSIZE + alignrect "btn_mod" ITEM_ALIGN_LEFT 0 36 96 24 + type ITEM_TYPE_BUTTON + style WINDOW_STYLE_EMPTY + visible 1 + action { open quit_popmenu } } -//Logo+credits - - itemDef { - name rq3_logo - type 1 - background "menu/art/rq3-title-logo.tga" - rect 448 408 192 64 - style WINDOW_STYLE_SHADER + itemdef { + autowrapped + text "Exit Reaction Quake 3" + forecolor .25 .25 .25 1 + textalign 0 + textalignx 12 + textaligny 12 + textscale 0.2 + alignrect "btn_quit" ITEM_ALIGN_LEFT 0 20 240 24 + type ITEM_TYPE_TEXT + style 0 visible 1 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 - } + } diff --git a/reaction/uifiles/main2.menu b/reaction/uifiles/main2.menu index 15295673..51e9f44e 100644 --- a/reaction/uifiles/main2.menu +++ b/reaction/uifiles/main2.menu @@ -7,7 +7,7 @@ bigFont "fonts/bigfont" 20 // font cursor "gfx/rq3_ta_hud/3_cursor3.tga" // cursor 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 fadeAmount 0.05 // amount to adjust alpha per cycle @@ -30,7 +30,7 @@ onOpen { //setitemcolor fadebox backcolor 0 0 0 1 ; //fadeout fadebox ; - play "sound/misc/menu1.wav" ; + play "sound/misc/whoosh3.wav" ; //exec "music music/rq3_title_intro.wav music/rq3_title_loop.wav" ; setfocus rq3_start ; uiScript stopRefresh ; diff --git a/reaction/uifiles/memory.menu b/reaction/uifiles/memory.menu index 70313ea1..98d2b056 100644 --- a/reaction/uifiles/memory.menu +++ b/reaction/uifiles/memory.menu @@ -100,7 +100,7 @@ textalign ITEM_ALIGN_CENTER textalignx 30 textaligny 12 - text "Ok" + text "^_O^_k" shortcutKey "O" visible 1 action { uiScript "quit" } diff --git a/reaction/uifiles/menudef.h b/reaction/uifiles/menudef.h index 269a7020..54c9a647 100644 --- a/reaction/uifiles/menudef.h +++ b/reaction/uifiles/menudef.h @@ -212,6 +212,8 @@ #define CG_2NDPLACE 68 #define CG_CAPTURES 69 +//Makro - clock +#define UI_CLOCK 149 //Makro - for SSG crosshair selection #define UI_SSG_CROSSHAIR 150 @@ -343,11 +345,14 @@ #define RQ3_MAIN_HINT_COLOR .75 .75 1 .75 */ -#define RQ3_MAIN_BAR_COLOR 0 0 0 1 -#define RQ3_MAIN_BAR_COLOR2 .5 .5 .5 1 +#define RQ3_MAIN_BAR_COLOR 1 1 1 .5 +#define RQ3_MAIN_BAR_COLOR2 0 0 0 1 //#define RQ3_MAIN_HINT_COLOR .75 .75 .75 1 #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 #define RQ3_MAIN_BAR_COLOR 0 0 0 1 #define RQ3_MAIN_BAR_COLOR2 1 0 0 1 @@ -356,7 +361,7 @@ #define RQ3_MAIN_TEXTSIZE .28 #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 diff --git a/reaction/uifiles/mod.menu b/reaction/uifiles/mod.menu index 2e6c36d4..de7bb7c1 100644 --- a/reaction/uifiles/mod.menu +++ b/reaction/uifiles/mod.menu @@ -232,11 +232,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type 1 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" ; show back_hint ; timeFade back_hint forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -244,9 +245,10 @@ visible 1 } + itemdef { name back_hint - text "Go back to main menu" + text "Go ^_b^_ack to main menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -259,6 +261,5 @@ decoration } - } } \ No newline at end of file diff --git a/reaction/uifiles/options.menu b/reaction/uifiles/options.menu index 6b0b9daf..0a9558c6 100644 --- a/reaction/uifiles/options.menu +++ b/reaction/uifiles/options.menu @@ -11,7 +11,7 @@ visible MENU_TRUE // Visible on open 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 } @@ -945,11 +945,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type ITEM_TYPE_BUTTON 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" ; show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -959,7 +960,7 @@ itemdef { name hint_back - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/quit.menu b/reaction/uifiles/quit.menu index f8fb49b5..ae4f3ecc 100644 --- a/reaction/uifiles/quit.menu +++ b/reaction/uifiles/quit.menu @@ -6,88 +6,103 @@ menuDef { name "quit_popmenu" visible 0 - rect 170 180 300 100 - focusColor RQ3_MAIN_FOCUSCOLOR + rect 332 182 180 152 + anglevectors -10 -100 + focusColor .25 .25 .5 1 popup outOfBoundsClick //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 } - 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 } - itemDef { - name window + itemDef { + name "postit" + group window style WINDOW_STYLE_SHADER - background "ui/assets/fake_gradient_75" - rect 0 0 300 100 - border 4 - bordersize 2 - bordercolor 1 0 0 1 - //backcolor 0 0 0 .65 + //style WINDOW_STYLE_FILLED + background "ui/assets/post_it" + forecolor .94 .94 .82 .9 + //backcolor .94 .94 .82 1 + rect 0 0 180 152 + anglevectors -10 -100 visible 1 decoration } - // QUIT // + // QUIT // itemDef { + renderpoint name confirm - text "Exit Reaction Quake 3 ?" - style 0 - textscale .32 - textstyle 3 - rect 0 16 300 32 + group window + autowrapped + text "Done playing ?" + style WINDOW_STYLE_EMPTY + backcolor 0 0 0 .1 + textscale .25 + rect 32 24 112 32 + adjustrect textalign 1 - textalignx 150 + textalignx 56 textaligny 16 decoration - forecolor 1 1 1 1 + forecolor 0 0 .15 1 visible 1 } + // YES // itemDef { name yes - text "YES" + group window + text "^_Y^_ES" shortcutKey "Y" - type 1 - style 0 - textscale .32 - textstyle 3 - rect 100 64 50 32 - textalign 1 - textalignx 25 - textaligny 16 - forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + style WINDOW_STYLE_EMPTY + backcolor 0 0 0 .1 + textscale .25 + //rect 32 88 32 16 + //anglevectors -15 -105 + alignrect confirm ITEM_ALIGN_LEFT 20 56 32 16 + textalign ITEM_ALIGN_CENTER + textalignx 16 + textaligny 12 + forecolor 0 0 .15 1 visible 1 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 // itemDef { name no - text "NO" + group window + text "^_N^_O" shortcutKey "N" - type 1 - style 0 - textscale .3 - textstyle 3 - rect 150 64 50 32 - textalign 1 - textalignx 25 - textaligny 16 - forecolor 1 1 1 1 + type ITEM_TYPE_BUTTON + style WINDOW_STYLE_EMPTY + backcolor 0 0 0 .1 + textscale .25 + //rect 72 100 32 16 + //anglevectors -15 -105 + alignrect confirm ITEM_ALIGN_RIGHT 20 56 32 16 + textalign ITEM_ALIGN_CENTER + textalignx 16 + textaligny 12 + forecolor 0 0 .15 1 visible 1 action { close quit_popmenu ; open main } - mouseEnter { setitemcolor no backcolor .1 .37 .1 1 } - mouseExit { setitemcolor no backcolor .37 .1 .1 1 } } } diff --git a/reaction/uifiles/replacements.menu b/reaction/uifiles/replacements.menu index 1aebc4ac..a08eeeae 100644 --- a/reaction/uifiles/replacements.menu +++ b/reaction/uifiles/replacements.menu @@ -12,7 +12,8 @@ focusColor RQ3_MAIN_FOCUSCOLOR // Menu focus color for text and items 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 itemdef { name page3 - rect 143 133 96 96 + rect 135 125 114 128 style WINDOW_STYLE_SHADER background "ui/assets/rq3-ingame-loadout" - border 1 + border 0 bordersize 1 bordercolor Ig_Window_BorderColor //backcolor .5 .5 .5 .4 @@ -142,7 +143,7 @@ name page3 //type ITEM_TYPE_MODEL ownerdraw UI_RQ3_REPLACEMENTMODEL - rect 143 133 96 96 + rect 143 133 98 110 decoration visible 1 } @@ -170,6 +171,7 @@ itemDef { name page3 shortcutkey "," + shortcutkey "P" rect 147 178 16 16 style WINDOW_STYLE_SHADER background "ui/assets/arrow_left_white" @@ -185,6 +187,7 @@ itemDef { name page3 shortcutkey "." + shortcutkey "N" rect 219 178 16 16 style WINDOW_STYLE_SHADER background "ui/assets/arrow_right_white" @@ -203,13 +206,13 @@ name page3 style 1 ownerdraw UI_RQ3_REPLACEMENTNAME - rect 143 228 96 16 + rect 147 220 80 16 textalign ITEM_ALIGN_LEFT textalignx 5 textaligny 12 textscale .18 - forecolor .75 .75 .75 1 - border 1 + forecolor 0 0 0 1 + border 0 bordersize 1 bordercolor Ig_Window_BorderColor visible 1 @@ -218,16 +221,28 @@ //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 { name page3 - text "Select" + text "^_S^_elect" + shortcutKey "S" type ITEM_TYPE_BUTTON textscale .225 style WINDOW_STYLE_FILLED - rect 143 244 96 16 + rect 143 248 96 16 textalign ITEM_ALIGN_CENTER textalignx 48 textaligny 12 + textstyle ITEM_TEXTSTYLE_SHADOWED border 1 bordersize 1 backcolor Ig_Sub_Color1 @@ -235,8 +250,25 @@ bordercolor Ig_Sub_BorderColor1 visible 1 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 } + //onFocus { setcolor backcolor Ig_Sub_Color2 ; setcolor bordercolor Ig_Sub_BorderColor2 } + //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 @@ -318,11 +350,12 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type ITEM_TYPE_BUTTON 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" ; show hint_back ; timeFade hint_back forecolor .9 .9 .9 1 0 250 } leaveFocus { setbackground "menu/art/rq3-menu-back.tga" ; @@ -332,7 +365,7 @@ itemdef { name hint_back - text "Go back to setup menu" + text "Go ^_b^_ack to setup menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 diff --git a/reaction/uifiles/setup.menu b/reaction/uifiles/setup.menu index 0460b8ed..dd857675 100644 --- a/reaction/uifiles/setup.menu +++ b/reaction/uifiles/setup.menu @@ -12,7 +12,7 @@ onOpen { - play "sound/misc/menu1.wav" ; + play "sound/ui/whoosh3.wav" ; } onEsc { close setup_menu ; open main } @@ -362,6 +362,7 @@ itemdef { name "btn_back" + shortcutKey "B" style WINDOW_STYLE_SHADER rect 12 432 32 32 type 1 @@ -377,7 +378,7 @@ itemdef { name back_hint - text "Go back to main menu" + text "Go ^_b^_ack to main menu" forecolor RQ3_MAIN_HINT_COLOR textalign 1 textalignx 240 @@ -448,7 +449,7 @@ itemDef { name yes - text "YES" + text "^_Y^_ES" shortcutKey "Y" type 1 style 0 @@ -469,7 +470,7 @@ itemDef { name no - text "NO" + text "^_N^_O" shortcutKey "N" type 1 style 0 diff --git a/reaction/uifiles/system.menu b/reaction/uifiles/system.menu index d494cc73..a2ec90ea 100644 --- a/reaction/uifiles/system.menu +++ b/reaction/uifiles/system.menu @@ -191,7 +191,7 @@ //Pre-defined settings - itemdef { + itemdef { name opt_predef group graphics type ITEM_TYPE_MULTI @@ -227,7 +227,7 @@ //Driver - itemdef { + itemdef { name opt_gldriver group graphics type ITEM_TYPE_EDITFIELD @@ -261,7 +261,7 @@ //GL Extensions - itemdef { + itemdef { name opt_glext group graphics type ITEM_TYPE_YESNO @@ -296,7 +296,7 @@ //Resolution - itemdef { + itemdef { name opt_res group graphics type ITEM_TYPE_MULTI @@ -332,7 +332,7 @@ //Color depth - itemdef { + itemdef { name opt_cldepth group graphics type ITEM_TYPE_MULTI @@ -368,7 +368,7 @@ //Fullscreen - itemdef { + itemdef { name opt_fscreen group graphics type ITEM_TYPE_YESNO @@ -403,7 +403,7 @@ //Lightmap/vertex - itemdef { + itemdef { name opt_light group graphics type ITEM_TYPE_MULTI @@ -439,7 +439,7 @@ //Geometric detail - itemdef { + itemdef { name opt_geodetail group graphics type ITEM_TYPE_MULTI @@ -475,7 +475,7 @@ //Texture detail - itemdef { + itemdef { name opt_texdetail group graphics type ITEM_TYPE_MULTI @@ -511,7 +511,7 @@ //Texture quality - itemdef { + itemdef { name opt_texquality group graphics type ITEM_TYPE_MULTI @@ -547,7 +547,7 @@ //Texture filtering mode - itemdef { + itemdef { name opt_texfilter group graphics type ITEM_TYPE_MULTI @@ -583,7 +583,7 @@ //Compressed textures - itemdef { + itemdef { name opt_comptex group graphics type ITEM_TYPE_YESNO @@ -789,9 +789,10 @@ //Brightness - itemdef { + itemdef { name opt_gamma type ITEM_TYPE_SLIDER + anglevectors 30 -60 text "Brightness:" cvarfloat r_gamma 1 .5 1.7 rect 472 100 112 20 @@ -822,7 +823,7 @@ //Screen size - itemdef { + itemdef { name opt_screensize type ITEM_TYPE_SLIDER text "Screen Size:" @@ -855,7 +856,7 @@ //Overbrightbits - itemdef { + itemdef { name opt_overbits type ITEM_TYPE_YESNO text "Overbright Bits:" @@ -934,7 +935,7 @@ //Sound volume - itemdef { + itemdef { name opt_svol type ITEM_TYPE_SLIDER text "Sound Volume:" @@ -967,7 +968,7 @@ //Music volume - itemdef { + itemdef { name opt_mvol type ITEM_TYPE_SLIDER text "Music volume:" @@ -1000,7 +1001,7 @@ //Sound quality - itemdef { + itemdef { name opt_squality type ITEM_TYPE_MULTI text "Sound Quality:" @@ -1034,7 +1035,7 @@ //Doppler effect - itemdef { + itemdef { name opt_doppler type ITEM_TYPE_YESNO text "Doppler Sound:" @@ -1113,7 +1114,7 @@ //Net rate - itemdef { + itemdef { name opt_netrate type ITEM_TYPE_MULTI text "Net Data Rate:"