mirror of
https://github.com/UberGames/GtkRadiant.git
synced 2024-11-23 04:12:06 +00:00
- Added option to toggle the camera window stats on/off
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@116 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
bdf247256f
commit
bd1602cf73
3 changed files with 38 additions and 7 deletions
6
CHANGES
6
CHANGES
|
@ -1,6 +1,12 @@
|
||||||
This is the changelog for developers, != changelog for the end user
|
This is the changelog for developers, != changelog for the end user
|
||||||
that we distribute with the binaries. (see changelog)
|
that we distribute with the binaries. (see changelog)
|
||||||
|
|
||||||
|
09/10/2006
|
||||||
|
namespace
|
||||||
|
- Added option to toggle the camera window stats on/off (Shaderman)
|
||||||
|
(view --> show --> show stats)
|
||||||
|
|
||||||
|
|
||||||
08/10/2006
|
08/10/2006
|
||||||
namespace
|
namespace
|
||||||
- Fix for bug 1106 - .wad files don't get listed in the textures menu (Shaderman)
|
- Fix for bug 1106 - .wad files don't get listed in the textures menu (Shaderman)
|
||||||
|
|
|
@ -80,13 +80,15 @@ struct camwindow_globals_private_t
|
||||||
bool m_bCamInverseMouse;
|
bool m_bCamInverseMouse;
|
||||||
bool m_bCamDiscrete;
|
bool m_bCamDiscrete;
|
||||||
bool m_bCubicClipping;
|
bool m_bCubicClipping;
|
||||||
|
bool m_showStats;
|
||||||
|
|
||||||
camwindow_globals_private_t() :
|
camwindow_globals_private_t() :
|
||||||
m_nMoveSpeed(100),
|
m_nMoveSpeed(100),
|
||||||
m_nAngleSpeed(3),
|
m_nAngleSpeed(3),
|
||||||
m_bCamInverseMouse(false),
|
m_bCamInverseMouse(false),
|
||||||
m_bCamDiscrete(true),
|
m_bCamDiscrete(true),
|
||||||
m_bCubicClipping(true)
|
m_bCubicClipping(true),
|
||||||
|
m_showStats(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1500,6 +1502,22 @@ Cam_Draw
|
||||||
==============
|
==============
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
void ShowStatsToggle()
|
||||||
|
{
|
||||||
|
g_camwindow_globals_private.m_showStats ^= 1;
|
||||||
|
}
|
||||||
|
typedef FreeCaller<ShowStatsToggle> ShowStatsToggleCaller;
|
||||||
|
|
||||||
|
void ShowStatsExport(const BoolImportCallback& importer)
|
||||||
|
{
|
||||||
|
importer(g_camwindow_globals_private.m_showStats);
|
||||||
|
}
|
||||||
|
typedef FreeCaller1<const BoolImportCallback&, ShowStatsExport> ShowStatsExportCaller;
|
||||||
|
|
||||||
|
ShowStatsExportCaller g_show_stats_caller;
|
||||||
|
BoolExportCallback g_show_stats_callback(g_show_stats_caller);
|
||||||
|
ToggleItem g_show_stats(g_show_stats_callback);
|
||||||
|
|
||||||
void CamWnd::Cam_Draw()
|
void CamWnd::Cam_Draw()
|
||||||
{
|
{
|
||||||
glViewport(0, 0, m_Camera.width, m_Camera.height);
|
glViewport(0, 0, m_Camera.width, m_Camera.height);
|
||||||
|
@ -1646,13 +1664,16 @@ void CamWnd::Cam_Draw()
|
||||||
glEnd();
|
glEnd();
|
||||||
}
|
}
|
||||||
|
|
||||||
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - 1.0f, 0.0f);
|
if(g_camwindow_globals_private.m_showStats)
|
||||||
extern const char* Renderer_GetStats();
|
{
|
||||||
GlobalOpenGL().drawString(Renderer_GetStats());
|
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - 1.0f, 0.0f);
|
||||||
|
extern const char* Renderer_GetStats();
|
||||||
|
GlobalOpenGL().drawString(Renderer_GetStats());
|
||||||
|
|
||||||
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - 11.0f, 0.0f);
|
glRasterPos3f(1.0f, static_cast<float>(m_Camera.height) - 11.0f, 0.0f);
|
||||||
extern const char* Cull_GetStats();
|
extern const char* Cull_GetStats();
|
||||||
GlobalOpenGL().drawString(Cull_GetStats());
|
GlobalOpenGL().drawString(Cull_GetStats());
|
||||||
|
}
|
||||||
|
|
||||||
// bind back to the default texture so that we don't have problems
|
// bind back to the default texture so that we don't have problems
|
||||||
// elsewhere using/modifying texture maps between contexts
|
// elsewhere using/modifying texture maps between contexts
|
||||||
|
@ -2009,6 +2030,9 @@ void CamWnd_Construct()
|
||||||
GlobalShortcuts_insert("CameraFreeMoveLeft", Accelerator(GDK_Left));
|
GlobalShortcuts_insert("CameraFreeMoveLeft", Accelerator(GDK_Left));
|
||||||
GlobalShortcuts_insert("CameraFreeMoveRight", Accelerator(GDK_Right));
|
GlobalShortcuts_insert("CameraFreeMoveRight", Accelerator(GDK_Right));
|
||||||
|
|
||||||
|
GlobalToggles_insert("ShowStats", ShowStatsToggleCaller(), ToggleItem::AddCallbackCaller(g_show_stats));
|
||||||
|
|
||||||
|
GlobalPreferenceSystem().registerPreference("ShowStats", BoolImportStringCaller(g_camwindow_globals_private.m_showStats), BoolExportStringCaller(g_camwindow_globals_private.m_showStats));
|
||||||
GlobalPreferenceSystem().registerPreference("MoveSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nMoveSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nMoveSpeed));
|
GlobalPreferenceSystem().registerPreference("MoveSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nMoveSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nMoveSpeed));
|
||||||
GlobalPreferenceSystem().registerPreference("AngleSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nAngleSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nAngleSpeed));
|
GlobalPreferenceSystem().registerPreference("AngleSpeed", IntImportStringCaller(g_camwindow_globals_private.m_nAngleSpeed), IntExportStringCaller(g_camwindow_globals_private.m_nAngleSpeed));
|
||||||
GlobalPreferenceSystem().registerPreference("CamInverseMouse", BoolImportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse), BoolExportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse));
|
GlobalPreferenceSystem().registerPreference("CamInverseMouse", BoolImportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse), BoolExportStringCaller(g_camwindow_globals_private.m_bCamInverseMouse));
|
||||||
|
|
|
@ -2087,6 +2087,7 @@ GtkMenuItem* create_view_menu(MainFrame::EViewStyle style)
|
||||||
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Window Outline", "ShowWindowOutline");
|
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Window Outline", "ShowWindowOutline");
|
||||||
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Axes", "ShowAxes");
|
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Axes", "ShowAxes");
|
||||||
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Workzone", "ShowWorkzone");
|
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Workzone", "ShowWorkzone");
|
||||||
|
create_check_menu_item_with_mnemonic(menu_in_menu, "Show Stats", "ShowStats");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue