Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Client|libdeng2|Script: Separated app-specific stuff out of Config.de
The application-specific "appconfig" module is now responsible for the default configuration of the application (window, console, etc.).
- Loading branch information
Showing
5 changed files
with
95 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# The Doomsday Engine Project -- libdeng2 | ||
# | ||
# Copyright (c) 2013 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 General Public License as published by | ||
# the Free Software Foundation; either version 2 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
|
||
#---------------------------------------------------------------------------- | ||
# CONFIGURATION FOR THE DOOMSDAY CLIENT | ||
# | ||
# This module contains configuration related scripts for the client | ||
# application. It is automatically imported by Config and used as needed. | ||
# | ||
# TODO: make sure the server doesn't run this | ||
|
||
import Version | ||
|
||
def setDefaults(d) | ||
# Applies the client's defaults. | ||
# - 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 | ||
|
||
# Console defaults. | ||
record d.console | ||
d.console.snap = True | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters