Skip to content

Commit

Permalink
qmake|libgui|Scripting: Moved gui.de to libgui
Browse files Browse the repository at this point in the history
gui.de directly relates to functionality in libgui, so it should be
located in libgui's modules.

Project files updates accordingly. client.pro still handles the
installation of all Doomsday Script modules for the Doomsday client.
  • Loading branch information
skyjake committed Feb 26, 2014
1 parent ec9cf01 commit 5543f69
Show file tree
Hide file tree
Showing 6 changed files with 82 additions and 61 deletions.
4 changes: 2 additions & 2 deletions doomsday/client/client.pro
Expand Up @@ -815,9 +815,9 @@ data.files = $$OUT_PWD/../doomsday.pk3
mod.files = \
$$DOOMSDAY_SCRIPTS \
$$DENG_MODULES_DIR/Config.de \
$$DENG_MODULES_DIR/gui.de \
$$DENG_MODULES_DIR/Log.de \
$$DENG_MODULES_DIR/recutil.de
$$DENG_MODULES_DIR/recutil.de \
$$DENG_MODULES_DIR/../../libgui/modules/gui.de

# These fonts may be needed during the initial startup busy mode.
startupfonts.files = \
Expand Down
51 changes: 4 additions & 47 deletions doomsday/client/modules/appconfig.de
Expand Up @@ -23,13 +23,16 @@
#
# TODO: make sure the server doesn't run this

import gui
import Version
import Updater
import Log

def setDefaults(d)
# Applies the client's defaults.
# - d: Record where to set the values.

gui.setDefaults(d)

# Additional Log defaults.
d.log.filterBySubsystem = False
Expand All @@ -47,52 +50,6 @@ def setDefaults(d)
record d.input
record d.input.mouse
d.input.mouse.syncSensitivity = True

try
import DisplayMode

# The default audio and video subsystems.
d.video = 'opengl'
d.audio = 'fmod'

# Window manager defaults.
record d.window
d.window.fsaa = True # Remove this (should be window-specific).

# Configure the main window.
record d.window.main
d.window.main.showFps = False
d.window.main.center = True
d.window.main.fsaa = True
d.window.main.vsync = True

# The default window parameters depend on the original display mode.
mode = DisplayMode.originalMode()

# By default the fullscreen resolution is the desktop resolution.
d.window.main.fullSize = [mode['width'], mode['height']]

# In windowed mode mode, leave some space on the sides so that
# the first switch to windowed mode does not place the window in an
# inconvenient location. The reduction is done proportionally.
offx = mode['width'] * 0.15
offy = mode['height'] * 0.15
d.window.main.rect = [offx, offy,
mode['width'] - 2*offx,
mode['height'] - 2*offy]
d.window.main.colorDepth = mode['depth']

if Version.OS == 'windows' or Version.OS == 'macx'
d.window.main.fullscreen = True
d.window.main.maximize = False
else
d.window.main.fullscreen = False
d.window.main.maximize = True
end

catch NotFoundError
# DisplayMode isn't available on the server.
end

# Defaults for the automatic updater.
record d.updater
Expand All @@ -114,5 +71,5 @@ def setDefaults(d)
record d.console
d.console.snap = True
d.console.script = False
end


15 changes: 9 additions & 6 deletions doomsday/config.pri
Expand Up @@ -122,16 +122,19 @@ deng_nosdl {
deng_sdk {
# SDK install location.
!isEmpty(SDK_PREFIX) {
DENG_SDK_HEADER_DIR = $$SDK_PREFIX/include/doomsday/de
DENG_SDK_LIB_DIR = $$SDK_PREFIX/lib
DENG_SDK_DIR = $$SDK_PREFIX
DENG_SDK_HEADER_DIR = $$DENG_SDK_DIR/include/doomsday/de
DENG_SDK_LIB_DIR = $$DENG_SDK_DIR/lib
}
else:!isEmpty(PREFIX) {
DENG_SDK_HEADER_DIR = $$PREFIX/include/doomsday/de
DENG_SDK_LIB_DIR = $$PREFIX/lib
DENG_SDK_DIR = $$PREFIX
DENG_SDK_HEADER_DIR = $$DENG_SDK_DIR/include/doomsday/de
DENG_SDK_LIB_DIR = $$DENG_SDK_DIR/lib
}
else {
DENG_SDK_HEADER_DIR = $$OUT_PWD/../include/de
DENG_SDK_LIB_DIR = $$OUT_PWD/../lib
DENG_SDK_DIR = $$OUT_PWD/..
DENG_SDK_HEADER_DIR = $$DENG_SDK_DIR/include/de
DENG_SDK_LIB_DIR = $$DENG_SDK_DIR/lib
}
echo(SDK header directory: $$DENG_SDK_HEADER_DIR)
echo(SDK library directory: $$DENG_SDK_LIB_DIR)
Expand Down
10 changes: 7 additions & 3 deletions doomsday/libdeng2/libdeng2.pro
Expand Up @@ -171,11 +171,14 @@ SOURCES += \
src/core/textstreamlogsink.cpp \
src/core/unixinfo.cpp

OTHER_FILES += \
scripts.files = \
modules/Config.de \
modules/gui.de \
modules/Log.de \
modules/recutil.de

OTHER_FILES += \
$$scripts.files

# Installation ---------------------------------------------------------------

macx {
Expand All @@ -199,6 +202,7 @@ macx {
}

deng_sdk {
INSTALLS *= target
INSTALLS *= target scripts
target.path = $$DENG_SDK_LIB_DIR
scripts.path = $$DENG_SDK_DIR/modules
}
9 changes: 8 additions & 1 deletion doomsday/libgui/libgui.pro
Expand Up @@ -173,6 +173,12 @@ else {

unix:!macx: SOURCES += src/imKStoUCS_x11.c

scripts.files = \
modules/gui.de

OTHER_FILES += \
$$scripts.files

# Installation ---------------------------------------------------------------

macx {
Expand All @@ -190,6 +196,7 @@ else {
}

deng_sdk {
INSTALLS *= target
INSTALLS *= target scripts
target.path = $$DENG_SDK_LIB_DIR
scripts.path = $$DENG_SDK_DIR/modules
}
@@ -1,6 +1,6 @@
# The Doomsday Engine Project -- libdeng2
# The Doomsday Engine Project
#
# Copyright (c) 2013 Jaakko Keränen <jaakko.keranen@iki.fi>
# Copyright (c) 2013-2014 Jaakko Keränen <jaakko.keranen@iki.fi>
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
Expand All @@ -18,6 +18,56 @@
#----------------------------------------------------------------------------
# Graphical user interface

def setDefaults(d)
# Applies the default configuration settings.
# - d: Record where to set the values.
try
import DisplayMode

# The default audio and video subsystems.
d.video = 'opengl'
d.audio = 'fmod'

# Window manager defaults.
record d.window
d.window.fsaa = True # Remove this (should be window-specific).

# Configure the main window.
record d.window.main
d.window.main.showFps = False
d.window.main.center = True
d.window.main.fsaa = True
d.window.main.vsync = True

# The default window parameters depend on the original display mode.
mode = DisplayMode.originalMode()

# By default the fullscreen resolution is the desktop resolution.
d.window.main.fullSize = [mode['width'], mode['height']]

# In windowed mode mode, leave some space on the sides so that
# the first switch to windowed mode does not place the window in an
# inconvenient location. The reduction is done proportionally.
offx = mode['width'] * 0.15
offy = mode['height'] * 0.15
d.window.main.rect = [offx, offy,
mode['width'] - 2*offx,
mode['height'] - 2*offy]
d.window.main.colorDepth = mode['depth']

if Version.OS == 'windows' or Version.OS == 'macx'
d.window.main.fullscreen = True
d.window.main.maximize = False
else
d.window.main.fullscreen = False
d.window.main.maximize = True
end

catch NotFoundError
# DisplayMode isn't available on the server.
end
end

def scale(value, factor)
# Scales a value by 'factor'. If 'value' is a text string, the
# suffixes "pt" and "px" (point, pixel) are retained in the result.
Expand Down

0 comments on commit 5543f69

Please sign in to comment.