mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 16:19:19 +02:00
build 180131. support for nested material attribute definitions, minor bug fixes, refactoring and master branch unifications
This commit is contained in:
@@ -2616,19 +2616,14 @@ bool TController::DecBrake()
|
|||||||
|
|
||||||
bool TController::IncSpeed()
|
bool TController::IncSpeed()
|
||||||
{ // zwiększenie prędkości; zwraca false, jeśli dalej się nie da zwiększać
|
{ // zwiększenie prędkości; zwraca false, jeśli dalej się nie da zwiększać
|
||||||
#ifdef EU07_USE_OLD_SOUNDCODE
|
|
||||||
if (tsGuardSignal) // jeśli jest dźwięk kierownika
|
|
||||||
if (tsGuardSignal->GetStatus() & DSBSTATUS_PLAYING) // jeśli gada, to nie jedziemy
|
|
||||||
return false;
|
|
||||||
#else
|
|
||||||
if( true == tsGuardSignal.is_playing() ) {
|
if( true == tsGuardSignal.is_playing() ) {
|
||||||
|
// jeśli gada, to nie jedziemy
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
bool OK = true;
|
bool OK = true;
|
||||||
if( ( iDrivigFlags & moveDoorOpened )
|
if( ( iDrivigFlags & moveDoorOpened )
|
||||||
&& ( VelDesired > 0.0 ) ) { // to prevent door shuffle on stop
|
&& ( VelDesired > 0.0 ) ) { // to prevent door shuffle on stop
|
||||||
// zamykanie drzwi - tutaj wykonuje tylko AI (zmienia fActionTime)
|
// zamykanie drzwi - tutaj wykonuje tylko AI (zmienia fActionTime)
|
||||||
Doors( false );
|
Doors( false );
|
||||||
}
|
}
|
||||||
if( fActionTime < 0.0 ) {
|
if( fActionTime < 0.0 ) {
|
||||||
|
|||||||
55
DynObj.cpp
55
DynObj.cpp
@@ -3088,7 +3088,7 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
{ // trzeba usunąć to rozróżnienie
|
{ // trzeba usunąć to rozróżnienie
|
||||||
case 0:
|
case 0:
|
||||||
if( ( Global.bLiveTraction == false )
|
if( ( Global.bLiveTraction == false )
|
||||||
&& ( p->hvPowerWire == nullptr ) ) {
|
&& ( p->hvPowerWire == nullptr ) ) {
|
||||||
// jeśli nie ma drutu, może pooszukiwać
|
// jeśli nie ma drutu, może pooszukiwać
|
||||||
MoverParameters->PantFrontVolt =
|
MoverParameters->PantFrontVolt =
|
||||||
( p->PantWys >= 1.2 ) ?
|
( p->PantWys >= 1.2 ) ?
|
||||||
@@ -3098,19 +3098,20 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
else if( ( true == MoverParameters->PantFrontUp )
|
else if( ( true == MoverParameters->PantFrontUp )
|
||||||
&& ( PantDiff < 0.01 ) ) // tolerancja niedolegania
|
&& ( PantDiff < 0.01 ) ) // tolerancja niedolegania
|
||||||
{
|
{
|
||||||
if( ( MoverParameters->PantFrontVolt == 0.0 )
|
if (p->hvPowerWire) {
|
||||||
&& ( MoverParameters->PantRearVolt == 0.0 ) ) {
|
auto const wirevoltage { p->hvPowerWire->VoltageGet( MoverParameters->Voltage, fPantCurrent ) };
|
||||||
for( auto &pantograph : m_pantographsounds ) {
|
// TODO: refactor reaction to voltage change to mover as sound event for specific pantograph
|
||||||
if( pantograph.sPantUp.offset().z > 0 ) {
|
if( ( MoverParameters->PantFrontVolt == 0.0 )
|
||||||
// limit to pantographs located in the front half of the vehicle
|
&& ( wirevoltage > 0.0 ) ) {
|
||||||
pantograph.sPantUp.play( sound_flags::exclusive );
|
for( auto &pantograph : m_pantographsounds ) {
|
||||||
|
if( pantograph.sPantUp.offset().z > 0 ) {
|
||||||
|
// limit to pantographs located in the front half of the vehicle
|
||||||
|
pantograph.sPantUp.play( sound_flags::exclusive );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (p->hvPowerWire) {
|
|
||||||
// TODO: wyliczyć trzeba prąd przypadający na pantograf i wstawić do GetVoltage()
|
// TODO: wyliczyć trzeba prąd przypadający na pantograf i wstawić do GetVoltage()
|
||||||
MoverParameters->PantFrontVolt =
|
MoverParameters->PantFrontVolt = wirevoltage;
|
||||||
p->hvPowerWire->VoltageGet(MoverParameters->Voltage, fPantCurrent);
|
|
||||||
fCurrent -= fPantCurrent; // taki prąd płynie przez powyższy pantograf
|
fCurrent -= fPantCurrent; // taki prąd płynie przez powyższy pantograf
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -3131,16 +3132,18 @@ bool TDynamicObject::Update(double dt, double dt1)
|
|||||||
else if ( ( true == MoverParameters->PantRearUp )
|
else if ( ( true == MoverParameters->PantRearUp )
|
||||||
&& ( PantDiff < 0.01 ) )
|
&& ( PantDiff < 0.01 ) )
|
||||||
{
|
{
|
||||||
if( ( MoverParameters->PantRearVolt == 0.0 )
|
if (p->hvPowerWire) {
|
||||||
&& ( MoverParameters->PantFrontVolt == 0.0 ) ) {
|
auto const wirevoltage { p->hvPowerWire->VoltageGet( MoverParameters->Voltage, fPantCurrent ) };
|
||||||
for( auto &pantograph : m_pantographsounds ) {
|
// TODO: refactor reaction to voltage change to mover as sound event for specific pantograph
|
||||||
if( pantograph.sPantUp.offset().z < 0 ) {
|
if( ( MoverParameters->PantRearVolt == 0.0 )
|
||||||
// limit to pantographs located in the rear half of the vehicle
|
&& ( wirevoltage > 0.0 ) ) {
|
||||||
pantograph.sPantUp.play( sound_flags::exclusive );
|
for( auto &pantograph : m_pantographsounds ) {
|
||||||
|
if( pantograph.sPantUp.offset().z < 0 ) {
|
||||||
|
// limit to pantographs located in the rear half of the vehicle
|
||||||
|
pantograph.sPantUp.play( sound_flags::exclusive );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (p->hvPowerWire) {
|
|
||||||
// TODO: wyliczyć trzeba prąd przypadający na pantograf i wstawić do GetVoltage()
|
// TODO: wyliczyć trzeba prąd przypadający na pantograf i wstawić do GetVoltage()
|
||||||
MoverParameters->PantRearVolt = p->hvPowerWire->VoltageGet( MoverParameters->Voltage, fPantCurrent );
|
MoverParameters->PantRearVolt = p->hvPowerWire->VoltageGet( MoverParameters->Voltage, fPantCurrent );
|
||||||
fCurrent -= fPantCurrent; // taki prąd płynie przez powyższy pantograf
|
fCurrent -= fPantCurrent; // taki prąd płynie przez powyższy pantograf
|
||||||
@@ -3888,7 +3891,7 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
|||||||
parser.getTokens(); parser >> token;
|
parser.getTokens(); parser >> token;
|
||||||
|
|
||||||
if( ( token == "models:" )
|
if( ( token == "models:" )
|
||||||
|| ( token == "models:" ) ) { // crude way to handle utf8 bom potentially appearing before the first token
|
|| ( token == "\xef\xbb\xbfmodels:" ) ) { // crude way to handle utf8 bom potentially appearing before the first token
|
||||||
// modele i podmodele
|
// modele i podmodele
|
||||||
m_materialdata.multi_textures = 0; // czy jest wiele tekstur wymiennych?
|
m_materialdata.multi_textures = 0; // czy jest wiele tekstur wymiennych?
|
||||||
parser.getTokens();
|
parser.getTokens();
|
||||||
@@ -4013,8 +4016,9 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
|||||||
// Ra: tu wczytywanie modelu ładunku jest w porządku
|
// Ra: tu wczytywanie modelu ładunku jest w porządku
|
||||||
if( false == asLoadName.empty() ) {
|
if( false == asLoadName.empty() ) {
|
||||||
// try first specialized version of the load model, vehiclename_loadname
|
// try first specialized version of the load model, vehiclename_loadname
|
||||||
auto const specializedloadfilename { BaseDir + TypeName + "_" + MoverParameters->LoadType + ".t3d" };
|
auto const specializedloadfilename { BaseDir + TypeName + "_" + MoverParameters->LoadType };
|
||||||
if( true == FileExists( specializedloadfilename ) ) {
|
if( ( true == FileExists( specializedloadfilename + ".e3d" ) )
|
||||||
|
|| ( true == FileExists( specializedloadfilename + ".t3d" ) ) ) {
|
||||||
mdLoad = TModelsManager::GetModel( specializedloadfilename, true );
|
mdLoad = TModelsManager::GetModel( specializedloadfilename, true );
|
||||||
}
|
}
|
||||||
if( mdLoad == nullptr ) {
|
if( mdLoad == nullptr ) {
|
||||||
@@ -4629,8 +4633,7 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
|||||||
m_powertrainsounds.rsWentylator.m_frequencyfactor /= MoverParameters->RVentnmax;
|
m_powertrainsounds.rsWentylator.m_frequencyfactor /= MoverParameters->RVentnmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
else if( ( token == "transmission:" )
|
else if( token == "transmission:" ) {
|
||||||
&& ( MoverParameters->EngineType == ElectricSeriesMotor ) ) {
|
|
||||||
// plik z dzwiekiem, mnozniki i ofsety amp. i czest.
|
// plik z dzwiekiem, mnozniki i ofsety amp. i czest.
|
||||||
// NOTE, fixed default parameters, legacy system leftover
|
// NOTE, fixed default parameters, legacy system leftover
|
||||||
m_powertrainsounds.transmission.m_amplitudefactor = 0.029;
|
m_powertrainsounds.transmission.m_amplitudefactor = 0.029;
|
||||||
@@ -4777,7 +4780,7 @@ void TDynamicObject::LoadMMediaFile( std::string BaseDir, std::string TypeName,
|
|||||||
|
|
||||||
else if( token == "outernoise:" ) {
|
else if( token == "outernoise:" ) {
|
||||||
// szum podczas jazdy:
|
// szum podczas jazdy:
|
||||||
rsOuterNoise.deserialize( parser, sound_type::single, sound_parameters::amplitude | sound_parameters::frequency );
|
rsOuterNoise.deserialize( parser, sound_type::single, sound_parameters::amplitude | sound_parameters::frequency, MoverParameters->Vmax );
|
||||||
rsOuterNoise.owner( this );
|
rsOuterNoise.owner( this );
|
||||||
|
|
||||||
rsOuterNoise.m_amplitudefactor /= ( 1 + MoverParameters->Vmax );
|
rsOuterNoise.m_amplitudefactor /= ( 1 + MoverParameters->Vmax );
|
||||||
@@ -5041,7 +5044,7 @@ void TDynamicObject::RadioStop()
|
|||||||
if( ( MoverParameters->SecuritySystem.RadioStop )
|
if( ( MoverParameters->SecuritySystem.RadioStop )
|
||||||
&& ( MoverParameters->Radio ) ) {
|
&& ( MoverParameters->Radio ) ) {
|
||||||
// jeśli pojazd ma RadioStop i jest on aktywny
|
// jeśli pojazd ma RadioStop i jest on aktywny
|
||||||
// HAX cast until math types unification
|
// HACK cast until math types unification
|
||||||
Mechanik->PutCommand( "Emergency_brake", 1.0, 1.0, &static_cast<glm::dvec3>(vPosition), stopRadio );
|
Mechanik->PutCommand( "Emergency_brake", 1.0, 1.0, &static_cast<glm::dvec3>(vPosition), stopRadio );
|
||||||
// add onscreen notification for human driver
|
// add onscreen notification for human driver
|
||||||
// TODO: do it selectively for the 'local' driver once the multiplayer is in
|
// TODO: do it selectively for the 'local' driver once the multiplayer is in
|
||||||
|
|||||||
3
DynObj.h
3
DynObj.h
@@ -269,6 +269,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct pantograph_sounds {
|
struct pantograph_sounds {
|
||||||
|
// TODO: split pantograph sound into one for contact of arm with the wire, and electric arc sound
|
||||||
sound_source sPantUp { sound_placement::external };
|
sound_source sPantUp { sound_placement::external };
|
||||||
sound_source sPantDown { sound_placement::external };
|
sound_source sPantDown { sound_placement::external };
|
||||||
};
|
};
|
||||||
@@ -455,7 +456,7 @@ private:
|
|||||||
TDynamicObject();
|
TDynamicObject();
|
||||||
~TDynamicObject();
|
~TDynamicObject();
|
||||||
// zwraca długość pojazdu albo 0, jeśli błąd
|
// zwraca długość pojazdu albo 0, jeśli błąd
|
||||||
double TDynamicObject::Init(
|
double Init(
|
||||||
std::string Name, std::string BaseDir, std::string asReplacableSkin, std::string Type_Name,
|
std::string Name, std::string BaseDir, std::string asReplacableSkin, std::string Type_Name,
|
||||||
TTrack *Track, double fDist, std::string DriverType, double fVel, std::string TrainName,
|
TTrack *Track, double fDist, std::string DriverType, double fVel, std::string TrainName,
|
||||||
float Load, std::string LoadType, bool Reversed, std::string);
|
float Load, std::string LoadType, bool Reversed, std::string);
|
||||||
|
|||||||
20
EU07.cpp
20
EU07.cpp
@@ -191,7 +191,7 @@ void key_callback( GLFWwindow *window, int key, int scancode, int action, int mo
|
|||||||
#ifdef CAN_I_HAS_LIBPNG
|
#ifdef CAN_I_HAS_LIBPNG
|
||||||
switch( key )
|
switch( key )
|
||||||
{
|
{
|
||||||
case GLFW_KEY_F11: {
|
case GLFW_KEY_PRINT_SCREEN: {
|
||||||
make_screenshot();
|
make_screenshot();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -426,20 +426,17 @@ int main(int argc, char *argv[])
|
|||||||
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
|
ErrorLog( "Critical error, memory allocation failure: " + std::string( Error.what() ) );
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
#ifdef _WINDOWS
|
||||||
Console *pConsole = new Console(); // Ra: nie wiem, czy ma to sens, ale jakoś zainicjowac trzeba
|
Console *pConsole = new Console(); // Ra: nie wiem, czy ma to sens, ale jakoś zainicjowac trzeba
|
||||||
/*
|
#endif
|
||||||
if( !joyGetNumDevs() )
|
|
||||||
WriteLog( "No joystick" );
|
|
||||||
*/
|
|
||||||
if( Global.iConvertModels < 0 ) {
|
if( Global.iConvertModels < 0 ) {
|
||||||
Global.iConvertModels = -Global.iConvertModels;
|
Global.iConvertModels = -Global.iConvertModels;
|
||||||
World.CreateE3D( "models\\" ); // rekurencyjne przeglądanie katalogów
|
World.CreateE3D( "models\\" ); // rekurencyjne przeglądanie katalogów
|
||||||
World.CreateE3D( "dynamic\\", true );
|
World.CreateE3D( "dynamic\\", true );
|
||||||
} // po zrobieniu E3D odpalamy normalnie scenerię, by ją zobaczyć
|
} // po zrobieniu E3D odpalamy normalnie scenerię, by ją zobaczyć
|
||||||
|
#ifdef _WINDOWS
|
||||||
Console::On(); // włączenie konsoli
|
Console::On(); // włączenie konsoli
|
||||||
|
#endif
|
||||||
try {
|
try {
|
||||||
while( ( false == glfwWindowShouldClose( window ) )
|
while( ( false == glfwWindowShouldClose( window ) )
|
||||||
&& ( true == World.Update() )
|
&& ( true == World.Update() )
|
||||||
@@ -456,10 +453,11 @@ int main(int argc, char *argv[])
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
Console::Off(); // wyłączenie konsoli (komunikacji zwrotnej)
|
|
||||||
|
|
||||||
TPythonInterpreter::killInstance();
|
TPythonInterpreter::killInstance();
|
||||||
SafeDelete( pConsole );
|
#ifdef _WINDOWS
|
||||||
|
Console::Off(); // wyłączenie konsoli (komunikacji zwrotnej)
|
||||||
|
SafeDelete( pConsole );
|
||||||
|
#endif
|
||||||
SafeDelete( simulation::Region );
|
SafeDelete( simulation::Region );
|
||||||
|
|
||||||
glfwDestroyWindow(window);
|
glfwDestroyWindow(window);
|
||||||
|
|||||||
28
EvLaunch.cpp
28
EvLaunch.cpp
@@ -128,22 +128,18 @@ bool TEventLauncher::Load(cParser *parser)
|
|||||||
|
|
||||||
bool TEventLauncher::check_conditions()
|
bool TEventLauncher::check_conditions()
|
||||||
{ //"renderowanie" wyzwalacza
|
{ //"renderowanie" wyzwalacza
|
||||||
bool bCond = false;
|
auto bCond { false };
|
||||||
if (iKey != 0)
|
if (iKey != 0) {
|
||||||
{
|
if( iKey > 255 ) {
|
||||||
if( Global.bActive ) {
|
// key and modifier
|
||||||
// tylko jeśli okno jest aktywne
|
auto const modifier = ( iKey & 0xff00 ) >> 8;
|
||||||
if( iKey > 255 ) {
|
bCond = ( Console::Pressed( iKey & 0xff ) )
|
||||||
// key and modifier
|
&& ( ( modifier & 1 ) ? Global.shiftState : true )
|
||||||
auto const modifier = ( iKey & 0xff00 ) >> 8;
|
&& ( ( modifier & 2 ) ? Global.ctrlState : true );
|
||||||
bCond = ( Console::Pressed( iKey & 0xff ) )
|
}
|
||||||
&& ( ( modifier & 1 ) ? Global.shiftState : true )
|
else {
|
||||||
&& ( ( modifier & 2 ) ? Global.ctrlState : true );
|
// just key
|
||||||
}
|
bCond = ( Console::Pressed( iKey & 0xff ) ); // czy klawisz wciśnięty
|
||||||
else {
|
|
||||||
// just key
|
|
||||||
bCond = ( Console::Pressed( iKey & 0xff ) ); // czy klawisz wciśnięty
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (DeltaTime > 0)
|
if (DeltaTime > 0)
|
||||||
|
|||||||
@@ -1439,7 +1439,7 @@ event_manager::InitEvents() {
|
|||||||
auto *track = simulation::Paths.find( event->asNodeName );
|
auto *track = simulation::Paths.find( event->asNodeName );
|
||||||
if( track != nullptr ) {
|
if( track != nullptr ) {
|
||||||
// dowiązanie toru
|
// dowiązanie toru
|
||||||
if( track->iAction == NULL ) {
|
if( track->iAction == 0 ) {
|
||||||
// jeśli nie jest zwrotnicą ani obrotnicą to będzie się zmieniał stan uszkodzenia
|
// jeśli nie jest zwrotnicą ani obrotnicą to będzie się zmieniał stan uszkodzenia
|
||||||
track->iAction |= 0x100;
|
track->iAction |= 0x100;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -104,11 +104,11 @@ class float4
|
|||||||
z = c;
|
z = c;
|
||||||
w = d;
|
w = d;
|
||||||
};
|
};
|
||||||
float inline float4::LengthSquared() const
|
float inline LengthSquared() const
|
||||||
{
|
{
|
||||||
return x * x + y * y + z * z + w * w;
|
return x * x + y * y + z * z + w * w;
|
||||||
};
|
};
|
||||||
float inline float4::Length() const
|
float inline Length() const
|
||||||
{
|
{
|
||||||
return sqrt(x * x + y * y + z * z + w * w);
|
return sqrt(x * x + y * y + z * z + w * w);
|
||||||
};
|
};
|
||||||
|
|||||||
16
Globals.cpp
16
Globals.cpp
@@ -558,14 +558,14 @@ global_settings::ConfigParse(cParser &Parser) {
|
|||||||
// color of the ui text. NOTE: will be obsolete once the real ui is in place
|
// color of the ui text. NOTE: will be obsolete once the real ui is in place
|
||||||
Parser.getTokens( 3, false );
|
Parser.getTokens( 3, false );
|
||||||
Parser
|
Parser
|
||||||
>> UITextColor.x
|
>> UITextColor.r
|
||||||
>> UITextColor.y
|
>> UITextColor.g
|
||||||
>> UITextColor.z;
|
>> UITextColor.b;
|
||||||
UITextColor.x = clamp( UITextColor.x, 0.0f, 255.0f );
|
UITextColor.r = clamp( UITextColor.r, 0.0f, 255.0f );
|
||||||
UITextColor.y = clamp( UITextColor.y, 0.0f, 255.0f );
|
UITextColor.g = clamp( UITextColor.g, 0.0f, 255.0f );
|
||||||
UITextColor.z = clamp( UITextColor.z, 0.0f, 255.0f );
|
UITextColor.b = clamp( UITextColor.b, 0.0f, 255.0f );
|
||||||
UITextColor = UITextColor / 255.0f;
|
UITextColor = UITextColor / 255.0f;
|
||||||
UITextColor.w = 1.0f;
|
UITextColor.a = 1.0f;
|
||||||
}
|
}
|
||||||
else if (token == "pyscreenrendererpriority")
|
else if (token == "pyscreenrendererpriority")
|
||||||
{
|
{
|
||||||
@@ -704,7 +704,9 @@ global_settings::ConfigParse(cParser &Parser) {
|
|||||||
// TBD: remove, or launch depending on passed flag?
|
// TBD: remove, or launch depending on passed flag?
|
||||||
if (qp)
|
if (qp)
|
||||||
{ // to poniżej wykonywane tylko raz, jedynie po wczytaniu eu07.ini*/
|
{ // to poniżej wykonywane tylko raz, jedynie po wczytaniu eu07.ini*/
|
||||||
|
#ifdef _WINDOWS
|
||||||
Console::ModeSet(iFeedbackMode, iFeedbackPort); // tryb pracy konsoli sterowniczej
|
Console::ModeSet(iFeedbackMode, iFeedbackPort); // tryb pracy konsoli sterowniczej
|
||||||
|
#endif
|
||||||
/*iFpsRadiusMax = 0.000025 * fFpsRadiusMax *
|
/*iFpsRadiusMax = 0.000025 * fFpsRadiusMax *
|
||||||
fFpsRadiusMax; // maksymalny promień renderowania 3000.0 -> 225
|
fFpsRadiusMax; // maksymalny promień renderowania 3000.0 -> 225
|
||||||
if (iFpsRadiusMax > 400)
|
if (iFpsRadiusMax > 400)
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ struct global_settings {
|
|||||||
double fFogStart{ 1700 };
|
double fFogStart{ 1700 };
|
||||||
double fFogEnd{ 2000 };
|
double fFogEnd{ 2000 };
|
||||||
std::string Season; // season of the year, based on simulation date
|
std::string Season; // season of the year, based on simulation date
|
||||||
std::string Weather{ "clear" }; // current weather
|
std::string Weather{ "clear:" }; // current weather
|
||||||
bool FullPhysics{ true }; // full calculations performed for each simulation step
|
bool FullPhysics{ true }; // full calculations performed for each simulation step
|
||||||
bool bnewAirCouplers{ true };
|
bool bnewAirCouplers{ true };
|
||||||
double fMoveLight{ -1 }; // numer dnia w roku albo -1
|
double fMoveLight{ -1 }; // numer dnia w roku albo -1
|
||||||
@@ -89,7 +89,7 @@ struct global_settings {
|
|||||||
// ui
|
// ui
|
||||||
int iTextMode{ 0 }; // tryb pracy wyświetlacza tekstowego
|
int iTextMode{ 0 }; // tryb pracy wyświetlacza tekstowego
|
||||||
int iScreenMode[ 12 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // numer ekranu wyświetlacza tekstowego
|
int iScreenMode[ 12 ] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; // numer ekranu wyświetlacza tekstowego
|
||||||
float4 UITextColor{ float4( 225.f / 255.f, 225.f / 255.f, 225.f / 255.f, 1.f ) }; // base color of UI text
|
glm::vec4 UITextColor { glm::vec4( 225.f / 255.f, 225.f / 255.f, 225.f / 255.f, 1.f ) }; // base color of UI text
|
||||||
std::string asLang{ "pl" }; // domyślny język - http://tools.ietf.org/html/bcp47
|
std::string asLang{ "pl" }; // domyślny język - http://tools.ietf.org/html/bcp47
|
||||||
// gfx
|
// gfx
|
||||||
int iWindowWidth{ 800 };
|
int iWindowWidth{ 800 };
|
||||||
@@ -182,7 +182,7 @@ struct global_settings {
|
|||||||
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
int iMultiplayer{ 0 }; // blokada działania niektórych eventów na rzecz kominikacji
|
||||||
// other
|
// other
|
||||||
std::string AppName{ "EU07" };
|
std::string AppName{ "EU07" };
|
||||||
std::string asVersion{ "couldn't retrieve version string" }; // z opisem
|
std::string asVersion{ "UNKNOWN" }; // z opisem
|
||||||
|
|
||||||
// methods
|
// methods
|
||||||
void LoadIniFile( std::string asFileName );
|
void LoadIniFile( std::string asFileName );
|
||||||
|
|||||||
8
Logs.h
8
Logs.h
@@ -13,10 +13,10 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
|
|
||||||
enum logtype : unsigned int {
|
enum logtype : unsigned int {
|
||||||
|
|
||||||
generic = 0x1,
|
generic = ( 1 << 0 ),
|
||||||
file = 0x2,
|
file = ( 1 << 1 ),
|
||||||
model = 0x4,
|
model = ( 1 << 2 ),
|
||||||
texture = 0x8
|
texture = ( 1 << 3 )
|
||||||
};
|
};
|
||||||
|
|
||||||
void WriteLog( const char *str, logtype const Type = logtype::generic );
|
void WriteLog( const char *str, logtype const Type = logtype::generic );
|
||||||
|
|||||||
@@ -6108,52 +6108,55 @@ bool TMoverParameters::ChangeOffsetH(double DeltaOffset)
|
|||||||
// *************************************************************************************************
|
// *************************************************************************************************
|
||||||
std::string TMoverParameters::EngineDescription(int what)
|
std::string TMoverParameters::EngineDescription(int what)
|
||||||
{
|
{
|
||||||
std::string outstr;
|
std::string outstr { "OK" };
|
||||||
|
switch (what) {
|
||||||
outstr = "";
|
case 0: {
|
||||||
switch (what)
|
if( DamageFlag == 255 ) {
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
if (DamageFlag == 255)
|
|
||||||
outstr = "WRECKED";
|
outstr = "WRECKED";
|
||||||
else
|
}
|
||||||
{
|
else {
|
||||||
if (TestFlag(DamageFlag, dtrain_thinwheel))
|
if( TestFlag( DamageFlag, dtrain_thinwheel ) ) {
|
||||||
if (Power > 0.1)
|
if( Power > 0.1 )
|
||||||
outstr = "Thin wheel";
|
outstr = "Thin wheel";
|
||||||
else
|
else
|
||||||
outstr = "Load shifted";
|
outstr = "Load shifted";
|
||||||
if (TestFlag(DamageFlag, dtrain_wheelwear))
|
}
|
||||||
|
if( ( WheelFlat > 5.0 )
|
||||||
|
|| ( TestFlag( DamageFlag, dtrain_wheelwear ) ) ) {
|
||||||
outstr = "Wheel wear";
|
outstr = "Wheel wear";
|
||||||
if (TestFlag(DamageFlag, dtrain_bearing))
|
}
|
||||||
|
if( TestFlag( DamageFlag, dtrain_bearing ) ) {
|
||||||
outstr = "Bearing damaged";
|
outstr = "Bearing damaged";
|
||||||
if (TestFlag(DamageFlag, dtrain_coupling))
|
}
|
||||||
|
if( TestFlag( DamageFlag, dtrain_coupling ) ) {
|
||||||
outstr = "Coupler broken";
|
outstr = "Coupler broken";
|
||||||
if (TestFlag(DamageFlag, dtrain_loaddamage))
|
}
|
||||||
if (Power > 0.1)
|
if( TestFlag( DamageFlag, dtrain_loaddamage ) ) {
|
||||||
|
if( Power > 0.1 )
|
||||||
outstr = "Ventilator damaged";
|
outstr = "Ventilator damaged";
|
||||||
else
|
else
|
||||||
outstr = "Load damaged";
|
outstr = "Load damaged";
|
||||||
|
}
|
||||||
if (TestFlag(DamageFlag, dtrain_loaddestroyed))
|
if( TestFlag( DamageFlag, dtrain_loaddestroyed ) ) {
|
||||||
if (Power > 0.1)
|
if( Power > 0.1 )
|
||||||
outstr = "Engine damaged";
|
outstr = "Engine damaged";
|
||||||
else
|
else
|
||||||
outstr = "LOAD DESTROYED";
|
outstr = "LOAD DESTROYED";
|
||||||
if (TestFlag(DamageFlag, dtrain_axle))
|
}
|
||||||
|
if( TestFlag( DamageFlag, dtrain_axle ) ) {
|
||||||
outstr = "Axle broken";
|
outstr = "Axle broken";
|
||||||
if (TestFlag(DamageFlag, dtrain_out))
|
}
|
||||||
|
if( TestFlag( DamageFlag, dtrain_out ) ) {
|
||||||
outstr = "DERAILED";
|
outstr = "DERAILED";
|
||||||
if (outstr == "")
|
}
|
||||||
outstr = "OK";
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default: {
|
||||||
outstr = "Invalid qualifier";
|
outstr = "Invalid qualifier";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return outstr;
|
return outstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -513,7 +513,7 @@ class TDriverHandle {
|
|||||||
virtual double GetPos(int i);
|
virtual double GetPos(int i);
|
||||||
virtual double GetEP(double pos);
|
virtual double GetEP(double pos);
|
||||||
|
|
||||||
inline TDriverHandle() { ::SecureZeroMemory( Sounds, sizeof( Sounds ) ); }
|
inline TDriverHandle() { memset( Sounds, 0, sizeof( Sounds ) ); }
|
||||||
};
|
};
|
||||||
|
|
||||||
class TFV4a : public TDriverHandle {
|
class TFV4a : public TDriverHandle {
|
||||||
|
|||||||
@@ -4772,7 +4772,7 @@ bool TTrain::LoadMMediaFile(std::string const &asFileName)
|
|||||||
}
|
}
|
||||||
else if( token == "runningnoise:" ) {
|
else if( token == "runningnoise:" ) {
|
||||||
// szum podczas jazdy:
|
// szum podczas jazdy:
|
||||||
rsRunningNoise.deserialize( parser, sound_type::single, sound_parameters::amplitude | sound_parameters::frequency );
|
rsRunningNoise.deserialize( parser, sound_type::single, sound_parameters::amplitude | sound_parameters::frequency, mvOccupied->Vmax );
|
||||||
rsRunningNoise.owner( DynamicObject );
|
rsRunningNoise.owner( DynamicObject );
|
||||||
|
|
||||||
rsRunningNoise.m_amplitudefactor /= ( 1 + mvOccupied->Vmax );
|
rsRunningNoise.m_amplitudefactor /= ( 1 + mvOccupied->Vmax );
|
||||||
|
|||||||
@@ -1262,7 +1262,7 @@ TWorld::Update_UI() {
|
|||||||
( ( owner->iStationStart < table->StationIndex )
|
( ( owner->iStationStart < table->StationIndex )
|
||||||
&& ( i < table->StationIndex )
|
&& ( i < table->StationIndex )
|
||||||
&& ( ( time.wHour * 60 + time.wMinute ) >= ( tableline->Dh * 60 + tableline->Dm ) ) ?
|
&& ( ( time.wHour * 60 + time.wMinute ) >= ( tableline->Dh * 60 + tableline->Dm ) ) ?
|
||||||
float4( 0.0f, 1.0f, 0.0f, 1.0f ) :// czas minął i odjazd był, to nazwa stacji będzie na zielono
|
glm::vec4( 0.0f, 1.0f, 0.0f, 1.0f ) :// czas minął i odjazd był, to nazwa stacji będzie na zielono
|
||||||
Global.UITextColor ) );
|
Global.UITextColor ) );
|
||||||
// divider/footer
|
// divider/footer
|
||||||
UITable->text_lines.emplace_back( "+----------------------------+-------+-------+-----+", Global.UITextColor );
|
UITable->text_lines.emplace_back( "+----------------------------+-------+-------+-----+", Global.UITextColor );
|
||||||
@@ -1556,7 +1556,7 @@ TWorld::Update_UI() {
|
|||||||
+ ", PM=" + to_string( vehicle->MoverParameters->WheelFlat, 1 )
|
+ ", PM=" + to_string( vehicle->MoverParameters->WheelFlat, 1 )
|
||||||
+ " mm; enrot=" + to_string( vehicle->MoverParameters->enrot * 60, 0 )
|
+ " mm; enrot=" + to_string( vehicle->MoverParameters->enrot * 60, 0 )
|
||||||
+ " tmrot=" + to_string( std::abs( vehicle->MoverParameters->nrot ) * vehicle->MoverParameters->Transmision.Ratio * 60, 0 )
|
+ " tmrot=" + to_string( std::abs( vehicle->MoverParameters->nrot ) * vehicle->MoverParameters->Transmision.Ratio * 60, 0 )
|
||||||
+ "; ventrot=" + to_string( vehicle->MoverParameters->RventRot, 1 );
|
+ "; ventrot=" + to_string( vehicle->MoverParameters->RventRot * 60, 1 );
|
||||||
|
|
||||||
uitextline2 =
|
uitextline2 =
|
||||||
"HamZ=" + to_string( vehicle->MoverParameters->fBrakeCtrlPos, 2 )
|
"HamZ=" + to_string( vehicle->MoverParameters->fBrakeCtrlPos, 2 )
|
||||||
@@ -1746,7 +1746,7 @@ TWorld::Update_UI() {
|
|||||||
while( true == parser.getTokens( 1, false, "|" ) ) {
|
while( true == parser.getTokens( 1, false, "|" ) ) {
|
||||||
|
|
||||||
std::string transcriptline; parser >> transcriptline;
|
std::string transcriptline; parser >> transcriptline;
|
||||||
transcripts.emplace_back( transcriptline, float4( 1.0f, 1.0f, 0.0f, 1.0f ) );
|
transcripts.emplace_back( transcriptline, glm::vec4( 1.0f, 1.0f, 0.0f, 1.0f ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
83
material.cpp
83
material.cpp
@@ -14,6 +14,14 @@ http://mozilla.org/MPL/2.0/.
|
|||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
|
||||||
|
// helper, returns potential path part from provided file name
|
||||||
|
std::string path( std::string const &Filename ) {
|
||||||
|
return (
|
||||||
|
Filename.rfind( '\\' ) != std::string::npos ?
|
||||||
|
Filename.substr( 0, Filename.rfind( '\\' ) + 1 ) :
|
||||||
|
"" );
|
||||||
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
opengl_material::deserialize( cParser &Input, bool const Loadnow ) {
|
opengl_material::deserialize( cParser &Input, bool const Loadnow ) {
|
||||||
|
|
||||||
@@ -33,51 +41,58 @@ opengl_material::deserialize( cParser &Input, bool const Loadnow ) {
|
|||||||
// imports member data pair from the config file
|
// imports member data pair from the config file
|
||||||
bool
|
bool
|
||||||
opengl_material::deserialize_mapping( cParser &Input, int const Priority, bool const Loadnow ) {
|
opengl_material::deserialize_mapping( cParser &Input, int const Priority, bool const Loadnow ) {
|
||||||
|
// token can be a key or block end
|
||||||
|
std::string const key { Input.getToken<std::string>( true, "\n\r\t ,;[]" ) };
|
||||||
|
|
||||||
if( false == Input.getTokens( 2, true, "\n\r\t;, " ) ) {
|
if( ( true == key.empty() ) || ( key == "}" ) ) { return false; }
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string path;
|
auto const value { Input.getToken<std::string>( true, "\n\r\t ,;" ) };
|
||||||
if( name.rfind( '\\' ) != std::string::npos ) {
|
|
||||||
path = name.substr( 0, name.rfind( '\\' ) + 1 );
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string key, value;
|
if( Priority != -1 ) {
|
||||||
Input
|
// regular attribute processing mode
|
||||||
>> key
|
if( key == Global.Weather ) {
|
||||||
>> value;
|
// weather textures override generic (pri 0) and seasonal (pri 1) textures
|
||||||
|
// seasonal weather textures (pri 1+2=3) override generic weather (pri 2) textures
|
||||||
if( value == "{" ) {
|
while( true == deserialize_mapping( Input, Priority + 2, Loadnow ) ) {
|
||||||
// detect and optionally process config blocks
|
; // all work is done in the header
|
||||||
cParser blockparser( Input.getToken<std::string>( false, "}" ) );
|
}
|
||||||
if( key == Global.Season ) {
|
}
|
||||||
|
else if( key == Global.Season ) {
|
||||||
// seasonal textures override generic textures
|
// seasonal textures override generic textures
|
||||||
while( true == deserialize_mapping( blockparser, 1, Loadnow ) ) {
|
while( true == deserialize_mapping( Input, 1, Loadnow ) ) {
|
||||||
; // all work is done in the header
|
; // all work is done in the header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( key == Global.Weather ) {
|
else if( key == "texture1:" ) {
|
||||||
// weather textures override generic and seasonal textures
|
if( ( texture1 == null_handle )
|
||||||
while( true == deserialize_mapping( blockparser, 2, Loadnow ) ) {
|
|| ( Priority > priority1 ) ) {
|
||||||
|
texture1 = GfxRenderer.Fetch_Texture( path( name ) + value, Loadnow );
|
||||||
|
priority1 = Priority;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( key == "texture2:" ) {
|
||||||
|
if( ( texture2 == null_handle )
|
||||||
|
|| ( Priority > priority2 ) ) {
|
||||||
|
texture2 = GfxRenderer.Fetch_Texture( path( name ) + value, Loadnow );
|
||||||
|
priority2 = Priority;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if( value == "{" ) {
|
||||||
|
// unrecognized or ignored token, but comes with attribute block and potential further nesting
|
||||||
|
// go through it and discard the content
|
||||||
|
while( true == deserialize_mapping( Input, -1, Loadnow ) ) {
|
||||||
; // all work is done in the header
|
; // all work is done in the header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( key == "texture1:" ) {
|
else {
|
||||||
// TODO: full-fledged priority system
|
// discard mode; ignores all retrieved tokens
|
||||||
if( ( texture1 == null_handle )
|
if( value == "{" ) {
|
||||||
|| ( Priority > priority1 ) ) {
|
// ignored tokens can come with their own blocks, ignore these recursively
|
||||||
texture1 = GfxRenderer.Fetch_Texture( path + value, Loadnow );
|
// go through it and discard the content
|
||||||
priority1 = Priority;
|
while( true == deserialize_mapping( Input, -1, Loadnow ) ) {
|
||||||
}
|
; // all work is done in the header
|
||||||
}
|
}
|
||||||
else if( key == "texture2:" ) {
|
|
||||||
// TODO: full-fledged priority system
|
|
||||||
if( ( texture2 == null_handle )
|
|
||||||
|| ( Priority > priority2 ) ) {
|
|
||||||
texture2 = GfxRenderer.Fetch_Texture( path + value, Loadnow );
|
|
||||||
priority2 = Priority;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ sound_source::deserialize( std::string const &Input, sound_type const Legacytype
|
|||||||
}
|
}
|
||||||
|
|
||||||
sound_source &
|
sound_source &
|
||||||
sound_source::deserialize( cParser &Input, sound_type const Legacytype, int const Legacyparameters ) {
|
sound_source::deserialize( cParser &Input, sound_type const Legacytype, int const Legacyparameters, int const Chunkrange ) {
|
||||||
|
|
||||||
// cache parser config, as it may change during deserialization
|
// cache parser config, as it may change during deserialization
|
||||||
auto const inputautoclear { Input.autoclear() };
|
auto const inputautoclear { Input.autoclear() };
|
||||||
@@ -80,7 +80,7 @@ sound_source::deserialize( cParser &Input, sound_type const Legacytype, int cons
|
|||||||
m_crossfaderange * 0.01f );
|
m_crossfaderange * 0.01f );
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
m_soundchunks.back().second.fadeout = std::max( 100, m_soundchunks.back().second.threshold );
|
m_soundchunks.back().second.fadeout = std::max( Chunkrange, m_soundchunks.back().second.threshold );
|
||||||
// m_soundchunks.back().second.fadeout = m_soundchunks.back().second.threshold;
|
// m_soundchunks.back().second.fadeout = m_soundchunks.back().second.threshold;
|
||||||
// test if the chunk table contains any actual samples while at it
|
// test if the chunk table contains any actual samples while at it
|
||||||
for( auto &soundchunk : m_soundchunks ) {
|
for( auto &soundchunk : m_soundchunks ) {
|
||||||
|
|||||||
2
sound.h
2
sound.h
@@ -56,7 +56,7 @@ public:
|
|||||||
// methods
|
// methods
|
||||||
// restores state of the class from provided data stream
|
// restores state of the class from provided data stream
|
||||||
sound_source &
|
sound_source &
|
||||||
deserialize( cParser &Input, sound_type const Legacytype, int const Legacyparameters = 0 );
|
deserialize( cParser &Input, sound_type const Legacytype, int const Legacyparameters = 0, int const Chunkrange = 100 );
|
||||||
sound_source &
|
sound_source &
|
||||||
deserialize( std::string const &Input, sound_type const Legacytype, int const Legacyparameters = 0 );
|
deserialize( std::string const &Input, sound_type const Legacytype, int const Legacyparameters = 0 );
|
||||||
// copies list of sounds from provided source
|
// copies list of sounds from provided source
|
||||||
|
|||||||
24
uilayer.cpp
24
uilayer.cpp
@@ -126,18 +126,18 @@ ui_layer::render_progress() {
|
|||||||
size = glm::vec2{ 320.0f, 16.0f };
|
size = glm::vec2{ 320.0f, 16.0f };
|
||||||
}
|
}
|
||||||
|
|
||||||
quad( float4( origin.x, origin.y, origin.x + size.x, origin.y + size.y ), float4(0.0f, 0.0f, 0.0f, 0.25f) );
|
quad( glm::vec4( origin.x, origin.y, origin.x + size.x, origin.y + size.y ), glm::vec4(0.0f, 0.0f, 0.0f, 0.25f) );
|
||||||
// secondary bar
|
// secondary bar
|
||||||
if( m_subtaskprogress ) {
|
if( m_subtaskprogress ) {
|
||||||
quad(
|
quad(
|
||||||
float4( origin.x, origin.y, origin.x + size.x * m_subtaskprogress, origin.y + size.y),
|
glm::vec4( origin.x, origin.y, origin.x + size.x * m_subtaskprogress, origin.y + size.y),
|
||||||
float4( 8.0f/255.0f, 160.0f/255.0f, 8.0f/255.0f, 0.35f ) );
|
glm::vec4( 8.0f/255.0f, 160.0f/255.0f, 8.0f/255.0f, 0.35f ) );
|
||||||
}
|
}
|
||||||
// primary bar
|
// primary bar
|
||||||
if( m_progress ) {
|
if( m_progress ) {
|
||||||
quad(
|
quad(
|
||||||
float4( origin.x, origin.y, origin.x + size.x * m_progress, origin.y + size.y ),
|
glm::vec4( origin.x, origin.y, origin.x + size.x * m_progress, origin.y + size.y ),
|
||||||
float4( 8.0f / 255.0f, 160.0f / 255.0f, 8.0f / 255.0f, 1.0f ) );
|
glm::vec4( 8.0f / 255.0f, 160.0f / 255.0f, 8.0f / 255.0f, 1.0f ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( false == m_progresstext.empty() ) {
|
if( false == m_progresstext.empty() ) {
|
||||||
@@ -224,12 +224,12 @@ ui_layer::render_background() {
|
|||||||
1024.0f : // legacy mode, square texture displayed as 4:3 image
|
1024.0f : // legacy mode, square texture displayed as 4:3 image
|
||||||
texture.width() / ( texture.height() / 768.0f ) );
|
texture.width() / ( texture.height() / 768.0f ) );
|
||||||
quad(
|
quad(
|
||||||
float4(
|
glm::vec4(
|
||||||
( 1024.0f * 0.5f ) - ( width * 0.5f ),
|
( 1024.0f * 0.5f ) - ( width * 0.5f ),
|
||||||
( 768.0f * 0.5f ) - ( height * 0.5f ),
|
( 768.0f * 0.5f ) - ( height * 0.5f ),
|
||||||
( 1024.0f * 0.5f ) - ( width * 0.5f ) + width,
|
( 1024.0f * 0.5f ) - ( width * 0.5f ) + width,
|
||||||
( 768.0f * 0.5f ) - ( height * 0.5f ) + height ),
|
( 768.0f * 0.5f ) - ( height * 0.5f ) + height ),
|
||||||
float4( 1.0f, 1.0f, 1.0f, 1.0f ) );
|
colors::white );
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -276,7 +276,7 @@ ui_layer::print( std::string const &Text )
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ui_layer::quad( float4 const &Coordinates, float4 const &Color ) {
|
ui_layer::quad( glm::vec4 const &Coordinates, glm::vec4 const &Color ) {
|
||||||
|
|
||||||
float const screenratio = static_cast<float>( Global.iWindowWidth ) / Global.iWindowHeight;
|
float const screenratio = static_cast<float>( Global.iWindowWidth ) / Global.iWindowHeight;
|
||||||
float const width =
|
float const width =
|
||||||
@@ -288,12 +288,8 @@ ui_layer::quad( float4 const &Coordinates, float4 const &Color ) {
|
|||||||
Global.iWindowHeight / 768.f :
|
Global.iWindowHeight / 768.f :
|
||||||
Global.iWindowHeight / 768.f * screenratio / ( 4.f / 3.f ) );
|
Global.iWindowHeight / 768.f * screenratio / ( 4.f / 3.f ) );
|
||||||
float const height = 768.f * heightratio;
|
float const height = 768.f * heightratio;
|
||||||
/*
|
|
||||||
float const heightratio = Global.iWindowHeight / 768.0f;
|
glColor4fv(glm::value_ptr(Color));
|
||||||
float const height = 768.0f * heightratio;
|
|
||||||
float const width = Global.iWindowWidth * heightratio;
|
|
||||||
*/
|
|
||||||
glColor4fv(&Color.x);
|
|
||||||
|
|
||||||
glBegin( GL_TRIANGLE_STRIP );
|
glBegin( GL_TRIANGLE_STRIP );
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "texture.h"
|
#include "texture.h"
|
||||||
#include "float3d.h"
|
|
||||||
|
|
||||||
// GuiLayer -- basic user interface class. draws requested information on top of openGL screen
|
// GuiLayer -- basic user interface class. draws requested information on top of openGL screen
|
||||||
|
|
||||||
@@ -11,10 +10,10 @@ struct ui_panel {
|
|||||||
|
|
||||||
struct text_line {
|
struct text_line {
|
||||||
|
|
||||||
float4 color;
|
glm::vec4 color;
|
||||||
std::string data;
|
std::string data;
|
||||||
|
|
||||||
text_line( std::string const &Data, float4 const &Color):
|
text_line( std::string const &Data, glm::vec4 const &Color):
|
||||||
data(Data), color(Color)
|
data(Data), color(Color)
|
||||||
{}
|
{}
|
||||||
};
|
};
|
||||||
@@ -84,7 +83,7 @@ private:
|
|||||||
print( std::string const &Text );
|
print( std::string const &Text );
|
||||||
// draws a quad between coordinates x,y and z,w with uv-coordinates spanning 0-1
|
// draws a quad between coordinates x,y and z,w with uv-coordinates spanning 0-1
|
||||||
void
|
void
|
||||||
quad( float4 const &Coordinates, float4 const &Color );
|
quad( glm::vec4 const &Coordinates, glm::vec4 const &Color );
|
||||||
|
|
||||||
|
|
||||||
// members:
|
// members:
|
||||||
|
|||||||
Reference in New Issue
Block a user