mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-20 03:19:19 +02:00
continued refactoring: traction, events, event launchers, sounds; additional diagnostics timers, minor performance enhancements and bug fixes
This commit is contained in:
40
EvLaunch.cpp
40
EvLaunch.cpp
@@ -17,36 +17,14 @@ http://mozilla.org/MPL/2.0/.
|
||||
#include "EvLaunch.h"
|
||||
#include "Globals.h"
|
||||
#include "Logs.h"
|
||||
#include "Usefull.h"
|
||||
#include "McZapkie/mctools.h"
|
||||
#include "Event.h"
|
||||
#include "MemCell.h"
|
||||
#include "mtable.h"
|
||||
#include "Timer.h"
|
||||
#include "parser.h"
|
||||
#include "Console.h"
|
||||
|
||||
using namespace Mtable;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
TEventLauncher::TEventLauncher()
|
||||
{ // ustawienie początkowych wartości dla wszystkich zmiennych
|
||||
iKey = 0;
|
||||
DeltaTime = -1;
|
||||
UpdatedTime = 0;
|
||||
fVal1 = fVal2 = 0;
|
||||
iHour = iMinute = -1; // takiego czasu nigdy nie będzie
|
||||
dRadius = 0;
|
||||
Event1 = Event2 = NULL;
|
||||
MemCell = NULL;
|
||||
iCheckMask = 0;
|
||||
}
|
||||
|
||||
void TEventLauncher::Init()
|
||||
{
|
||||
}
|
||||
|
||||
// encodes expected key in a short, where low byte represents the actual key,
|
||||
// and the high byte holds modifiers: 0x1 = shift, 0x2 = ctrl, 0x4 = alt
|
||||
int vk_to_glfw_key( int const Keycode ) {
|
||||
@@ -145,7 +123,7 @@ bool TEventLauncher::Load(cParser *parser)
|
||||
return true;
|
||||
};
|
||||
|
||||
bool TEventLauncher::Render()
|
||||
bool TEventLauncher::check_conditions()
|
||||
{ //"renderowanie" wyzwalacza
|
||||
bool bCond = false;
|
||||
if (iKey != 0)
|
||||
@@ -199,13 +177,13 @@ bool TEventLauncher::Render()
|
||||
return bCond; // sprawdzanie dRadius w Ground.cpp
|
||||
}
|
||||
|
||||
bool TEventLauncher::IsGlobal()
|
||||
{ // sprawdzenie, czy jest globalnym wyzwalaczem czasu
|
||||
if (DeltaTime == 0)
|
||||
if (iHour >= 0)
|
||||
if (iMinute >= 0)
|
||||
if (dRadius < 0.0) // bez ograniczenia zasięgu
|
||||
return true;
|
||||
return false;
|
||||
// sprawdzenie, czy jest globalnym wyzwalaczem czasu
|
||||
bool TEventLauncher::IsGlobal() const {
|
||||
|
||||
return ( ( DeltaTime == 0 )
|
||||
&& ( iHour >= 0 )
|
||||
&& ( iMinute >= 0 )
|
||||
&& ( dRadius < 0.0 ) ); // bez ograniczenia zasięgu
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user