Updated settings:

- Removed obsolete sound settings
- Adapted types and limits of settings to actual needs of ETR
- Changed default BPP mode to 0 (choose system's mode. Now implemented) instead of 1 (16-bit)

Bugfixes:
- Fixed track marks being broken since sf::Color introduction
- Fixed splash screen logo position

git-svn-id: https://svn.code.sf.net/p/extremetuxracer/code/branches/SFML2@486 0420edf4-82e4-42fc-9478-35b55e6d67a3
master
pkeus 2013-11-30 09:17:19 +00:00
parent 0d621aac9b
commit e2b58a7b9b
14 changed files with 72 additions and 93 deletions

View File

@ -205,14 +205,12 @@ void GetTimeComponents (double time, int *min, int *sec, int *hundr) {
string GetTimeString () {
time_t rawtime;
struct tm * timeinfo;
time (&rawtime);
timeinfo = localtime (&rawtime);
// line = Int_StrN (timeinfo->tm_year-100);
string line = Int_StrN (timeinfo->tm_mon + 1);
line += "_" + Int_StrN (timeinfo->tm_mday);
line += "_" + Int_StrN (timeinfo->tm_hour);
struct tm* timeinfo = localtime (&rawtime);
string line = Int_StrN(timeinfo->tm_mon + 1);
line += '_' + Int_StrN(timeinfo->tm_mday);
line += '_' + Int_StrN(timeinfo->tm_hour);
line += Int_StrN (timeinfo->tm_min);
line += Int_StrN (timeinfo->tm_sec);
return line;

View File

@ -170,8 +170,8 @@ void CGameConfig::Enter() {
fullscreen->checked = param.fullscreen;
resolution = AddUpDown(rightpos, area.top+dd*1, 0, NUM_RESOLUTIONS-1, (int)param.res_type);
mus_vol = AddUpDown(rightpos, area.top+dd*2, 0, 120, param.music_volume);
sound_vol = AddUpDown(rightpos, area.top+dd*3, 0, 120, param.sound_volume);
mus_vol = AddUpDown(rightpos, area.top+dd*2, 0, 100, param.music_volume);
sound_vol = AddUpDown(rightpos, area.top+dd*3, 0, 100, param.sound_volume);
language = AddUpDown(rightpos, area.top+dd*4, 0, (int)Trans.languages.size() - 1, (int)param.language);
detail_level = AddUpDown(rightpos, area.top+dd*5, 1, 4, param.perf_level);

View File

@ -42,6 +42,7 @@ Then edit the below functions:
#include "game_config.h"
#include "spx.h"
#include "translation.h"
#include <sstream>
TParam param;
@ -58,26 +59,25 @@ void LoadConfigFile () {
param.fullscreen = SPBoolN (line, "fullscreen", false);
param.res_type = SPIntN (line, "res_type", 0);
param.framerate = SPIntN (line, "framerate", 60);
param.perf_level = SPIntN (line, "detail_level", 3);
param.language = SPIntN (line, "language", 0);
param.sound_volume = SPIntN (line, "sound_volume", 100);
param.sound_volume = SPIntN (line, "sound_volume", 90);
param.music_volume = SPIntN (line, "music_volume", 20);
param.framerate = SPIntN (line, "framerate", 60);
param.forward_clip_distance = SPIntN (line, "forward_clip_distance", 75);
param.backward_clip_distance = SPIntN (line, "backward_clip_distance", 20);
param.fov = SPIntN (line, "fov", 60);
param.bpp_mode = SPIntN (line, "bpp_mode", 1);
param.bpp_mode = SPIntN (line, "bpp_mode", 0);
param.tree_detail_distance = SPIntN (line, "tree_detail_distance", 20);
param.tux_sphere_divisions = SPIntN (line, "tux_sphere_divisions", 10);
param.tux_shadow_sphere_divisions = SPIntN (line, "tux_shadow_sphere_div", 3);
param.course_detail_level = SPIntN (line, "course_detail_level", 75);
param.use_papercut_font = SPIntN (line, "use_papercut_font", 1);
param.ice_cursor = SPBoolN (line, "ice_cursor", true);
param.ice_cursor = SPIntN (line, "ice_cursor", 1) != 0;
param.full_skybox = SPBoolN (line, "full_skybox", false);
param.audio_freq = SPIntN (line, "audio_freq", 22050);
param.audio_buffer_size = SPIntN (line, "audio_buffer_size", 512);
param.use_quad_scale = SPBoolN (line, "use_quad_scale", false);
param.menu_music = SPStrN (line, "menu_music", "start_1");
@ -89,24 +89,23 @@ void LoadConfigFile () {
void SetConfigDefaults () {
param.fullscreen = true;
param.res_type = 0; // 0=auto / 1=800x600 / 2=1024x768 ...
param.framerate = 60;
param.perf_level = 3; // detail level
param.language = string::npos; // If language is set to npos, ETR will try to load default system language
param.sound_volume = 100;
param.sound_volume = 90;
param.music_volume = 20;
// ---------------------------------------
param.framerate = 60;
param.forward_clip_distance = 75;
param.backward_clip_distance = 20;
param.fov = 60;
param.bpp_mode = 1;
param.bpp_mode = 0;
param.tree_detail_distance = 20;
param.tux_sphere_divisions = 10;
param.tux_shadow_sphere_divisions = 3;
param.course_detail_level = 75;
param.audio_freq = 22050;
param.audio_buffer_size = 512;
param.use_papercut_font = 1;
param.ice_cursor = true;
@ -119,14 +118,11 @@ void SetConfigDefaults () {
}
void AddItem (CSPList &list, const string& tag, const string& content) {
string item = " [" +tag + "] " + content;
list.Add (item);
}
void AddIntItem (CSPList &list, const string& tag, int val) {
string vs = Int_StrN (val);
AddItem (list, tag, vs);
template<typename T>
void AddItem(CSPList &list, const string& tag, T content) {
ostringstream os;
os << " [" << tag << "] " << content;
list.Add (os.str());
}
void AddComment (CSPList &list, const string& comment) {
@ -144,38 +140,33 @@ void SaveConfigFile () {
liste.AddLine();
AddComment (liste, "Full-screen mode [0...1]");
AddIntItem (liste, "fullscreen", param.fullscreen);
AddItem(liste, "fullscreen", param.fullscreen);
liste.AddLine();
AddComment (liste, "Screen resolution [0...9]");
AddComment (liste, "0 = auto, 1 = 800x600, 2 = 1024x768");
AddComment (liste, "3 = 1152x864, 4 = 1280x960, 5 = 1280x1024");
AddComment (liste, "6 = 1360x768, 7 = 1400x1050, 8 = 1440x900, 9=1680x1050");
AddIntItem (liste, "res_type", (int)param.res_type);
liste.AddLine();
AddComment (liste, "Framerate limit");
AddComment (liste, "0 = unlimited, default: 60");
AddIntItem (liste, "framerate", (int)param.framerate);
AddItem(liste, "res_type", param.res_type);
liste.AddLine();
AddComment (liste, "Level of details [1...3]");
AddComment (liste, "1 = best performance, 3 = best appearance");
AddIntItem (liste, "detail_level", param.perf_level);
AddItem(liste, "detail_level", param.perf_level);
liste.AddLine();
AddComment (liste, "Language code [0...]");
AddComment (liste, "0 = English etc.");
AddIntItem (liste, "language", (int)param.language);
AddItem(liste, "language", param.language);
liste.AddLine();
AddComment (liste, "Sound volume [0...120]");
AddComment (liste, "Sound volume [0...100]");
AddComment (liste, "Sounds are the terrain effects or the pickup noise.");
AddIntItem (liste, "sound_volume", param.sound_volume);
AddItem(liste, "sound_volume", param.sound_volume);
liste.AddLine();
AddComment (liste, "Volume of the background music [0...120]");
AddIntItem (liste, "music_volume", param.music_volume);
AddComment (liste, "Volume of the background music [0...100]");
AddItem(liste, "music_volume", param.music_volume);
liste.AddLine();
liste.Add ("# ------------------------------------------------------------------");
@ -183,80 +174,75 @@ void SaveConfigFile () {
liste.Add ("# ------------------------------------------------------------------");
liste.AddLine();
AddComment(liste, "Framerate limit");
AddComment(liste, "0 = unlimited, default: 60");
AddItem(liste, "framerate", param.framerate);
liste.AddLine();
AddComment (liste, "Forward clipping distance");
AddComment (liste, "Controls how far ahead of the camera the course");
AddComment (liste, "is rendered. Larger values mean that more of the course is");
AddComment (liste, "rendered, resulting in slower performance. Decreasing this ");
AddComment (liste, "value is an effective way to improve framerates.");
AddIntItem (liste, "forward_clip_distance", param.forward_clip_distance);
AddItem(liste, "forward_clip_distance", param.forward_clip_distance);
liste.AddLine();
AddComment (liste, "Backward clipping distance");
AddComment (liste, "Some objects aren't yet clipped to the view frustum, ");
AddComment (liste, "so this value is used to control how far up the course these ");
AddComment (liste, "objects are drawn.");
AddIntItem (liste, "backward_clip_distance", param.backward_clip_distance);
AddItem(liste, "backward_clip_distance", param.backward_clip_distance);
liste.AddLine();
AddComment (liste, "Field of View of the camera");
AddIntItem (liste, "fov", param.fov);
AddItem(liste, "fov", param.fov);
liste.AddLine();
AddComment (liste, "Bpp mode - bits per pixel [0...2]");
AddComment (liste, "Bpp mode - bits per pixel");
AddComment (liste, "Controls the color depth of the OpenGL window");
AddComment (liste, "0 = use current bpp setting of operating system,");
AddComment (liste, "1 = 16 bpp, 2 = 32 bpp");
AddIntItem (liste, "bpp_mode", param.bpp_mode);
AddComment (liste, "16 = 16 bpp, 32 = 32 bpp,");
AddComment (liste, "0 (or any other) = use current bpp setting of operating system,");
AddItem(liste, "bpp_mode", param.bpp_mode);
liste.AddLine();
AddComment (liste, "Tree detail distance");
AddComment (liste, "Controls how far up the course the trees are drawn crosswise.");
AddIntItem (liste, "tree_detail_distance", param.tree_detail_distance);
AddItem(liste, "tree_detail_distance", param.tree_detail_distance);
liste.AddLine();
AddComment (liste, "Tux sphere divisions");
AddComment (liste, "Controls how detailled the character is drawn");
AddIntItem (liste, "tux_sphere_divisions", param.tux_sphere_divisions);
AddItem(liste, "tux_sphere_divisions", param.tux_sphere_divisions);
liste.AddLine();
AddComment (liste, "Tux shadow sphere divisions");
AddComment (liste, "The same but for the shadow of the character");
AddIntItem (liste, "tux_shadow_sphere_div", param.tux_shadow_sphere_divisions);
AddItem(liste, "tux_shadow_sphere_div", param.tux_shadow_sphere_divisions);
liste.AddLine();
AddComment (liste, "Detail level of the course");
AddComment (liste, "This param is used for the quadtree and controls the");
AddComment (liste, "LOD of the algorithm. ");
AddIntItem (liste, "course_detail_level", param.course_detail_level);
AddItem(liste, "course_detail_level", param.course_detail_level);
liste.AddLine();
AddComment (liste, "Font type [0...2]");
AddComment (liste, "0 = always arial-like font,");
AddComment (liste, "1 = papercut font on the menu screens");
AddComment (liste, "2 = papercut font for the hud display, too");
AddIntItem (liste, "use_papercut_font", param.use_papercut_font);
AddItem(liste, "use_papercut_font", param.use_papercut_font);
liste.AddLine();
AddComment (liste, "Cursor type [0...1]");
AddComment (liste, "0 = normal cursor (arrow), 1 = icicle");
AddIntItem (liste, "ice_cursor", param.ice_cursor);
AddItem(liste, "ice_cursor", (int)param.ice_cursor);
liste.AddLine();
AddComment (liste, "Draw full skybox [0...1]");
AddComment (liste, "A normal skybox consists of 6 textures. In Tuxracer");
AddComment (liste, "3 textures are invisible (top, bottom and back).");
AddComment (liste, "These textures needn't be drawn.");
AddIntItem (liste, "full_skybox", param.full_skybox);
liste.AddLine();
AddComment (liste, "Audio frequency");
AddComment (liste, "Typical values are 11025, 22050 ...");
AddIntItem (liste, "audio_freq", param.audio_freq);
liste.AddLine();
AddComment (liste, "Size of audio buffer");
AddComment (liste, "Typical values are 512, 1024, 2048 ...");
AddIntItem (liste, "audio_buffer_size", param.audio_buffer_size);
AddItem(liste, "full_skybox", param.full_skybox);
liste.AddLine();
AddComment (liste, "Select the music:");
@ -269,7 +255,7 @@ void SaveConfigFile () {
AddComment (liste, "Use sqare root of scale factors for menu screens [0...1]");
AddComment (liste, "Exprimental: these factors reduce the effect of screen scaling.");
AddComment (liste, "The widgets are closer to their default sizes.");
AddIntItem (liste, "use_quad_scale", param.use_quad_scale);
AddItem(liste, "use_quad_scale", param.use_quad_scale);
liste.AddLine();
// ---------------------------------------

View File

@ -59,8 +59,6 @@ struct TParam {
int tux_sphere_divisions;
int tux_shadow_sphere_divisions;
int course_detail_level; // only for quadtree
int audio_freq;
int audio_buffer_size;
int use_papercut_font;
bool ice_cursor;

View File

@ -223,7 +223,7 @@ const TAvatar* CPlayers::FindAvatar(const string& name) {
void CPlayers::AddPassedCup (const string& cup) {
if (SPIntN (g_game.player->funlocked, cup, -1) > 0) return;
g_game.player->funlocked += " ";
g_game.player->funlocked += ' ';
g_game.player->funlocked += cup;
}

View File

@ -98,7 +98,7 @@ void GameOverMessage (const CControl *ctrl) {
if (g_game.game_type == CUPRACING) {
line += " (";
line += Int_StrN (g_game.race->herrings.x);
line += ")";
line += ')';
}
FT.DrawString (leftframe+240, topframe+40, line);
@ -109,7 +109,7 @@ void GameOverMessage (const CControl *ctrl) {
if (g_game.game_type == CUPRACING) {
line += " (";
line += Float_StrN (g_game.race->time.x, 2);
line += ")";
line += ')';
}
FT.DrawString (leftframe+240, topframe+65, line);

View File

@ -61,7 +61,7 @@ static void draw_time() {
string secstr = Int_StrN (sec, 2);
string hundrstr = Int_StrN (hundr, 2);
timestr += ":";
timestr += ':';
timestr += secstr;
if (param.use_papercut_font < 2) {

View File

@ -364,27 +364,27 @@ void CKeyframe::SaveTest (const string& dir, const string& filename) {
double ll = frame->val[9];
double rr = frame->val[10];
if (ll != 0 || rr != 0)
line += " [sh] " + Int_StrN((int) ll) + " " + Int_StrN((int)rr);
line += " [sh] " + Int_StrN((int)ll) + ' ' + Int_StrN((int)rr);
ll = frame->val[11];
rr = frame->val[12];
if (ll != 0 || rr != 0)
line += " [arm] " + Int_StrN((int)ll) + " " + Int_StrN((int)rr);
line += " [arm] " + Int_StrN((int)ll) + ' ' + Int_StrN((int)rr);
ll = frame->val[13];
rr = frame->val[14];
if (ll != 0 || rr != 0)
line += " [hip] " + Int_StrN((int)ll) + " " + Int_StrN((int)rr);
line += " [hip] " + Int_StrN((int)ll) + ' ' + Int_StrN((int)rr);
ll = frame->val[15];
rr = frame->val[16];
if (ll != 0 || rr != 0)
line += " [knee] " + Int_StrN((int)ll) + " " + Int_StrN((int)rr);
line += " [knee] " + Int_StrN((int)ll) + ' ' + Int_StrN((int)rr);
ll = frame->val[17];
rr = frame->val[18];
if (ll != 0 || rr != 0)
line += " [ankle] " + Int_StrN((int)ll) + " " + Int_StrN((int)rr);
line += " [ankle] " + Int_StrN((int)ll) + ' ' + Int_StrN((int)rr);
list.Add (line);
}

View File

@ -42,7 +42,7 @@ void CLoading::Enter() {
void CLoading::Loop(double time_step) {
TCourse *CourseList = &Course.CourseList[0];
string msg = Trans.Text(29) + " " + g_game.course->name;
string msg = Trans.Text(29) + ' ' + g_game.course->name;
check_gl_error ();
ScopedRenderMode rm(GUI);
@ -56,7 +56,7 @@ void CLoading::Loop(double time_step) {
sf::Sprite logo;
logo.setTexture(Tex.GetSFTexture(TEXLOGO));
logo.setScale(0.35, 0.35);
logo.setPosition((Winsys.resolution.width - logo.getTextureRect().width) / 2, 40);
logo.setPosition((Winsys.resolution.width - logo.getTextureRect().width*0.35) / 2, 40);
Winsys.draw(logo);
DrawGUIFrame();

View File

@ -181,7 +181,7 @@ void CalcJumpEnergy (double time_step) {
int CalcSoundVol (float fact) {
float vv = (float) param.sound_volume * fact;
if (vv > 120) vv = 120;
if (vv > 100) vv = 100;
return (int) vv;
}

View File

@ -66,7 +66,7 @@ void CSplashScreen::Loop(double timestep) {
sf::Sprite logo(Tex.GetSFTexture(TEXLOGO));
logo.setScale(Winsys.scale/2, Winsys.scale/2);
logo.setPosition((Winsys.resolution.width - logo.getTextureRect().width) / 2, 60);
logo.setPosition((Winsys.resolution.width - logo.getTextureRect().width*(Winsys.scale / 2)) / 2, 60);
FT.AutoSizeN(6);
sf::Text t1(Trans.Text(67), FT.getCurrentFont(), FT.GetSize());

View File

@ -362,7 +362,7 @@ void ScreenshotN () {
string path = param.screenshot_dir;
path += SEP;
path += g_game.course->dir;
path += "_";
path += '_';
path += GetTimeString();
int type = SCREENSHOT_PROC;

View File

@ -45,7 +45,7 @@ struct track_quad_t {
TVector2d t1, t2, t3, t4;
TVector3d n1, n2, n3, n4;
track_types_t track_type;
double alpha;
uint8_t alpha;
};
struct track_marks_t {
@ -291,7 +291,7 @@ void add_track_mark(const CControl *ctrl, int *id) {
q->t4 = TVector2d (1.0, q->t2.y + tex_end);
}
}
q->alpha = min ((2*comp_depth-dist_from_surface)/(4*comp_depth), 1.0);
q->alpha = min ((2*comp_depth-dist_from_surface)/(4*comp_depth)*255, 255);
continuing_track = true;
}

View File

@ -82,18 +82,15 @@ double CWinsys::CalcScreenScale () const {
void CWinsys::SetupVideoMode (const TScreenRes& resolution_) {
int bpp = 32;
switch (param.bpp_mode) {
case 16:
case 32:
bpp = param.bpp_mode;
break;
case 0:
bpp = 32;
break;
case 1:
bpp = 16;
break;
case 2:
bpp = 32;
break;
default:
param.bpp_mode = 0;
bpp = 32;
bpp = sf::VideoMode::getDesktopMode().bitsPerPixel;
break;
}
sf::Uint32 style = sf::Style::Close | sf::Style::Titlebar;
if (param.fullscreen)