Skip to content

Commit

Permalink
Windows: Fixed build issues and widget initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jun 4, 2013
1 parent 6d4da2f commit 758fa49
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion doomsday/client/include/de_platform.h
Expand Up @@ -53,7 +53,7 @@

#define stricmp _stricmp
#define strnicmp _strnicmp
#define open _open
//#define open _open
//#define close _close
//#define read _read
//#define write _write
Expand Down
11 changes: 6 additions & 5 deletions doomsday/client/src/m_misc.cpp
Expand Up @@ -23,6 +23,8 @@

// HEADER FILES ------------------------------------------------------------

#include "de_platform.h"

#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
Expand All @@ -31,6 +33,10 @@
# include <direct.h>
# include <io.h>
# include <conio.h>
# ifndef O_BINARY
# define O_BINARY 0
# endif
# define open _open
#endif

#if defined(UNIX)
Expand All @@ -42,7 +48,6 @@
#include <ctype.h>
#include <math.h>

#include "de_platform.h"
#include "de_base.h"
#include "de_console.h"
#include "de_system.h"
Expand Down Expand Up @@ -256,10 +261,6 @@ int M_BoxOnLineSide2(const AABoxd* box, double const linePoint[], double const l
#undef NORMALIZE
}

#ifndef O_BINARY
# define O_BINARY 0
#endif

DENG_EXTERN_C boolean M_WriteFile(const char* name, const char* source, size_t length)
{
int handle = open(name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/src/ui/widgets/busywidget.cpp
Expand Up @@ -63,6 +63,8 @@ void BusyWidget::viewResized()

void BusyWidget::update()
{
GuiWidget::update();

DENG_ASSERT(BusyMode_Active());
BusyMode_Loop();
}
Expand Down
9 changes: 6 additions & 3 deletions doomsday/client/src/ui/widgets/guirootwidget.cpp
Expand Up @@ -169,8 +169,11 @@ void GuiRootWidget::routeMouse(Widget *routeTo)

void GuiRootWidget::update()
{
// Allow GL operations.
window().canvas().makeCurrent();
if(window().canvas().isGLReady())
{
// Allow GL operations.
window().canvas().makeCurrent();

RootWidget::update();
RootWidget::update();
}
}
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/widgets/guiwidget.cpp
Expand Up @@ -202,7 +202,7 @@ void GuiWidget::update()

void GuiWidget::drawIfVisible()
{
if(!isHidden())
if(!isHidden() && d->inited)
{
if(clipped())
{
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/src/ui/widgets/legacywidget.cpp
Expand Up @@ -83,6 +83,8 @@ void LegacyWidget::viewResized()

void LegacyWidget::update()
{
GuiWidget::update();

if(isDisabled()) return;

//LOG_DEBUG("Legacy update");
Expand Down
12 changes: 7 additions & 5 deletions doomsday/plugins/common/src/hu_menu.c
Expand Up @@ -6467,12 +6467,14 @@ D_CMD(MenuOpen)
return true;
}

mn_page_t* page = Hu_MenuFindPageByName(argv[1]);
if(page)
{
Hu_MenuCommand(MCMD_OPEN);
Hu_MenuSetActivePage(page);
return true;
mn_page_t* page = Hu_MenuFindPageByName(argv[1]);
if(page)
{
Hu_MenuCommand(MCMD_OPEN);
Hu_MenuSetActivePage(page);
return true;
}
}
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/tests/test_glsandbox/testwindow.cpp
Expand Up @@ -234,7 +234,7 @@ DENG2_OBSERVES(Bank, Load)

self.canvas().makeCurrent();
testpic.setImage(imageBank.image(path));
self.canvas().doneCurrent();
//self.canvas().doneCurrent();

imageBank.unload(path);
}
Expand Down

0 comments on commit 758fa49

Please sign in to comment.