Skip to content

Commit

Permalink
Change "doublebuf" to "vsync"
Browse files Browse the repository at this point in the history
We're actually doing V-sync when this option is turned on, so calling it
"Double Buffering" in inappropriate.
  • Loading branch information
dorkster committed Mar 21, 2015
1 parent 1d501c8 commit 4aaf41c
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 37 deletions.
2 changes: 1 addition & 1 deletion mods/default/menus/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ listbox_scrollbar_offset=2
[video]
fullscreen=224,40,256,32
hwsurface=224,72,256,64
doublebuf=224,104,256,96
vsync=224,104,256,96
texture_filter=224,136,256,128
hws_note=288,72
dbuf_note=288,104
Expand Down
2 changes: 1 addition & 1 deletion src/GameStateConfigBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ bool GameStateConfigBase::parseStub(FileParser &infile) {
if (infile.key == "fullscreen");
else if (infile.key == "mouse_move");
else if (infile.key == "hwsurface");
else if (infile.key == "doublebuf");
else if (infile.key == "vsync");
else if (infile.key == "enable_joystick");
else if (infile.key == "change_gamma");
else if (infile.key == "mouse_aim");
Expand Down
26 changes: 13 additions & 13 deletions src/GameStateConfigDesktop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ GameStateConfigDesktop::GameStateConfigDesktop()
, fullscreen_lb(new WidgetLabel())
, hwsurface_cb(new WidgetCheckBox())
, hwsurface_lb(new WidgetLabel())
, doublebuf_cb(new WidgetCheckBox())
, doublebuf_lb(new WidgetLabel())
, vsync_cb(new WidgetCheckBox())
, vsync_lb(new WidgetLabel())
, texture_filter_cb(new WidgetCheckBox())
, texture_filter_lb(new WidgetLabel())
, change_gamma_cb(new WidgetCheckBox())
Expand Down Expand Up @@ -195,9 +195,9 @@ bool GameStateConfigDesktop::parseKeyDesktop(FileParser &infile, int &x1, int &y
// @ATTR hwsurface|label x (integer), label y (integer), x (integer), y (integer)|Position of the "Hardware surfaces" checkbox relative to the frame.
placeLabeledWidget(hwsurface_lb, hwsurface_cb, x1, y1, x2, y2, msg->get("Hardware surfaces"), JUSTIFY_RIGHT);
}
else if (infile.key == "doublebuf") {
// @ATTR doublebuf|label x (integer), label y (integer), x (integer), y (integer)|Position of the "Double buffering" checkbox relative to the frame.
placeLabeledWidget(doublebuf_lb, doublebuf_cb, x1, y1, x2, y2, msg->get("Double buffering"), JUSTIFY_RIGHT);
else if (infile.key == "vsync") {
// @ATTR vsync|label x (integer), label y (integer), x (integer), y (integer)|Position of the "V-Sync" checkbox relative to the frame.
placeLabeledWidget(vsync_lb, vsync_cb, x1, y1, x2, y2, msg->get("V-Sync"), JUSTIFY_RIGHT);
}
else if (infile.key == "texture_filter") {
// @ATTR texture_filter|label x (integer), label y (integer), x (integer), y (integer)|Position of the "Texture Filtering" checkbox relative to the frame.
Expand Down Expand Up @@ -361,8 +361,8 @@ void GameStateConfigDesktop::addChildWidgetsDesktop() {
addChildWidget(fullscreen_lb, VIDEO_TAB);
addChildWidget(hwsurface_cb, VIDEO_TAB);
addChildWidget(hwsurface_lb, VIDEO_TAB);
addChildWidget(doublebuf_cb, VIDEO_TAB);
addChildWidget(doublebuf_lb, VIDEO_TAB);
addChildWidget(vsync_cb, VIDEO_TAB);
addChildWidget(vsync_lb, VIDEO_TAB);
addChildWidget(texture_filter_cb, VIDEO_TAB);
addChildWidget(texture_filter_lb, VIDEO_TAB);
addChildWidget(change_gamma_cb, VIDEO_TAB);
Expand Down Expand Up @@ -398,7 +398,7 @@ void GameStateConfigDesktop::setupTabList() {
tablist.add(cancel_button);
tablist.add(fullscreen_cb);
tablist.add(hwsurface_cb);
tablist.add(doublebuf_cb);
tablist.add(vsync_cb);
tablist.add(texture_filter_cb);
tablist.add(change_gamma_cb);
tablist.add(gamma_sl);
Expand Down Expand Up @@ -446,8 +446,8 @@ void GameStateConfigDesktop::updateVideo() {
else fullscreen_cb->unCheck();
if (HWSURFACE) hwsurface_cb->Check();
else hwsurface_cb->unCheck();
if (DOUBLEBUF) doublebuf_cb->Check();
else doublebuf_cb->unCheck();
if (VSYNC) vsync_cb->Check();
else vsync_cb->unCheck();
if (TEXTURE_FILTER) texture_filter_cb->Check();
else texture_filter_cb->unCheck();
if (CHANGE_GAMMA) change_gamma_cb->Check();
Expand Down Expand Up @@ -594,9 +594,9 @@ void GameStateConfigDesktop::logicVideo() {
if (hwsurface_cb->isChecked()) HWSURFACE=true;
else HWSURFACE=false;
}
else if (doublebuf_cb->checkClick()) {
if (doublebuf_cb->isChecked()) DOUBLEBUF=true;
else DOUBLEBUF=false;
else if (vsync_cb->checkClick()) {
if (vsync_cb->isChecked()) VSYNC=true;
else VSYNC=false;
}
else if (texture_filter_cb->checkClick()) {
if (texture_filter_cb->isChecked()) TEXTURE_FILTER=true;
Expand Down
4 changes: 2 additions & 2 deletions src/GameStateConfigDesktop.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ class GameStateConfigDesktop : public GameStateConfigBase {
WidgetLabel * fullscreen_lb;
WidgetCheckBox * hwsurface_cb;
WidgetLabel * hwsurface_lb;
WidgetCheckBox * doublebuf_cb;
WidgetLabel * doublebuf_lb;
WidgetCheckBox * vsync_cb;
WidgetLabel * vsync_lb;
WidgetCheckBox * texture_filter_cb;
WidgetLabel * texture_filter_lb;
WidgetCheckBox * change_gamma_cb;
Expand Down
2 changes: 1 addition & 1 deletion src/RenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Image * Sprite::getGraphics() {
RenderDevice::RenderDevice()
: fullscreen(false)
, hwsurface(false)
, doublebuf(false)
, vsync(false)
, texture_filter(false)
, min_screen(640, 480)
, is_initialized(false) {
Expand Down
2 changes: 1 addition & 1 deletion src/RenderDevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ class RenderDevice {

bool fullscreen;
bool hwsurface;
bool doublebuf;
bool vsync;
bool texture_filter;
Point min_screen;

Expand Down
14 changes: 7 additions & 7 deletions src/SDLHardwareRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,15 +160,15 @@ SDLHardwareRenderDevice::SDLHardwareRenderDevice()

fullscreen = FULLSCREEN;
hwsurface = HWSURFACE;
doublebuf = DOUBLEBUF;
vsync = VSYNC;
texture_filter = TEXTURE_FILTER;

min_screen.x = MIN_SCREEN_W;
min_screen.y = MIN_SCREEN_H;
}

int SDLHardwareRenderDevice::createContext() {
bool settings_changed = (fullscreen != FULLSCREEN || hwsurface != HWSURFACE || doublebuf != DOUBLEBUF || texture_filter != TEXTURE_FILTER);
bool settings_changed = (fullscreen != FULLSCREEN || hwsurface != HWSURFACE || vsync != VSYNC || texture_filter != TEXTURE_FILTER);

Uint32 w_flags = 0;
Uint32 r_flags = 0;
Expand Down Expand Up @@ -202,9 +202,9 @@ int SDLHardwareRenderDevice::createContext() {
}
else {
r_flags = SDL_RENDERER_SOFTWARE | SDL_RENDERER_TARGETTEXTURE;
DOUBLEBUF = false; // can't have software mode & vsync at the same time
VSYNC = false; // can't have software mode & vsync at the same time
}
if (DOUBLEBUF) r_flags = r_flags | SDL_RENDERER_PRESENTVSYNC;
if (VSYNC) r_flags = r_flags | SDL_RENDERER_PRESENTVSYNC;

if (settings_changed || !is_initialized) {
if (is_initialized) {
Expand Down Expand Up @@ -241,13 +241,13 @@ int SDLHardwareRenderDevice::createContext() {
// try previous setting first
FULLSCREEN = fullscreen;
HWSURFACE = hwsurface;
DOUBLEBUF = doublebuf;
VSYNC = vsync;
TEXTURE_FILTER = texture_filter;
if (createContext() == -1) {
// last resort, try turning everything off
FULLSCREEN = false;
HWSURFACE = false;
DOUBLEBUF = false;
VSYNC = false;
TEXTURE_FILTER = false;
return createContext();
}
Expand All @@ -258,7 +258,7 @@ int SDLHardwareRenderDevice::createContext() {
else {
fullscreen = FULLSCREEN;
hwsurface = HWSURFACE;
doublebuf = DOUBLEBUF;
vsync = VSYNC;
texture_filter = TEXTURE_FILTER;
is_initialized = true;
}
Expand Down
14 changes: 7 additions & 7 deletions src/SDLSoftwareRenderDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,15 +197,15 @@ SDLSoftwareRenderDevice::SDLSoftwareRenderDevice()

fullscreen = FULLSCREEN;
hwsurface = HWSURFACE;
doublebuf = DOUBLEBUF;
vsync = VSYNC;
texture_filter = TEXTURE_FILTER;

min_screen.x = MIN_SCREEN_W;
min_screen.y = MIN_SCREEN_H;
}

int SDLSoftwareRenderDevice::createContext() {
bool settings_changed = (fullscreen != FULLSCREEN || hwsurface != HWSURFACE || doublebuf != DOUBLEBUF || texture_filter != TEXTURE_FILTER);
bool settings_changed = (fullscreen != FULLSCREEN || hwsurface != HWSURFACE || vsync != VSYNC || texture_filter != TEXTURE_FILTER);

Uint32 w_flags = 0;
Uint32 r_flags = 0;
Expand Down Expand Up @@ -235,9 +235,9 @@ int SDLSoftwareRenderDevice::createContext() {
}
else {
r_flags = r_flags | SDL_RENDERER_SOFTWARE;
DOUBLEBUF = false; // can't have software mode & vsync at the same time
VSYNC = false; // can't have software mode & vsync at the same time
}
if (DOUBLEBUF) r_flags = r_flags | SDL_RENDERER_PRESENTVSYNC;
if (VSYNC) r_flags = r_flags | SDL_RENDERER_PRESENTVSYNC;

if (settings_changed || !is_initialized) {
if (is_initialized) {
Expand Down Expand Up @@ -274,13 +274,13 @@ int SDLSoftwareRenderDevice::createContext() {
// try previous setting first
FULLSCREEN = fullscreen;
HWSURFACE = hwsurface;
DOUBLEBUF = doublebuf;
VSYNC = vsync;
TEXTURE_FILTER = texture_filter;
if (createContext() == -1) {
// last resort, try turning everything off
FULLSCREEN = false;
HWSURFACE = false;
DOUBLEBUF = false;
VSYNC = false;
TEXTURE_FILTER = false;
return createContext();
}
Expand All @@ -291,7 +291,7 @@ int SDLSoftwareRenderDevice::createContext() {
else {
fullscreen = FULLSCREEN;
hwsurface = HWSURFACE;
doublebuf = DOUBLEBUF;
vsync = VSYNC;
texture_filter = TEXTURE_FILTER;
is_initialized = true;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ ConfigEntry config[] = {
{ "sound_volume", &typeid(SOUND_VOLUME), "128", &SOUND_VOLUME, NULL},
{ "combat_text", &typeid(COMBAT_TEXT), "0", &COMBAT_TEXT, "display floating damage text. 1 enable, 0 disable."},
{ "mouse_move", &typeid(MOUSE_MOVE), "0", &MOUSE_MOVE, "use mouse to move (experimental). 1 enable, 0 disable."},
{ "hwsurface", &typeid(HWSURFACE), "1", &HWSURFACE, "hardware surfaces, double buffering. Try disabling for performance. 1 enable, 0 disable."},
{ "doublebuf", &typeid(DOUBLEBUF), "1", &DOUBLEBUF, NULL},
{ "hwsurface", &typeid(HWSURFACE), "1", &HWSURFACE, "hardware surfaces, v-sync. Try disabling for performance. 1 enable, 0 disable."},
{ "vsync", &typeid(VSYNC), "1", &VSYNC, NULL},
{ "texture_filter", &typeid(TEXTURE_FILTER), "1", &TEXTURE_FILTER, "texture filter quality. 0 nearest neighbor (worst), 1 linear (best)"},
{ "enable_joystick", &typeid(ENABLE_JOYSTICK), "0", &ENABLE_JOYSTICK, "joystick settings."},
{ "joystick_device", &typeid(JOYSTICK_DEVICE), "0", &JOYSTICK_DEVICE, NULL},
Expand Down Expand Up @@ -120,7 +120,7 @@ short MIN_SCREEN_W = 640;
short MIN_SCREEN_H = 480;
unsigned short SCREEN_W = 640;
unsigned short SCREEN_H = 480;
bool DOUBLEBUF;
bool VSYNC;
bool HWSURFACE;
bool TEXTURE_FILTER;
bool CHANGE_GAMMA;
Expand Down
2 changes: 1 addition & 1 deletion src/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ extern unsigned short SCREEN_W;
extern unsigned short SCREEN_H;
extern short MIN_SCREEN_W;
extern short MIN_SCREEN_H;
extern bool DOUBLEBUF;
extern bool VSYNC;
extern bool HWSURFACE;
extern bool TEXTURE_FILTER;
extern bool CHANGE_GAMMA;
Expand Down

0 comments on commit 4aaf41c

Please sign in to comment.