Changeset View
Changeset View
Standalone View
Standalone View
source/graphics/CinemaManager.cpp
Show All 31 Lines | |||||
#include "maths/MathUtil.h" | #include "maths/MathUtil.h" | ||||
#include "maths/Quaternion.h" | #include "maths/Quaternion.h" | ||||
#include "maths/Vector3D.h" | #include "maths/Vector3D.h" | ||||
#include "maths/Vector4D.h" | #include "maths/Vector4D.h" | ||||
#include "ps/CLogger.h" | #include "ps/CLogger.h" | ||||
#include "ps/ConfigDB.h" | #include "ps/ConfigDB.h" | ||||
#include "ps/CStr.h" | #include "ps/CStr.h" | ||||
#include "ps/Game.h" | #include "ps/Game.h" | ||||
#include "ps/GameSetup/Config.h" | |||||
#include "ps/Hotkey.h" | #include "ps/Hotkey.h" | ||||
#include "ps/ScreenSize.h" | |||||
#include "ps/World.h" | #include "ps/World.h" | ||||
#include "simulation2/components/ICmpCinemaManager.h" | #include "simulation2/components/ICmpCinemaManager.h" | ||||
#include "simulation2/components/ICmpOverlayRenderer.h" | #include "simulation2/components/ICmpOverlayRenderer.h" | ||||
#include "simulation2/components/ICmpRangeManager.h" | #include "simulation2/components/ICmpRangeManager.h" | ||||
#include "simulation2/components/ICmpSelectable.h" | #include "simulation2/components/ICmpSelectable.h" | ||||
#include "simulation2/components/ICmpTerritoryManager.h" | #include "simulation2/components/ICmpTerritoryManager.h" | ||||
#include "simulation2/MessageTypes.h" | #include "simulation2/MessageTypes.h" | ||||
#include "simulation2/system/ComponentManager.h" | #include "simulation2/system/ComponentManager.h" | ||||
▲ Show 20 Lines • Show All 134 Lines • ▼ Show 20 Lines | #else | ||||
glPointSize(1.0f); | glPointSize(1.0f); | ||||
glDisable(GL_POINT_SMOOTH); | glDisable(GL_POINT_SMOOTH); | ||||
glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | ||||
#endif | #endif | ||||
} | } | ||||
void CCinemaManager::DrawBars() const | void CCinemaManager::DrawBars() const | ||||
{ | { | ||||
int height = (float)g_xres / 2.39f; | int height = (float)g_ScreenSize.GuiWidth() / 2.39f; | ||||
int shift = (g_yres - height) / 2; | int shift = (g_ScreenSize.GuiHeight() - height) / 2; | ||||
if (shift <= 0) | if (shift <= 0) | ||||
return; | return; | ||||
#if CONFIG2_GLES | #if CONFIG2_GLES | ||||
#warning TODO : implement bars for GLES | #warning TODO : implement bars for GLES | ||||
#else | #else | ||||
// Set up transform for GL bars | // Set up transform for GL bars | ||||
glMatrixMode(GL_PROJECTION); | glMatrixMode(GL_PROJECTION); | ||||
glPushMatrix(); | glPushMatrix(); | ||||
glLoadIdentity(); | glLoadIdentity(); | ||||
glMatrixMode(GL_MODELVIEW); | glMatrixMode(GL_MODELVIEW); | ||||
glPushMatrix(); | glPushMatrix(); | ||||
glLoadIdentity(); | glLoadIdentity(); | ||||
CMatrix3D transform; | CMatrix3D transform; | ||||
transform.SetOrtho(0.f, (float)g_xres, 0.f, (float)g_yres, -1.f, 1000.f); | transform.SetOrtho(0.f, (float)g_ScreenSize.GuiWidth(), 0.f, (float)g_ScreenSize.GuiHeight(), -1.f, 1000.f); | ||||
Stan: static_cast<float>() * 2 | |||||
glLoadMatrixf(&transform._11); | glLoadMatrixf(&transform._11); | ||||
glColor4f(0.0f, 0.0f, 0.0f, 1.0f); | glColor4f(0.0f, 0.0f, 0.0f, 1.0f); | ||||
glEnable(GL_BLEND); | glEnable(GL_BLEND); | ||||
glDisable(GL_DEPTH_TEST); | glDisable(GL_DEPTH_TEST); | ||||
glBegin(GL_QUADS); | glBegin(GL_QUADS); | ||||
glVertex2i(0, 0); | glVertex2i(0, 0); | ||||
glVertex2i(g_xres, 0); | glVertex2i(g_ScreenSize.GuiWidth(), 0); | ||||
glVertex2i(g_xres, shift); | glVertex2i(g_ScreenSize.GuiWidth(), shift); | ||||
glVertex2i(0, shift); | glVertex2i(0, shift); | ||||
glEnd(); | glEnd(); | ||||
glBegin(GL_QUADS); | glBegin(GL_QUADS); | ||||
glVertex2i(0, g_yres - shift); | glVertex2i(0, g_ScreenSize.GuiHeight() - shift); | ||||
glVertex2i(g_xres, g_yres - shift); | glVertex2i(g_ScreenSize.GuiWidth(), g_ScreenSize.GuiHeight() - shift); | ||||
glVertex2i(g_xres, g_yres); | glVertex2i(g_ScreenSize.GuiWidth(), g_ScreenSize.GuiHeight()); | ||||
glVertex2i(0, g_yres); | glVertex2i(0, g_ScreenSize.GuiHeight()); | ||||
glEnd(); | glEnd(); | ||||
glDisable(GL_BLEND); | glDisable(GL_BLEND); | ||||
glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | ||||
// Restore transform | // Restore transform | ||||
glMatrixMode(GL_PROJECTION); | glMatrixMode(GL_PROJECTION); | ||||
glPopMatrix(); | glPopMatrix(); | ||||
Show All 25 Lines |
Wildfire Games · Phabricator
static_cast<float>() * 2