Skip to content

Commit

Permalink
UI|Refactor|Client: Removed GameUIWidget; view composited by ViewComp…
Browse files Browse the repository at this point in the history
…ositor
  • Loading branch information
skyjake committed Sep 28, 2016
1 parent 1a52664 commit 2126049
Show file tree
Hide file tree
Showing 6 changed files with 58 additions and 208 deletions.
2 changes: 0 additions & 2 deletions doomsday/apps/client/include/ui/viewcompositor.h
Expand Up @@ -75,8 +75,6 @@ class ViewCompositor
*
* Note that the existing contents of the game view framebuffer are used as-is; the
* game view needs to be redrawn separately beforehand, if needed.
*
* @param rect Rectangle in which to draw the layers.
*/
void drawCompositedLayers();

Expand Down
45 changes: 0 additions & 45 deletions doomsday/apps/client/include/ui/widgets/gameuiwidget.h

This file was deleted.

4 changes: 3 additions & 1 deletion doomsday/apps/client/src/render/viewports.cpp
Expand Up @@ -63,7 +63,7 @@

#include "ui/ui_main.h"
#include "ui/clientwindow.h"
#include "ui/widgets/gameuiwidget.h"
//#include "ui/widgets/gameuiwidget.h"

using namespace de;
using namespace world;
Expand Down Expand Up @@ -1035,6 +1035,7 @@ static void restoreDefaultGLState()
DGL_Enable(DGL_POINT_SMOOTH);
}

#if 0
static void clearViewPorts()
{
GLbitfield bits = GL_DEPTH_BUFFER_BIT;
Expand Down Expand Up @@ -1080,6 +1081,7 @@ static void clearViewPorts()
// This is all the clearing we'll do.
LIBGUI_GL.glClear(bits);
}
#endif

void R_RenderViewPort(int playerNum)
{
Expand Down
16 changes: 7 additions & 9 deletions doomsday/apps/client/src/ui/clientwindow.cpp
Expand Up @@ -50,7 +50,6 @@
#include "gl/sys_opengl.h"
#include "gl/gl_main.h"
#include "ui/widgets/gamewidget.h"
#include "ui/widgets/gameuiwidget.h"
#include "ui/widgets/busywidget.h"
#include "ui/widgets/taskbarwidget.h"
#include "ui/widgets/consolewidget.h"
Expand Down Expand Up @@ -87,7 +86,6 @@ DENG2_PIMPL(ClientWindow)
/// Root of the nomal UI widgets of this window.
ClientRootWidget root;
GameWidget *game = nullptr;
GameUIWidget *gameUI = nullptr;
LabelWidget *nowPlaying = nullptr;
TaskBarWidget *taskBar = nullptr;
LabelWidget *taskBarBlur = nullptr; ///< Blur everything below the task bar.
Expand Down Expand Up @@ -184,10 +182,10 @@ DENG2_PIMPL(ClientWindow)
game->disable();
root.add(game);

gameUI = new GameUIWidget;
/*gameUI = new GameUIWidget;
gameUI->rule().setRect(game->rule());
gameUI->disable();
root.add(gameUI);
root.add(gameUI);*/

auto *miniGameControls = new LabelWidget;
{
Expand Down Expand Up @@ -415,8 +413,8 @@ DENG2_PIMPL(ClientWindow)
case Busy:
game->hide();
game->disable();
gameUI->hide();
gameUI->disable();
//gameUI->hide();
//gameUI->disable();
taskBar->disable();

busy->show();
Expand All @@ -429,8 +427,8 @@ DENG2_PIMPL(ClientWindow)

game->show();
game->enable();
gameUI->show();
gameUI->enable();
//gameUI->show();
//gameUI->enable();
taskBar->enable();
break;
}
Expand All @@ -456,7 +454,7 @@ DENG2_PIMPL(ClientWindow)

// Now that the window is ready for drawing we can enable the GameWidget.
game->enable();
gameUI->enable();
//gameUI->enable();

// Configure a viewport immediately.
GLState::current().setViewport(Rectangleui(0, 0, self.pixelWidth(), self.pixelHeight())).apply();
Expand Down
54 changes: 48 additions & 6 deletions doomsday/apps/client/src/ui/viewcompositor.cpp
Expand Up @@ -18,10 +18,17 @@

#include "ui/viewcompositor.h"
#include "ui/clientwindow.h"
#include "ui/infine/finaleinterpreter.h"
#include "ui/infine/finalepagewidget.h"
#include "ui/editors/edit_bias.h"
#include "render/rend_main.h"
#include "render/viewports.h"
#include "world/p_players.h"
#include "world/map.h"
#include "api_console.h"
#include "api_render.h"
#include "clientapp.h"
#include "dd_main.h"

#include <de/Config>
#include <de/GLState>
Expand Down Expand Up @@ -113,6 +120,15 @@ DENG2_PIMPL(ViewCompositor)
viewFramebuf.glDeinit();
frameDrawable.clear();
}

static void setupProjectionForFinale(dgl_borderedprojectionstate_t *bp)
{
GL_ConfigureBorderedProjection(bp, BPF_OVERDRAW_CLIP |
(!App_World().hasMap()? BPF_OVERDRAW_MASK : 0),
SCREENWIDTH, SCREENHEIGHT,
DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT,
scalemode_t(Con_GetByte("rend-finale-stretch")));
}
};

ViewCompositor::ViewCompositor()
Expand Down Expand Up @@ -196,7 +212,7 @@ void ViewCompositor::drawCompositedLayers()

// Game HUD.
{
/// @todo HUD rendering probably doesn't need the vdWindow.
/// @todo HUD rendering probably doesn't need the vdWindow (maybe for the automap?).

auto const *vp = R_CurrentViewPort();
RectRaw vpGeometry(vp->geometry.topLeft.x, vp->geometry.topLeft.y,
Expand All @@ -220,27 +236,53 @@ void ViewCompositor::drawCompositedLayers()
}
}

DGL_MatrixMode(DGL_PROJECTION);
DGL_PopMatrix();

// Finale.
{

if (App_InFineSystem().finaleInProgess())
{
dgl_borderedprojectionstate_t bp;
d->setupProjectionForFinale(&bp);
GL_BeginBorderedProjection(&bp);
for (Finale *finale : App_InFineSystem().finales())
{
finale->interpreter().page(FinaleInterpreter::Anims).draw();
finale->interpreter().page(FinaleInterpreter::Texts).draw();
}
GL_EndBorderedProjection(&bp);
}
}

// Non-map game screens.
{

// Draw any full window game graphics.
if (gx.DrawWindow)
{
Size2Raw const dimensions(DENG_GAMEVIEW_WIDTH, DENG_GAMEVIEW_HEIGHT);
gx.DrawWindow(&dimensions);
}
}

// Legacy engine/debug UIs (stuff from the old Net_Drawer).
{
// Draw the widgets of the Shadow Bias Editor (if active).
SBE_DrawGui();

// Debug visualizations.
if (App_World().hasMap() && App_World().map().hasLightGrid())
{
Rend_LightGridVisual(App_World().map().lightGrid());
}
Net_Drawer();
Sfx_ChannelDrawer();
}

// Restore the default drawing state.
R_UseViewPort(nullptr);
displayPlayer = oldDisplayPlayer;

DGL_MatrixMode(DGL_PROJECTION);
DGL_PopMatrix();

GLState::considerNativeStateUndefined();
GLState::pop().apply();
}
145 changes: 0 additions & 145 deletions doomsday/apps/client/src/ui/widgets/gameuiwidget.cpp

This file was deleted.

0 comments on commit 2126049

Please sign in to comment.