16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 03:29:19 +02:00

reformat: remove redundant 'inline' specifier

This commit is contained in:
jerrrrycho
2026-07-04 05:58:21 +02:00
parent b4b6686320
commit 6e4d000ddb
85 changed files with 877 additions and 988 deletions

View File

@@ -34,8 +34,7 @@ public:
bool check_activation();
// checks conditions associated with the event. returns: true if the conditions are met
bool check_conditions();
inline
auto key() const {
auto key() const {
return iKey; }
bool IsGlobal() const;
bool IsRadioActivated() const;

View File

@@ -128,7 +128,7 @@ protected:
};
// methods
template <class TableType_>
void init_targets( TableType_ &Repository, std::string const &Targettype, bool const Logerrors = true );
void init_targets( TableType_ &Repository, std::string const &Targettype, bool Logerrors = true );
// returns true if provided token is a an event desription keyword, false otherwise
static bool is_keyword( std::string const &Token );
@@ -648,7 +648,7 @@ public:
queue( TEventLauncher *Launcher );
// inserts in the event query events assigned to event launchers capable of receiving specified radio message sent from specified location
void
queue_receivers( radio_message const Message, glm::dvec3 const &Location );
queue_receivers( radio_message Message, glm::dvec3 const &Location );
// legacy method, updates event queues
void
update();
@@ -656,16 +656,14 @@ public:
// TBD, TODO: return handle to the event
bool
insert( basic_event *Event );
inline
bool
bool
insert( TEventLauncher *Launcher ) {
return Launcher->IsRadioActivated() ? m_radiodrivenlaunchers.insert(Launcher) : m_inputdrivenlaunchers.insert(Launcher); }
inline void purge (TEventLauncher *Launcher) {
void purge (TEventLauncher *Launcher) {
m_radiodrivenlaunchers.purge(Launcher);
m_inputdrivenlaunchers.purge(Launcher); }
// returns first event in the queue
inline
basic_event *
basic_event *
begin() {
return QueryRootEvent; }
@@ -677,7 +675,7 @@ public:
// legacy method, returns pointer to specified event, or null
basic_event *
FindEvent( std::string const &Name );
inline TEventLauncher* FindEventlauncher(std::string const &Name) {
TEventLauncher * FindEventlauncher(std::string const &Name) {
const auto ptr = m_inputdrivenlaunchers.find(Name);
return ptr ? ptr : m_radiodrivenlaunchers.find(Name);
}

View File

@@ -21,17 +21,17 @@ public:
explicit TMemCell( scene::node_data const &Nodedata );
// methods
void
UpdateValues( std::string const &szNewText, double const fNewValue1, double const fNewValue2, int const CheckMask );
UpdateValues( std::string const &szNewText, double fNewValue1, double fNewValue2, int CheckMask );
bool
Load(cParser *parser);
void
PutCommand( TController *Mech, glm::dvec3 const *Loc ) const;
bool
Compare( std::string const &szTestText, double const fTestValue1, double const fTestValue2, int const CheckMask,
comparison_operator const TextOperator = comparison_operator::equal,
comparison_operator const Value1Operator = comparison_operator::equal,
comparison_operator const Value2Operator = comparison_operator::equal,
comparison_pass const Pass = comparison_pass::all ) const;
Compare( std::string const &szTestText, double fTestValue1, double fTestValue2, int CheckMask,
comparison_operator TextOperator = comparison_operator::equal,
comparison_operator Value1Operator = comparison_operator::equal,
comparison_operator Value2Operator = comparison_operator::equal,
comparison_pass Pass = comparison_pass::all ) const;
std::string const &
Text() const {
return szText; }

View File

@@ -54,11 +54,11 @@ class TSegment
glm::dvec3 vA, vB, vC; // współczynniki wielomianów trzeciego stopnia vD==Point1
TTrack *pOwner = nullptr; // wskaźnik na właściciela
glm::dvec3 GetFirstDerivative(double const fTime) const;
double RombergIntegral(double const fA, double const fB) const;
double GetTFromS(double const s) const;
glm::dvec3 RaInterpolate(double const t) const;
glm::dvec3 RaInterpolate0(double const t) const;
glm::dvec3 GetFirstDerivative(double fTime) const;
double RombergIntegral(double fA, double fB) const;
double GetTFromS(double s) const;
glm::dvec3 RaInterpolate(double t) const;
glm::dvec3 RaInterpolate0(double t) const;
public:
bool bCurve = false;
@@ -71,22 +71,19 @@ public:
// finds point on segment closest to specified point in 3d space. returns: point on segment as value in range 0-1
double
find_nearest_point( glm::dvec3 const &Point ) const;
inline
glm::dvec3
glm::dvec3
GetDirection1() const {
return bCurve ? CPointOut - Point1 : CPointOut; };
inline
glm::dvec3
glm::dvec3
GetDirection2() const {
return bCurve ? CPointIn - Point2 : CPointIn; };
glm::dvec3
GetDirection(double const fDistance) const;
inline
glm::dvec3
GetDirection(double fDistance) const;
glm::dvec3
GetDirection() const {
return CPointOut; };
glm::dvec3
FastGetDirection(double const fDistance, double const fOffset);
FastGetDirection(double fDistance, double fOffset);
/*
Math3D::vector3
GetPoint(double const fDistance) const;
@@ -98,39 +95,33 @@ public:
/// <param name="fDistance">Distance from p1</param>
/// <param name="position">Calculated position</param>
/// <param name="rotation">Calculated rotation</param>
void RaPositionGet(double const fDistance, glm::dvec3 &position, glm::vec3 &rotation) const;
glm::dvec3 FastGetPoint(double const t) const;
inline
glm::dvec3
void RaPositionGet(double fDistance, glm::dvec3 &position, glm::vec3 &rotation) const;
glm::dvec3 FastGetPoint(double t) const;
glm::dvec3
FastGetPoint_0() const {
return Point1; };
inline
glm::dvec3
glm::dvec3
FastGetPoint_1() const {
return Point2; };
inline
float
float
GetRoll(double const Distance) const {
return std::lerp( fRoll1, fRoll2, static_cast<float>(Distance / fLength) ); }
inline
void
void
GetRolls(float &r1, float &r2) const {
// pobranie przechyłek (do generowania trójkątów)
r1 = fRoll1;
r2 = fRoll2; }
bool
RenderLoft( gfx::vertex_array &Output, glm::dvec3 const &Origin, gfx::vertex_array const &ShapePoints, bool const Transition, double fTextureLength, double Texturescale = 1.0, int iSkip = 0, int iEnd = 0, std::pair<float, float> fOffsetX = {0.f, 0.f}, glm::vec3 **p = nullptr, bool bRender = true );
RenderLoft( gfx::vertex_array &Output, glm::dvec3 const &Origin, gfx::vertex_array const &ShapePoints, bool Transition, double fTextureLength, double Texturescale = 1.0, int iSkip = 0, int iEnd = 0, std::pair<float, float> fOffsetX = {0.f, 0.f}, glm::vec3 **p = nullptr, bool bRender = true );
/*
void
Render();
*/
inline
double
void
Render();
*/
double
GetLength() const {
return fLength; };
inline
int
int
RaSegCount() const {
return fTsBuffer.empty() ? 1 : iSegCount; };

View File

@@ -56,7 +56,7 @@ class TTraction;
class TSwitchExtension
{ // dodatkowe dane do toru, który jest zwrotnicą
public:
TSwitchExtension(TTrack *owner, int const what);
TSwitchExtension(TTrack *owner, int what);
~TSwitchExtension();
std::shared_ptr<TSegment> Segments[6]; // dwa tory od punktu 1, pozosta³e dwa od 2? Ra 140101: 6 po³¹czeñ dla skrzy¿owañ
TTrack *pNexts[2]; // tory do³¹czone do punktów 2 i 4
@@ -112,24 +112,19 @@ public:
static TIsolated * Find(const std::string &n); // znalezienie obiektu albo utworzenie nowego
void AssignEvents();
void Modify(int i, TDynamicObject *o); // dodanie lub odjęcie osi
inline
bool
bool
Busy() {
return iAxles > 0; };
inline
static TIsolated *
static TIsolated *
Root() {
return pRoot; };
inline
TIsolated *
TIsolated *
Next() {
return pNext; };
inline
void
void
parent( TIsolated *Parent ) {
pParent = Parent; }
inline
TIsolated *
TIsolated *
parent() const {
return pParent; }
// members
@@ -249,39 +244,38 @@ public:
static bool sort_by_material( TTrack const *Left, TTrack const *Right );
static TTrack * Create400m(int what, double dx);
TTrack * NullCreate(int dir);
inline bool IsEmpty() {
bool IsEmpty() {
return Dynamics.empty(); };
void ConnectPrevPrev(TTrack *pNewPrev, int typ);
void ConnectPrevNext(TTrack *pNewPrev, int typ);
void ConnectNextPrev(TTrack *pNewNext, int typ);
void ConnectNextNext(TTrack *pNewNext, int typ);
material_handle copy_adjacent_trackbed_material( TTrack const *Exclude = nullptr );
inline double Length() const {
double Length() const {
return Segment->GetLength(); };
inline std::shared_ptr<TSegment> CurrentSegment() const {
std::shared_ptr<TSegment> CurrentSegment() const {
return Segment; };
inline TTrack *CurrentNext() const {
TTrack *CurrentNext() const {
return trNext; };
inline TTrack *CurrentPrev() const {
TTrack *CurrentPrev() const {
return trPrev; };
TTrack *Connected(int s, double &d) const;
bool SetConnections(int i);
bool Switch(int i, float const t = -1.f, float const d = -1.f);
bool Switch(int i, float t = -1.f, float d = -1.f);
bool SwitchForced(int i, TDynamicObject *o);
int CrossSegment(int from, int into);
inline int GetSwitchState() {
int GetSwitchState() {
return SwitchExtension ? SwitchExtension->CurrentIndex : -1; };
// returns number of different routes possible to take from given point
// TODO: specify entry point, number of routes for switches can vary
inline
int
int
RouteCount() const {
return SwitchExtension != nullptr ? SwitchExtension->iRoads - 1 : 1; }
void Load(cParser *parser, glm::dvec3 const &pOrigin);
bool AssignEvents();
bool AssignForcedEvents(basic_event *NewEventPlus, basic_event *NewEventMinus);
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner );
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double const Delaylimit );
void QueueEvents( event_sequence const &Events, TDynamicObject const *Owner, double Delaylimit );
bool CheckDynamicObject(TDynamicObject *Dynamic);
bool AddDynamicObject(TDynamicObject *Dynamic);
bool RemoveDynamicObject(TDynamicObject *Dynamic);
@@ -300,7 +294,7 @@ public:
double ActiveLength();
void create_geometry( gfx::geometrybank_handle const &Bank ); // wypełnianie VBO
void create_map_geometry(std::vector<gfx::basic_vertex> &Bank, const gfx::geometrybank_handle Extra);
void create_map_geometry(std::vector<gfx::basic_vertex> &Bank, gfx::geometrybank_handle Extra);
void get_map_active_paths(map_colored_paths &handles);
void get_map_paths_for_state(map_colored_paths &handles, int state);
void get_map_future_paths(map_colored_paths &handles);
@@ -325,7 +319,7 @@ public:
double WidthTotal();
bool IsGroupable();
int TestPoint(const glm::dvec3 *Point);
void MovedUp1(float const dh);
void MovedUp1(float dh);
void VelocitySet(float v);
double VelocityGet();
float Friction() const;
@@ -352,16 +346,16 @@ private:
// loads content of specified file and converts it into a vertex array
static gfx::vertex_array deserialize_profile( std::string const &Profile );
// provides direct access to vertex data of specified profile
static gfx::vertex_array const & track_rail_profile( int const Profile );
static gfx::vertex_array const & track_rail_profile( int Profile );
// returns texture length for specified material
float texture_length( material_handle const Material );
float texture_length( material_handle Material );
// creates profile for a part of current path
void create_switch_trackbed( gfx::vertex_array &Output );
void create_track_rail_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
void create_track_blade_profile( gfx::vertex_array &Right, gfx::vertex_array &Left );
void create_track_bed_profile( gfx::vertex_array &Output, TTrack const *Previous, TTrack const *Next );
void create_road_profile( gfx::vertex_array &Output, bool const Forcetransition = false );
void create_road_side_profile( gfx::vertex_array &Right, gfx::vertex_array &Left, gfx::vertex_array const &Road, bool const Forcetransition = false );
void create_road_profile( gfx::vertex_array &Output, bool Forcetransition = false );
void create_road_side_profile( gfx::vertex_array &Right, gfx::vertex_array &Left, gfx::vertex_array const &Road, bool Forcetransition = false );
/// <summary>
/// resolves the sleeper model/skin via the model and material managers, and fills
/// m_sleeper_local_transforms by walking the active segment(s) at m_sleeper_frequency.

View File

@@ -21,7 +21,7 @@ public:
// constructor
TTractionPowerSource( scene::node_data const &Nodedata );
// methods
void Init(double const u, double const i);
void Init(double u, double i);
bool Load(cParser *parser);
bool Update(double dt);
double CurrentGet(double res);
@@ -73,7 +73,7 @@ class powergridsource_table : public basic_table<TTractionPowerSource> {
public:
// legacy method, calculates changes in simulation state over specified time
void
update( double const Deltatime );
update( double Deltatime );
};
//---------------------------------------------------------------------------

View File

@@ -24,17 +24,17 @@ public:
// methods
TTrack * SetCurrentTrack(TTrack *pTrack, int end);
bool Move(double fDistance, bool bPrimary);
inline TTrack * GetTrack() const {
TTrack * GetTrack() const {
return pCurrentTrack; };
// przechyłka policzona przy ustalaniu pozycji
inline double GetRoll() {
double GetRoll() {
return vAngles.x; };
//{return pCurrentSegment->GetRoll(fCurrentDistance)*fDirection;}; //zamiast liczyć można pobrać
// zwrot na torze
inline double GetDirection() const {
double GetDirection() const {
return fDirection; };
// ABu-030403
inline double GetTranslation() const {
double GetTranslation() const {
return fCurrentDistance; };
// inline double GetLength(vector3 p1, vector3 cp1, vector3 cp2, vector3 p2)
//{ return pCurrentSegment->ComputeLength(p1,cp1,cp2,p2); };

View File

@@ -77,7 +77,7 @@ class TTrainParameters
bool IsMaintenance() const;
bool IsTimeToGo(double hh, double mm);
// returns: difference between specified time and scheduled departure from current stop, in seconds
double seconds_until_departure( double const Hour, double const Minute ) const;
double seconds_until_departure( double Hour, double Minute ) const;
bool UpdateMTable(double hh, double mm, std::string const &NewName);
bool UpdateMTable( scenario_time const &Time, std::string const &NewName );
bool RewindTimeTable( std::string actualStationName );

View File

@@ -18,7 +18,7 @@ public:
// methods
// exchanges load with consist attached to specified vehicle, operating on specified schedule; returns: time needed for exchange, in seconds
double
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int const Platform );
update_load( TDynamicObject *First, Mtable::TTrainParameters &Schedule, int Platform );
};
namespace simulation {