Removed unnecessary code
git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/trunk@458 0420edf4-82e4-42fc-9478-35b55e6d67a3master
parent
7afb08f242
commit
98f256a751
|
@ -106,7 +106,6 @@ void CCredits::DrawCreditsText (double time_step) {
|
|||
glVertex2i (w, h - TOP_Y - 30);
|
||||
glEnd();
|
||||
|
||||
glColor4f (1, 1, 1, 1);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
if (offs < TOP_Y) y_offset = 0;
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ bool CEvents::LoadEventList () {
|
|||
RaceList.back().light = Env.GetLightIdx (item);
|
||||
RaceList.back().snow = SPIntN (line, "snow", 0);
|
||||
RaceList.back().wind = SPIntN (line, "wind", 0);
|
||||
RaceList.back().time = SPVector3N (line, "time", NullVec);
|
||||
RaceList.back().time = SPVector3N (line, "time");
|
||||
RaceList.back().herrings = SPIndex3N (line, "herring", TIndex3 (0, 0, 0));
|
||||
RaceList.back().music_theme = Music.GetThemeIdx (SPStrN (line, "theme", "normal"));
|
||||
}
|
||||
|
|
|
@ -407,7 +407,6 @@ void DrawHud (const CControl *ctrl) {
|
|||
|
||||
draw_gauge (speed * 3.6, ctrl->jump_amt);
|
||||
ScopedRenderMode rm(TEXFONT);
|
||||
glColor4f (1, 1, 1, 1);
|
||||
draw_time();
|
||||
draw_herring_count (g_game.herring);
|
||||
DrawSpeed (speed * 3.6);
|
||||
|
|
|
@ -112,7 +112,7 @@ bool CKeyframe::Load (const string& dir, const string& filename) {
|
|||
for (size_t i=0; i<list.Count(); i++) {
|
||||
const string& line = list.Line(i);
|
||||
frames[i].val[0] = SPFloatN (line, "time", 0);
|
||||
TVector3d posit = SPVector3N (line, "pos", NullVec);
|
||||
TVector3d posit = SPVector3N (line, "pos");
|
||||
frames[i].val[1] = posit.x;
|
||||
frames[i].val[2] = posit.y;
|
||||
frames[i].val[3] = posit.z;
|
||||
|
@ -121,19 +121,19 @@ bool CKeyframe::Load (const string& dir, const string& filename) {
|
|||
frames[i].val[6] = SPFloatN (line, "roll", 0);
|
||||
frames[i].val[7] = SPFloatN (line, "neck", 0);
|
||||
frames[i].val[8] = SPFloatN (line, "head", 0);
|
||||
TVector2d pp = SPVector2N (line, "sh", TVector2d(0, 0));
|
||||
TVector2d pp = SPVector2N (line, "sh");
|
||||
frames[i].val[9] = pp.x;
|
||||
frames[i].val[10] = pp.y;
|
||||
pp = SPVector2N (line, "arm", TVector2d(0, 0));
|
||||
pp = SPVector2N (line, "arm");
|
||||
frames[i].val[11] = pp.x;
|
||||
frames[i].val[12] = pp.y;
|
||||
pp = SPVector2N (line, "hip", TVector2d(0, 0));
|
||||
pp = SPVector2N (line, "hip");
|
||||
frames[i].val[13] = pp.x;
|
||||
frames[i].val[14] = pp.y;
|
||||
pp = SPVector2N (line, "knee", TVector2d(0, 0));
|
||||
pp = SPVector2N (line, "knee");
|
||||
frames[i].val[15] = pp.x;
|
||||
frames[i].val[16] = pp.y;
|
||||
pp = SPVector2N (line, "ankle", TVector2d(0, 0));
|
||||
pp = SPVector2N (line, "ankle");
|
||||
frames[i].val[17] = pp.x;
|
||||
frames[i].val[18] = pp.y;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,6 @@ GNU General Public License for more details.
|
|||
|
||||
#include "bh.h"
|
||||
|
||||
static const TVector3d NullVec(0.0, 0.0, 0.0);
|
||||
static const TVector3d GravVec(0.0, -1.0, 0.0);
|
||||
|
||||
// --------------------------------------------------------------------
|
||||
|
|
|
@ -39,6 +39,7 @@ CPaused Paused;
|
|||
static bool sky = true;
|
||||
static bool fog = true;
|
||||
static bool terr = true;
|
||||
static bool trees = true;
|
||||
|
||||
void CPaused::Keyb (unsigned int key, bool special, bool release, int x, int y) {
|
||||
if (release) return;
|
||||
|
@ -55,6 +56,9 @@ void CPaused::Keyb (unsigned int key, bool special, bool release, int x, int y)
|
|||
case SDLK_F7:
|
||||
terr = !terr;
|
||||
break;
|
||||
case SDLK_F8:
|
||||
trees = !trees;
|
||||
break;
|
||||
default:
|
||||
State::manager.RequestEnterState (Racing);
|
||||
}
|
||||
|
@ -64,18 +68,6 @@ void CPaused::Mouse (int button, int state, int x, int y) {
|
|||
State::manager.RequestEnterState (Racing);
|
||||
}
|
||||
|
||||
void PausedSetupDisplay () {
|
||||
double offset = 0.0;
|
||||
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
glOrtho (0, Winsys.resolution.width, 0, Winsys.resolution.height, -1.0, 1.0);
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
glTranslatef (offset, offset, -1.0);
|
||||
glColor4f (1.0, 1.0, 1.0, 1.0);
|
||||
}
|
||||
|
||||
// ====================================================================
|
||||
|
||||
void CPaused::Loop (double time_step) {
|
||||
|
@ -87,7 +79,6 @@ void CPaused::Loop (double time_step) {
|
|||
Music.Update ();
|
||||
ClearRenderContext ();
|
||||
Env.SetupFog ();
|
||||
ctrl->UpdatePlayerPos (0);
|
||||
update_view (ctrl, 0);
|
||||
SetupViewFrustum (ctrl);
|
||||
|
||||
|
@ -96,18 +87,13 @@ void CPaused::Loop (double time_step) {
|
|||
Env.SetupLight ();
|
||||
if (terr) RenderCourse();
|
||||
DrawTrackmarks ();
|
||||
DrawTrees();
|
||||
if (trees) DrawTrees();
|
||||
|
||||
UpdateWind (time_step);
|
||||
UpdateSnow (time_step, ctrl);
|
||||
DrawSnow (ctrl);
|
||||
|
||||
if (param.perf_level > 2) draw_particles (ctrl);
|
||||
Char.Draw (g_game.char_id);
|
||||
|
||||
ScopedRenderMode rm(GUI);
|
||||
SetupGuiDisplay ();
|
||||
PausedSetupDisplay ();
|
||||
DrawHud (ctrl);
|
||||
Reshape (width, height);
|
||||
Winsys.SwapBuffers ();
|
||||
|
|
|
@ -62,7 +62,7 @@ static void UpdateInfo() {
|
|||
}
|
||||
}
|
||||
|
||||
void SetRaceConditions (void) {
|
||||
void SetRaceConditions() {
|
||||
g_game.mirror_id = mirror->GetValue() != 0;
|
||||
g_game.light_id = light->GetValue();
|
||||
g_game.snow_id = snow->GetValue();
|
||||
|
|
|
@ -194,7 +194,7 @@ void SetSoundVolumes () {
|
|||
}
|
||||
|
||||
// ---------------------------- init ----------------------------------
|
||||
void CRacing::Enter (void) {
|
||||
void CRacing::Enter() {
|
||||
CControl *ctrl = Players.GetCtrl (g_game.player_id);
|
||||
|
||||
if (param.view_mode < 0 || param.view_mode >= NUM_VIEW_MODES) {
|
||||
|
|
|
@ -85,7 +85,7 @@ static int framewidth, frameheight, arrowwidth;
|
|||
static TArea area;
|
||||
static double texsize;
|
||||
|
||||
void CRegist::Enter (void) {
|
||||
void CRegist::Enter() {
|
||||
Winsys.ShowCursor (!param.ice_cursor);
|
||||
Music.Play (param.menu_music, -1);
|
||||
|
||||
|
|
12
src/spx.h
12
src/spx.h
|
@ -46,9 +46,9 @@ string Vector_StrN (const TVector3d& v, const streamsize count);
|
|||
int Str_IntN (const string &s, const int def);
|
||||
bool Str_BoolN (const string &s, const bool def);
|
||||
float Str_FloatN (const string &s, const float def);
|
||||
TVector2d Str_Vector2N (const string &s, const TVector2d& def);
|
||||
TVector3d Str_Vector3N (const string &s, const TVector3d& def);
|
||||
TVector4d Str_Vector4N (const string &s, const TVector4d& def);
|
||||
TVector2d Str_Vector2N(const string &s, const TVector2d& def);
|
||||
TVector3d Str_Vector3N(const string &s, const TVector3d& def);
|
||||
TVector4d Str_Vector4N(const string &s, const TVector4d& def);
|
||||
TColor Str_ColorN (const string &s, const TColor& def);
|
||||
TColor3 Str_Color3N (const string &s, const TColor3& def);
|
||||
void Str_ArrN (const string &s, float *arr, size_t count, float def);
|
||||
|
@ -64,10 +64,10 @@ string SPStrN (const string &s, const string &tag, const string& def = e
|
|||
int SPIntN (const string &s, const string &tag, const int def);
|
||||
bool SPBoolN (const string &s, const string &tag, const bool def);
|
||||
float SPFloatN (const string &s, const string &tag, const float def);
|
||||
TVector2d SPVector2N (const string &s, const string &tag, const TVector2d& def);
|
||||
TVector3d SPVector3N (const string &s, const string &tag, const TVector3d& def);
|
||||
TVector2d SPVector2N (const string &s, const string &tag, const TVector2d& def = NullVec2);
|
||||
TVector3d SPVector3N (const string &s, const string &tag, const TVector3d& def = NullVec3);
|
||||
TIndex3 SPIndex3N (const string &s, const string &tag, const TIndex3& def);
|
||||
TVector4d SPVector4N (const string &s, const string &tag, const TVector4d& def);
|
||||
TVector4d SPVector4N (const string &s, const string &tag, const TVector4d& def);
|
||||
TColor SPColorN (const string &s, const string &tag, const TColor& def);
|
||||
TColor3 SPColor3N (const string &s, const string &tag, const TColor3& def);
|
||||
void SPArrN (const string &s, const string &tag, float *arr, size_t count, float def);
|
||||
|
|
|
@ -317,7 +317,7 @@ void RenderSequence (double timestep) {
|
|||
GluCamera.Update (timestep);
|
||||
if (TestFrame.active) TestFrame.UpdateTest (timestep, &TestChar);
|
||||
else if (keyrun) {
|
||||
TestFrame.InitTest (NullVec, &TestChar);
|
||||
TestFrame.InitTest (NullVec3, &TestChar);
|
||||
keyrun = false;
|
||||
}
|
||||
|
||||
|
|
12
src/tux.cpp
12
src/tux.cpp
|
@ -219,7 +219,7 @@ bool CCharShape::RotateNode (size_t node_name, int axis, double angle) {
|
|||
MakeRotationMatrix (rotMatrix, -angle, caxis);
|
||||
MultiplyMatrices (node->invtrans, rotMatrix, node->invtrans);
|
||||
|
||||
if (newActions && useActions) AddAction (node_name, axis, NullVec, angle);
|
||||
if (newActions && useActions) AddAction (node_name, axis, NullVec3, angle);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -254,7 +254,7 @@ bool CCharShape::VisibleNode (size_t node_name, float level) {
|
|||
clamp (MIN_SPHERE_DIV, ROUND_TO_NEAREST (param.tux_sphere_divisions * level / 10), MAX_SPHERE_DIV);
|
||||
node->radius = 1.0;
|
||||
}
|
||||
if (newActions && useActions) AddAction (node_name, 5, NullVec, level);
|
||||
if (newActions && useActions) AddAction (node_name, 5, NullVec3, level);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -341,8 +341,8 @@ TCharMaterial* CCharShape::GetMaterial (const string& mat_name) {
|
|||
}
|
||||
|
||||
void CCharShape::CreateMaterial (const string& line) {
|
||||
TVector3d diff = SPVector3N(line, "diff", NullVec);
|
||||
TVector3d spec = SPVector3N(line, "spec", NullVec);
|
||||
TVector3d diff = SPVector3N(line, "diff");
|
||||
TVector3d spec = SPVector3N(line, "spec");
|
||||
float exp = SPFloatN (line, "exp", 50);
|
||||
std::string mat = SPItemN (line, "mat");
|
||||
STrimN(mat);
|
||||
|
@ -450,13 +450,13 @@ bool CCharShape::Load (const string& dir, const string& filename, bool with_acti
|
|||
bool shadow = SPBoolN (line, "shad", false);
|
||||
string order = SPStrN (line, "order");
|
||||
CreateCharNode (parent_name, node_name, name, fullname, order, shadow);
|
||||
TVector3d rot = SPVector3N (line, "rot", NullVec);
|
||||
TVector3d rot = SPVector3N (line, "rot");
|
||||
MaterialNode (node_name, mat_name);
|
||||
for (size_t ii = 0; ii < order.size(); ii++) {
|
||||
int act = order[ii]-48;
|
||||
switch (act) {
|
||||
case 0: {
|
||||
TVector3d trans = SPVector3N(line, "trans", NullVec);
|
||||
TVector3d trans = SPVector3N(line, "trans");
|
||||
TranslateNode (node_name, trans);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -22,6 +22,10 @@ GNU General Public License for more details.
|
|||
#include "vectors.h"
|
||||
|
||||
|
||||
const TVector2d NullVec2;
|
||||
const TVector3d NullVec3;
|
||||
|
||||
|
||||
// Instanciate only functions we actually need
|
||||
template<>
|
||||
double TVector3<double>::Norm() {
|
||||
|
|
|
@ -162,4 +162,8 @@ double DotProduct(const TVector3d& v1, const TVector3d& v2);
|
|||
TVector3d CrossProduct(const TVector3d& u, const TVector3d& v);
|
||||
|
||||
|
||||
extern const TVector2d NullVec2;
|
||||
extern const TVector3d NullVec3;
|
||||
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue