void CamWnd_registerShortcuts()
{
toggle_add_accelerator("ToggleCubicClip");
+
+ if(g_pGameDescription->mGameType == "doom3")
+ {
+ command_connect_accelerator("TogglePreview");
+ }
}
}
}
+void CamWnd_TogglePreview(void)
+{
+ // gametype must be doom3 for this function to work
+ // if the gametype is not doom3 something is wrong with the
+ // global command list or somebody else calls this function.
+ ASSERT_MESSAGE(g_pGameDescription->mGameType == "doom3", "CamWnd_TogglePreview called although mGameType is not doom3 compatible");
+
+ // switch between textured and lighting mode
+ CamWnd_SetMode((CamWnd_GetMode() == cd_lighting) ? cd_texture : cd_lighting);
+}
+
CameraModel* g_camera_model = 0;
typedef FreeCaller1<bool, CamWnd_Move_Discrete_Import> CamWndMoveDiscreteImportCaller;
+/// \brief Initialisation for things that have the same lifespan as this module.
void CamWnd_Construct()
{
GlobalCommands_insert("CenterView", FreeCaller<GlobalCamera_ResetAngles>(), Accelerator(GDK_End));
GlobalCommands_insert("LookThroughSelected", FreeCaller<GlobalCamera_LookThroughSelected>());
GlobalCommands_insert("LookThroughCamera", FreeCaller<GlobalCamera_LookThroughCamera>());
+ if(g_pGameDescription->mGameType == "doom3")
+ {
+ GlobalCommands_insert("TogglePreview", FreeCaller<CamWnd_TogglePreview>(), Accelerator(GDK_F3));
+ }
+
GlobalShortcuts_insert("CameraForward", Accelerator(GDK_Up));
GlobalShortcuts_insert("CameraBack", Accelerator(GDK_Down));
GlobalShortcuts_insert("CameraLeft", Accelerator(GDK_Left));