Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
cryham committed May 3, 2024
1 parent ca36475 commit 6f8d215
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions docs/Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Marked: `crucial`, **Next or Big**, _Important_.
----
### New game stuff✨

🏆 new [game Modes](https://stuntrally.tuxfamily.org/mantis/view.php?id=21): [Career](https://forum.freegamedev.net/viewtopic.php?f=79&t=5211), WIP Collection, 3d cup models
Score for: drift (sliding on road), air time (jumps etc)
🏆 new [game Modes](https://stuntrally.tuxfamily.org/mantis/view.php?id=21): [Career](https://forum.freegamedev.net/viewtopic.php?f=79&t=5211), WIP Collection, 3d cup models
Score for: drift (sliding on road), air time (jumps etc), hitting dynamic objects

🕹️ New **Game** elements:
✨Teleporters, moving & rotating Obstacles, elevators
Expand Down
9 changes: 5 additions & 4 deletions src/game/CarModel_Create.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void CarModel::CreateLight(SceneNode* ndCar, LiType type, Vector3 pos, ColourVal
const Real dirY = under ?-1.f : front ? -0.1f : -0.0f; //par-
const Real dirZ = under ? 0.f : front ? 1.0f : -1.0f;

LogO("C**L Add light: type "+toStr(type)+" pos "+toStr(pos)); //-
LogO("C**L Add light: "+strLiType[type]+" pos "+toStr(pos)); //-
SceneNode* node = ndCar->createChildSceneNode( SCENE_DYNAMIC, pos );
Light* l = mSceneMgr->createLight();
node->attachObject( l ); ToDel(node);
Expand Down Expand Up @@ -261,7 +261,8 @@ void CarModel::CreateLight(SceneNode* ndCar, LiType type, Vector3 pos, ColourVal
//-------------------------------------------------------------------------------------------------------
void CarModel::Create()
{
LogO("C==C Creating Vehicle: "+sDirname+" -----");
LogO("");
LogO("C==C ----- Creating Vehicle: "+sDirname+" -----");
//if (!pCar) return;

String strI = toStr(iIndex)+ (cType == CT_TRACK ? "Z" : (cType == CT_GHOST2 ? "V" :""));
Expand Down Expand Up @@ -490,7 +491,7 @@ void CarModel::Create()
for (auto& pos : fsReverse.pos)
{
bsReverse->createBillboard(pos, fsReverse.clr);
if (fsReverse.lit[n] && pSet->li.front && !ghost)
if (fsReverse.lit[n] && pSet->li.reverse && !ghost)
CreateLight(ndCar, LI_Revese, pos, fsReverse.clr); //💡
++n;
}
Expand Down Expand Up @@ -616,5 +617,5 @@ void CarModel::Create()
} }
UpdParsTrails();
}
LogO("C--L Created Vehicle: "+sDirname+" total lights: "+toStr(lights.size())+" -----");
LogO("C--L ----- Created Vehicle: "+sDirname+" total lights: "+toStr(lights.size())+" -----\n");
}
5 changes: 3 additions & 2 deletions src/game/CarModel_Update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,7 @@ void CarModel::Update(PosInfo& posInfo, PosInfo& posInfoCam, float time)


// 🔴 brake state flares
//------------------------------------------------------------------------
bool braking = posInfo.braking > 0;
if (bBraking != braking && gPar.carPrv == 0)
{
Expand All @@ -292,7 +293,7 @@ void CarModel::Update(PosInfo& posInfo, PosInfo& posInfoCam, float time)
if (bsBrakes)
bsBrakes->setVisible(vis);
}
// reverse
// 💡 reverse
bool reverse = posInfo.reverse > 0;
if (bReverse != reverse && gPar.carPrv == 0)
{
Expand All @@ -301,7 +302,6 @@ void CarModel::Update(PosInfo& posInfo, PosInfo& posInfoCam, float time)
if (bsReverse)
bsReverse->setVisible(vis);
}
bReverseOld = bReverse; // meh
bReverse = reverse;
if (bReverse != bReverseOld)
{
Expand All @@ -311,6 +311,7 @@ void CarModel::Update(PosInfo& posInfo, PosInfo& posInfoCam, float time)
if (bsReverse)
bsReverse->setVisible(bReverse && pSet->li.front);
}
bReverseOld = bReverse;

// 💡 Lights
//------------------------------------------------------------------------
Expand Down
18 changes: 10 additions & 8 deletions src/game/Gui_Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,17 @@ void CGui::GuiShortcut(EMenu menu, int tab, int subtab, int game)
if (menu != MN_NoCng) // chg menu
{
pSet->iMenu = menu;

if (tab == TAB_Track || tab == TAB_Champs)
{ SetNumPlayers(1); app->updPanGames(game); }
if (tab == TAB_Split)
{ SetNumPlayers(-2); app->updPanGames(game); } // 👥
if (tab == TAB_Multi)
{ SetNumPlayers(1); app->updPanGames(game); } // 📡
}

if (pSet->iMenu == MN_Single) // set num plr
{
if (tab == TAB_Track || tab == TAB_Champs)
{ SetNumPlayers(1); app->updPanGames(game); }
if (tab == TAB_Split)
{ SetNumPlayers(-2); app->updPanGames(game); } // 👥
if (tab == TAB_Multi)
{ SetNumPlayers(1); app->updPanGames(game); } // 📡
} }

TabPtr tabs = 0;
std::vector<TabControl*>* subt = 0;

Expand Down
5 changes: 3 additions & 2 deletions src/vdrift/car.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ class CAR
/// return the speedometer reading (based on the driveshaft speed) in m/s
float GetSpeedometer() const
{
return dynamics.vtype != V_Car ?
dynamics.GetSpeedDir() : dynamics.GetSpeedMPS();
auto& t = dynamics.vtype;
return t == V_Sphere ? dynamics.GetVelocity().Magnitude() :
t != V_Car ? dynamics.GetSpeedDir() : dynamics.GetSpeedMPS();
}

std::string GetCarType() const { return cartype; }
Expand Down

0 comments on commit 6f8d215

Please sign in to comment.