Commit 08ad9137 authored by Chen Bill's avatar Chen Bill

struct Config: default member initialize

parent 8f2c22ef
......@@ -1312,57 +1312,6 @@ void Game::LoadConfig() {
char strbuf[32];
char valbuf[256];
wchar_t wstr[256];
gameConf.use_d3d = 0;
gameConf.use_image_scale = 1;
gameConf.antialias = 0;
gameConf.serverport = 7911;
gameConf.textfontsize = 14;
gameConf.nickname[0] = 0;
gameConf.gamename[0] = 0;
gameConf.lastcategory[0] = 0;
gameConf.lastdeck[0] = 0;
gameConf.numfont[0] = 0;
gameConf.textfont[0] = 0;
gameConf.lasthost[0] = 0;
gameConf.lastport[0] = 0;
gameConf.roompass[0] = 0;
gameConf.bot_deck_path[0] = 0;
//settings
gameConf.chkMAutoPos = 0;
gameConf.chkSTAutoPos = 1;
gameConf.chkRandomPos = 0;
gameConf.chkAutoChain = 0;
gameConf.chkWaitChain = 0;
gameConf.chkDefaultShowChain = 0;
gameConf.chkIgnore1 = 0;
gameConf.chkIgnore2 = 0;
gameConf.use_lflist = 1;
gameConf.default_lflist = 0;
gameConf.default_rule = DEFAULT_DUEL_RULE;
gameConf.hide_setname = 0;
gameConf.hide_hint_button = 0;
gameConf.control_mode = 0;
gameConf.draw_field_spell = 1;
gameConf.separate_clear_button = 1;
gameConf.auto_search_limit = -1;
gameConf.search_multiple_keywords = 1;
gameConf.chkIgnoreDeckChanges = 0;
gameConf.defaultOT = 1;
gameConf.enable_bot_mode = 0;
gameConf.quick_animation = 0;
gameConf.auto_save_replay = 0;
gameConf.draw_single_chain = 0;
gameConf.hide_player_name = 0;
gameConf.prefer_expansion_script = 0;
gameConf.enable_sound = true;
gameConf.sound_volume = 0.5;
gameConf.enable_music = true;
gameConf.music_volume = 0.5;
gameConf.music_mode = 1;
gameConf.window_maximized = false;
gameConf.window_width = 1024;
gameConf.window_height = 640;
gameConf.resize_popup_menu = false;
while(fgets(linebuf, 256, fp)) {
sscanf(linebuf, "%s = %s", strbuf, valbuf);
if(!strcmp(strbuf, "antialias")) {
......
......@@ -9,60 +9,62 @@
#include <vector>
#include <list>
#define DEFAULT_DUEL_RULE 5
namespace ygo {
struct Config {
bool use_d3d;
bool use_image_scale;
unsigned short antialias;
unsigned short serverport;
unsigned char textfontsize;
wchar_t lasthost[100];
wchar_t lastport[10];
wchar_t nickname[20];
wchar_t gamename[20];
wchar_t lastcategory[64];
wchar_t lastdeck[64];
wchar_t textfont[256];
wchar_t numfont[256];
wchar_t roompass[20];
wchar_t bot_deck_path[64];
bool use_d3d{ false };
bool use_image_scale{ true };
unsigned short antialias{ 0 };
unsigned short serverport{ 7911 };
unsigned char textfontsize{ 14 };
wchar_t lasthost[100]{};
wchar_t lastport[10]{};
wchar_t nickname[20]{};
wchar_t gamename[20]{};
wchar_t lastcategory[64]{};
wchar_t lastdeck[64]{};
wchar_t textfont[256]{};
wchar_t numfont[256]{};
wchar_t roompass[20]{};
wchar_t bot_deck_path[64]{};
//settings
int chkMAutoPos;
int chkSTAutoPos;
int chkRandomPos;
int chkAutoChain;
int chkWaitChain;
int chkDefaultShowChain;
int chkIgnore1;
int chkIgnore2;
int use_lflist;
int default_lflist;
int default_rule;
int hide_setname;
int hide_hint_button;
int control_mode;
int draw_field_spell;
int separate_clear_button;
int auto_search_limit;
int search_multiple_keywords;
int chkIgnoreDeckChanges;
int defaultOT;
int enable_bot_mode;
int quick_animation;
int auto_save_replay;
int draw_single_chain;
int hide_player_name;
int prefer_expansion_script;
bool enable_sound;
bool enable_music;
double sound_volume;
double music_volume;
int music_mode;
bool window_maximized;
int window_width;
int window_height;
bool resize_popup_menu;
int chkMAutoPos{ 0 };
int chkSTAutoPos{ 1 };
int chkRandomPos{ 0 };
int chkAutoChain{ 0 };
int chkWaitChain{ 0 };
int chkDefaultShowChain{ 0 };
int chkIgnore1{ 0 };
int chkIgnore2{ 0 };
int use_lflist{ 1 };
int default_lflist{ 0 };
int default_rule{ DEFAULT_DUEL_RULE };
int hide_setname{ 0 };
int hide_hint_button{ 0 };
int control_mode{ 0 };
int draw_field_spell{ 1 };
int separate_clear_button{ 1 };
int auto_search_limit{ -1 };
int search_multiple_keywords{ 1 };
int chkIgnoreDeckChanges{ 0 };
int defaultOT{ 1 };
int enable_bot_mode{ 0 };
int quick_animation{ 0 };
int auto_save_replay{ 0 };
int draw_single_chain{ 0 };
int hide_player_name{ 0 };
int prefer_expansion_script{ 0 };
bool enable_sound{ true };
bool enable_music{ true };
double sound_volume{ 0.5 };
double music_volume{ 0.5 };
int music_mode{ 1 };
bool window_maximized{ false };
int window_width{ 1024 };
int window_height{ 640 };
bool resize_popup_menu{ false };
};
struct DuelInfo {
......@@ -824,8 +826,6 @@ extern Game* mainGame;
#define AVAIL_SC 0x8
#define AVAIL_OCGTCG (AVAIL_OCG|AVAIL_TCG)
#define DEFAULT_DUEL_RULE 5
#define CARD_ARTWORK_VERSIONS_OFFSET 10
#define MAX_LAYER_COUNT 6
#endif // GAME_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment