Skip to content

Commit

Permalink
Refactor|Added: Replacing SDL window management with Qt
Browse files Browse the repository at this point in the history
Also, modified some of the libdeng header files to be C++ friendly.
  • Loading branch information
skyjake committed Mar 11, 2012
1 parent 5bc548d commit 37e4ead
Show file tree
Hide file tree
Showing 7 changed files with 302 additions and 263 deletions.
5 changes: 2 additions & 3 deletions doomsday/engine/engine.pro
Expand Up @@ -368,7 +368,6 @@ HEADERS += \
$$DENG_HEADERS

DENG_UNIX_SOURCES += \
portable/src/sys_sdl_window.c \
unix/src/dd_uinit.c \
unix/src/sys_console.c \
unix/src/sys_findfile.c \
Expand All @@ -379,8 +378,7 @@ DENG_WIN32_SOURCES += \
win32/src/dd_winit.c \
win32/src/sys_console.c \
win32/src/sys_findfile.c \
win32/src/sys_input.c \
win32/src/sys_window.c
win32/src/sys_input.c

SOURCES += \
portable/src/abstractfile.c \
Expand Down Expand Up @@ -568,6 +566,7 @@ SOURCES += \
portable/src/sys_sock.c \
portable/src/sys_system.c \
portable/src/sys_timer.c \
portable/src/sys_window.cpp \
portable/src/tab_tables.c \
portable/src/texture.c \
portable/src/textures.c \
Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/portable/include/con_main.h
Expand Up @@ -29,6 +29,10 @@
#ifndef LIBDENG_CONSOLE_MAIN_H
#define LIBDENG_CONSOLE_MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

#include <stdio.h>
#include "dd_share.h"
#include "dd_types.h"
Expand Down Expand Up @@ -382,4 +386,8 @@ void Con_PrintCVar(cvar_t* cvar, char* prefix);
*/
void Con_PrintCCmdUsage(ccmd_t* ccmd, boolean printInfo);

#ifdef __cplusplus
}
#endif

#endif /* LIBDENG_CONSOLE_MAIN_H */
25 changes: 14 additions & 11 deletions doomsday/engine/portable/include/dd_main.h
Expand Up @@ -29,16 +29,19 @@
#ifndef LIBDENG_MAIN_H
#define LIBDENG_MAIN_H

#include "dd_types.h"
#include "game.h"
#include "sys_direc.h"
#include "textures.h"
#include "de/c_wrapper.h"

#ifdef __cplusplus
extern "C" {
#endif

#include "dd_types.h"
#include "dd_plugin.h"
#ifndef __cplusplus // Kludge: these aren't yet C++ compatible
# include "game.h"
# include "textures.h"
#endif
#include "sys_direc.h"
#include "de/c_wrapper.h"

// Verbose messages.
#define VERBOSE(code) { if(verbose >= 1) { code; } }
#define VERBOSE2(code) { if(verbose >= 2) { code; } }
Expand Down Expand Up @@ -72,7 +75,7 @@ extern GETGAMEAPI GetGameAPI;
#endif

/// Currently active game.
extern Game* theGame;
extern struct Game_s* theGame;

int DD_EarlyInit(void);
boolean DD_Init(void);
Expand Down Expand Up @@ -128,18 +131,18 @@ int DD_GameCount(void);
/**
* @return Game associated with unique index @a idx else @c NULL.
*/
Game* DD_GameByIndex(int idx);
struct Game_s* DD_GameByIndex(int idx);

/**
* @return Game associated with @a identityKey else @c NULL.
*/
Game* DD_GameByIdentityKey(const char* identityKey);
struct Game_s* DD_GameByIdentityKey(const char* identityKey);

/**
* Is this the special "null-game" object (not a real playable game).
* \todo Implement a proper null-game object for this.
*/
boolean DD_IsNullGame(const Game* game);
boolean DD_IsNullGame(const struct Game_s* game);

/**
* @defgroup printGameFlags Print Game Flags.
Expand All @@ -158,7 +161,7 @@ boolean DD_IsNullGame(const Game* game);
* @param info Game record to be printed.
* @param flags &see printGameFlags
*/
void DD_PrintGame(Game* game, int flags);
void DD_PrintGame(struct Game_s* game, int flags);

/**
* Frees the info structures for all registered games.
Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/portable/include/gl_main.h
Expand Up @@ -29,6 +29,10 @@
#ifndef LIBDENG_GRAPHICS_H
#define LIBDENG_GRAPHICS_H

#ifdef __cplusplus
extern "C" {
#endif

#include "r_main.h"

struct colorpalette_s;
Expand Down Expand Up @@ -160,4 +164,8 @@ void GL_CalcLuminance(const uint8_t* buffer, int width, int height, int comps,
// Console commands.
D_CMD(UpdateGammaRamp);

#ifdef __cplusplus
}
#endif

#endif /* LIBDENG_GRAPHICS_H */
13 changes: 12 additions & 1 deletion doomsday/engine/portable/include/sys_window.h
Expand Up @@ -29,14 +29,21 @@
#ifndef LIBDENG_SYS_WINDOW_H
#define LIBDENG_SYS_WINDOW_H

#include "de_base.h"
#include "dd_types.h"
#include "rect.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(UNIX)
# include <curses.h>
# include "dd_uinit.h"
#endif

#if defined(WIN32)
# include <windows.h>
# include "dd_winit.h"
#endif

// Structure used to describe what features are available in a window
Expand Down Expand Up @@ -186,4 +193,8 @@ ddwindow_t* Sys_MainWindow(void);
HWND Sys_GetWindowHandle(uint idx);
#endif

#ifdef __cplusplus
}
#endif

#endif /* LIBDENG_SYS_WINDOW_H */
8 changes: 8 additions & 0 deletions doomsday/engine/portable/include/ui_main.h
Expand Up @@ -29,6 +29,10 @@
#ifndef LIBDENG_UI_MAIN_H
#define LIBDENG_UI_MAIN_H

#ifdef __cplusplus
extern "C" {
#endif

#include "rect.h"

#define IS_ACTKEY(x) (x == ' ' || x == DDKEY_RETURN)
Expand Down Expand Up @@ -398,4 +402,8 @@ int UI_TextOutWrap(const char* text, const Point2Raw* origin, const Size2Raw* si
int UI_TextOutWrapEx(const char* text, const Point2Raw* origin, const Size2Raw* size, ui_color_t* color, float alpha);
void UI_DrawHelpBox(const Point2Raw* origin, const Size2Raw* size, float alpha, char* text);

#ifdef __cplusplus
}
#endif

#endif /* LIBDENG_UI_MAIN_H */

0 comments on commit 37e4ead

Please sign in to comment.