* Use enum class instead of enum (except for the enums for the resource IDs, not really necessary there).
* For NCSF specifically, included a function to convert an enum class to its underlying integral type (as this is needed for use with the std::bitset class).
* Cleanup headers so all the ones needed in a file are explicitly included even if they may possibly be included in another header.
* Used forward declarations in a few spots.
* Explicitly namespaced all (u)int*_t uses (this might seem like overkill, but it helps me see when the standard types are being used with a simple search for std::).
* Made sure it all builds with MinGW-w64 as well (both gcc and clang).
* Removed some std::move from DialogBuilder.cpp based on clang's warnings for that.
* Replaced use of std::copy_n on strings in DialogBuilder.cpp with my CopyToString functions that use wcscpy.
* Replaced CHAR_MIN/CHAR_MAX in eqstr.h and ltstr.h with std::numeric_limits<char>::min/max().
| ... | ... |
@@ -9,10 +9,13 @@ |
| 9 | 9 |
#pragma once |
| 10 | 10 |
|
| 11 | 11 |
#include <memory> |
| 12 |
-#include "SSEQ.h" |
|
| 12 |
+#include <cstdint> |
|
| 13 |
+#include "INFOEntry.h" |
|
| 13 | 14 |
#include "SBNK.h" |
| 15 |
+#include "SSEQ.h" |
|
| 14 | 16 |
#include "SWAR.h" |
| 15 |
-#include "common.h" |
|
| 17 |
+ |
|
| 18 |
+struct PseudoFile; |
|
| 16 | 19 |
|
| 17 | 20 |
struct SDAT |
| 18 | 21 |
{
|
| ... | ... |
@@ -21,5 +24,5 @@ struct SDAT |
| 21 | 24 |
std::unique_ptr<SWAR> swar[4]; |
| 22 | 25 |
INFOEntryPLAYER player; |
| 23 | 26 |
|
| 24 |
- SDAT(PseudoFile &file, uint32_t sseqToLoad); |
|
| 27 |
+ SDAT(PseudoFile &file, std::uint32_t sseqToLoad); |
|
| 25 | 28 |
}; |
(They were probably holdovers from copying the code from the NCSF creation tools.)
(I never remember to update these and besides, GitHub history can show when they were last modified.)
Backwards compatibility is kept by treating the lack of PLAYER info as
if all channels are able to be allocated.
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2014-09-08 |
|
| 4 |
+ * Last modification on 2014-10-25 |
|
| 5 | 5 |
* |
| 6 | 6 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 7 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| ... | ... |
@@ -20,6 +20,7 @@ struct SDAT |
| 20 | 20 |
std::unique_ptr<SSEQ> sseq; |
| 21 | 21 |
std::unique_ptr<SBNK> sbnk; |
| 22 | 22 |
std::unique_ptr<SWAR> swar[4]; |
| 23 |
+ INFOEntryPLAYER player; |
|
| 23 | 24 |
|
| 24 | 25 |
SDAT(PseudoFile &file, uint32_t sseqToLoad); |
| 25 | 26 |
private: |
| ... | ... |
@@ -1,14 +1,13 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2013-03-30 |
|
| 4 |
+ * Last modification on 2014-09-08 |
|
| 5 | 5 |
* |
| 6 | 6 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 7 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| 8 | 8 |
*/ |
| 9 | 9 |
|
| 10 |
-#ifndef SSEQPLAYER_SDAT_H |
|
| 11 |
-#define SSEQPLAYER_SDAT_H |
|
| 10 |
+#pragma once |
|
| 12 | 11 |
|
| 13 | 12 |
#include <memory> |
| 14 | 13 |
#include "SSEQ.h" |
| ... | ... |
@@ -27,5 +26,3 @@ private: |
| 27 | 26 |
SDAT(const SDAT &); |
| 28 | 27 |
SDAT &operator=(const SDAT &); |
| 29 | 28 |
}; |
| 30 |
- |
|
| 31 |
-#endif |
| ... | ... |
@@ -1,7 +1,7 @@ |
| 1 | 1 |
/* |
| 2 | 2 |
* SSEQ Player - SDAT structure |
| 3 | 3 |
* By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
| 4 |
- * Last modification on 2013-03-21 |
|
| 4 |
+ * Last modification on 2013-03-30 |
|
| 5 | 5 |
* |
| 6 | 6 |
* Nintendo DS Nitro Composer (SDAT) Specification document found at |
| 7 | 7 |
* http://www.feshrine.net/hacking/doc/nds-sdat.html |
| ... | ... |
@@ -18,9 +18,9 @@ |
| 18 | 18 |
|
| 19 | 19 |
struct SDAT |
| 20 | 20 |
{
|
| 21 |
- std::auto_ptr<SSEQ> sseq; |
|
| 22 |
- std::auto_ptr<SBNK> sbnk; |
|
| 23 |
- std::auto_ptr<SWAR> swar[4]; |
|
| 21 |
+ std::unique_ptr<SSEQ> sseq; |
|
| 22 |
+ std::unique_ptr<SBNK> sbnk; |
|
| 23 |
+ std::unique_ptr<SWAR> swar[4]; |
|
| 24 | 24 |
|
| 25 | 25 |
SDAT(PseudoFile &file, uint32_t sseqToLoad); |
| 26 | 26 |
private: |
| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,31 @@ |
| 1 |
+/* |
|
| 2 |
+ * SSEQ Player - SDAT structure |
|
| 3 |
+ * By Naram Qashat (CyberBotX) [cyberbotx@cyberbotx.com] |
|
| 4 |
+ * Last modification on 2013-03-21 |
|
| 5 |
+ * |
|
| 6 |
+ * Nintendo DS Nitro Composer (SDAT) Specification document found at |
|
| 7 |
+ * http://www.feshrine.net/hacking/doc/nds-sdat.html |
|
| 8 |
+ */ |
|
| 9 |
+ |
|
| 10 |
+#ifndef SSEQPLAYER_SDAT_H |
|
| 11 |
+#define SSEQPLAYER_SDAT_H |
|
| 12 |
+ |
|
| 13 |
+#include <memory> |
|
| 14 |
+#include "SSEQ.h" |
|
| 15 |
+#include "SBNK.h" |
|
| 16 |
+#include "SWAR.h" |
|
| 17 |
+#include "common.h" |
|
| 18 |
+ |
|
| 19 |
+struct SDAT |
|
| 20 |
+{
|
|
| 21 |
+ std::auto_ptr<SSEQ> sseq; |
|
| 22 |
+ std::auto_ptr<SBNK> sbnk; |
|
| 23 |
+ std::auto_ptr<SWAR> swar[4]; |
|
| 24 |
+ |
|
| 25 |
+ SDAT(PseudoFile &file, uint32_t sseqToLoad); |
|
| 26 |
+private: |
|
| 27 |
+ SDAT(const SDAT &); |
|
| 28 |
+ SDAT &operator=(const SDAT &); |
|
| 29 |
+}; |
|
| 30 |
+ |
|
| 31 |
+#endif |