mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 07:29:20 +02:00
The template-header propagation only walked files with a module declaration, so EU07.cpp, windows.cpp, export_e3d_standalone.cpp and every betterRenderer source were outside it - including the file with main(). They reach cParser and friends through eu07.simcore and instantiate their templates without the headers those bodies name. Adds audit_modules.py, which checks the whole tree for the seven classes this migration hit; all seven are clean now.
69 lines
2.0 KiB
C++
69 lines
2.0 KiB
C++
#include "utilities/utilities_macros.h"
|
|
#include <array>
|
|
#include <chrono>
|
|
#include <cstddef>
|
|
#include <deque>
|
|
#include <limits>
|
|
#include <mutex>
|
|
#include <ostream>
|
|
#include <sstream>
|
|
#include <string>
|
|
#include <type_traits>
|
|
#include <unordered_map>
|
|
#include <utility>
|
|
#include <vector>
|
|
import eu07.input.messaging;
|
|
import eu07.utilities.utilities;
|
|
|
|
#pragma warning (disable: 4091)
|
|
|
|
extern "C"
|
|
{
|
|
__declspec(dllexport) DWORD NvOptimusEnablement = 0x00000001;
|
|
__declspec(dllexport) DWORD AmdPowerXpressRequestHighPerformance = 0x00000001;
|
|
}
|
|
|
|
HWND Hwnd;
|
|
WNDPROC BaseWindowProc;
|
|
PCOPYDATASTRUCT pDane;
|
|
|
|
LRESULT APIENTRY WndProc( HWND hWnd, // handle for this window
|
|
UINT uMsg, // message for this window
|
|
WPARAM wParam, // additional message information
|
|
LPARAM lParam) // additional message information
|
|
{
|
|
switch( uMsg ) // check for windows messages
|
|
{
|
|
case WM_COPYDATA: {
|
|
// obsługa danych przesłanych przez program sterujący
|
|
pDane = (PCOPYDATASTRUCT)lParam;
|
|
if( pDane->dwData == MAKE_ID4('E', 'U', '0', '7')) // sygnatura danych
|
|
multiplayer::OnCommandGet( ( multiplayer::DaneRozkaz *)( pDane->lpData ) );
|
|
break;
|
|
}
|
|
case WM_KEYDOWN:
|
|
case WM_KEYUP: {
|
|
if (wParam == VK_INSERT || wParam == VK_DELETE || wParam == VK_HOME || wParam == VK_END ||
|
|
wParam == VK_PRIOR || wParam == VK_NEXT || wParam == VK_SNAPSHOT)
|
|
lParam &= ~0x1ff0000;
|
|
if (wParam == VK_INSERT)
|
|
lParam |= 0x152 << 16;
|
|
else if (wParam == VK_DELETE)
|
|
lParam |= 0x153 << 16;
|
|
else if (wParam == VK_HOME)
|
|
lParam |= 0x147 << 16;
|
|
else if (wParam == VK_END)
|
|
lParam |= 0x14F << 16;
|
|
else if (wParam == VK_PRIOR)
|
|
lParam |= 0x149 << 16;
|
|
else if (wParam == VK_NEXT)
|
|
lParam |= 0x151 << 16;
|
|
else if (wParam == VK_SNAPSHOT)
|
|
lParam |= 0x137 << 16;
|
|
break;
|
|
}
|
|
}
|
|
// pass all messages to DefWindowProc
|
|
return CallWindowProc( BaseWindowProc, Hwnd, uMsg, wParam, lParam );
|
|
};
|