mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-03-22 15:05:03 +01:00
change screenshot key, configurable location
This commit is contained in:
4
EU07.cpp
4
EU07.cpp
@@ -90,7 +90,7 @@ void screenshot_save_thread( char *img )
|
|||||||
perf = ts.tv_nsec;
|
perf = ts.tv_nsec;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
std::string filename = "screenshots/" + std::string(datetime) +
|
std::string filename = Global::screenshot_dir + "/" + std::string(datetime) +
|
||||||
"_" + std::to_string(perf) + ".png";
|
"_" + std::to_string(perf) + ".png";
|
||||||
|
|
||||||
if (png_image_write_to_file(&png, filename.c_str(), 0, img, -Global::iWindowWidth * 3, nullptr) == 1)
|
if (png_image_write_to_file(&png, filename.c_str(), 0, img, -Global::iWindowWidth * 3, nullptr) == 1)
|
||||||
@@ -186,7 +186,7 @@ void key_callback( GLFWwindow *window, int key, int scancode, int action, int mo
|
|||||||
|
|
||||||
switch( key )
|
switch( key )
|
||||||
{
|
{
|
||||||
case GLFW_KEY_F11: {
|
case GLFW_KEY_PRINT_SCREEN: {
|
||||||
make_screenshot();
|
make_screenshot();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -178,6 +178,8 @@ Global::soundmode_t Global::soundpitchmode = Global::linear;
|
|||||||
Global::soundmode_t Global::soundgainmode = Global::linear;
|
Global::soundmode_t Global::soundgainmode = Global::linear;
|
||||||
Global::soundstopmode_t Global::soundstopmode = Global::queue;
|
Global::soundstopmode_t Global::soundstopmode = Global::queue;
|
||||||
|
|
||||||
|
std::string Global::screenshot_dir = "screenshots";
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@@ -808,6 +810,11 @@ void Global::ConfigParse(cParser &Parser)
|
|||||||
Parser >> Global::motiontelemetry_conf.latposbased;
|
Parser >> Global::motiontelemetry_conf.latposbased;
|
||||||
Parser >> Global::motiontelemetry_conf.axlebumpscale;
|
Parser >> Global::motiontelemetry_conf.axlebumpscale;
|
||||||
}
|
}
|
||||||
|
else if (token == "screenshotsdir")
|
||||||
|
{
|
||||||
|
Parser.getTokens(1);
|
||||||
|
Parser >> Global::screenshot_dir;
|
||||||
|
}
|
||||||
} while ((token != "") && (token != "endconfig")); //(!Parser->EndOfFile)
|
} while ((token != "") && (token != "endconfig")); //(!Parser->EndOfFile)
|
||||||
// na koniec trochę zależności
|
// na koniec trochę zależności
|
||||||
if (!bLoadTraction) // wczytywanie drutów i słupów
|
if (!bLoadTraction) // wczytywanie drutów i słupów
|
||||||
|
|||||||
@@ -321,6 +321,8 @@ public:
|
|||||||
|
|
||||||
static opengl_light DayLight;
|
static opengl_light DayLight;
|
||||||
|
|
||||||
|
static std::string screenshot_dir;
|
||||||
|
|
||||||
enum soundmode_t
|
enum soundmode_t
|
||||||
{
|
{
|
||||||
linear,
|
linear,
|
||||||
|
|||||||
19
windows.cpp
19
windows.cpp
@@ -68,23 +68,26 @@ LRESULT APIENTRY WndProc( HWND hWnd, // handle for this window
|
|||||||
}
|
}
|
||||||
case WM_KEYDOWN:
|
case WM_KEYDOWN:
|
||||||
case WM_KEYUP: {
|
case WM_KEYUP: {
|
||||||
if (wParam == VK_INSERT || wParam == VK_DELETE || wParam == VK_HOME || wParam == VK_END || wParam == VK_PRIOR || wParam == VK_NEXT)
|
if (wParam == VK_INSERT || wParam == VK_DELETE || wParam == VK_HOME || wParam == VK_END ||
|
||||||
|
wParam == VK_PRIOR || wParam == VK_NEXT || wParam == VK_SNAPSHOT)
|
||||||
lParam &= ~0x1ff0000;
|
lParam &= ~0x1ff0000;
|
||||||
if (wParam == VK_INSERT)
|
if (wParam == VK_INSERT)
|
||||||
lParam |= 0x152 << 16;
|
lParam |= 0x152 << 16;
|
||||||
if (wParam == VK_DELETE)
|
else if (wParam == VK_DELETE)
|
||||||
lParam |= 0x153 << 16;
|
lParam |= 0x153 << 16;
|
||||||
if (wParam == VK_HOME)
|
else if (wParam == VK_HOME)
|
||||||
lParam |= 0x147 << 16;
|
lParam |= 0x147 << 16;
|
||||||
if (wParam == VK_END)
|
else if (wParam == VK_END)
|
||||||
lParam |= 0x14F << 16;
|
lParam |= 0x14F << 16;
|
||||||
if (wParam == VK_PRIOR)
|
else if (wParam == VK_PRIOR)
|
||||||
lParam |= 0x149 << 16;
|
lParam |= 0x149 << 16;
|
||||||
if (wParam == VK_NEXT)
|
else if (wParam == VK_NEXT)
|
||||||
lParam |= 0x151 << 16;
|
lParam |= 0x151 << 16;
|
||||||
|
else if (wParam == VK_SNAPSHOT)
|
||||||
|
lParam |= 0x137 << 16;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// pass all unhandled messages to DefWindowProc
|
// pass all messages to DefWindowProc
|
||||||
return CallWindowProc( BaseWindowProc, Hwnd, uMsg, wParam, lParam );
|
return CallWindowProc( BaseWindowProc, Hwnd, uMsg, wParam, lParam );
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user