summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-03-02 01:15:13 +0100
committerAki <please@ignore.pl>2024-03-02 01:18:45 +0100
commite70158ea57302e2fa2d588b67fc8dc18265192eb (patch)
treeec1d90159f147a9aa896cb654cda905c2f3ee357
parent8b21a7027491d7e69bb165c0c50b0a23d1c8755e (diff)
downloadstarshatter-e70158ea57302e2fa2d588b67fc8dc18265192eb.zip
starshatter-e70158ea57302e2fa2d588b67fc8dc18265192eb.tar.gz
starshatter-e70158ea57302e2fa2d588b67fc8dc18265192eb.tar.bz2
You can now toggle Full Screen in Video settings
Full screen setting is preserved after game is restarted. Switching in and out of full screen repetitively causes some mode inconsistencies, but this should be enough for now. You can still force window mode with -win CLI option.
-rw-r--r--StarsEx/Starshatter.cpp13
-rw-r--r--StarsEx/VidDlg.cpp18
-rw-r--r--StarsEx/VidDlg.h1
-rw-r--r--data/content/Content/content.txt3
-rw-r--r--data/content/Screens/VidDlg.frm55
-rw-r--r--data/shatter/Screens/VidDlg.frm57
6 files changed, 96 insertions, 51 deletions
diff --git a/StarsEx/Starshatter.cpp b/StarsEx/Starshatter.cpp
index b0f7910..808e682 100644
--- a/StarsEx/Starshatter.cpp
+++ b/StarsEx/Starshatter.cpp
@@ -2255,6 +2255,7 @@ void
Starshatter::LoadVideoConfig(const char* filename)
{
// set up defaults:
+ bool full_screen = true;
int screen_width = 1280;
int screen_height = 720;
int screen_depth = 32;
@@ -2314,6 +2315,10 @@ Starshatter::LoadVideoConfig(const char* filename)
if (term) {
TermDef* def = term->isDef();
if (def) {
+ if (def->name()->value() == "full_screen") {
+ GetDefBool(full_screen, def, filename);
+ }
+
if (def->name()->value() == "width") {
int w;
GetDefNumber(w, def, filename);
@@ -2471,6 +2476,7 @@ Starshatter::LoadVideoConfig(const char* filename)
loader->ReleaseBuffer(block);
if (video_settings) {
+ video_settings->is_windowed = !full_screen;
video_settings->fullscreen_mode.width = screen_width;
video_settings->fullscreen_mode.height = screen_height;
@@ -2507,9 +2513,10 @@ Starshatter::SaveVideoConfig(const char* filename)
FILE* f = fopen(filename, "wb");
if (f) {
fprintf(f, "VIDEO\n\n");
- fprintf(f, "width: %4d\n", video_settings->fullscreen_mode.width);
- fprintf(f, "height: %4d\n", video_settings->fullscreen_mode.height);
- fprintf(f, "depth: %4d\n", video_settings->fullscreen_mode.format == VideoMode::FMT_R5G6B5 ? 16 : 32);
+ fprintf(f, "full_screen: %s\n", video_settings->is_windowed ? "false" : "true");
+ fprintf(f, "width: %4d\n", video_settings->fullscreen_mode.width);
+ fprintf(f, "height: %4d\n", video_settings->fullscreen_mode.height);
+ fprintf(f, "depth: %4d\n", video_settings->fullscreen_mode.format == VideoMode::FMT_R5G6B5 ? 16 : 32);
fprintf(f, "\n");
fprintf(f, "max_tex: %4d\n", video_settings->tex_size);
fprintf(f, "primary3D: %s\n", "true");
diff --git a/StarsEx/VidDlg.cpp b/StarsEx/VidDlg.cpp
index 7447349..36253ae 100644
--- a/StarsEx/VidDlg.cpp
+++ b/StarsEx/VidDlg.cpp
@@ -92,6 +92,7 @@ VidDlg::RegisterControls()
REGISTER_CLIENT(EID_CLICK, gamma, VidDlg, OnGamma);
}
+ full_screen = (ComboBox*) FindControl(202);
lens_flare = (ComboBox*) FindControl(211);
corona = (ComboBox*) FindControl(212);
nebula = (ComboBox*) FindControl(213);
@@ -131,7 +132,7 @@ VidDlg::Show()
FormWindow::Show();
if (closed) {
- bool fullscreen = true;
+ bool is_fullscreen = false;
if (stars) {
selected_render = 9;
@@ -158,7 +159,10 @@ VidDlg::Show()
if (bump_maps)
bump_maps->SetSelection(video->IsBumpMapEnabled());
- fullscreen = video->IsFullScreen();
+ if (full_screen) {
+ is_fullscreen = video->IsFullScreen();
+ full_screen->SetSelection(is_fullscreen);
+ }
}
if (lens_flare)
@@ -180,7 +184,7 @@ VidDlg::Show()
if (mode) {
BuildModeList();
mode->SetSelection(selected_mode);
- mode->SetEnabled(fullscreen);
+ mode->SetEnabled(is_fullscreen);
}
if (tex_size)
@@ -362,6 +366,7 @@ VidDlg::Apply()
Video* video = Video::GetInstance();
if (video) {
const VideoSettings* vs = video->GetVideoSettings();
+ video_change = static_cast<bool>(full_screen->GetSelectedIndex()) != video->IsFullScreen();
if (vs)
bias = vs->depth_bias;
@@ -404,9 +409,10 @@ VidDlg::Apply()
if (f) {
fprintf(f, "VIDEO\n\n");
- fprintf(f, "width: %4d\n", w);
- fprintf(f, "height: %4d\n", h);
- fprintf(f, "depth: %4d\n", d);
+ fprintf(f, "full_screen: %s\n", full_screen->GetSelectedIndex() ? "true" : "false");
+ fprintf(f, "width: %4d\n", w);
+ fprintf(f, "height: %4d\n", h);
+ fprintf(f, "depth: %4d\n", d);
fprintf(f, "\n");
fprintf(f, "max_tex: %d\n", (int) pow(2.0f, 6 + selected_tex_size));
fprintf(f, "primary3D: %s\n", (a>0)?"true":"false");
diff --git a/StarsEx/VidDlg.h b/StarsEx/VidDlg.h
index 0b6e918..884428d 100644
--- a/StarsEx/VidDlg.h
+++ b/StarsEx/VidDlg.h
@@ -65,6 +65,7 @@ protected:
BaseScreen* manager;
Starshatter* stars;
+ ComboBox* full_screen;
ComboBox* mode;
ComboBox* tex_size;
ComboBox* detail;
diff --git a/data/content/Content/content.txt b/data/content/Content/content.txt
index c199163..2a16b75 100644
--- a/data/content/Content/content.txt
+++ b/data/content/Content/content.txt
@@ -646,7 +646,8 @@ form.gameplay.full = Full Damage
form.gameplay.standard-lcos = Standard LCOS
form.gameplay.lead-diamond = Lead Indicator
-form.video.mode = Video Mode:
+form.video.full-screen = Full Screen:
+form.video.mode = Full Screen Mode:
form.video.max-texture = Max Texture Size:
form.video.shadows = Shadows:
form.video.specular-maps = Specular Maps:
diff --git a/data/content/Screens/VidDlg.frm b/data/content/Screens/VidDlg.frm
index 62530d5..13ade32 100644
--- a/data/content/Screens/VidDlg.frm
+++ b/data/content/Screens/VidDlg.frm
@@ -147,8 +147,8 @@ form: {
x_mins: ( 20, 100, 100, 20, 100, 100, 20)
x_weights: ( 2, 3, 3, 2, 3, 3, 2)
- y_mins: ( 20, 25, 25, 25, 25, 25, 25, 25, 25, 20)
- y_weights: ( 3, 0, 0, 0, 0, 0, 0, 0, 0, 7)
+ y_mins: ( 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20)
+ y_weights: ( 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7)
}
}
@@ -164,55 +164,61 @@ form: {
},
ctrl: {
+ id: 102
+ type: label
+ text: "form.video.full-screen"
+ cells: (1,1,1,1)
+ },
+
+ ctrl: {
id: 101
type: label
text: "form.video.mode"
- cells: (1,1,1,1)
+ cells: (1,2,1,1)
},
ctrl: {
id: 104
type: label
text: "form.video.max-texture"
- cells: (1,2,1,1)
+ cells: (1,3,1,1)
},
ctrl: {
id: 122
type: label
text: "form.video.shadows"
- cells: (1,3,1,1)
+ cells: (1,4,1,1)
},
ctrl: {
id: 123
type: label
text: "form.video.specular-maps"
- cells: (1,4,1,1)
+ cells: (1,5,1,1)
},
ctrl: {
id: 124
type: label
text: "form.video.bump-maps"
- cells: (1,5,1,1)
+ cells: (1,6,1,1)
},
ctrl: {
id: 105
type: label
text: "form.video.terrain-detail"
- cells: (1,7,1,1)
+ cells: (1,8,1,1)
},
ctrl: {
id: 106
type: label
text: "form.video.terrain-texture"
- cells: (1,8,1,1)
+ cells: (1,9,1,1)
},
-
ctrl: {
id: 111
type: label
@@ -245,7 +251,7 @@ form: {
id: 115
type: label
text: "form.video.gamma-level"
- cells: (4,7,1,1)
+ cells: (4,8,1,1)
},
@@ -264,10 +270,19 @@ form: {
ctrl: {
- id: 203
+ id: 202
type: combo
cells: (2,1,1,1)
+ item: "form.disable"
+ item: "form.enable"
+ }
+
+ ctrl: {
+ id: 203
+ type: combo
+ cells: (2,2,1,1)
+
item: "800 x 600 x 8"
item: "800 x 600 x 16"
item: "800 x 600 x 32"
@@ -276,7 +291,7 @@ form: {
ctrl: {
id: 204
type: combo
- cells: (2,2,1,1)
+ cells: (2,3,1,1)
item: "64 x 64"
item: "128 x 128"
@@ -290,7 +305,7 @@ form: {
ctrl: {
id: 222
type: combo
- cells: (2,3,1,1)
+ cells: (2,4,1,1)
item: "form.disable"
item: "form.enable"
@@ -299,7 +314,7 @@ form: {
ctrl: {
id: 223
type: combo
- cells: (2,4,1,1)
+ cells: (2,5,1,1)
item: "form.disable"
item: "form.enable"
@@ -308,7 +323,7 @@ form: {
ctrl: {
id: 224
type: combo
- cells: (2,5,1,1)
+ cells: (2,6,1,1)
item: "form.disable"
item: "form.enable"
@@ -317,7 +332,7 @@ form: {
ctrl: {
id: 205
type: combo
- cells: (2,7,1,1)
+ cells: (2,8,1,1)
item: "form.video.low"
item: "form.video.medium"
@@ -327,7 +342,7 @@ form: {
ctrl: {
id: 206
type: combo
- cells: (2,8,1,1)
+ cells: (2,9,1,1)
item: "form.disable"
item: "form.enable"
@@ -373,7 +388,7 @@ form: {
ctrl: {
id: 215
type: slider
- cells: (5,7,1,1)
+ cells: (5,8,1,1)
cell_insets: (0,0,0,16)
active_color: (250, 250, 100)
@@ -385,7 +400,7 @@ form: {
ctrl: {
id: 315
type: label
- cells: (5,8,1,1)
+ cells: (5,9,1,1)
cell_insets: (0,0,0,0)
texture: gamma_test
diff --git a/data/shatter/Screens/VidDlg.frm b/data/shatter/Screens/VidDlg.frm
index adf0ff5..27ccbd0 100644
--- a/data/shatter/Screens/VidDlg.frm
+++ b/data/shatter/Screens/VidDlg.frm
@@ -147,8 +147,8 @@ form: {
x_mins: ( 20, 100, 100, 20, 100, 100, 20)
x_weights: ( 2, 3, 3, 2, 3, 3, 2)
- y_mins: ( 20, 25, 25, 25, 25, 25, 25, 25, 25, 20)
- y_weights: ( 3, 0, 0, 0, 0, 0, 0, 0, 0, 7)
+ y_mins: ( 20, 25, 25, 25, 25, 25, 25, 25, 25, 25, 20)
+ y_weights: ( 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7)
}
}
@@ -164,55 +164,61 @@ form: {
},
ctrl: {
- id: 101
+ id: 102
type: label
- text: "Video Mode:"
+ text: "Full Screen:"
cells: (1,1,1,1)
},
ctrl: {
+ id: 101
+ type: label
+ text: "Full Screen Mode:"
+ cells: (1,2,1,1)
+ },
+
+ ctrl: {
id: 104
type: label
text: "Max Texture Size:"
- cells: (1,2,1,1)
+ cells: (1,3,1,1)
},
ctrl: {
id: 122
type: label
text: "Shadows:"
- cells: (1,3,1,1)
+ cells: (1,4,1,1)
},
ctrl: {
id: 123
type: label
text: "Spec Maps:"
- cells: (1,4,1,1)
+ cells: (1,5,1,1)
},
ctrl: {
id: 124
type: label
text: "Bump Maps:"
- cells: (1,5,1,1)
+ cells: (1,6,1,1)
},
ctrl: {
id: 105
type: label
text: "Terrain Detail:"
- cells: (1,7,1,1)
+ cells: (1,8,1,1)
},
ctrl: {
id: 106
type: label
text: "Terrain Texture:"
- cells: (1,8,1,1)
+ cells: (1,9,1,1)
},
-
ctrl: {
id: 111
type: label
@@ -245,7 +251,7 @@ form: {
id: 115
type: label
text: "Gamma Level:"
- cells: (4,7,1,1)
+ cells: (4,8,1,1)
},
@@ -264,10 +270,19 @@ form: {
ctrl: {
- id: 203
+ id: 202
type: combo
cells: (2,1,1,1)
+ item: Disable
+ item: Enable
+ }
+
+ ctrl: {
+ id: 203
+ type: combo
+ cells: (2,2,1,1)
+
item: "800 x 600 x 8"
item: "800 x 600 x 16"
item: "800 x 600 x 32"
@@ -276,7 +291,7 @@ form: {
ctrl: {
id: 204
type: combo
- cells: (2,2,1,1)
+ cells: (2,3,1,1)
item: "64 x 64"
item: "128 x 128"
@@ -290,7 +305,7 @@ form: {
ctrl: {
id: 222
type: combo
- cells: (2,3,1,1)
+ cells: (2,4,1,1)
item: Disable
item: Enable
@@ -299,7 +314,7 @@ form: {
ctrl: {
id: 223
type: combo
- cells: (2,4,1,1)
+ cells: (2,5,1,1)
item: Disable
item: Enable
@@ -308,7 +323,7 @@ form: {
ctrl: {
id: 224
type: combo
- cells: (2,5,1,1)
+ cells: (2,6,1,1)
item: Disable
item: Enable
@@ -317,7 +332,7 @@ form: {
ctrl: {
id: 205
type: combo
- cells: (2,7,1,1)
+ cells: (2,8,1,1)
item: Low
item: Medium
@@ -327,7 +342,7 @@ form: {
ctrl: {
id: 206
type: combo
- cells: (2,8,1,1)
+ cells: (2,9,1,1)
item: Disable
item: Enable
@@ -373,7 +388,7 @@ form: {
ctrl: {
id: 215
type: slider
- cells: (5,7,1,1)
+ cells: (5,8,1,1)
cell_insets: (0,0,0,16)
active_color: (250, 250, 100)
@@ -385,7 +400,7 @@ form: {
ctrl: {
id: 315
type: label
- cells: (5,8,1,1)
+ cells: (5,9,1,1)
cell_insets: (0,0,0,0)
texture: gamma_test