-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathengine_interface.cpp
4767 lines (3873 loc) · 166 KB
/
engine_interface.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* Copyright (c) 2012 Cheese and Bacon Games, LLC */
/* This file is licensed under the MIT License. */
/* See the file docs/LICENSE.txt for the full license text. */
#include "engine_interface.h"
#include "world.h"
#include "render.h"
#include "sorting.h"
#include <fstream>
#include <cmath>
#include <SDL_image.h>
#include <boost/algorithm/string.hpp>
using namespace std;
GUI_Object::GUI_Object(string get_type,int get_index,int get_x,int get_y){
type=get_type;
index=get_index;
x=get_x;
y=get_y;
}
GUI_Selector_Chaser::GUI_Selector_Chaser(){
x=-1.0;
y=-1.0;
}
Controller::Controller(SDL_GameController* get_controller){
controller=get_controller;
instance_id=-1;
haptic=0;
}
Engine_Interface::Engine_Interface(){
window_under_mouse=0;
controller_text_entry_small=false;
cursor_render_always=false;
cursor="";
cursor_mouse_over="";
color_theme="";
toast_font="";
default_font="";
toast_length_short=0;
toast_length_medium=0;
toast_length_long=0;
logical_screen_width=0;
logical_screen_height=0;
resolution_mode="";
axis_scroll_rate=0;
scrolling_buttons_offset=0;
cursor_width=0;
cursor_height=0;
console_height=0;
chat_height=0;
sound_falloff=0.0;
window_border_thickness=0.0;
gui_border_thickness=0.0;
touch_finger_size=0.0;
touch_controller_shoulders=false;
touch_controller_guide=false;
touch_controller_xy=false;
game_title="";
home_directory="";
developer="";
option_save_location="";
option_version=get_version();
option_screen_width=0;
option_screen_height=0;
option_fullscreen=false;
option_fullscreen_mode="windowed";
option_vsync=false;
option_accelerometer_controller=false;
option_touch_controller=false;
option_touch_controller_opacity=0.0;
option_font_shadows=false;
option_screen_keyboard=false;
option_hw_cursor=false;
option_bind_cursor=false;
option_fps=false;
option_dev=false;
option_volume_global=1.0;
option_volume_sound=1.0;
option_volume_music=1.0;
option_mute_global=false;
option_mute_sound=false;
option_mute_music=false;
hide_gui=false;
need_to_reinit=false;
mouse_over=false;
touch_controls=false;
gui_mode="mouse";
gui_selected_object=-1;
gui_selector_style="";
for(int i=0;i<2;i++){
gui_selector_chasers.push_back(GUI_Selector_Chaser());
}
gui_axis_nav_last_direction="none";
controller_dead_zone=0;
counter_gui_scroll_axis=0;
configure_command=-1;
editing_server=0;
counter_cursor=0;
cursor_fade_direction=false;
cursor_opacity=10;
ptr_mutable_info=0;
}
void Engine_Interface::reload(){
need_to_reinit=true;
}
void Engine_Interface::quit(){
game.stop();
unload_world();
main_window.cleanup_video();
for(int i=0;i<controllers.size();i++){
if(controllers[i].haptic!=0 && SDL_HapticOpened(SDL_HapticIndex(controllers[i].haptic))){
SDL_HapticClose(controllers[i].haptic);
}
SDL_GameControllerClose(controllers[i].controller);
}
controllers.clear();
IMG_Quit();
Mix_CloseAudio();
Mix_Quit();
SDL_Quit();
exit(EXIT_SUCCESS);
}
void Engine_Interface::build_text_input_characters(){
characters_symbols.clear();
characters_lower.clear();
for(char i='a';i<='z';i++){
characters_lower.push_back(string(1,i));
}
if(!controller_text_entry_small){
characters_lower.push_back(",");
characters_lower.push_back(".");
characters_lower.push_back(":");
characters_lower.push_back("/");
characters_lower.push_back("@");
characters_lower.push_back("-");
}
else{
characters_symbols.push_back(",");
characters_symbols.push_back(".");
characters_symbols.push_back(":");
characters_symbols.push_back("/");
characters_symbols.push_back("@");
characters_symbols.push_back("-");
}
characters_upper.clear();
for(char i='A';i<='Z';i++){
characters_upper.push_back(string(1,i));
}
if(!controller_text_entry_small){
characters_upper.push_back("?");
characters_upper.push_back("!");
characters_upper.push_back(";");
characters_upper.push_back("\\");
characters_upper.push_back("&");
characters_upper.push_back("_");
}
else{
characters_symbols.push_back("?");
characters_symbols.push_back("!");
characters_symbols.push_back(";");
characters_symbols.push_back("\\");
characters_symbols.push_back("&");
characters_symbols.push_back("_");
}
characters_numbers.clear();
characters_numbers.push_back("1");
characters_numbers.push_back("2");
characters_numbers.push_back("3");
characters_numbers.push_back("4");
characters_numbers.push_back("5");
characters_numbers.push_back("6");
characters_numbers.push_back("7");
characters_numbers.push_back("8");
characters_numbers.push_back("9");
characters_numbers.push_back("0");
if(!controller_text_entry_small){
characters_numbers.push_back("*");
characters_numbers.push_back("+");
characters_numbers.push_back(string(1,(unsigned char)156));
characters_numbers.push_back(string(1,(unsigned char)155));
characters_numbers.push_back("$");
characters_numbers.push_back("`");
characters_numbers.push_back("'");
characters_numbers.push_back("\"");
characters_numbers.push_back("~");
characters_numbers.push_back("|");
characters_numbers.push_back("=");
characters_numbers.push_back("#");
characters_numbers.push_back("%");
characters_numbers.push_back("^");
characters_numbers.push_back("<");
characters_numbers.push_back(">");
characters_numbers.push_back("[");
characters_numbers.push_back("]");
characters_numbers.push_back("{");
characters_numbers.push_back("}");
characters_numbers.push_back("(");
characters_numbers.push_back(")");
}
else{
characters_numbers.push_back(" ");
characters_numbers.push_back(" ");
characters_numbers.push_back(" ");
characters_symbols.push_back("*");
characters_symbols.push_back("+");
characters_symbols.push_back(string(1,(unsigned char)156));
characters_symbols.push_back(string(1,(unsigned char)155));
characters_symbols.push_back("$");
characters_symbols.push_back("`");
characters_symbols.push_back("'");
characters_symbols.push_back("\"");
characters_symbols.push_back("~");
characters_symbols.push_back("|");
characters_symbols.push_back("=");
characters_symbols.push_back("#");
characters_symbols.push_back("%");
characters_symbols.push_back("^");
characters_symbols.push_back("<");
characters_symbols.push_back(">");
characters_symbols.push_back("[");
characters_symbols.push_back("]");
characters_symbols.push_back("{");
characters_symbols.push_back("}");
characters_symbols.push_back("(");
characters_symbols.push_back(")");
characters_symbols.push_back(" ");
characters_symbols.push_back(" ");
characters_symbols.push_back(" ");
characters_symbols.push_back(string(1,(unsigned char)1));
characters_symbols.push_back(string(1,(unsigned char)2));
}
}
void Engine_Interface::set_logic_update_rate(double frame_rate){
UPDATE_RATE=frame_rate;
SKIP_TICKS=1000.0/UPDATE_RATE;
}
void Engine_Interface::set_render_update_rate(double frame_rate){
UPDATE_RATE_RENDER=frame_rate;
SKIP_TICKS_RENDER=1000.0/UPDATE_RATE_RENDER;
}
bool Engine_Interface::load_data_engine(){
bool load_result=load_data("engine");
build_text_input_characters();
return load_result;
}
void Engine_Interface::load_data_main(){
load_data("font");
load_data("cursor");
load_data("color");
load_data("color_theme");
load_data("animation");
load_data("window");
load_data("game_command");
load_data("game_constant");
load_data_game();
for(int i=0;i<windows.size();i++){
windows[i].create_close_button();
windows[i].set_last_normal_button();
}
for(int i=0;i<cursors.size();i++){
cursors[i].load_hw_cursor();
}
text_selector.set_name("text_selector");
}
void Engine_Interface::load_data_game_options(){
load_data("game_option");
}
bool Engine_Interface::load_data(string script){
//Look through all of the files in the directory.
for(File_IO_Directory_Iterator it("data");it.evaluate();it.iterate()){
//If the file is not a directory.
if(it.is_regular_file()){
string file_path=it.get_full_path();
File_IO_Load load(file_path);
if(load.file_loaded()){
bool multi_line_comment=false;
//As long as we haven't reached the end of the file.
while(!load.eof()){
string line="";
//Grab the next line of the file.
load.getline(&line);
//Clear initial whitespace from the line.
boost::algorithm::trim(line);
//If the line ends a multi-line comment.
if(boost::algorithm::contains(line,"*/")){
multi_line_comment=false;
}
//If the line starts a multi-line comment.
if(!multi_line_comment && boost::algorithm::starts_with(line,"/*")){
multi_line_comment=true;
}
//If the line is a comment.
else if(!multi_line_comment && boost::algorithm::starts_with(line,"//")){
//Ignore this line.
}
//If the line begins an instance of the passed script type.
else if(!multi_line_comment && boost::algorithm::starts_with(line,"<"+script+">")){
if(script=="engine"){
load_engine_data(&load);
}
else if(script=="font"){
load_font(&load);
}
else if(script=="cursor"){
load_cursor(&load);
}
else if(script=="color"){
load_color(&load);
}
else if(script=="color_theme"){
load_color_theme(&load);
}
else if(script=="animation"){
load_animation(&load);
}
else if(script=="window"){
load_window(&load);
}
else if(script=="game_command"){
load_game_command(&load);
}
else if(script=="game_option"){
load_game_option(&load);
}
else if(script=="game_constant"){
load_game_constant(&load);
}
else{
load_data_script_game(script,&load);
}
}
}
}
else{
message_log.add_error("Error loading script data: '"+script+"'");
return false;
}
}
}
return true;
}
void Engine_Interface::unload_data(){
for(int i=0;i<cursors.size();i++){
cursors[i].free_hw_cursor();
}
clear_mutable_info();
fonts.clear();
cursors.clear();
colors.clear();
color_themes.clear();
animations.clear();
windows.clear();
window_z_order.clear();
window_under_mouse=0;
game_commands.clear();
game_options.clear();
unload_data_game();
}
void Engine_Interface::load_engine_data(File_IO_Load* load){
bool multi_line_comment=false;
//As long as we haven't reached the end of the file.
while(!load->eof()){
string line="";
//The option strings used in the file.
string str_name="name:";
string str_home_directory="home_directory:";
string str_developer="developer:";
string str_starting_windows="starting_windows:";
string str_logical_screen_width="logical_screen_width:";
string str_logical_screen_height="logical_screen_height:";
string str_resolution_mode="resolution_mode:";
string str_frame_rate="logic_update_rate:";
string str_frame_rate_render="frame_rate_max:";
string str_axis_scroll_rate="axis_scroll_rate:";
string str_scrolling_buttons_offset="scrolling_buttons_offset:";
string str_cursor_width="cursor_width:";
string str_cursor_height="cursor_height:";
string str_console_height="console_height:";
string str_chat_height="chat_height:";
string str_sound_falloff="sound_falloff:";
string str_window_border_thickness="window_border_thickness:";
string str_gui_border_thickness="gui_border_thickness:";
string str_touch_finger_size="touch_finger_size:";
string str_touch_controller_shoulders="touch_controller_shoulders:";
string str_touch_controller_guide="touch_controller_guide:";
string str_touch_controller_xy="touch_controller_xy:";
string str_tooltip_font="tooltip_font:";
string str_toast_font="toast_font:";
string str_default_font="default_font:";
string str_toast_length_short="toast_length_short:";
string str_toast_length_medium="toast_length_medium:";
string str_toast_length_long="toast_length_long:";
string str_console_move_speed="console_move_speed:";
string str_console_max_command_length="console_max_command_length:";
string str_console_max_log_recall="console_max_log_recall:";
string str_console_max_command_recall="console_max_command_recall:";
string str_console_font="console_font:";
string str_console_font_color="console_font_color:";
string str_console_opacity="console_opacity:";
string str_chat_move_speed="chat_move_speed:";
string str_chat_max_command_length="chat_max_command_length:";
string str_chat_max_log_recall="chat_max_log_recall:";
string str_chat_max_command_recall="chat_max_command_recall:";
string str_chat_font="chat_font:";
string str_chat_font_color="chat_font_color:";
string str_chat_opacity="chat_opacity:";
string str_chat_line_timeout="chat_line_timeout:";
string str_gui_selector_style="gui_selector_style:";
string str_controller_dead_zone="controller_dead_zone:";
string str_color_theme="color_theme:";
string str_controller_text_entry_small="controller_text_entry_small:";
string str_cursor_render_always="cursor_render_always:";
string str_cursor="cursor:";
string str_cursor_mouse_over="cursor_mouse_over:";
string str_default_save_location="default_save_location:";
string str_default_screen_width="default_screen_width:";
string str_default_screen_height="default_screen_height:";
string str_default_fullscreen="default_fullscreen_state:";
string str_default_fullscreen_mode="default_fullscreen_mode:";
string str_default_vsync="default_vsync:";
string str_default_accelerometer_controller="default_accelerometer_controller:";
string str_default_touch_controller="default_touch_controller:";
string str_default_touch_controller_opacity="default_touch_controller_opacity:";
string str_default_font_shadows="default_font_shadows:";
string str_default_screen_keyboard="default_screen_keyboard:";
string str_default_hw_cursor="default_hw_cursor:";
string str_default_bind_cursor="default_bind_cursor:";
string str_default_fps="default_fps:";
string str_default_dev="default_dev:";
string str_default_volume_global="default_volume_global:";
string str_default_volume_sound="default_volume_sound:";
string str_default_volume_music="default_volume_music:";
string str_default_mute_global="default_mute_global:";
string str_default_mute_sound="default_mute_sound:";
string str_default_mute_music="default_mute_music:";
//Grab the next line of the file.
load->getline(&line);
//Clear initial whitespace from the line.
boost::algorithm::trim(line);
//If the line ends a multi-line comment.
if(boost::algorithm::contains(line,"*/")){
multi_line_comment=false;
}
//If the line starts a multi-line comment.
if(!multi_line_comment && boost::algorithm::starts_with(line,"/*")){
multi_line_comment=true;
}
//If the line is a comment.
else if(!multi_line_comment && boost::algorithm::starts_with(line,"//")){
//Ignore this line.
}
//Load data based on the line.
//Name
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_name)){
//Clear the data name.
line.erase(0,str_name.length());
game_title=line;
}
//Home directory
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_home_directory)){
//Clear the data name.
line.erase(0,str_home_directory.length());
home_directory=line;
}
//Developer
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_developer)){
//Clear the data name.
line.erase(0,str_developer.length());
developer=line;
}
//Starting windows
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_starting_windows)){
//Clear the data name.
line.erase(0,str_starting_windows.length());
starting_windows.clear();
boost::algorithm::split(starting_windows,line,boost::algorithm::is_any_of(","));
for(int i=0;i<starting_windows.size();i++){
if(starting_windows[i].length()==0){
starting_windows.erase(starting_windows.begin()+i);
i--;
}
}
}
//Logical screen width
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_logical_screen_width)){
//Clear the data name.
line.erase(0,str_logical_screen_width.length());
logical_screen_width=string_stuff.string_to_long(line);
}
//Logical screen height
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_logical_screen_height)){
//Clear the data name.
line.erase(0,str_logical_screen_height.length());
logical_screen_height=string_stuff.string_to_long(line);
}
//Resolution mode
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_resolution_mode)){
//Clear the data name.
line.erase(0,str_resolution_mode.length());
resolution_mode=line;
}
//Frame rate
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_frame_rate)){
//Clear the data name.
line.erase(0,str_frame_rate.length());
set_logic_update_rate(string_stuff.string_to_double(line));
}
//Frame rate render
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_frame_rate_render)){
//Clear the data name.
line.erase(0,str_frame_rate_render.length());
set_render_update_rate(string_stuff.string_to_double(line));
}
//Axis scroll rate
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_axis_scroll_rate)){
//Clear the data name.
line.erase(0,str_axis_scroll_rate.length());
axis_scroll_rate=string_stuff.string_to_long(line);
}
//Scrolling buttons offset
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_scrolling_buttons_offset)){
//Clear the data name.
line.erase(0,str_scrolling_buttons_offset.length());
scrolling_buttons_offset=string_stuff.string_to_long(line);
}
//Cursor width
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_cursor_width)){
//Clear the data name.
line.erase(0,str_cursor_width.length());
cursor_width=string_stuff.string_to_long(line);
}
//Cursor height
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_cursor_height)){
//Clear the data name.
line.erase(0,str_cursor_height.length());
cursor_height=string_stuff.string_to_long(line);
}
//Console height
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_height)){
//Clear the data name.
line.erase(0,str_console_height.length());
console_height=string_stuff.string_to_long(line);
}
//Chat height
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_height)){
//Clear the data name.
line.erase(0,str_chat_height.length());
chat_height=string_stuff.string_to_long(line);
}
//Sound falloff
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_sound_falloff)){
//Clear the data name.
line.erase(0,str_sound_falloff.length());
sound_falloff=string_stuff.string_to_double(line);
}
//Window border thickness
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_window_border_thickness)){
//Clear the data name.
line.erase(0,str_window_border_thickness.length());
window_border_thickness=string_stuff.string_to_double(line);
}
//GUI border thickness
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_gui_border_thickness)){
//Clear the data name.
line.erase(0,str_gui_border_thickness.length());
gui_border_thickness=string_stuff.string_to_double(line);
}
//Touch finger size
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_touch_finger_size)){
//Clear the data name.
line.erase(0,str_touch_finger_size.length());
touch_finger_size=string_stuff.string_to_double(line);
}
//Touch controller shoulders
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_touch_controller_shoulders)){
//Clear the data name.
line.erase(0,str_touch_controller_shoulders.length());
touch_controller_shoulders=string_stuff.string_to_bool(line);
}
//Touch controller guide
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_touch_controller_guide)){
//Clear the data name.
line.erase(0,str_touch_controller_guide.length());
touch_controller_guide=string_stuff.string_to_bool(line);
}
//Touch controller xy
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_touch_controller_xy)){
//Clear the data name.
line.erase(0,str_touch_controller_xy.length());
touch_controller_xy=string_stuff.string_to_bool(line);
}
//Tooltip font
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_tooltip_font)){
//Clear the data name.
line.erase(0,str_tooltip_font.length());
tooltip.font=line;
}
//Toast font
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_toast_font)){
//Clear the data name.
line.erase(0,str_toast_font.length());
toast_font=line;
}
//Default font
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_font)){
//Clear the data name.
line.erase(0,str_default_font.length());
default_font=line;
}
//Toast length short
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_toast_length_short)){
//Clear the data name.
line.erase(0,str_toast_length_short.length());
toast_length_short=string_stuff.string_to_long(line);
}
//Toast length medium
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_toast_length_medium)){
//Clear the data name.
line.erase(0,str_toast_length_medium.length());
toast_length_medium=string_stuff.string_to_long(line);
}
//Toast length long
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_toast_length_long)){
//Clear the data name.
line.erase(0,str_toast_length_long.length());
toast_length_long=string_stuff.string_to_long(line);
}
//Console move speed
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_move_speed)){
//Clear the data name.
line.erase(0,str_console_move_speed.length());
console.move_speed=string_stuff.string_to_long(line);
}
//Console max command length
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_max_command_length)){
//Clear the data name.
line.erase(0,str_console_max_command_length.length());
console.max_command_length=string_stuff.string_to_long(line);
}
//Console max log recall
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_max_log_recall)){
//Clear the data name.
line.erase(0,str_console_max_log_recall.length());
console.max_log_recall=string_stuff.string_to_long(line);
}
//Console max command recall
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_max_command_recall)){
//Clear the data name.
line.erase(0,str_console_max_command_recall.length());
console.max_command_recall=string_stuff.string_to_long(line);
}
//Console font
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_font)){
//Clear the data name.
line.erase(0,str_console_font.length());
console.font=line;
}
//Console font color
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_font_color)){
//Clear the data name.
line.erase(0,str_console_font_color.length());
console.font_color=line;
}
//Console opacity
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_console_opacity)){
//Clear the data name.
line.erase(0,str_console_opacity.length());
console.background_opacity=string_stuff.string_to_double(line);
}
//Chat move speed
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_move_speed)){
//Clear the data name.
line.erase(0,str_chat_move_speed.length());
chat.move_speed=string_stuff.string_to_long(line);
}
//Chat max command length
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_max_command_length)){
//Clear the data name.
line.erase(0,str_chat_max_command_length.length());
chat.max_command_length=string_stuff.string_to_long(line);
}
//Chat max log recall
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_max_log_recall)){
//Clear the data name.
line.erase(0,str_chat_max_log_recall.length());
chat.max_log_recall=string_stuff.string_to_long(line);
}
//Chat max command recall
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_max_command_recall)){
//Clear the data name.
line.erase(0,str_chat_max_command_recall.length());
chat.max_command_recall=string_stuff.string_to_long(line);
}
//Chat font
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_font)){
//Clear the data name.
line.erase(0,str_chat_font.length());
chat.font=line;
}
//Chat font color
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_font_color)){
//Clear the data name.
line.erase(0,str_chat_font_color.length());
chat.font_color=line;
}
//Chat opacity
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_opacity)){
//Clear the data name.
line.erase(0,str_chat_opacity.length());
chat.background_opacity=string_stuff.string_to_double(line);
}
//Chat line timeout
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_chat_line_timeout)){
//Clear the data name.
line.erase(0,str_chat_line_timeout.length());
chat.line_timeout=string_stuff.string_to_long(line);
}
//GUI selector style
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_gui_selector_style)){
//Clear the data name.
line.erase(0,str_gui_selector_style.length());
gui_selector_style=line;
}
//Controller dead zone
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_controller_dead_zone)){
//Clear the data name.
line.erase(0,str_controller_dead_zone.length());
controller_dead_zone=string_stuff.string_to_long(line);
}
//Color theme
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_color_theme)){
//Clear the data name.
line.erase(0,str_color_theme.length());
color_theme=line;
}
//Controller text entry small
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_controller_text_entry_small)){
//Clear the data name.
line.erase(0,str_controller_text_entry_small.length());
controller_text_entry_small=string_stuff.string_to_bool(line);
}
//Cursor render always
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_cursor_render_always)){
//Clear the data name.
line.erase(0,str_cursor_render_always.length());
cursor_render_always=string_stuff.string_to_bool(line);
}
//Cursor
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_cursor)){
//Clear the data name.
line.erase(0,str_cursor.length());
cursor=line;
}
//Cursor Mouse Over
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_cursor_mouse_over)){
//Clear the data name.
line.erase(0,str_cursor_mouse_over.length());
cursor_mouse_over=line;
}
//default_save_location
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_save_location)){
//Clear the data name.
line.erase(0,str_default_save_location.length());
option_save_location=line;
}
//default_screen_width
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_screen_width)){
//Clear the data name.
line.erase(0,str_default_screen_width.length());
option_screen_width=string_stuff.string_to_long(line);
}
//default_screen_height
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_screen_height)){
//Clear the data name.
line.erase(0,str_default_screen_height.length());
option_screen_height=string_stuff.string_to_long(line);
}
//default_fullscreen
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_fullscreen)){
//Clear the data name.
line.erase(0,str_default_fullscreen.length());
option_fullscreen=string_stuff.string_to_bool(line);
}
//default_fullscreen_mode
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_fullscreen_mode)){
//Clear the data name.
line.erase(0,str_default_fullscreen_mode.length());
option_fullscreen_mode=line;
}
//default_vsync
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_vsync)){
//Clear the data name.
line.erase(0,str_default_vsync.length());
option_vsync=string_stuff.string_to_bool(line);
}
//default_accelerometer_controller
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_accelerometer_controller)){
//Clear the data name.
line.erase(0,str_default_accelerometer_controller.length());
option_accelerometer_controller=string_stuff.string_to_bool(line);
}
//default_touch_controller
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_touch_controller)){
//Clear the data name.
line.erase(0,str_default_touch_controller.length());
option_touch_controller=string_stuff.string_to_bool(line);
}
//default_touch_controller_opacity
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_touch_controller_opacity)){
//Clear the data name.
line.erase(0,str_default_touch_controller_opacity.length());
option_touch_controller_opacity=string_stuff.string_to_double(line);
}
//default_font_shadows
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_font_shadows)){
//Clear the data name.
line.erase(0,str_default_font_shadows.length());
option_font_shadows=string_stuff.string_to_bool(line);
}
//default_screen_keyboard
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_screen_keyboard)){
//Clear the data name.
line.erase(0,str_default_screen_keyboard.length());
option_screen_keyboard=string_stuff.string_to_bool(line);
}
//default_hw_cursor
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_hw_cursor)){
//Clear the data name.
line.erase(0,str_default_hw_cursor.length());
option_hw_cursor=string_stuff.string_to_bool(line);
}
//default_bind_cursor
else if(!multi_line_comment && boost::algorithm::starts_with(line,str_default_bind_cursor)){
//Clear the data name.
line.erase(0,str_default_bind_cursor.length());
option_bind_cursor=string_stuff.string_to_bool(line);
}
//default_fps