mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
Merge branch 'gfx-work' into sim
This commit is contained in:
34
EvLaunch.cpp
34
EvLaunch.cpp
@@ -59,12 +59,25 @@ bool TEventLauncher::Load(cParser *parser)
|
||||
dRadius *= dRadius; // do kwadratu, pod warunkiem, że nie jest ujemne
|
||||
parser->getTokens(); // klawisz sterujący
|
||||
*parser >> token;
|
||||
if (token != "none")
|
||||
{
|
||||
if( token.size() == 1 )
|
||||
if (token != "none") {
|
||||
|
||||
if( token.size() == 1 ) {
|
||||
// single char, assigned activation key
|
||||
iKey = vk_to_glfw_key( token[ 0 ] );
|
||||
else
|
||||
iKey = vk_to_glfw_key(stol_def( token, 0 )); // a jak więcej, to jakby numer klawisza jest
|
||||
}
|
||||
else {
|
||||
// this launcher may be activated by radio message
|
||||
std::map<std::string, int> messages {
|
||||
{ "radio_call1", radio_message::call1 },
|
||||
{ "radio_call3", radio_message::call3 }
|
||||
};
|
||||
auto lookup = messages.find( token );
|
||||
iKey = (
|
||||
lookup != messages.end() ?
|
||||
lookup->second :
|
||||
// a jak więcej, to jakby numer klawisza jest
|
||||
vk_to_glfw_key( stol_def( token, 0 ) ) );
|
||||
}
|
||||
}
|
||||
parser->getTokens();
|
||||
*parser >> DeltaTime;
|
||||
@@ -139,6 +152,8 @@ bool TEventLauncher::Load(cParser *parser)
|
||||
}
|
||||
|
||||
bool TEventLauncher::check_activation_key() {
|
||||
if (iKey <= 0)
|
||||
return false;
|
||||
|
||||
char key = iKey & 0xff;
|
||||
|
||||
@@ -146,9 +161,9 @@ bool TEventLauncher::check_activation_key() {
|
||||
|
||||
char modifier = iKey >> 8;
|
||||
if (modifier & GLFW_MOD_SHIFT)
|
||||
result |= Global.shiftState;
|
||||
result &= Global.shiftState;
|
||||
if (modifier & GLFW_MOD_CONTROL)
|
||||
result |= Global.ctrlState;
|
||||
result &= Global.ctrlState;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -213,6 +228,11 @@ bool TEventLauncher::IsGlobal() const {
|
||||
&& ( dRadius < 0.0 ) ); // bez ograniczenia zasięgu
|
||||
}
|
||||
|
||||
bool TEventLauncher::IsRadioActivated() const {
|
||||
|
||||
return ( iKey < 0 );
|
||||
}
|
||||
|
||||
// radius() subclass details, calculates node's bounding radius
|
||||
float
|
||||
TEventLauncher::radius_() {
|
||||
|
||||
Reference in New Issue
Block a user