-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract localization data from SCR files
- Loading branch information
1 parent
dd65ee7
commit 095fec8
Showing
30 changed files
with
23,516 additions
and
501 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
#ifndef __ACI_DEFINE_H__ | ||
#define __ACI_DEFINE_H__ | ||
|
||
// scrDefineData::flags | ||
const unsigned DEF_TEXT = 0x01; | ||
|
||
struct scrDefineData | ||
{ | ||
int flags; | ||
|
||
int startIndex; | ||
int endIndex; | ||
|
||
int srcLen; | ||
char* srcData; | ||
|
||
int destLen; | ||
char* destData; | ||
|
||
void* list; | ||
scrDefineData* prev; | ||
scrDefineData* next; | ||
|
||
void init(char* ptr,int sz); | ||
|
||
scrDefineData(void); | ||
~scrDefineData(void); | ||
}; | ||
|
||
#endif /* __ACI_DEFINE_H__ */ |
174 changes: 89 additions & 85 deletions
174
MechoSoma/aciparser/aci_parser.h → MechoSoma/ParserC/aci_parser.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,89 @@ | ||
|
||
#ifndef __ACI_PARSER_H__ | ||
#define __ACI_PARSER_H__ | ||
|
||
#include <filesystem> | ||
#include <string> | ||
|
||
#include "xtool.h" | ||
|
||
// scrDataBlock flags... | ||
#define SCR_ALLOC_DATA 0x01 | ||
|
||
// Data types... | ||
enum scrDataTypes { | ||
SCR_VOID_DATA = 0, | ||
SCR_INT_DATA, | ||
SCR_DOUBLE_DATA, | ||
SCR_CHAR_DATA, | ||
|
||
SCR_MAX_DATA_ID | ||
}; | ||
|
||
struct scrDataBlock | ||
{ | ||
int ID; | ||
int flags; | ||
int dataSize; | ||
int dataType; | ||
|
||
int dataSize0; | ||
char* name; | ||
|
||
union { | ||
int* i_dataPtr; | ||
double* d_dataPtr; | ||
char* c_dataPtr; | ||
}; | ||
|
||
scrDataBlock* owner; | ||
xtList<scrDataBlock>* nextLevel; | ||
|
||
void* list; | ||
scrDataBlock* prev; | ||
scrDataBlock* next; | ||
|
||
void saveInfo(XStream& fh); | ||
void saveData(XStream& fh); | ||
void loadInfo(XStream& fh); | ||
void loadData(XStream& fh); | ||
|
||
void loadInfo(XBuffer& fh); | ||
void loadData(XBuffer& fh); | ||
|
||
void initName(char* p); | ||
void allocList(void){ nextLevel = new xtList<scrDataBlock>; } | ||
|
||
void alloc(int tp,int sz); | ||
void allocData(void); | ||
void freeData(void); | ||
|
||
void add(scrDataBlock* p); | ||
void dump(XStream& fh,int idx,int mode = 0); | ||
void get_keys(void); | ||
|
||
scrDataBlock* find(int id){ if(nextLevel) return nextLevel -> search(id); return NULL; } | ||
|
||
scrDataBlock(int tp); | ||
scrDataBlock(void); | ||
~scrDataBlock(void); | ||
}; | ||
|
||
void scrSetVerbose(int v = 1); | ||
|
||
void scrSetInputDir(const char* p); | ||
void scrSetOutputDir(const char* p); | ||
void scrSetOutputFile(const char* p); | ||
|
||
scrDataBlock* loadScript(const std::string &path); | ||
scrDataBlock* loadScript(XStream& fh); | ||
scrDataBlock* parseScript(const char* fname,const char *set_name); | ||
void saveScript(const char* fname,scrDataBlock* p); | ||
void dumpScript(const char* fname,scrDataBlock* p); | ||
void dumpScriptKeywords(const char* fname,scrDataBlock* p); | ||
|
||
#endif /* __ACI_PARSER_H__ */ | ||
|
||
#ifndef __ACI_PARSER_H__ | ||
#define __ACI_PARSER_H__ | ||
|
||
#include <filesystem> | ||
#include <functional> | ||
#include <string> | ||
#include <string_view> | ||
|
||
#include "xtool.h" | ||
|
||
// scrDataBlock flags... | ||
#define SCR_ALLOC_DATA 0x01 | ||
|
||
// Data types... | ||
enum scrDataTypes { | ||
SCR_VOID_DATA = 0, | ||
SCR_INT_DATA, | ||
SCR_DOUBLE_DATA, | ||
SCR_CHAR_DATA, | ||
|
||
SCR_MAX_DATA_ID | ||
}; | ||
|
||
struct scrDataBlock | ||
{ | ||
int ID; | ||
int flags; | ||
int dataSize; | ||
int dataType; | ||
|
||
int dataSize0; | ||
char* name; | ||
|
||
union { | ||
int* i_dataPtr; | ||
double* d_dataPtr; | ||
char* c_dataPtr; | ||
}; | ||
|
||
scrDataBlock* owner; | ||
xtList<scrDataBlock>* nextLevel; | ||
|
||
void* list; | ||
scrDataBlock* prev; | ||
scrDataBlock* next; | ||
|
||
void saveInfo(XStream& fh); | ||
void saveData(XStream& fh); | ||
void loadInfo(XStream& fh); | ||
void loadData(XStream& fh); | ||
|
||
void loadInfo(XBuffer& fh); | ||
void loadData(XBuffer& fh); | ||
|
||
void initName(const char* p); | ||
void allocList(void){ nextLevel = new xtList<scrDataBlock>; } | ||
|
||
void alloc(int tp,int sz); | ||
void allocData(void); | ||
void freeData(void); | ||
|
||
void add(scrDataBlock* p); | ||
void dump(XStream& fh,int idx,int mode = 0); | ||
void get_keys(void); | ||
|
||
scrDataBlock* find(int id){ if(nextLevel) return nextLevel -> search(id); return NULL; } | ||
|
||
scrDataBlock(int tp); | ||
scrDataBlock(void); | ||
~scrDataBlock(void); | ||
}; | ||
|
||
void scrSetVerbose(int v = 1); | ||
|
||
void scrSetInputDir(const char* p); | ||
void scrSetOutputDir(const char* p); | ||
void scrSetOutputFile(const char* p); | ||
|
||
scrDataBlock* loadScript(const std::string &fname); | ||
scrDataBlock* loadScript(XStream& fh); | ||
scrDataBlock* parseScript(const char* fname,const char *set_name); | ||
void saveScript(const char* fname,scrDataBlock* p); | ||
void dumpScript(const char* fname,scrDataBlock* p); | ||
void dumpScriptKeywords(const char* fname,scrDataBlock* p); | ||
|
||
extern std::function<const std::string_view (const std::string_view)> getLocalizedKey; | ||
|
||
#endif /* __ACI_PARSER_H__ */ |
Oops, something went wrong.