Skip to content

Commit

Permalink
Merge branch 'master' into defs-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed May 21, 2014
2 parents 0ceb670 + d466df9 commit 1a2739c
Show file tree
Hide file tree
Showing 35 changed files with 115 additions and 51 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/client.pro
Expand Up @@ -56,7 +56,7 @@ win32 {
RC_FILE = res/windows/doomsday.rc
OTHER_FILES += $$RC_FILE

QMAKE_LFLAGS += /NODEFAULTLIB:libcmt
deng_msvc: QMAKE_LFLAGS += /NODEFAULTLIB:libcmt

LIBS += -lkernel32 -lgdi32 -lole32 -luser32 -lwsock32 -lopengl32
}
Expand All @@ -71,7 +71,7 @@ else {

# Source Files ---------------------------------------------------------------

PRECOMPILED_HEADER = include/precompiled.h
!deng_mingw: PRECOMPILED_HEADER = include/precompiled.h

DENG_API_HEADERS = \
$$DENG_API_DIR/apis.h \
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/dd_def.h
Expand Up @@ -38,7 +38,7 @@
extern "C" {
#endif

#ifdef WIN32
#ifdef WIN32_MSVC
// Disable annoying MSVC warnings.
// 4761: integral size mismatch in argument
// 4244: conversion from 'type1' to 'type2', possible loss of data
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/include/de_platform.h
Expand Up @@ -26,6 +26,7 @@
#define __DOOMSDAY_PLATFORM__

#include "dd_types.h"
#include <de/libcore.h>

/*
* The Win32 Platform
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/include/tab_anorms.h
Expand Up @@ -8,7 +8,7 @@
* From Quake.
*/

#ifdef WIN32
#ifdef WIN32_MSVC
#pragma warning(disable:4305)
#endif

Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/include/ui/clientwindow.h
Expand Up @@ -29,6 +29,8 @@
#include "resource/image.h"
#include "ui/widgets/gamewidget.h"

#undef main

/**
* 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
Expand Down
2 changes: 2 additions & 0 deletions doomsday/client/include/ui/clientwindowsystem.h
Expand Up @@ -22,6 +22,8 @@
#include <de/WindowSystem>
#include "SettingsRegister"

#undef main

class ClientWindow;

/**
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/audio/sys_audiod_sdlmixer.cpp
Expand Up @@ -30,6 +30,7 @@

#include <SDL.h>
#include <SDL_mixer.h>
#undef main

#include "de_base.h"
#include "de_console.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/m_misc.cpp
Expand Up @@ -20,6 +20,7 @@
#define DENG_NO_API_MACROS_FILESYS

#include "de_platform.h"
#include "de_console.h"

#include <sys/stat.h>
#include <sys/types.h>
Expand All @@ -42,7 +43,6 @@
#endif

#include "de_base.h"
#include "de_console.h"
#include "de_system.h"
#include "de_filesys.h"
#include "de_graphics.h"
Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/main_client.cpp
Expand Up @@ -84,4 +84,5 @@ int main(int argc, char** argv)
// Check that all reference-counted objects have been deleted.
DENG2_ASSERT(de::Counted::totalCount == 0);
#endif
return 0;
}
2 changes: 1 addition & 1 deletion doomsday/client/src/ui/p_control.cpp
Expand Up @@ -23,7 +23,7 @@

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

#ifdef WIN32
#ifdef WIN32_MSVC
# pragma warning (disable:4100) // lots of unused arguments
#endif

Expand Down
1 change: 1 addition & 0 deletions doomsday/client/src/windows/directinput.cpp
Expand Up @@ -23,6 +23,7 @@

#include "directinput.h"
#include "dd_winit.h"
#include <de/Log>

static LPDIRECTINPUT8 dInput;
static LPDIRECTINPUT dInput3;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/client/src/windows/joystick_win32.cpp
Expand Up @@ -147,7 +147,7 @@ dd_bool Joystick_Init()
}

// Set properties.
for(int i = 0; i < sizeof(joyProp) / sizeof(joyProp[0]); ++i)
for(uint i = 0; i < sizeof(joyProp) / sizeof(joyProp[0]); ++i)
{
hr = didJoy->SetProperty(DIPROP_RANGE, DIPropRange(DIPH_BYOFFSET, joyProp[i], IJOY_AXISMIN, IJOY_AXISMAX));
if(FAILED(hr))
Expand Down
28 changes: 20 additions & 8 deletions doomsday/config_win32.pri
Expand Up @@ -5,14 +5,21 @@
# Windows-specific configuration.

win32-g++* {
error("Sorry, gcc is not supported in the Windows build.")
CONFIG += deng_mingw
DEFINES += MINGW32 GNU_X86_FIXED_ASM
}
else {
CONFIG += deng_msvc
DEFINES += MSVC WIN32_MSVC
}

DEFINES += WIN32 MSVC _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES
DEFINES += WIN32 _CRT_SECURE_NO_WARNINGS _USE_MATH_DEFINES

# Disable warnings about unreferenced formal parameters (C4100).
QMAKE_CFLAGS += -w14505 -wd4100 -wd4748
QMAKE_CXXFLAGS += -w14505 -wd4100 -wd4748
deng_msvc {
# Disable warnings about unreferenced formal parameters (C4100).
QMAKE_CFLAGS += -w14505 -wd4100 -wd4748
QMAKE_CXXFLAGS += -w14505 -wd4100 -wd4748
}

DENG_WIN_PRODUCTS_DIR = $$PWD/../distrib/products

Expand All @@ -24,10 +31,15 @@ DENG_PLUGIN_LIB_DIR = $$DENG_LIB_DIR/plugins
DENG_DATA_DIR = $$DENG_BASE_DIR/data
DENG_DOCS_DIR = $$DENG_BASE_DIR/doc

# Tell rc where to get the API headers.
QMAKE_RC = $$QMAKE_RC /I \"$$DENG_API_DIR\"
deng_msvc {
# Tell rc where to get the API headers.
QMAKE_RC = $$QMAKE_RC /I \"$$DENG_API_DIR\"

deng_debug: QMAKE_RC = $$QMAKE_RC /d _DEBUG
deng_debug: QMAKE_RC = $$QMAKE_RC /d _DEBUG
}
deng_mingw {
QMAKE_RC = $$QMAKE_RC --include-dir=\"$$DENG_API_DIR\"
}

# Also build the OpenAL plugin.
CONFIG += deng_openal
9 changes: 7 additions & 2 deletions doomsday/dep_assimp.pri
Expand Up @@ -34,8 +34,13 @@ deng_extassimp {
# On Windows we assume that cmake has been run in the root of
# the assimp source tree.
aiIncDir = $$ASSIMP_DIR/include
deng_debug: aiLibs = -L$$ASSIMP_DIR/lib/debug -lassimpd
else: aiLibs = -L$$ASSIMP_DIR/lib/release -lassimp
deng_msvc {
deng_debug: aiLibs = -L$$ASSIMP_DIR/lib/debug -lassimpd
else: aiLibs = -L$$ASSIMP_DIR/lib/release -lassimp
}
else {
aiLibs = -L$$ASSIMP_DIR/lib -lassimp
}

INSTALLS += assimplib
assimplib.path = $$DENG_BIN_DIR
Expand Down
3 changes: 2 additions & 1 deletion doomsday/dep_legacy.pri
Expand Up @@ -4,7 +4,8 @@ INCLUDEPATH += $$LIBDENG_INCLUDE_DIR

win32 {
# Tell rc where to get the API headers.
QMAKE_RC = $$QMAKE_RC /I \"$$LIBDENG_INCLUDE_DIR\"
deng_msvc: QMAKE_RC = $$QMAKE_RC /I \"$$LIBDENG_INCLUDE_DIR\"
deng_mingw: QMAKE_RC = $$QMAKE_RC --include-dir=\"$$LIBDENG_INCLUDE_DIR\"
}

# Use the appropriate library path (trying some alternatives).
Expand Down
2 changes: 2 additions & 0 deletions doomsday/libappfw/include/de/framework/windowsystem.h
Expand Up @@ -33,6 +33,8 @@

namespace de {

#undef main

/**
* Window management subsystem.
*
Expand Down
10 changes: 5 additions & 5 deletions doomsday/libcore/include/de/core/matrix.h
Expand Up @@ -357,18 +357,18 @@ class Matrix4
m.at(3, 2) = -Type(2) * farDistance * nearDistance / depth;
return m;
}
static Matrix4 perspectiveZoom(Type width, Type height, Type near = 1.f, Type far = 1000.f, Type zoom = 1.f) {
static Matrix4 perspectiveZoom(Type width, Type height, Type nearDist = 1.f, Type farDist = 1000.f, Type zoom = 1.f) {
Type const zoomHalf = zoom / 2;
Type const aspect = width / height;
Type const left = -zoomHalf;
Type const right = zoomHalf;
Type const bottom = -zoomHalf / aspect;
Type const top = zoomHalf / aspect;
Type m[16] = {
2 * near / (right - left), 0, 0, 0,
0, 2 * near / (top - bottom), 0, 0,
(right + left) / (right - left), (top + bottom) / (top - bottom), -(far + near) / (far - near), -1,
0, 0, -2 * (far * near) / (far - near), 0
2 * nearDist / (right - left), 0, 0, 0,
0, 2 * nearDist / (top - bottom), 0, 0,
(right + left) / (right - left), (top + bottom) / (top - bottom), -(farDist + nearDist) / (farDist - nearDist), -1,
0, 0, -2 * (farDist * nearDist) / (farDist - nearDist), 0
};
return m;
}
Expand Down
2 changes: 2 additions & 0 deletions doomsday/libgui/include/de/gui/persistentcanvaswindow.h
Expand Up @@ -26,6 +26,8 @@

namespace de {

#undef main

/**
* General-purpose top-level window with persistent state. Each instance must
* be identified by a unique name (e.g., "main") that is used when saving the
Expand Down
6 changes: 5 additions & 1 deletion doomsday/libgui/src/graphics/glentrypoints.cpp
Expand Up @@ -122,7 +122,11 @@ void getAllOpenGLEntryPoints()
if(haveProcs) return;

#ifdef WIN32
# define GET_PROC_EXT(name) *((void**)&name) = wglGetProcAddress(#name)
# ifdef MSVC
# define GET_PROC_EXT(name) *((void**)&name) = wglGetProcAddress(#name)
# else
# define GET_PROC_EXT(name) *reinterpret_cast<PROC *>(&name) = wglGetProcAddress(#name)
# endif
#else
# define GET_PROC_EXT(name) *((void (**)())&name) = glXGetProcAddress((GLubyte const *)#name)
#endif
Expand Down
22 changes: 11 additions & 11 deletions doomsday/plugins/common/src/hu_chat.c
Expand Up @@ -43,17 +43,17 @@
#include "hu_chat.h"

cvartemplate_t chatCVars[] = {
{ "chat-macro0", 0, CVT_CHARPTR, &cfg.chatMacros[0], 0, 0 },
{ "chat-macro1", 0, CVT_CHARPTR, &cfg.chatMacros[1], 0, 0 },
{ "chat-macro2", 0, CVT_CHARPTR, &cfg.chatMacros[2], 0, 0 },
{ "chat-macro3", 0, CVT_CHARPTR, &cfg.chatMacros[3], 0, 0 },
{ "chat-macro4", 0, CVT_CHARPTR, &cfg.chatMacros[4], 0, 0 },
{ "chat-macro5", 0, CVT_CHARPTR, &cfg.chatMacros[5], 0, 0 },
{ "chat-macro6", 0, CVT_CHARPTR, &cfg.chatMacros[6], 0, 0 },
{ "chat-macro7", 0, CVT_CHARPTR, &cfg.chatMacros[7], 0, 0 },
{ "chat-macro8", 0, CVT_CHARPTR, &cfg.chatMacros[8], 0, 0 },
{ "chat-macro9", 0, CVT_CHARPTR, &cfg.chatMacros[9], 0, 0 },
{ "chat-beep", 0, CVT_BYTE, &cfg.chatBeep, 0, 1 },
{ "chat-macro0", 0, CVT_CHARPTR, &cfg.chatMacros[0], 0, 0, NULL },
{ "chat-macro1", 0, CVT_CHARPTR, &cfg.chatMacros[1], 0, 0, NULL },
{ "chat-macro2", 0, CVT_CHARPTR, &cfg.chatMacros[2], 0, 0, NULL },
{ "chat-macro3", 0, CVT_CHARPTR, &cfg.chatMacros[3], 0, 0, NULL },
{ "chat-macro4", 0, CVT_CHARPTR, &cfg.chatMacros[4], 0, 0, NULL },
{ "chat-macro5", 0, CVT_CHARPTR, &cfg.chatMacros[5], 0, 0, NULL },
{ "chat-macro6", 0, CVT_CHARPTR, &cfg.chatMacros[6], 0, 0, NULL },
{ "chat-macro7", 0, CVT_CHARPTR, &cfg.chatMacros[7], 0, 0, NULL },
{ "chat-macro8", 0, CVT_CHARPTR, &cfg.chatMacros[8], 0, 0, NULL },
{ "chat-macro9", 0, CVT_CHARPTR, &cfg.chatMacros[9], 0, 0, NULL },
{ "chat-beep", 0, CVT_BYTE, &cfg.chatBeep, 0, 1, NULL },
{ NULL }
};

Expand Down
6 changes: 6 additions & 0 deletions doomsday/plugins/config_plugin.pri
Expand Up @@ -26,3 +26,9 @@ INCLUDEPATH += $$DENG_API_DIR
else: include(../dep_core.pri)

include(../dep_legacy.pri)

deng_mingw: QMAKE_CFLAGS_WARN_ON += \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wno-missing-braces \
-Wno-unused-function
4 changes: 3 additions & 1 deletion doomsday/plugins/dehread/dehread.pro
Expand Up @@ -30,7 +30,9 @@ SOURCES += src/dehread.cpp \
src/info.cpp

win32 {
QMAKE_LFLAGS += /DEF:\"$$PWD/api/dpdehread.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/dpdehread.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/dpdehread.def\"

OTHER_FILES += api/dpdehread.def

RC_FILE = res/dehread.rc
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/doom/doom.pro
Expand Up @@ -94,7 +94,9 @@ SOURCES += \
src/wi_stuff.c

win32 {
QMAKE_LFLAGS += /DEF:\"$$PWD/api/doom.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/doom.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/doom.def\"

OTHER_FILES += api/doom.def

RC_FILE = res/doom.rc
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/doom/include/doomdef.h
Expand Up @@ -34,7 +34,9 @@
#include <string.h>

#ifdef WIN32
# pragma warning(disable:4244)
# ifdef MSVC
# pragma warning(disable:4244)
# endif
# define stricmp _stricmp
# define strnicmp _strnicmp
# define strlwr _strlwr
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/doom64/doom64.pro
Expand Up @@ -86,7 +86,9 @@ SOURCES += \
src/wi_stuff.c \

win32 {
QMAKE_LFLAGS += /DEF:\"$$PWD/api/doom64.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/doom64.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/doom64.def\"

OTHER_FILES += api/doom64.def

RC_FILE = res/doom64.rc
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/doom64/include/doomdef.h
Expand Up @@ -33,7 +33,9 @@
#endif

#ifdef WIN32
# pragma warning(disable:4244)
# ifdef MSVC
# pragma warning(disable:4244)
# endif
# define stricmp _stricmp
# define strnicmp _strnicmp
# define strlwr _strlwr
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/example/example.pro
Expand Up @@ -18,7 +18,9 @@ SOURCES += \
win32 {
RC_FILE = res/example.rc

QMAKE_LFLAGS += /DEF:\"$$PWD/api/example.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/example.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/example.def\"

OTHER_FILES += \
api/example.def \
doc/readme.txt \
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/heretic/heretic.pro
Expand Up @@ -93,7 +93,9 @@ SOURCES += \
src/tables.c

win32 {
QMAKE_LFLAGS += /DEF:\"$$PWD/api/heretic.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/heretic.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/heretic.def\"

OTHER_FILES += api/heretic.def

RC_FILE = res/heretic.rc
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/heretic/include/doomdef.h
Expand Up @@ -34,7 +34,9 @@
#include <string.h>

#ifdef WIN32
# pragma warning(disable:4244)
# ifdef MSVC
# pragma warning(disable:4244)
# endif
# define stricmp _stricmp
# define strnicmp _strnicmp
# define strlwr _strlwr
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/hexen/hexen.pro
Expand Up @@ -102,7 +102,9 @@ SOURCES += \
src/x_api.c

win32 {
QMAKE_LFLAGS += /DEF:\"$$PWD/api/hexen.def\"
deng_msvc: QMAKE_LFLAGS += /DEF:\"$$PWD/api/hexen.def\"
deng_mingw: QMAKE_LFLAGS += --def \"$$PWD/api/hexen.def\"

OTHER_FILES += api/hexen.def

RC_FILE = res/hexen.rc
Expand Down
4 changes: 3 additions & 1 deletion doomsday/plugins/hexen/include/h2def.h
Expand Up @@ -30,7 +30,9 @@
#include <string.h>

#ifdef WIN32
# pragma warning(disable:4244)
# ifdef MSVC
# pragma warning(disable:4244)
# endif
# define stricmp _stricmp
# define strnicmp _strnicmp
# define strlwr _strlwr
Expand Down

0 comments on commit 1a2739c

Please sign in to comment.