-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathfile_formats.h
1199 lines (1148 loc) · 61 KB
/
file_formats.h
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
/*
* PGE File Library - a library to process file formats, part of Moondust project
*
* Copyright (c) 2014-2025 Vitaly Novichkov <[email protected]>
*
* The MIT License (MIT)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
/*! \file file_formats.h
* \brief Main header of PGE File Library which includes all provided features set
*/
#pragma once
#ifndef FILE_FORMATS_H
#define FILE_FORMATS_H
#include "pge_file_lib_globs.h"
#include "lvl_filedata.h"
#include "npc_filedata.h"
#include "wld_filedata.h"
#include "save_filedata.h"
#include "smbx64_cnf_filedata.h"
#ifdef __GNUC__
# define PGEFL_DEPRECATED(func) func __attribute__ ((deprecated))
#elif defined(_MSC_VER)
# define PGEFL_DEPRECATED(func) __declspec(deprecated) func
#else
# pragma message("WARNING: You need to implement PGEFL_DEPRECATED for this compiler")
# define PGEFL_DEPRECATED(func) func
#endif
/*!
* \brief PGE File library class of static functions.
* Library is buildable in both Qt and STL applications
*/
class FileFormats PGE_FILES_INHERED
{
#ifdef PGE_FILES_QT
Q_OBJECT
#endif
public:
static const unsigned int c_latest_version_smbx64 = 64;
static const unsigned int c_latest_version_smbx38a = 69;
static const unsigned int c_version_default = 0xFFFFFFFF;
/******************************non-SMBX64 Meda-data file***********************************/
/*!
* \brief Parses non-SMBX64 meta-data from additional *.meta files
* there are contains data which impossible to save into SMBX64 LVL file
* therefore it will be saved into additional *.meta file
* \param [__in] filePath Full path to file with meta-data
* \param [__out] FileData Meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool ReadNonSMBX64MetaDataF(const PGESTRING &filePath, MetaData &FileData);
/*!
* \brief Parses non-SMBX64 meta-data from additional *.meta files
* there are contains data which impossible to save into SMBX64 LVL file
* therefore it will be saved into additional *.meta file
* \param [__in] rawdata Raw data of the meta-data
* \param [__in] filePath Full path to file with meta-data (needed to detect custom directory info)
* \param [__out] FileData Meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool ReadNonSMBX64MetaDataRaw(PGESTRING &rawdata, const PGESTRING &filePath, MetaData &FileData);
/*!
* \brief Parses non-SMBX64 meta-data from additional *.meta files
* there are contains data which impossible to save into SMBX64 LVL file
* therefore it will be saved into additional *.meta file
* \param [__in] in File input descriptor
* \param [__out] FileData FileData Meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool ReadNonSMBX64MetaDataFile(PGE_FileFormats_misc::TextInput &in, MetaData /*output*/ &FileData);
/*!
* \brief Saves data of non-SMBX meta-data into the file from Meta-data structure
* \param [__in] filePath Full path to file where need to save
* \param [__in] metaData Meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool WriteNonSMBX64MetaDataF(const PGESTRING &filePath, MetaData &metaData);
/*!
* \brief Generates raw data of non-SMBX meta-data from level data structure
* \param [__in] metaData Meta-data structure
* \param [__out] rawdata raw PGE-X data of meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool WriteNonSMBX64MetaDataRaw(MetaData &metaData, PGESTRING &rawdata);
/*!
* \brief Writes raw data of non-SMBX meta-data from level data through file descriptor
* \param [__inout] out File output descriptor
* \param [__in] metaData Meta-data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool WriteNonSMBX64MetaData(PGE_FileFormats_misc::TextOutput &out, MetaData /*Output*/ &metaData);
/******************************Level files***********************************/
/*!
* \brief Supported level file formats
*/
enum LevelFileFormat
{
//! PGE-X LVLX Level File format
LVL_PGEX = 0,
//! SMBX1...64 LVL Level File format
LVL_SMBX64,
//! SMBX-38A LVL Level File format
LVL_SMBX38A,
};
/*!
* \brief Parses a level file with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* \param [__in] filePath Full path to file which must be opened
* \param [__out] FileData Level data structure
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelFile(const PGESTRING &filePath, LevelData &FileData);
/**
* @brief Parses a level file data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rawdata Raw data of the supported level file
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] FileData Level data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
#ifdef PGEFL_ENABLE_RWOPS
/**
* @brief Parses a level file data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rwops SDL_RWops read-mode handle to a supported level file
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] FileData Level data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelRWops(SDL_RWops *rwops, const PGESTRING &filePath, LevelData &FileData);
#endif
/**
* @brief Parses a level file data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] file Input file descriptor
* @param [__out] FileData Level data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelFileT(PGE_FileFormats_misc::TextInput &file, LevelData &FileData);
/*!
* \brief Parses a level file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* \param [__in] filePath Full path to file which must be opened
* \param [__out] data Level data structure (with initialized header data only)
* \return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelFileHeader(const PGESTRING &filePath, LevelData &data);
/**
* @brief Parses a level file data header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rawdata Input raw data
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] data Level data structure (with initialized header data only)
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &data);
/**
* @brief Parses a level file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] file Input file descriptor
* @param [__out] data Level data structure (with initialized header data only)
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenLevelFileHeaderT(PGE_FileFormats_misc::TextInput &file, LevelData &data);
/*!
* \brief Save a level file to the disk
* \param [__in] FileData Level data structure
* \param [__in] filePath Path to file to save encoded in UTF-8 (for STL-version)
* \param [__in] format Target file format (PGE LVLX, SMBX1...64 LVL, SMBX-38A LVL)
* \param [__in] FormatVersion Version of target SMBX1...64 file. Takes no effect for other file formats
* \return true if file successfully saved
*/
static bool SaveLevelFile(LevelData &FileData, const PGESTRING &filePath, LevelFileFormat format, unsigned int formatVersion = c_version_default);
/*!
* \brief Save a level file to the raw string
* \param FileData Level data structure
* \param RawData Raw data string where to save levele file data
* \param format Target file format (PGE LVLX, SMBX1...64 LVL, SMBX-38A LVL)
* \param FormatVersion Version of target SMBX1...64 file. Takes no effect for other file formats
* \return true if data successfully generated
*/
static bool SaveLevelData(LevelData &FileData, PGESTRING &RawData, LevelFileFormat format, unsigned int formatVersion = c_version_default);
// SMBX64 LVL File
enum SMBX64LvlFlags
{
//! Keep default behavkour
F_SMBX64_NO_FLAGS = 0,
//! Don't convert NPC codes in blocks into modern format: keep them as-is (as -100, -101, -102, etc.)
F_SMBX64_KEEP_LEGACY_NPC_IN_BLOCK_CODES = 0x01
};
/*!
* \brief Changes the behaviour of reading and writing SMBX64 level files
* \param flags Bitwise flags that affects reading and writing of SMBX64 level files
*/
static void SetSMBX64LvlFlags(int flags);
/*!
* \brief Parses SMBX1...64 level file header and skips other part of a file
* \param [__in] filePath Full path to level file
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFileHeader(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX1...64 level file header and skips other part of a file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX1...64 level file header and skips other part of a file
* \param [__in] inf Input file descriptor
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFileHeaderT(PGE_FileFormats_misc::TextInput &inf, LevelData &FileData);
/*!
* \brief Parses SMBX1...64 level file data
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFileF(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX1...64 level file data
* \param [__in] rawdata Raw data of the SMBX1...64 level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__Out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX1...64 level file data
* \param [__in] in Input file descriptor
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64LvlFile(PGE_FileFormats_misc::TextInput &in, LevelData /*output*/ &FileData);
/*!
* \brief Generates SMBX1...64 Level file data and saves into file
* \param [__in] filePath Target file path
* \param [__in] FileData Level data structure
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64LvlFileF(const PGESTRING &filePath, LevelData &FileData, unsigned int file_format = c_latest_version_smbx64);
/*!
* \brief Generates SMBX1...64 Level file data and saves into raw string
* \param [__in] FileData Target file path
* \param [__out] rawdata Level data structure
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64LvlFileRaw(LevelData &FileData, PGESTRING &rawdata, unsigned int file_format = c_latest_version_smbx64);
/*!
* \brief Generates SMBX1...64 Level file data and saves it through file output descriptor
* \param [__inout] out Output file descriptor
* \param [__in] FileData Target file path
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64LvlFile(PGE_FileFormats_misc::TextOutput &out, LevelData /*output*/ &FileData, unsigned int file_format = c_latest_version_smbx64);
// SMBX-38A LVL File
/*!
* \brief Parses SMBX-38A level file header and skips other part of a file
* \param [__in] filePath Full path to level file
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFileHeader(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX-38A level file header and skips other part of a file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX-38A level file header and skips other part of a file
* \param [__in] inf Input file descriptor
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFileHeaderT(PGE_FileFormats_misc::TextInput &inf, LevelData &FileData);
/*!
* \brief Parses SMBX-38A level file data from file
* \param [__in] filePath Full path to flie
* \param [__out] FileData
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFileF(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX-38A level file data from raw data string
* \param [__in] rawdata Raw-data string contains SMBX-38A Level file data
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses SMBX-38A level file data from raw data string
* \param [__in] in File input descriptor
* \param [__out] FileData FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFile(PGE_FileFormats_misc::TextInput &in, LevelData /*output*/ &FileData);
#if 0 // Removed
/*!
* \brief Parses SMBX-38A level file data from raw data string (Old algorithm)
* \param [__in] in File input descriptor
* \param [__out] FileData FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38ALvlFile_OLD(PGE_FileFormats_misc::TextInput &in, LevelData &FileData);
#endif
/*!
* \brief Generates SMBX-38A Level file data and saves into file
* \param [__in] filePath Target file path
* \param [__in] FileData Level data structure
* \param [__in] file_format SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38ALvlFileF(const PGESTRING &filePath, LevelData &FileData, unsigned int format_version = c_latest_version_smbx38a);
/*!
* \brief Generates SMBX-38A Level file data and saves into raw string
* \param [__in] FileData Target file path
* \param [__out] rawdata Raw data string in the SMBX-38A level format
* \param [__in] file_format SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38ALvlFileRaw(LevelData &FileData, PGESTRING &rawdata, unsigned int format_version = c_latest_version_smbx38a);
/*!
* \brief Generates SMBX-38A Level file data and saves it through file output descriptor
* \param [__inout] out Output file descriptor
* \param [__in] FileData Target file path
* \param [__in] file_format SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38ALvlFile(PGE_FileFormats_misc::TextOutput &out, LevelData &FileData, unsigned int format_version = c_latest_version_smbx38a);
// PGE Extended Level File
/*!
* \brief Parses PGE-X Level file header from the file
* \param filePath Full path to PGE-X Level file
* \param FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFileHeader(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses PGE-X Level file header from the file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses PGE-X Level file header from the file
* \param [__in] inf Input file descriptor
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFileHeaderT(PGE_FileFormats_misc::TextInput &inf, LevelData &FileData);
/*!
* \brief Parses PGE-X level file data from file
* \param [__in] filePath Full path to the file
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFileF(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses PGE-X level file data from raw data string
* \param [__in] rawdata Raw data string in the PGE-X level format
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Parses PGE-X level file data from file input descriptor
* \param [__in] in File Input descriptor
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedLvlFile(PGE_FileFormats_misc::TextInput &in, LevelData /*output*/ &FileData);
/*!
* \brief Generates PGE-X Level file
* \param [__in] filePath Target file path
* \param [__in] FileData Level data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedLvlFileF(const PGESTRING &filePath, LevelData &FileData);
/*!
* \brief Generates PGE-X Level raw data string
* \param [__in] FileData Level data structure
* \param [__out] rawdata Raw data string in the PGE-X level format
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedLvlFileRaw(LevelData &FileData, PGESTRING &rawdata);
/*!
* \brief Generates PGE-X Level data and sends into file output descriptor
* \param [__inout] out Output file descriptor
* \param [__in] FileData Level data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedLvlFile(PGE_FileFormats_misc::TextOutput &out, LevelData /*output*/ &FileData);
// Lvl Data
/*!
* \brief Generates blank initialized level data structure
* \return Level data structure
*/
static LevelData CreateLevelData();
/*!
* \brief Initializes blank level data structure
* \param NewFileData blank level data structure
*/
static void CreateLevelData(LevelData &NewFileData);
/*!
* \brief Initializes header only of the blank level data structure
* \param NewFileData blank level data structure
*/
static void CreateLevelHeader(LevelData &NewFileData);
/*!
* \brief Initializes Level specific NPC entry structure with default properties
* \return Initialized with default properties level specific NPC entry structure
*/
static LevelNPC CreateLvlNpc();
/*!
* \brief Initializes Level specific Warp entry structure with default properties
* \return Initialized with default properties level specific Warp entry structure
*/
static LevelDoor CreateLvlWarp();
/*!
* \brief Initializes Level specific Block entry structure with default properties
* \return Initialized with default properties level specific Block entry structure
*/
static LevelBlock CreateLvlBlock();
/*!
* \brief Initializes Level specific Background Object entry structure with default properties
* \return Initialized with default properties level specific Background Object entry structure
*/
static LevelBGO CreateLvlBgo();
/*!
* \brief Initializes Level specific Physical Environment Zone entry structure with default properties
* \return Initialized with default properties level specific Physical Environment Zone entry structure
*/
static LevelPhysEnv CreateLvlPhysEnv();
/*!
* \brief Initializes Level specific Layer entry structure with default properties
* \return Initialized with default properties level specific Layer entry structure
*/
static LevelLayer CreateLvlLayer();
/*!
* \brief Initializes Level specific SMBX64 Event entry structure with default properties
* \return Initialized with default properties level specific SMBX64 Event entry structure
*/
static LevelSMBX64Event CreateLvlEvent();
/*!
* \brief Initializes Level specific Player spawn point entry structure with default properties
* \return Initialized with default properties level specific Player spawn point entry structure
*/
static PlayerPoint CreateLvlPlayerPoint(unsigned int id = 0);
/*!
* \brief Initializes Level specific Section Settings entry structure with default properties
* \return Initialized with default properties level specific Section Settings entry structure
*/
static LevelSection CreateLvlSection();
/*!
* \brief Initalizes Level specific Variable entry
* \param vname name of variable
* \return Initialized with default properties level specific Variable entry
*/
static LevelVariable CreateLvlVariable(const PGESTRING &vname);
/*!
* \brief Initalizes Level specific Script Entry
* \param name name of script
* \param lang language code of script (Lua, Luna-Autocode or Tea-Script)
* \return Initialized with default properties level specific Script entry
*/
static LevelScript CreateLvlScript(const PGESTRING &name, int lang = LevelScript::LANG_LUA);
/*!
* \brief Appends internal layers and events if not exists
* \param FileData initalized and filled level file
*/
static void LevelAddInternalEvents(LevelData &FileData);
/*!
* \brief Sets sort priority of unspecified BGOs according to SMBX64 priorities (component of smbx64LevelPrepare)
* \param [__inout] lvl Level data structure object
*/
static void smbx64LevelSetBGOPriorities(LevelData &lvl);
/*!
* \brief Optimizing level data for SMBX64 Standard requirements
* \param [__inout] lvl Level data structure object
*
* Internally calls smbx64LevelSetBGOPriorities and sets lvl.stars using smbx64CountStars
*/
static void smbx64LevelPrepare(LevelData &lvl);
/*!
* \brief Counts number of SMBX-64 Stars (NPC-97 and NPC-196). Friendly NPC's are not counts as stars.
* \param [__inout] lvl Level data structure
* \return number of found SMBX-64 stars
*/
static int smbx64CountStars(LevelData &lvl);
/*!
* \brief Sorts blocks array by Y->X positions in the given level data structure.
* By SMBX64 standard, blocks array must be sorted because it is required for
* NPC's collision detection algorithm of SMBX Engine
* \param [__inout] lvl Level data structure object
*/
static void smbx64LevelSortBlocks(LevelData &lvl);
/*!
* \brief Sorts Background objects by special order priority value
* Modifying of order priority values allowing to force specific non-foreground BGO's
* to be rendered foreground
* \param [__inout] lvl Level data structure object
*/
static void smbx64LevelSortBGOs(LevelData &lvl);
/*!
* \brief Sorts Background objects by arrayId and Z-offset
* \param [__inout] lvl Level data structure object
*/
static void smbx2bLevelSortBGOs(LevelData &lvl);
/*!
* \brief Sorts Background objects by arrayId
* \param [__inout] lvl Level data structure object
*/
static void arrayIdLevelSortBGOs(LevelData &lvl);
/******************************World map files***********************************/
/*!
* \brief Supported world map file formats
*/
enum WorldFileFormat
{
//! PGE-X WLDX World map file format
WLD_PGEX = 0,
//! SMBX1...64 WLD World map file format
WLD_SMBX64,
//! SMBX-38A WLD World map file format
WLD_SMBX38A
};
/*!
* \brief Parses a world map file with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX)
* \param [__in] filePath Full path to file which must be opened
* \param [__out] data World data structure
* \return true on success file reading, false if error was occouped
*/
static bool OpenWorldFile(const PGESTRING &filePath, WorldData &data);
/**
* @brief Parses a world map file data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rawdata Raw data of the supported level file
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] FileData World data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenWorldRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
#ifdef PGEFL_ENABLE_RWOPS
/**
* @brief Parses a world map file data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rwops SDL_RWops read-mode handle to a supported world file
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] FileData World data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenWorldRWops(SDL_RWops *rwops, const PGESTRING &filePath, WorldData &FileData);
#endif
/**
* @brief Parses a level world map data with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] file Input file descriptor
* @param [__out] FileData World data structure
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenWorldFileT(PGE_FileFormats_misc::TextInput &file, WorldData &data);
/*!
* \brief Parses a world map file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-WLDX)
* \param [__in] filePath Full path to file which must be opened
* \param [__out] data World data structure (with initialized header data only)
* \return true on success file reading, false if error was occouped
*/
static bool OpenWorldFileHeader(const PGESTRING &filePath, WorldData &data);
/**
* @brief Parses a level file data header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] rawdata Input raw data
* @param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* @param [__out] data Level data structure (with initialized header data only)
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenWorldFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &data);
/**
* @brief Parses a level file header only with auto-detection of a file type (SMBX1...64 LVL or PGE-LVLX)
* @param [__in] file Input file descriptor
* @param [__out] data Level data structure (with initialized header data only)
* @return true if file successfully opened and parsed, false if error occouped
*/
static bool OpenWorldFileHeaderT(PGE_FileFormats_misc::TextInput &file, WorldData &data);
/*!
* \brief Save a world file to the disk
* \param [__in] FileData World data structure
* \param [__in] filePath Path to file to save encoded in UTF-8 (for STL-version)
* \param [__in] format Target file format (PGE WLDX, SMBX1...64 WLD, SMBX-38A WLD)
* \param [__in] FormatVersion Version of target SMBX1...64 file. Takes no effect for other file formats
* \return true if file successfully saved
*/
static bool SaveWorldFile(WorldData &FileData, const PGESTRING &filePath, WorldFileFormat format, unsigned int formatVersion = c_version_default);
/*!
* \brief Save a world map file to the raw string
* \param [__in] FileData World data structure
* \param [__in] filePath Path to file to save encoded in UTF-8 (for STL-version)
* \param [__in] format Target file format (PGE WLDX, SMBX1...64 WLD, SMBX-38A WLD)
* \param [__in] FormatVersion Version of target SMBX1...64 file. Takes no effect for other file formats
* \return true if data successfully generated
*/
static bool SaveWorldData(WorldData &FileData, PGESTRING &RawData, WorldFileFormat format, unsigned int formatVersion = c_version_default);
// SMBX64 WLD File
/*!
* \brief Parsed SMBX1...64 World map file header only
* \param [__in] filePath Full path to file to open
* \param [__out] Filedata World data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFileHeader(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX1...64 world map file header and skips other part of a file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData World map data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX1...64 world map file header and skips other part of a file
* \param [__in] inf Input file descriptor
* \param [__out] FileData World map data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFileHeaderT(PGE_FileFormats_misc::TextInput &inf, WorldData &FileData);
/*!
* \brief Parses SMBX1...64 World map file from raw data from file
* \param [__in] filePath Full path to file to open
* \param [__out] FileData World data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFileF(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX1...64 World map file from raw data from raw-data string
* \param [__in] rawdata Raw-data string which contains SMBX1...64 World map data
* \param [__in] filePath
* \param [__out] FileData World data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX1...64 World map file from raw data from file input descriptor
* \param [__in] in File Input descriptor
* \param [__out] FileData World data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64WldFile(PGE_FileFormats_misc::TextInput &in, WorldData /*output*/ &FileData);
/*!
* \brief Saves level data into file of SMBX1...64 World map format
* \param [__in] filePath Target file path
* \param [__in] FileData World map data structure
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64WldFileF(const PGESTRING &filePath, WorldData &FileData, unsigned int file_format = c_latest_version_smbx64);
/*!
* \brief Generates raw data string in SMBX1...64 World map format
* \param [__in] FileData World map data structure
* \param [__out] rawdata Raw data string in SMBX1...64 World map format
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64WldFileRaw(WorldData &FileData, PGESTRING &rawdata, unsigned int file_format = c_latest_version_smbx64);
/*!
* \brief Writes world map data into file output descriptor of SMBX1...64 World map format
* \param [__inout] out Output file descriptor
* \param [__in] FileData World map data structure
* \param [__in] file_format SMBX file format version number (from 0 to 64) [Example of level in SMBX0 format is intro.dat included with SMBX 1.0]
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX64WldFile(PGE_FileFormats_misc::TextOutput &out, WorldData /*output*/ &FileData, unsigned int file_format = c_latest_version_smbx64);
// SMBX-38A WLD File
/*!
* \brief Parses SMBX-38A world map file header and skips other part of a file
* \param [__in] filePath Full path to world map file
* \param [__out] FileData Level data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFileHeader(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX-38A world map file header and skips other part of a file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param FileData World data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX-38A world map file header and skips other part of a file
* \param [__in] inf Input file descriptor
* \param [__out] FileData World map data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFileHeaderT(PGE_FileFormats_misc::TextInput &inf, WorldData &FileData);
/*!
* \brief Parses SMBX-38A world map file data from file
* \param [__in] filePath Full path to flie
* \param [__out] FileData
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFileF(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX-38A world map file data from raw data string
* \param [__in] rawdata Raw-data string contains SMBX-38A Level file data
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses SMBX-38A world map file data from raw data string
* \param [__in] in File input descriptor
* \param [__out] FileData FileData Level data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX38AWldFile(PGE_FileFormats_misc::TextInput &in, WorldData /*output*/ &FileData);
/*!
* \brief Generates SMBX-38A Level file data and saves into file
* \param [__in] filePath Target file path
* \param [__in] FileData Level data structure
* \param [__in] format_version SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38AWldFileF(const PGESTRING &filePath, WorldData &FileData, unsigned int format_version = c_latest_version_smbx38a);
/*!
* \brief Generates SMBX-38A Level file data and saves into raw string
* \param [__in] FileData Target file path
* \param [__out] rawdata Raw data string in the SMBX-38A world map format
* \param [__in] format_version SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38AWldFileRaw(WorldData &FileData, PGESTRING &rawdata, unsigned int format_version = c_latest_version_smbx38a);
/*!
* \brief Generates SMBX-38A Level file data and saves it through file output descriptor
* \param [__inout] out Output file descriptor
* \param [__in] FileData Target file path
* \param [__in] format_version SMBX-38A file format version number (from 64 to 69)
* \return true if file successfully saved, false if error occouped
*/
static bool WriteSMBX38AWldFile(PGE_FileFormats_misc::TextOutput &out, WorldData &FileData, unsigned int format_version = c_latest_version_smbx38a);
// PGE Extended World map File
/*!
* \brief Parsed PGE-X World map file header only
* \param filePath Full path to file which must be opened
* \param FileData World data structure (with initialized header data only)
* \return true if file successfully saved, false if error occouped
*/
static bool ReadExtendedWldFileHeader(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses PGE-X World map file header from the file
* \param [__in] rawdata Raw data of the supported level file
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData World data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedWldFileHeaderRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses PGE-X World map file header from the file
* \param [__in] inf Input file descriptor
* \param [__out] FileData World data structure (with initialized header data only)
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedWldFileHeaderT(PGE_FileFormats_misc::TextInput &inf, WorldData &FileData);
/*!
* \brief Parses PGE-X World map file from file
* \param [__in] filePath
* \param [__out] FileData World map data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedWldFileF(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses PGE-X World map file from raw data string
* \param [__in] rawdata Raw data strign with PGE-X World map data
* \param [__in] filePath Full path to the file (if empty, custom data in the episode and in the custom directories are will be inaccessible)
* \param [__out] FileData World map data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedWldFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Parses PGE-X World map file from file input descriptor
* \param [__in] in File Input descriptor
* \param [__out] FileData World map data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedWldFile(PGE_FileFormats_misc::TextInput &in, WorldData /*output*/ &FileData);
/*!
* \brief Saves world map data into file of PGE-X World map format
* \param [__in] filePath Target file path
* \param [__in] FileData World map data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedWldFileF(const PGESTRING &filePath, WorldData &FileData);
/*!
* \brief Generates raw data string in PGE-X World map format
* \param [__in] FileData World map data structure
* \param [__out] rawdata Raw data string in PGE-X World map format
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedWldFileRaw(WorldData &FileData, PGESTRING &rawdata);
/*!
* \brief Generates data into file output descriptor in PGE-X World map format
* \param [__inout] out Output file descriptor
* \param [__in] FileData World map data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedWldFile(PGE_FileFormats_misc::TextOutput &out, WorldData /*output*/ &FileData);
//Wld Data
/*!
* \brief Initializes world map structure header
* \param [__out] NewFileData World map data structure with initialized header only
*/
static void CreateWorldHeader(WorldData &NewFileData);
/*!
* \brief Generates blank initialized World map data structure
* \param [__out] NewFileData World map data structure
*/
static void CreateWorldData(WorldData &NewFileData);
/*!
* \brief Generates blank initialized World map data structure
* \return World map data structure
*/
static WorldData CreateWorldData();
/*!
* \brief Initializes World map specific Tile entry structure with default properties
* \return Initialized with default properties World map specific Tile entry structure
*/
static WorldTerrainTile CreateWldTile();
/*!
* \brief Initializes World map specific Scenery entry structure with default properties
* \return Initialized with default properties World map specific Scenery entry structure
*/
static WorldScenery CreateWldScenery();
/*!
* \brief Initializes World map specific Path entry structure with default properties
* \return Initialized with default properties World map specific Path entry structure
*/
static WorldPathTile CreateWldPath();
/*!
* \brief Initializes World map specific Level Entrance point entry structure with default properties
* \return Initialized with default properties World map specific Level Entrance point entry structure
*/
static WorldLevelTile CreateWldLevel();
/*!
* \brief Initializes World map specific Music Box entry structure with default properties
* \return Initialized with default properties World map specific Music Box entry structure
*/
static WorldMusicBox CreateWldMusicbox();
/*!
* \brief Sorts some item objects by array_id key (to restore original order after history actions)
* \param [__inout] wld World map data structure object
*/
static void WorldPrepare(WorldData &wld);
/****************************Save of game file********************************/
// SMBX1..64 SAV file
/*!
* \brief Parses SMBX1...64 Game save data from file
* \param [__in] filePath File path to open
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64SavFileF(const PGESTRING &filePath, GamesaveData &FileData);
/*!
* \brief Parses SMBX1...64 Game save data from raw data string
* \param [__in] rawdata raw data string in SMBX1..64 game save format
* \param [__in] filePath Path to original file
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64SavFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, GamesaveData &FileData);
/*!
* \brief Parses SMBX1...64 Game save data from input descriptor
* \param [__in] in File Input descriptor
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadSMBX64SavFile(PGE_FileFormats_misc::TextInput &in, GamesaveData /*output*/ &FileData);
//PGE-X SAVX file
/*!
* \brief Parses PGE-X level file data from file
* \param [__in] filePath Full path to the file
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedSaveFileF(const PGESTRING &filePath, GamesaveData &FileData);
/*!
* \brief Parses PGE-X level file data from raw data string
* \param [__in] rawdata Raw data string in the PGE-X Game save format
* \param [__in] filePath Full path to the file
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedSaveFileRaw(PGESTRING &rawdata, const PGESTRING &filePath, GamesaveData &FileData);
/*!
* \brief Parses PGE-X level file data from file input descriptor
* \param [__in] in File Input descriptor
* \param [__out] FileData Game save data structure
* \return true if file successfully parsed, false if error occouped
*/
static bool ReadExtendedSaveFile(PGE_FileFormats_misc::TextInput &in, GamesaveData &FileData);
/*!
* \brief Saves Game save data into file of PGE-X Game save format
* \param [__in] filePath Target file path
* \param [__in] FileData Game save data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedSaveFileF(const PGESTRING &filePath, GamesaveData &FileData);
/*!
* \brief Generates raw data string in PGE-X Game save format
* \param [__in] FileData World map data structure
* \param [__out] rawdata Raw data string in PGE-X Game save format
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedSaveFileRaw(GamesaveData &FileData, PGESTRING &rawdata);
/*!
* \brief WriteExtendedWldFile
* \param [__inout] out Output file descriptor
* \param [__in] FileData Game save data structure
* \return true if file successfully saved, false if error occouped
*/
static bool WriteExtendedSaveFile(PGE_FileFormats_misc::TextOutput &out, GamesaveData &FileData);
//Save Data
/*!
* \brief Initializes blank game save data structure with default preferences
* \return Blank Game Save data structure
*/
static GamesaveData CreateGameSaveData();
/*!
* \brief Inirializes Game Save specific playable character state entry
* \return Blank game save specific playable character state entry
*/
static saveCharState CreateSavCharacterState();
/****************************SMBX64 Config file********************************/
/*!
* \brief Parses SMBX Engine config file raw data string
* \param [__in] RawData raw data string in SMBX Engine config file format
* \return SMBX Engine specific config structure
*/
PGEFL_DEPRECATED(static SMBX64_ConfigFile ReadSMBX64ConfigFile(PGESTRING RawData));
/*!
* \brief Parses SMBX Engine config data from file
* \param [__in] filePath Filepath to open