diff --git a/doomsday/client/include/ui/clientwindow.h b/doomsday/client/include/ui/clientwindow.h index 939317a7a2..7d3a9e3e28 100644 --- a/doomsday/client/include/ui/clientwindow.h +++ b/doomsday/client/include/ui/clientwindow.h @@ -25,18 +25,22 @@ #include "GuiRootWidget" #include "resource/image.h" +#include "ui/widgets/legacywidget.h" /** * Macro for conveniently accessing the current active window. There is always * one active window, so no need to worry about NULLs. The easiest way to get * information about the window where drawing is done. */ -#define DENG_WINDOW (&ClientWindow::main()) +//#define DENG_WINDOW (&ClientWindow::main()) + +#define DENG_GAMEVIEW_WIDTH ClientWindow::main().game().rule().width().valuei() +#define DENG_GAMEVIEW_HEIGHT ClientWindow::main().game().rule().height().valuei() /** * A helpful macro that changes the origin of the window space coordinate system. */ -#define FLIP(y) (DENG_WINDOW->height() - (y+1)) +#define FLIP(y) (ClientWindow::main().height() - ((y)+1)) class ConsoleWidget; class TaskBarWidget; @@ -66,6 +70,7 @@ class ClientWindow : public de::PersistentCanvasWindow, TaskBarWidget &taskBar(); ConsoleWidget &console(); NotificationWidget ¬ifications(); + LegacyWidget &game(); BusyWidget &busy(); /** diff --git a/doomsday/client/src/audio/s_main.cpp b/doomsday/client/src/audio/s_main.cpp index bc60832461..1994a8c5bb 100644 --- a/doomsday/client/src/audio/s_main.cpp +++ b/doomsday/client/src/audio/s_main.cpp @@ -590,7 +590,7 @@ void S_Drawer(void) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); Sfx_DebugInfo(); diff --git a/doomsday/client/src/dd_main.cpp b/doomsday/client/src/dd_main.cpp index ba6a63ae86..1c99a81f20 100644 --- a/doomsday/client/src/dd_main.cpp +++ b/doomsday/client/src/dd_main.cpp @@ -762,8 +762,7 @@ void DD_StartTitle(void) ddstring_t setupCmds; Str_Init(&setupCmds); // Configure the predefined fonts (all normal, variable width). - char const *fontName = R_ChooseVariableFont(FS_NORMAL, DENG_WINDOW->width(), - DENG_WINDOW->height()); + char const *fontName = R_ChooseVariableFont(FS_NORMAL, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT); for(int i = 1; i <= FIPAGE_NUM_PREDEFINED_FONTS; ++i) { @@ -1611,7 +1610,7 @@ bool App_ChangeGame(Game &game, bool allowReload) #ifdef __CLIENT__ char buf[256]; DD_ComposeMainWindowTitle(buf); - DENG_WINDOW->setWindowTitle(buf); + ClientWindow::main().setWindowTitle(buf); #endif if(!DD_IsShuttingDown()) @@ -1635,7 +1634,7 @@ bool App_ChangeGame(Game &game, bool allowReload) #ifdef __CLIENT__ DD_ComposeMainWindowTitle(buf); - DENG_WINDOW->setWindowTitle(buf); + ClientWindow::main().setWindowTitle(buf); #endif /** @@ -1837,7 +1836,7 @@ void DD_FinishInitializationAfterWindowReady() { char buf[256]; DD_ComposeMainWindowTitle(buf); - DENG_WINDOW->setWindowTitle(buf); + ClientWindow::main().setWindowTitle(buf); } #endif @@ -2458,10 +2457,10 @@ int DD_GetInteger(int ddvalue) return I_ShiftDown(); case DD_WINDOW_WIDTH: - return DENG_WINDOW->width(); + return DENG_GAMEVIEW_WIDTH; case DD_WINDOW_HEIGHT: - return DENG_WINDOW->height(); + return DENG_GAMEVIEW_HEIGHT; case DD_CURRENT_CLIENT_FINALE_ID: return Cl_CurrentFinale(); diff --git a/doomsday/client/src/edit_bias.cpp b/doomsday/client/src/edit_bias.cpp index b769958282..bf2f3c0bfc 100644 --- a/doomsday/client/src/edit_bias.cpp +++ b/doomsday/client/src/edit_bias.cpp @@ -521,8 +521,8 @@ static void drawInfoBox(BiasSource *s, int rightX, String const title, float alp int th = FR_SingleLineHeight("Info"); Vector2i size(16 + FR_TextWidth("Color:(0.000, 0.000, 0.000)"), 16 + th * 6); - Vector2i origin(DENG_WINDOW->width() - 10 - size.x - rightX, - DENG_WINDOW->height() - 10 - size.y); + Vector2i origin(DENG_GAMEVIEW_WIDTH - 10 - size.x - rightX, + DENG_GAMEVIEW_HEIGHT - 10 - size.y); ui_color_t color; color.red = s->color().x; @@ -680,7 +680,7 @@ void SBE_DrawGui() glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); glEnable(GL_TEXTURE_2D); @@ -697,7 +697,7 @@ void SBE_DrawGui() Vector2i size(FR_TextWidth(text.toUtf8().constData()) + 16, FR_SingleLineHeight(text.toUtf8().constData()) + 16); - int top = DENG_WINDOW->height() - 10 - size.y; + int top = DENG_GAMEVIEW_HEIGHT - 10 - size.y; Vector2i origin(10, top); drawBoxBackground(origin, size, 0); @@ -724,7 +724,7 @@ void SBE_DrawGui() drawInfoBox(&hand.grabbed().first()->as(), x, "Grabbed", opacity); } - drawLightGauge(Vector2i(20, DENG_WINDOW->height()/2 - 255/2)); + drawLightGauge(Vector2i(20, DENG_GAMEVIEW_HEIGHT/2 - 255/2)); } glMatrixMode(GL_PROJECTION); diff --git a/doomsday/client/src/gl/gl_main.cpp b/doomsday/client/src/gl/gl_main.cpp index 0f65e7d831..32512e2ba5 100644 --- a/doomsday/client/src/gl/gl_main.cpp +++ b/doomsday/client/src/gl/gl_main.cpp @@ -190,7 +190,7 @@ void GL_DoUpdate() DD_WaitForOptimalUpdateTime(); // Blit screen to video. - DENG_WINDOW->swapBuffers(); + ClientWindow::main().swapBuffers(); // We will arrive here always at the same time in relation to the displayed // frame: it is a good time to update the mouse state. diff --git a/doomsday/client/src/network/net_main.cpp b/doomsday/client/src/network/net_main.cpp index 8cd6bce7f8..c1b7ba2eaf 100644 --- a/doomsday/client/src/network/net_main.cpp +++ b/doomsday/client/src/network/net_main.cpp @@ -687,7 +687,7 @@ static boolean recordingDemo(void) void Net_DrawDemoOverlay(void) { char buf[160], tmp[40]; - int x = DENG_WINDOW->width() - 10, y = 10; + int x = DENG_GAMEVIEW_WIDTH - 10, y = 10; if(!recordingDemo() || !(SECONDS_TO_TICKS(gameTime) & 8)) return; @@ -715,7 +715,7 @@ void Net_DrawDemoOverlay(void) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); glEnable(GL_TEXTURE_2D); diff --git a/doomsday/client/src/render/blockmapvisual.cpp b/doomsday/client/src/render/blockmapvisual.cpp index b5b5144e81..43205d09d9 100644 --- a/doomsday/client/src/render/blockmapvisual.cpp +++ b/doomsday/client/src/render/blockmapvisual.cpp @@ -78,7 +78,7 @@ static int rendBspLeaf(BspLeaf *bspLeaf, void * /*parameters*/) if(!bspLeaf->isDegenerate() && bspLeaf->validCount() != validCount) { float const scale = de::max(bmapDebugSize, 1.f); - float const width = (DENG_WINDOW->width() / 16) / scale; + float const width = (DENG_GAMEVIEW_WIDTH / 16) / scale; float length, dx, dy, normal[2], unit[2]; vec2f_t start, end; @@ -562,12 +562,12 @@ void Rend_BlockmapDebug() glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); // Orient on the center of the window. - glTranslatef((DENG_WINDOW->width() / 2), (DENG_WINDOW->height() / 2), 0); + glTranslatef((DENG_GAMEVIEW_WIDTH / 2), (DENG_GAMEVIEW_HEIGHT / 2), 0); // Uniform scaling factor for this visual. - scale = bmapDebugSize / de::max(DENG_WINDOW->height() / 100, 1); + scale = bmapDebugSize / de::max(DENG_GAMEVIEW_HEIGHT / 100, 1); glScalef(scale, -scale, 1); // If possible we'll tailor what we draw relative to the viewPlayer. @@ -586,7 +586,7 @@ void Rend_BlockmapDebug() glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); if(followMobj) { @@ -595,15 +595,15 @@ void Rend_BlockmapDebug() Blockmap::Cell cell = blockmap->toCell(followMobj->origin, &didClip); if(!didClip) { - origin.x = DENG_WINDOW->width() / 2; + origin.x = DENG_GAMEVIEW_WIDTH / 2; origin.y = 30; drawCellInfoBox(blockmap, &origin, objectTypeName, cell); } } // About the Blockmap itself. - origin.x = DENG_WINDOW->width() - 10; - origin.y = DENG_WINDOW->height() - 10; + origin.x = DENG_GAMEVIEW_WIDTH - 10; + origin.y = DENG_GAMEVIEW_HEIGHT - 10; drawBlockmapInfo(&origin, blockmap); glMatrixMode(GL_PROJECTION); diff --git a/doomsday/client/src/render/lightgrid.cpp b/doomsday/client/src/render/lightgrid.cpp index 493810961a..0adebd693a 100644 --- a/doomsday/client/src/render/lightgrid.cpp +++ b/doomsday/client/src/render/lightgrid.cpp @@ -981,7 +981,7 @@ void LightGrid::drawDebugVisual() glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); for(int y = 0; y < d->dimensions.y; ++y) { diff --git a/doomsday/client/src/render/r_main.cpp b/doomsday/client/src/render/r_main.cpp index fa72a3db14..f58a4071cc 100644 --- a/doomsday/client/src/render/r_main.cpp +++ b/doomsday/client/src/render/r_main.cpp @@ -142,8 +142,8 @@ void R_BuildTexGammaLut() #ifdef __CLIENT__ char const *R_ChooseFixedFont() { - if(DENG_WINDOW->width() < 300) return "console11"; - if(DENG_WINDOW->width() > 768) return "console18"; + if(DENG_GAMEVIEW_WIDTH < 300) return "console11"; + if(DENG_GAMEVIEW_WIDTH > 768) return "console18"; return "console14"; } #endif @@ -223,9 +223,9 @@ void R_LoadSystemFonts() if(!Fonts_IsInitialized() || isDedicated) return; loadFontIfNeeded(R_ChooseFixedFont(), &fontFixed); - loadFontIfNeeded(R_ChooseVariableFont(FS_NORMAL, DENG_WINDOW->width(), DENG_WINDOW->height()), &fontVariable[FS_NORMAL]); - loadFontIfNeeded(R_ChooseVariableFont(FS_BOLD, DENG_WINDOW->width(), DENG_WINDOW->height()), &fontVariable[FS_BOLD]); - loadFontIfNeeded(R_ChooseVariableFont(FS_LIGHT, DENG_WINDOW->width(), DENG_WINDOW->height()), &fontVariable[FS_LIGHT]); + loadFontIfNeeded(R_ChooseVariableFont(FS_NORMAL, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT), &fontVariable[FS_NORMAL]); + loadFontIfNeeded(R_ChooseVariableFont(FS_BOLD, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT), &fontVariable[FS_BOLD]); + loadFontIfNeeded(R_ChooseVariableFont(FS_LIGHT, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT), &fontVariable[FS_LIGHT]); //Con_SetFont(fontFixed); @@ -261,8 +261,8 @@ void R_SetupDefaultViewWindow(int consoleNum) vd->window.origin.x = vd->windowOld.origin.x = vd->windowTarget.origin.x = 0; vd->window.origin.y = vd->windowOld.origin.y = vd->windowTarget.origin.y = 0; - vd->window.size.width = vd->windowOld.size.width = vd->windowTarget.size.width = DENG_WINDOW->width(); - vd->window.size.height = vd->windowOld.size.height = vd->windowTarget.size.height = DENG_WINDOW->height(); + vd->window.size.width = vd->windowOld.size.width = vd->windowTarget.size.width = DENG_GAMEVIEW_WIDTH; + vd->window.size.height = vd->windowOld.size.height = vd->windowTarget.size.height = DENG_GAMEVIEW_HEIGHT; vd->windowInter = 1; #endif } @@ -435,10 +435,10 @@ void R_UpdateViewPortGeometry(viewport_t *port, int col, int row) DENG_ASSERT(port); RectRaw *rect = &port->geometry; - int const x = col * DENG_WINDOW->width() / gridCols; - int const y = row * DENG_WINDOW->height() / gridRows; - int const width = (col+1) * DENG_WINDOW->width() / gridCols - x; - int const height = (row+1) * DENG_WINDOW->height() / gridRows - y; + int const x = col * DENG_GAMEVIEW_WIDTH / gridCols; + int const y = row * DENG_GAMEVIEW_HEIGHT / gridRows; + int const width = (col+1) * DENG_GAMEVIEW_WIDTH / gridCols - x; + int const height = (row+1) * DENG_GAMEVIEW_HEIGHT / gridRows - y; ddhook_viewport_reshape_t p; bool doReshape = false; @@ -919,8 +919,8 @@ void R_UseViewPort(viewport_t *vp) if(!vp) { currentViewport = NULL; - glViewport(0, FLIP(0 + DENG_WINDOW->height() - 1), - DENG_WINDOW->width(), DENG_WINDOW->height()); + glViewport(0, FLIP(0 + DENG_GAMEVIEW_HEIGHT - 1), + DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT); } else { diff --git a/doomsday/client/src/render/rend_main.cpp b/doomsday/client/src/render/rend_main.cpp index eec9bfccc3..58d23a5173 100644 --- a/doomsday/client/src/render/rend_main.cpp +++ b/doomsday/client/src/render/rend_main.cpp @@ -2669,7 +2669,7 @@ static void drawLabel(Vector3d const &origin, String const &label, float scale, static void drawLabel(Vector3d const &origin, String const &label) { ddouble distToEye = (Vector3d(vOrigin[VX], vOrigin[VZ], vOrigin[VY]) - origin).length(); - drawLabel(origin, label, distToEye / (DENG_WINDOW->width() / 2), 1 - distToEye / 2000); + drawLabel(origin, label, distToEye / (DENG_GAMEVIEW_WIDTH / 2), 1 - distToEye / 2000); } /* @@ -2903,7 +2903,7 @@ void Rend_DrawLightModMatrix() glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); glTranslatef(BORDER, BORDER, 0); @@ -3094,7 +3094,7 @@ static int drawMobjBBox(thinker_t *th, void * /*context*/) Vector3d eye(vOrigin[VX], vOrigin[VZ], vOrigin[VY]); - float alpha = 1 - ((Vector3d(eye - Vector3d(mo->origin)).length() / (DENG_WINDOW->width()/2)) / 4); + float alpha = 1 - ((Vector3d(eye - Vector3d(mo->origin)).length() / (DENG_GAMEVIEW_WIDTH/2)) / 4); if(alpha < .25f) alpha = .25f; // Don't make them totally invisible. @@ -3165,7 +3165,7 @@ static void Rend_DrawBoundingBoxes(Map &map) polyobj->aaBox.minY + length, sec.floor().height()); - float alpha = 1 - ((Vector3d(eye - pos).length() / (DENG_WINDOW->width()/2)) / 4); + float alpha = 1 - ((Vector3d(eye - pos).length() / (DENG_GAMEVIEW_WIDTH/2)) / 4); if(alpha < .25f) alpha = .25f; // Don't make them totally invisible. @@ -3364,7 +3364,7 @@ static void drawSoundOrigin(Vector3d const &origin, char const *label, Vector3d if(alpha > 0) { - float scale = dist / (DENG_WINDOW->width() / 2); + float scale = dist / (DENG_GAMEVIEW_WIDTH / 2); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -3522,7 +3522,7 @@ static int drawPolyobjVertexes(Polyobj *po, void * /*context*/) if(distToEye < MAX_VERTEX_POINT_DIST) { drawLabel(origin, labelForVertex(&vtx), - distToEye / (DENG_WINDOW->width() / 2), + distToEye / (DENG_GAMEVIEW_WIDTH / 2), 1 - distToEye / MAX_VERTEX_POINT_DIST); } } @@ -3624,7 +3624,7 @@ static void drawVertexes(Map &map) if(distToEye < MAX_VERTEX_POINT_DIST) { drawLabel(origin, labelForVertex(vertex), - distToEye / (DENG_WINDOW->width() / 2), + distToEye / (DENG_GAMEVIEW_WIDTH / 2), 1 - distToEye / MAX_VERTEX_POINT_DIST); } } @@ -3674,7 +3674,7 @@ static void drawSectors(Map &map) if(distToEye < MAX_LABEL_DIST) { drawLabel(origin, labelForCluster(cluster), - distToEye / (DENG_WINDOW->width() / 2), + distToEye / (DENG_GAMEVIEW_WIDTH / 2), 1 - distToEye / MAX_LABEL_DIST); } } diff --git a/doomsday/client/src/render/rend_model.cpp b/doomsday/client/src/render/rend_model.cpp index ca9baf6981..58142032ea 100644 --- a/doomsday/client/src/render/rend_model.cpp +++ b/doomsday/client/src/render/rend_model.cpp @@ -1009,7 +1009,7 @@ static void Mod_RenderSubModel(uint number, rendmodelparams_t const *parm) // Determine the suitable LOD. if(mdl->info.numLODs > 1 && rend_model_lod != 0) { - float lodFactor = rend_model_lod * DENG_WINDOW->width() / 640.0f / (Rend_FieldOfView() / 90.0f); + float lodFactor = rend_model_lod * DENG_GAMEVIEW_WIDTH / 640.0f / (Rend_FieldOfView() / 90.0f); if(!FEQUAL(lodFactor, 0)) lodFactor = 1 / lodFactor; diff --git a/doomsday/client/src/render/rend_particle.cpp b/doomsday/client/src/render/rend_particle.cpp index 8c23434bb6..18d6f46feb 100644 --- a/doomsday/client/src/render/rend_particle.cpp +++ b/doomsday/client/src/render/rend_particle.cpp @@ -925,7 +925,7 @@ static int drawGeneratorOrigin(ptcgen_t* gen, void* parameters) if(alpha > 0) { Point2Raw const labelOrigin(2, 2); - float scale = dist / (DENG_WINDOW->width() / 2); + float scale = dist / (DENG_GAMEVIEW_WIDTH / 2); char buf[80]; sprintf(buf, "%i", gens->generatorId(gen)); diff --git a/doomsday/client/src/render/sprite.cpp b/doomsday/client/src/render/sprite.cpp index bbc228289c..99b40e55fa 100644 --- a/doomsday/client/src/render/sprite.cpp +++ b/doomsday/client/src/render/sprite.cpp @@ -126,7 +126,7 @@ static int drawThinkerId(thinker_t *thinker, void *context) if(alpha > 0) { - float scale = dist / (DENG_WINDOW->width() / 2); + float scale = dist / (DENG_GAMEVIEW_WIDTH / 2); glMatrixMode(GL_MODELVIEW); glPushMatrix(); diff --git a/doomsday/client/src/ui/clientwindow.cpp b/doomsday/client/src/ui/clientwindow.cpp index 545c7a9565..e287b7a807 100644 --- a/doomsday/client/src/ui/clientwindow.cpp +++ b/doomsday/client/src/ui/clientwindow.cpp @@ -136,7 +136,7 @@ public IGameChangeObserver legacy = new LegacyWidget(LEGACY_WIDGET_NAME); legacy->rule() .setLeftTop (root.viewLeft(), root.viewTop()) - .setRightBottom(root.viewRight(), root.viewBottom()); + .setRightBottom(root.viewWidth() / 2, root.viewBottom()); // Initially the widget is disabled. It will be enabled when the window // is visible and ready to be drawn. legacy->disable(); @@ -378,6 +378,11 @@ NotificationWidget &ClientWindow::notifications() return *d->notifications; } +LegacyWidget &ClientWindow::game() +{ + return *d->legacy; +} + BusyWidget &ClientWindow::busy() { return *d->busy; diff --git a/doomsday/client/src/ui/dd_input.cpp b/doomsday/client/src/ui/dd_input.cpp index 1bf47545d7..d58b0dc318 100644 --- a/doomsday/client/src/ui/dd_input.cpp +++ b/doomsday/client/src/ui/dd_input.cpp @@ -2239,7 +2239,7 @@ void Rend_AllInputDeviceStateVisuals(void) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); if(devRendKeyState) { diff --git a/doomsday/client/src/ui/ui_main.cpp b/doomsday/client/src/ui/ui_main.cpp index 28b3d70346..5f4a65ca7c 100644 --- a/doomsday/client/src/ui/ui_main.cpp +++ b/doomsday/client/src/ui/ui_main.cpp @@ -141,8 +141,8 @@ void UI_PageInit(boolean halttime, boolean tckui, boolean tckframe, boolean drwg allowEscape = !noescape; // Init cursor to the center of the screen. - uiCX = DENG_WINDOW->width() / 2; - uiCY = DENG_WINDOW->height() / 2; + uiCX = DENG_GAMEVIEW_WIDTH / 2; + uiCY = DENG_GAMEVIEW_HEIGHT / 2; uiMoved = false; } @@ -305,12 +305,12 @@ void UI_InitPage(ui_page_t* page, ui_object_t* objects) int UI_AvailableWidth(void) { - return DENG_WINDOW->width() - UI_BORDER * 4; + return DENG_GAMEVIEW_WIDTH - UI_BORDER * 4; } int UI_AvailableHeight(void) { - return DENG_WINDOW->height() - UI_BORDER * 4; + return DENG_GAMEVIEW_HEIGHT - UI_BORDER * 4; } int UI_ScreenX(int relx) @@ -419,16 +419,16 @@ int UI_Responder(const ddevent_t* ev) uiCX += ev->axis.pos; if(uiCX < 0) uiCX = 0; - if(uiCX >= DENG_WINDOW->width()) - uiCX = DENG_WINDOW->width() - 1; + if(uiCX >= DENG_GAMEVIEW_WIDTH) + uiCX = DENG_GAMEVIEW_WIDTH - 1; } else if(ev->axis.id == 1) // yaxis. { uiCY += ev->axis.pos; if(uiCY < 0) uiCY = 0; - if(uiCY >= DENG_WINDOW->height()) - uiCY = DENG_WINDOW->height() - 1; + if(uiCY >= DENG_GAMEVIEW_HEIGHT) + uiCY = DENG_GAMEVIEW_HEIGHT - 1; } } @@ -486,24 +486,24 @@ void UI_Drawer(void) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); // Call the active page's drawer. uiCurrentPage->drawer(uiCurrentPage); // Draw mouse cursor? - if(!uiNoMouse && DENG_WINDOW->canvas().isMouseTrapped()) + if(!uiNoMouse && ClientWindow::main().canvas().isMouseTrapped()) { Point2Raw origin; Size2Raw size; float scale; - if(DENG_WINDOW->width() >= DENG_WINDOW->height()) - scale = (DENG_WINDOW->width() / UI_WIDTH) * - (DENG_WINDOW->height() / (float) DENG_WINDOW->width()); + if(DENG_GAMEVIEW_WIDTH >= DENG_GAMEVIEW_HEIGHT) + scale = (DENG_GAMEVIEW_WIDTH / UI_WIDTH) * + (DENG_GAMEVIEW_HEIGHT / (float) DENG_GAMEVIEW_WIDTH); else - scale = (DENG_WINDOW->height() / UI_HEIGHT) * - (DENG_WINDOW->width() / (float) DENG_WINDOW->height()); + scale = (DENG_GAMEVIEW_HEIGHT / UI_HEIGHT) * + (DENG_GAMEVIEW_WIDTH / (float) DENG_GAMEVIEW_HEIGHT); origin.x = uiCX - 1; origin.y = uiCY - 1; @@ -768,7 +768,7 @@ void UIPage_Drawer(ui_page_t *page) // Draw background? if(page->flags.showBackground) { - UI_DrawDDBackground(Point2Raw(0, 0), Size2Raw(DENG_WINDOW->width(), DENG_WINDOW->height()), + UI_DrawDDBackground(Point2Raw(0, 0), Size2Raw(DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT), uiAlpha); } diff --git a/doomsday/client/src/ui/widgets/legacywidget.cpp b/doomsday/client/src/ui/widgets/legacywidget.cpp index 13a6fb78d4..49ea5ec051 100644 --- a/doomsday/client/src/ui/widgets/legacywidget.cpp +++ b/doomsday/client/src/ui/widgets/legacywidget.cpp @@ -103,7 +103,7 @@ DENG2_PIMPL(LegacyWidget) // Draw any full window game graphics. if(App_GameLoaded() && gx.DrawWindow) { - Size2Raw dimensions(DENG_WINDOW->width(), DENG_WINDOW->height()); + Size2Raw dimensions(DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT); gx.DrawWindow(&dimensions); } } diff --git a/doomsday/client/src/ui/zonedebug.cpp b/doomsday/client/src/ui/zonedebug.cpp index bbaf9147e2..5283d28c06 100644 --- a/doomsday/client/src/ui/zonedebug.cpp +++ b/doomsday/client/src/ui/zonedebug.cpp @@ -141,7 +141,7 @@ void Z_DebugDrawer(void) glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); - glOrtho(0, DENG_WINDOW->width(), DENG_WINDOW->height(), 0, -1, 1); + glOrtho(0, DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT, 0, -1, 1); glMatrixMode(GL_MODELVIEW); glPushMatrix(); @@ -155,19 +155,19 @@ void Z_DebugDrawer(void) // Make sure all the volumes fit vertically. volCount = pd.volumeCount; h = 200; - if(h * volCount + 10*(volCount - 1) > DENG_WINDOW->height()) + if(h * volCount + 10*(volCount - 1) > DENG_GAMEVIEW_HEIGHT) { - h = (DENG_WINDOW->height() - 10*(volCount - 1))/volCount; + h = (DENG_GAMEVIEW_HEIGHT - 10*(volCount - 1))/volCount; } i = 0; for(volume = pd.volumeRoot; volume; volume = volume->next, ++i) { RectRaw rect; - rect.size.width = MIN_OF(400, DENG_WINDOW->width()); + rect.size.width = MIN_OF(400, DENG_GAMEVIEW_WIDTH); rect.size.height = h; - rect.origin.x = DENG_WINDOW->width() - rect.size.width - 1; - rect.origin.y = DENG_WINDOW->height() - rect.size.height*(i+1) - 10*i - 1; + rect.origin.x = DENG_GAMEVIEW_WIDTH - rect.size.width - 1; + rect.origin.y = DENG_GAMEVIEW_HEIGHT - rect.size.height*(i+1) - 10*i - 1; Z_DebugDrawVolume(&pd, volume, &rect); }