Changeset View
Changeset View
Standalone View
Standalone View
source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | |||||
QUERYHANDLER(CinemaRecord) | QUERYHANDLER(CinemaRecord) | ||||
{ | { | ||||
const int w = msg->width, h = msg->height; | const int w = msg->width, h = msg->height; | ||||
{ | { | ||||
g_Renderer.Resize(w, h); | g_Renderer.Resize(w, h); | ||||
SViewPort vp = { 0, 0, w, h }; | SViewPort vp = { 0, 0, w, h }; | ||||
g_Game->GetView()->GetCamera()->SetViewPort(vp); | CGame::GetGame()->GetView()->GetCamera()->SetViewPort(vp); | ||||
g_Game->GetView()->SetCameraProjection(); | CGame::GetGame()->GetView()->SetCameraProjection(); | ||||
} | } | ||||
unsigned char* img = new unsigned char [w*h*3]; | unsigned char* img = new unsigned char [w*h*3]; | ||||
unsigned char* temp = new unsigned char[w*3]; | unsigned char* temp = new unsigned char[w*3]; | ||||
int num_frames = msg->framerate * msg->duration; | int num_frames = msg->framerate * msg->duration; | ||||
AtlasView::GetView_Game()->SaveState(L"cinema_record"); | AtlasView::GetView_Game()->SaveState(L"cinema_record"); | ||||
Show All 34 Lines | //*/ | ||||
delete[] img; | delete[] img; | ||||
delete[] temp; | delete[] temp; | ||||
// Restore viewport | // Restore viewport | ||||
{ | { | ||||
g_Renderer.Resize(g_xres, g_yres); | g_Renderer.Resize(g_xres, g_yres); | ||||
SViewPort vp = { 0, 0, g_xres, g_yres }; | SViewPort vp = { 0, 0, g_xres, g_yres }; | ||||
g_Game->GetView()->GetCamera()->SetViewPort(vp); | CGame::GetGame()->GetView()->GetCamera()->SetViewPort(vp); | ||||
g_Game->GetView()->SetCameraProjection(); | CGame::GetGame()->GetView()->SetCameraProjection(); | ||||
} | } | ||||
} | } | ||||
QUERYHANDLER(Ping) | QUERYHANDLER(Ping) | ||||
{ | { | ||||
UNUSED2(msg); | UNUSED2(msg); | ||||
} | } | ||||
MESSAGEHANDLER(SimStopMusic) | MESSAGEHANDLER(SimStopMusic) | ||||
{ | { | ||||
UNUSED2(msg); | UNUSED2(msg); | ||||
CmpPtr<ICmpSoundManager> cmpSoundManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); | CmpPtr<ICmpSoundManager> cmpSoundManager(*CGame::GetGame()->GetSimulation2(), SYSTEM_ENTITY); | ||||
if (cmpSoundManager) | if (cmpSoundManager) | ||||
cmpSoundManager->StopMusic(); | cmpSoundManager->StopMusic(); | ||||
} | } | ||||
MESSAGEHANDLER(SimStateSave) | MESSAGEHANDLER(SimStateSave) | ||||
{ | { | ||||
AtlasView::GetView_Game()->SaveState(*msg->label); | AtlasView::GetView_Game()->SaveState(*msg->label); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator