7#include <VersionHelpers.h>
19#define GUID_DEVINTERFACE_USB_DEVICE {0x4d1e55b2, 0xf16f, 0x11cf,{ 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30}}
24 logger = std::make_unique<Logger>();
29 networking = std::make_unique<Networking>(
this);
32 sound = std::make_unique<Sound>(
this);
38 bus = std::make_unique<Bus>(
logger.get());
39 viewscreen = std::make_unique<Viewscreen>(
this);
45 modules.emplace_back(std::make_unique<IceDetector>(
bus.get(),
logger.get()));
48 modules.emplace_back(std::make_unique<Avionics::Orbit>(
bus.get(), [
this] { TurnOffDOR(true); }, [
this] { return GUI && GUI->IsAdmin; }, [
this](
int index) {
49 if(index<0||index>=int(bus->waypoint.size())) return;
50 bus->WPtargetC=index;bus->targetC=-1;bus->ClearTurnByTurn();
51 auto packet=WaypointProtocol::Select(bus->waypoint[index].id,false);
52 networking->SendToServer(&packet,sizeof(packet),true);
97 if (notification && !UnregisterDeviceNotification(notification))
127 outpacket.
f_x = 1.0f;
128 outpacket.
f_y = 0.0f;
129 outpacket.
f_z = 0.0f;
130 outpacket.
f_w = 0.0f;
136#if defined(_DEBUG) && defined(_TOUCHFILES)
141 if (!SystemTimeToFileTime(&st, &ft))
148 handle = CreateFile(str, GENERIC_WRITE, FILE_SHARE_WRITE,
nullptr, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS,
nullptr);
149 if (handle == INVALID_HANDLE_VALUE)
153 else if (!SetFileTime(handle,
nullptr,
nullptr, &ft))
164#pragma region Mirrored on the Server
276 logger->
Log(
"Rendering::ClientToggleFullscreen(true)");
282 logger->
Log(
"Rendering::ClientToggleFullscreen(false)");
304 srand(
static_cast<unsigned int>(ltime));
315 logger->
Log(
"InitDirectInput() called...");
319#pragma region DirectInput
320 logger->
Log(
"Calling DirectInput8Create...");
322 IID_IDirectInput8,
reinterpret_cast<void**
>(&
viewscreen->
g_pDI), NULL)))
327 logger->
Log(
"Done with DirectInput8Create!");
330#pragma region Keyboard
331 logger->
Log(
"Calling ptrKeyboard->Initialize...");
334 logger->
Log(
"Done with ptrKeyboard->Initialize!");
337#pragma region Joystick
338 logger->
Log(
"Calling ptrJoystick->Initialize...");
340 logger->
Log(
"Done with ptrJoystick->Initialize!");
343 catch (
const std::exception& e)
348 logger->
Log(
"InitDirectInput() exited successfully!");
360 game->
logger->
Log(
"Calling OnCreateDevice()...");
391 game->
logger->
Log(
"Advanced to STATUS_LOADING");
395 game->
logger->
Log(
"OnCreateDevice() done!");
405 logger->
Log(
"First game frame presented; applying game window placement");
406 SetWindowLong(
Rendering::ClientWindow(), GWL_STYLE, WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_MAXIMIZE);
410 if (FAILED(hr))
return hr;
425 logger->
Log(
"game->GUI->g_HUD Initializing...");
470 sprintf_s(msg,
sizeof msg,
"GameClass::OnResetDevice() DS %i", game->
displaystage);
509 game->
logger->
Log(
"OnResetDevice() done!");
553 sprintf_s(msg,
sizeof msg,
"GameClass::OnFrameMove %i", game->
displaystage);
624 sprintf_s(msg,
sizeof msg,
"Somehow we are advancing to STATUS_LOGIN with a null m_pddsGUIScroll %i!", game->
loadstage);
649 game->
logger->
Log(
"Advanced to STATUS_LOGIN");
683 sprintf_s(msg,
sizeof msg,
"Somehow we are advancing to STATUS_LOADING with a null m_pddsGUIScroll %i!", game->
loadstage);
703 game->
logger->
Log(
"Advanced to STATUS_LOADING");
759 game->
logger->
Log(
"Advanced to STATUS_LOADING");
766 sprintf_s(msg,
sizeof msg,
"Error in GetWindowRect: %d", GetLastError());
771 const int loadingHeight =
static_cast<int>(500.0f * game->
displayscale);
772 const int loadingY = (rect.top + rect.bottom - loadingHeight) / 2;
775 sprintf_s(msg,
sizeof msg,
"Error in MoveWindow: %d", GetLastError());
832 game->
GUI->
fade += fElapsedTime / 5.8f;
841 game->
logger->
Log(
"Preparing game graphics in the loading window");
863 if (FAILED(cloudPrograms))
897 game->
logger->
Log(
"Advanced to STATUS_GAME");
900 if (FAILED(hudResult))
919#if !defined(DIALOGHARNESS) | !defined(_DEBUG)
924 networkSoundTiming.
Stop();
928 viewscreenUpdateTiming.
Stop();
933 uiUpdateTiming.
Stop();
941 if (command.
name ==
"UseInventoryItem")
945 const int itemIndex = command.
ivalues[0];
969 outpacket.
f_x =
static_cast<float>(item.
type);
970 outpacket.
f_y =
static_cast<float>(item.
subtype);
971 outpacket.
f_z = command.
bValue ? 0.0f : 1.0f;
996 outpacket.
f_x =
static_cast<float>(item.
type);
997 outpacket.
f_y =
static_cast<float>(item.
subtype);
998 outpacket.
f_z = command.
bValue ? 0.0f : 1.0f;
999 outpacket.
f_w = 0.0f;
1008 outpacket.
type = 21;
1009 outpacket.
f_x =
static_cast<float>(item.
type);
1010 outpacket.
f_y =
static_cast<float>(item.
subtype);
1011 outpacket.
f_z = command.
bValue ? 0.0f : 1.0f;
1012 outpacket.
f_w = 0.0f;
1031 float delay = 0.173f + 0.081f * hitpoints / 10.0f;
1036 outpacket.
type = 21;
1037 outpacket.
f_x =
static_cast<float>(item.
type);
1038 outpacket.
f_y =
static_cast<float>(item.
subtype);
1039 outpacket.
f_z = command.
bValue ? 0.0f : 1.0f;
1040 outpacket.
f_w = hitpoints;
1063 else if (command.
name ==
"TransferInventoryItem")
1067 const int itemIndex = command.
ivalues[0];
1068 int itemType, itemSubType;
1086 outpacket.
type = 26;
1087 outpacket.
f_x =
static_cast<float>(itemType);
1088 outpacket.
f_y =
static_cast<float>(itemSubType);
1089 outpacket.
f_z =
static_cast<float>(command.
ivalues[1]);
1090 outpacket.
f_w = 0.0f;
1099 else if (command.
name ==
"SwapInventoryItem")
1103 const int itemIndex = command.
ivalues[0];
1104 int itemType, itemSubType, vehicleId;
1123 outpacket.
type = 27;
1124 outpacket.
f_x =
static_cast<float>(itemType);
1125 outpacket.
f_y =
static_cast<float>(itemSubType);
1126 outpacket.
f_z =
static_cast<float>(command.
ivalues[1]);
1127 outpacket.
f_w = 0.0f;
1136 else if (command.
name ==
"TransferWeapon")
1141 outpacket.
type = 19;
1142 outpacket.
f_x = 0.0f;
1143 outpacket.
f_y = 0.0f;
1144 outpacket.
f_z = 1.0f;
1145 outpacket.
f_w =
static_cast<float>(command.
ivalues[0]);
1154 else if (command.
name ==
"ToggleAvionics")
1164 else if (command.
ivalues[0] == 4)
1171 else if (command.
ivalues[0] == 5)
1176 else if (command.
ivalues[0] == 6)
1191 else if (command.
name ==
"RadioStation")
1196 else if (command.
name ==
"SoundMidwayTarget")
1208 outpacket.
type = 11;
1210 outpacket.
f_y = 0.0f;
1211 outpacket.
f_z = 0.0f;
1212 outpacket.
f_w = 0.0f;
1243 sprintf_s(msg,
sizeof msg,
"GameClass::OnFrameRender (%i)", game->
displaystage);
1303 if (game->
stage == 0)
1305 game->
logger->
Log(
"#include TEXTURES called!");
1311 if (game->
stage == 31)
1313 game->
logger->
Log(
"#include TEXTURES exited successfully!");
1318 if (game->
stage == 32)
1367 std::vector<RECT> bounds;
1368 std::vector<DirectX::XMFLOAT4> masks;
1375 bounds.push_back({LONG(dialog->windowlocation.x*scale),LONG(dialog->windowlocation.y*scale),
1376 LONG((dialog->windowlocation.x+dialog->width)*scale),LONG((dialog->windowlocation.y+dialog->height+96)*scale)});
1377 dialog->HUD.AppendVisibleBounds(bounds);
1380 bounds.push_back({0,LONG(screen->Height)-LONG(64*game->
displayscale),LONG(screen->Width),LONG(screen->Height)});
1386 for (
const auto& rect:bounds)masks.push_back({float(rect.left)/screen->Width,float(rect.top)/screen->Height,
1387 float(rect.right)/screen->Width,float(rect.bottom)/screen->Height});
1401 sprintf_s(msg,
sizeof msg,
"Found a %i when trying to EndScene", game->
beginScene);
1412#if defined(TIMELAPSE) && defined(_DEBUG)
1413 static float timelapseTimer = 0.0f;
1414 static int timelapseFrame = 0;
1416 static bool active =
false;
1425 timelapseTimer += fElapsedTime;
1426 if (timelapseTimer >= 2.356f)
1428 timelapseTimer -= 2.356f;
1433 WCHAR szFileName[99];
1434 swprintf_s(szFileName, 99, L
"Screenshots\\Screenshot_%06d.png", timelapseFrame);
1495LRESULT CALLBACK
GameClass::MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
bool* pbNoFurtherProcessing,
void* pUserContext)
1500 const bool traceEnter = HudDiagnostics::IsEnterMessage(uMsg, wParam);
1501 if (traceEnter && game->
GUI)
1504 sprintf_s(event,
sizeof event,
1505 "window message=0x%04X flags=0x%08lX repeat=%d numpad=%d alt=%d ctrl=%d shift=%d",
1506 uMsg,
static_cast<unsigned long>(lParam), (lParam & (1L << 30)) != 0,
1507 (lParam & (1L << 24)) != 0, (GetKeyState(VK_MENU) & 0x8000) != 0,
1508 (GetKeyState(VK_CONTROL) & 0x8000) != 0, (GetKeyState(VK_SHIFT) & 0x8000) != 0);
1509 HudDiagnostics::LogChatInput(*game->
GUI, event);
1517 *pbNoFurtherProcessing =
true;
1522 if (wParam == SC_RESTORE)
1528 game->
logger->
Log(
"GameClass::MsgProc WM_CREATE");
1530 DEV_BROADCAST_DEVICEINTERFACE NotificationFilter;
1531 ZeroMemory(&NotificationFilter,
sizeof DEV_BROADCAST_DEVICEINTERFACE);
1532 NotificationFilter.dbcc_size =
sizeof DEV_BROADCAST_DEVICEINTERFACE;
1533 NotificationFilter.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE;
1535 game->
dev_notify = RegisterDeviceNotification(hWnd, &NotificationFilter, DEVICE_NOTIFY_WINDOW_HANDLE);
1538 game->
logger->
Log(
"Could not register for device notifications!",
Logger::Fatal, HRESULT_FROM_WIN32(GetLastError()));
1541 *pbNoFurtherProcessing =
true;
1548 *pbNoFurtherProcessing =
true;
1552 case WM_DEVICECHANGE:
1554 game->
logger->
Log(
"GameClass::MsgProc WM_DEVICECHANGE");
1558 const auto lpdb = PDEV_BROADCAST_HDR(lParam);
1559 if (lpdb->dbch_devicetype == DBT_DEVTYP_DEVICEINTERFACE)
1564 case DBT_DEVICEARRIVAL:
1565 case DBT_DEVICEREMOVECOMPLETE:
1591 game->
logger->
Log(
"GameClass::MsgProc WM_ACTIVATE");
1594 game->
logger->
Log(
"GameClass::MsgProc WM_NULL");
1597 game->
logger->
Log(
"GameClass::MsgProc WM_DESTROY");
1601 game->
logger->
Log(
"GameClass::MsgProc WM_ENABLE");
1604 game->
logger->
Log(
"GameClass::MsgProc WM_SETFOCUS");
1608 game->
logger->
Log(
"GameClass::MsgProc WM_KILLFOCUS");
1611 game->
logger->
Log(
"GameClass::MsgProc WM_QUIT");
1614 game->
logger->
Log(
"GameClass::MsgProc WM_SHOWWINDOW");
1618 game->
logger->
Log(
"GameClass::MsgProc WM_MOVE");
1622 game->
logger->
Log(
"GameClass::MsgProc WM_SIZE");
1638 if (GetClientRect(hWnd, &client))
1643 game->
displayWidth =
static_cast<float>(client.right - client.left);
1644 game->
displayHeight =
static_cast<float>(client.bottom - client.top);
1672 *pbNoFurtherProcessing = game->
GUI->
MsgProc(hWnd, uMsg, wParam, lParam);
1673 if (*pbNoFurtherProcessing)
1678 HudDiagnostics::LogChatInput(*game->
GUI,
"handled by HMI");
1684 *pbNoFurtherProcessing = game->
GUI->
g_HUD.
MsgProc(hWnd, uMsg, wParam, lParam);
1685 if (*pbNoFurtherProcessing)
1690 HudDiagnostics::LogChatInput(*game->
GUI,
"handled by main HUD");
1701 case WM_RBUTTONDOWN:
1702 game->
logger->
Log(
"GameClass::MsgProc WM_RBUTTONDOWN");
1709 game->
logger->
Log(
"GameClass::MsgProc WM_RBUTTONUP");
1715 case WM_RBUTTONDBLCLK:
1716 game->
logger->
Log(
"GameClass::MsgProc WM_RBUTTONDBLCLK");
1732 game->
logger->
Log(
"GameClass::MsgProc WM_CHAR");
1736 if (LOWORD(wParam) > 13)
1741 else if (LOWORD(wParam) == 13)
1744 HudDiagnostics::LogChatInput(*game->
GUI,
"Enter reached MFD/text-mode handler");
1750 strcpy_s(outpacket.msg,
sizeof outpacket.msg,
outgoing);
1752 outpacket.
array = 0;
1762 if (sscanf_s(
outgoing,
"%d", &amount) == 1 && amount > 0.0f)
1767 outpacket.
type = 19;
1768 outpacket.
f_x =
static_cast<float>(amount);
1769 outpacket.
f_y = 0.0f;
1770 outpacket.
f_z = 0.0f;
1784 if (sscanf_s(
outgoing,
"%d", &amount) == 1)
1789 outpacket.
type = 19;
1790 outpacket.
f_x = 0.0f;
1791 outpacket.
f_y =
static_cast<float>(amount);
1792 outpacket.
f_z = 0.0f;
1806 if (sscanf_s(
outgoing,
"%d", &amount) == 1 && amount < 0)
1818 outpacket.
f_x = -
static_cast<float>(amount);
1819 outpacket.
f_y = 0.0f;
1820 outpacket.
f_z = 0.0f;
1821 outpacket.
f_w = 0.0f;
1833 else if (LOWORD(wParam) == 8)
1835 const size_t len = strlen(
outgoing);
1846 HudDiagnostics::LogChatInput(*game->
GUI,
"window message finished; returned to DXUT");
1862 sprintf_s(msg,
sizeof msg,
"Resource was not previously released: %s", pointerName.c_str());
1869 sprintf_s(msg,
sizeof msg,
"Filename was blank for: %s", pointerName.c_str());
1921 outpacket.
type = 23;
1922 outpacket.
f_x = 0.0f;
1923 outpacket.
f_y = 2.0f;
1924 outpacket.
f_z = 0.0f;
1925 outpacket.
f_w = 0.0f;
1936 outpacket.
type = 23;
1937 outpacket.
f_x = 0.0f;
1938 outpacket.
f_y = 4.0f;
1939 outpacket.
f_z = 0.0f;
1940 outpacket.
f_w = 0.0f;
1961 outpacket.
type = 23;
1962 outpacket.
f_x = 0.0f;
1963 outpacket.
f_y = 1.0f;
1964 outpacket.
f_z = 0.0f;
1965 outpacket.
f_w = 0.0f;
1969 outpacket.
type = 23;
1970 outpacket.
f_x = 0.0f;
1971 outpacket.
f_y = 4.0f;
1972 outpacket.
f_z = 0.0f;
1973 outpacket.
f_w = 0.0f;
1978 else if (newGear == -1)
1983 outpacket.
type = 23;
1984 outpacket.
f_x = 0.0f;
1985 outpacket.
f_y = 3.0f;
1986 outpacket.
f_z = 0.0f;
1987 outpacket.
f_w = 0.0f;
2028 sprintf_s(bug, 199,
"That's weird, tried to lose scanner target but already -1: %s", msg);
2122 if (!preserveGuidance)
2148 sprintf_s(msg,
sizeof msg,
"KeyboardProc START %i %i %i", game->
displaystage, nChar, bKeyDown ? 1 : 0);
2151 if (nChar == VK_RETURN && game->
GUI)
2153 sprintf_s(msg,
sizeof msg,
"DXUT Enter callback keyDown=%d alt=%d", bKeyDown, bAltDown);
2154 HudDiagnostics::LogChatInput(*game->
GUI, msg);
2260 sprintf_s(msg,
sizeof msg,
"KeyboardProc key %x", nChar);
2301 else game->
logger->
Log(
"Native materials reloaded; shader source changes require rebuilding the embedded SM5 package");
2325 game->
logger->
Log(
"Calling OnLostDevice()...");
2370 game->
logger->
Log(
"OnLostDevice() done!");
2378 sprintf_s(msg,
sizeof msg,
"Resource not set to lost: %s", game->
trackedResources.at(t).name);
2394 game->
logger->
Log(
"Calling OnDestroyDevice()...");
2413 if (preservingModels && (!strcmp(name,
"ourcockpit.componentarray") ||
2414 !strcmp(name,
"polyobjects[5].VB") ||
2415 (!strncmp(name,
"playerships[", 12) && strstr(name,
"].componentarray"))))
continue;
2428 game->
logger->
Log(preservingModels ?
"All tracked GPU resources freed; CPU vehicle models retained for recovery" :
"All tracked resources have been freed!");
2430 game->
logger->
Log(
"OnDestroyDevice() done!");
2435 WCHAR filename[MAX_PATH];
2436 GetModuleFileName(
nullptr, filename, MAX_PATH);
2439 sprintf_s(msg, MAX_PATH,
"Executable: %S", filename);
2442 const DWORD dwSize = GetFileVersionInfoSize(filename,
nullptr);
2445 sprintf_s(msg, MAX_PATH,
"Error in GetFileVersionInfoSize: %d", GetLastError());
2450 BYTE* pbVersionInfo =
new BYTE[dwSize];
2452 if (!GetFileVersionInfo(filename, 0, dwSize, pbVersionInfo))
2454 sprintf_s(msg, MAX_PATH,
"Error in GetFileVersionInfo: %d", GetLastError());
2462 if (!VerQueryValue(pbVersionInfo, TEXT(
"\\"),
reinterpret_cast<VOID FAR * FAR*
>(&p), &querySize))
2464 sprintf_s(msg, MAX_PATH,
"Error in VerQueryValue: %d", GetLastError());
2472 VS_FIXEDFILEINFO* verInfo =
reinterpret_cast<VS_FIXEDFILEINFO*
>(p);
2473 major = HIWORD(verInfo->dwFileVersionMS);
2474 minor = LOWORD(verInfo->dwFileVersionMS);
2475 build = HIWORD(verInfo->dwFileVersionLS);
2476 revision = LOWORD(verInfo->dwFileVersionLS);
2488 assert(strlen(name) < 32);
2496 sprintf_s(msg,
sizeof msg,
"GameClass::AddTrackedResource Already Tracking: %s (%i)", name,
trackedResources.at(i).status);
2511 assert(status != 0);
2512 assert(strlen(name) < 32);
2520 sprintf_s(msg,
sizeof msg,
"GameClass::UpdateTrackedResource %s already status %i", name, status);
2526 sprintf_s(msg,
sizeof msg,
"GameClass::UpdateTrackedResource %s status transition %i", name, status);
2538 sprintf_s(msg,
sizeof msg,
"GameClass::UpdateTrackedResource Wasn't Tracking: %s", name);
@ SimulatorCannotTransferItem
@ FirstSelectVehicleOrContainer
@ InvalidNegativeKilogramAmount
@ SimulatorCannotTransferWeapons
@ InvalidPositiveKilogramAmount
@ InvalidPositiveMonetaryAmount
@ SimulatorCannotSwapItem
#define SAFE_DELETE_ARRAY(value)
#define V_RETURN(expression)
#define SAFE_RELEASE(value)
HRESULT(WINAPI *CUniBuffer::_ScriptApplyDigitSubstitution)(const SCRIPT_DIGITSUBSTITUTE *
SCRIPT_CONTROL SCRIPT_STATE const void DWORD
#define GUID_DEVINTERFACE_USB_DEVICE
#define DIRECTINPUT_VERSION
@ SOUND_AIRBRAKEONMAMMOTH
@ SOUND_AIRBRAKEOFFMAMMOTH
float RollAttitudeRadians
float PitchAttitudeRadians
void FrameMove(float fElapsed)
float EngineThrustLever[MAX_ENGINES]
bool ComponentFcsRollFail
std::vector< Message > messages
bool ComponentRcsRollFail
bool ThrustReverserCommand[MAX_ENGINES]
std::vector< Command > commandStream
Rendering::CloudRenderer11 * Effect()
static DialogBase * dialogs[D_ENUMERATION]
virtual void UpdateMenu(short tab)
void UpdatePresence(const char *prmDetails, const char *prmState, const char *prmLargeImageKey)
void OnDestroyDevice(const char *reason="unspecified")
void RestorePage(std::string screenName)
HRESULT InitializeGameHud()
void LoadTexture(Rendering::RenderTexture **resource, const std::string &pointerName, const WCHAR *file, Rendering::ImageFormat format=Rendering::ImageFormat::BGRA8)
std::unique_ptr< Bus > bus
static HRESULT CALLBACK OnResetDevice(Rendering::RenderDevice *pd3dDevice, const Rendering::SurfaceDescription *pBackBufferSurfaceDesc, void *pUserContext)
bool lastDeviceChangedSound
void LostScannerTarget(const char *msg) const
void RequestScannerData() const
static void CALLBACK OnDestroyDevice(void *pUserContext)
void UnregisterDeviceNotifications()
void GetProgramVersion(int &major, int &minor, int &build, int &revision) const
std::unique_ptr< HMI > GUI
HRESULT InitDirectInput(HWND hDlg) const
void UseOrDisuseInventoryItemType(int itemtype, int itemsubtype, int itemId, int vehicleId) const
std::unique_ptr< Sound > sound
static void CALLBACK KeyboardProc(UINT nChar, bool bKeyDown, bool bAltDown, void *pUserContext)
void LostVerticalTarget(const char *msg) const
std::unique_ptr< Networking > networking
void AddTrackedResource(const char *name, Rendering::ResourcePool pool=Rendering::ResourcePool::Managed)
void UpdateTrackedResource(const char *name, int status)
void RequestClose() const
static void CALLBACK OnLostDevice(void *pUserContext)
std::vector< Resource > trackedResources
void FlightDirectorOn() const
std::unique_ptr< Displays > displays
static void CALLBACK OnFrameMove(double fTime, float fElapsedTime, void *pUserContext)
static float GetCpuSpeedMhz()
static void CALLBACK OnFrameRender(Rendering::RenderDevice *pd3dDevice, double fTime, float fElapsedTime, void *pUserContext)
bool loadingReadyToContinue
std::vector< std::unique_ptr< Module > > modules
void RepairVehicle() const
static void TouchFile(const WCHAR *str)
HRESULT OnFramePresented()
std::unique_ptr< DiscordIntegration > discord
void KillScannerData() const
static LRESULT CALLBACK MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, bool *pbNoFurtherProcessing, void *pUserContext)
bool lastDeviceChangedInput
std::unique_ptr< Viewscreen > viewscreen
bool TurnOffDOR(bool preserveGuidance=false) const
void ChangeGear(char newGear, bool isInit=false) const
std::unique_ptr< Graphics > graphics
std::unique_ptr< Logger > logger
static HRESULT CALLBACK OnCreateDevice(Rendering::RenderDevice *pd3dDevice, const Rendering::SurfaceDescription *pBackBufferSurfaceDesc, void *pUserContext)
void ToggleFullScreen(bool goFullScreen)
void AutopilotDisconnect() const
Rendering::RenderTexture * m_pddsCloudBaseMapAndNetwork
HRESULT OnResetDevice(void) const
HRESULT LoadShaderFile(void)
void OnDestroyDevice(void)
void DrawImmigration(Rendering::RenderDevice *pd3dDevice, float fElapsedTime)
Rendering::RenderMaterial * g_pEffect
Rendering::RenderTexture * m_pddsLightningAndBackground[3]
const char * AdUnmeasuredUiReason() const
Rendering::RenderFont * g_pSubtitleFont
HRESULT OnCreateDevice(Rendering::RenderDevice *pd3dDevice)
SPlayerData player[MAX_ONLINEPLAYERS]
Rendering::RenderTexture * m_pddsGUIRanks
Rendering::RenderFont * g_pChatFont
Rendering::RenderTexture * m_pddsGUIInterlace
Rendering::RenderTexture * m_pddsGUIActions
bool MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void LightningCalculations(float fElapsedTime)
ExternalCameraOverlay externalCameraOverlay
std::wstring strings[L_ENUMERATION]
void OnFrameMove(float fElapsedTime)
InformationDialog * informationDialog
Rendering::RenderTexture * m_pddsGUIScrollButton
void SaveConfiguration() const
void LoadConfiguration() const
static void CALLBACK OnGUIEvent(UINT nEvent, int nControlID, RiseControl *pControl, void *pUserContext)
void FadeIn(float f, float fElapsedTime)
Rendering::RenderTexture * m_pddsGUIScroll
KeyboardChart keyboardChart
LoadingEyeReveal eyeReveal
void OnRender(float fElapsedTime, Rendering::RenderDevice *pd3dDevice)
Rendering::RenderFont * g_pFont
RiseDialogResourceManager g_DialogResourceManager
Rendering::RenderTexture * m_pddsGUIParts
void LoadTextures(GameState displaystage, short loadstage)
Rendering::RenderSprite * g_pTextSprite
float Progress(double now)
void Log(const char *msg, Level level=Info, int errorCode=0)
void AddToCallStack(const char *msg)
void SetNetworkingPointer(Networking *prmNetworking)
void FrameMove(GameState displaystage)
void SendToServer(void *pData, DWORD dwSize, bool bGuaranteed, PacketOrdering order=ORDERING_NONE) const
void RequestVerbiage(int helpId) const
void SendEvent(EventType eventType, float extent=0.0f) const
void DrawOverlay(RenderFont *font, RenderSprite *sprite, unsigned width, unsigned height, std::vector< RECT > *drawnBounds=nullptr)
void FinishScene(RenderDevice &device, bool weatherMeasured, const std::vector< DirectX::XMFLOAT4 > &uiRects, const char *uiBlocker=nullptr)
void LoadingFramePresented()
HRESULT PrepareLoadingStep(ID3D11DeviceContext *context, UINT samples, bool organic)
HRESULT SetRenderState(DWORD state, DWORD value)
HRESULT Clear(DWORD count, const RECT *rectangles, DWORD flags, PackedColor color, float depth, DWORD stencil)
HRESULT GetBackBuffer(UINT chain, UINT buffer, UINT type, RenderSurface **result)
HRESULT SetSamplerState(DWORD sampler, DWORD state, DWORD value)
HRESULT SetTechnique(const char *name)
HRESULT SetFullscreen(bool value)
Resource(const char *prmName, Rendering::ResourcePool prmPool)
RiseElement * GetElement(UINT iElement)
virtual void SetEnabled(bool bEnabled)
virtual void SetTextColor(Rendering::PackedColor Color)
RiseEditBox * GetEditBox(int ID)
void Init(RiseDialogResourceManager *pManager, bool bRegisterDialog=true)
bool MsgProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
void AppendVisibleBounds(std::vector< RECT > &rectangles) const
RiseControl * GetControl(int ID)
HRESULT AddStatic(int ID, LPCWSTR strText, int x, int y, int width, int height, bool bIsDefault=false, RiseStatic **ppCreated=NULL, bool bShadow=true)
static void WINAPI ClearFocus()
void SetLocation(int x, int y)
RiseStatic * GetStatic(int ID)
HRESULT OnRender(float fElapsedTime)
void RequestFocus(RiseControl *pControl)
RiseButton * GetButton(int ID)
HRESULT SetFont(UINT index, LPCWSTR strFaceName, LONG height, LONG weight)
void SetCallback(UICallback pCallback, void *pUserContext=NULL)
HRESULT AddButton(int ID, LPCWSTR strText, int x, int y, int width, int height, UINT nHotkey=0, bool bIsDefault=false, RiseButton **ppCreated=NULL)
void AddDelayedSound(SOUNDS soundEnum, float delay, float volume=1.0f, float freq=1.0f, bool fromOutside=false)
void Stop(SOUNDS soundEnum) const
void LoadSounds(short instage)
void FrameMoveEarPressure(float elapsedTime)
void FrameMoveVehicleSounds()
static void CALLBACK AdvanceStage(HSYNC handle, DWORD channel, DWORD data, void *user)
void FrameMove(float elapsedTime)
void FrameMoveWipers(float elapsedTime)
float Play(SOUNDS soundEnum, float volume=1.0f)
void FrameMoveImmigration()
void PlayEx(SOUNDS soundEnum, bool loop, float volume=1.0f, float frequencyMod=1.0f, float pan=0.0f, bool restart=true, bool fromOutside=false, bool partOfHull=false)
void LoadCustomSound(SOUNDS sound_enum, const char *path, SoundConfig *device=nullptr)
std::vector< GUID > deviceGuids
void ShowCloudFallbackWarning(HWND owner) const
std::unique_ptr< renderer > ptrRenderer
std::unique_ptr< keyboard > ptrKeyboard
void OnFrameRender(Rendering::RenderDevice *pd3dDevice, double fTime) const
static constexpr UINT CloudFallbackWarningMessage
CloudVolumeRenderer cloudVolume
void OnDestroyDevice(bool preserveModels=false)
void SetHornPressed(bool pressed)
std::unique_ptr< waypoints > ptrWaypoints
bool VolumeCloudsEnabled() const
bool InventoryItemEffectsEnabled() const
RiseMath::Matrix matrixView
HRESULT OnCreateDevice(Rendering::RenderDevice *pd3dDevice)
std::unique_ptr< weather > ptrWeather
void SetCrashHornFault(bool enabled)
void SetProjectionMatrices()
void OnFrameRender2(Rendering::RenderDevice *pd3dDevice, float fElapsedTime)
Rendering::AdDiagnostics11 adDiagnostics
float UniverseRelativeSpeedKms
void OnFrameMove(double fTime, float fElapsedTime)
std::unique_ptr< cockpit > ptrCockpit
std::unique_ptr< joystick > ptrJoystick
HRESULT OnResetDevice(Rendering::RenderDevice *pd3dDevice, const Rendering::SurfaceDescription *pBackBufferSurfaceDesc)
bool PrepareHullTextures(Rendering::RenderDevice *pd3dDevice, unsigned budget=2)
void FrameMovePropSounds(float elapsedTime) const
std::vector< DIDEVICEINSTANCE > deviceList
void Initialize(HWND prmHWND)
HRESULT Initialize(HWND hDlg)
void LoadTextures(Rendering::RenderDevice *pd3dDevice, short *stage, short *instage)
void RequestWaypointData()
s_network_objects playerships[MAX_SCAN]
unsigned short temptarget
void ReleaseAircraft(Afcs &a)
constexpr uint32_t INVSRCALPHA
constexpr uint32_t SRCALPHA
constexpr uint32_t TARGET
constexpr uint32_t ZBUFFER
constexpr uint32_t ALWAYS
constexpr uint32_t SRCBLEND
constexpr uint32_t ALPHABLENDENABLE
constexpr uint32_t DESTBLEND
constexpr uint32_t ADDRESSV
HRESULT SaveSurfaceToFile(const wchar_t *path, ImageFile format, RenderSurface *surface, const void *, const RECT *crop)
constexpr PackedColor ColorRGB(unsigned r, unsigned g, unsigned b)
double ClientAbsoluteTime()
const wchar_t * ErrorString(HRESULT code)
RenderDevice * ClientRenderer()
HRESULT LoadTexture(RenderDevice *owner, const wchar_t *path, RenderTexture **result, UINT levels=0, UINT width=0, UINT height=0)
const SurfaceDescription * ClientBackBufferDescription()
HINSTANCE ClientInstance()
HRESULT ClientToggleFullscreen()
constexpr auto Min(A first, B second)
float DesiredPitchRadians
enum Bus::Afcs::LateralModes CurrentLateralMode
float DesiredClosingSpeed
enum Bus::Afcs::VerticalModes CurrentVerticalMode
int inventoryItemInUseSubType
int inventoryItemInUseVehicleId
std::vector< InventoryHelper > vehicleInventory
std::vector< InventoryHelper > personalInventory
int inventoryItemInUseType