Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
ygopro
Commits
8bab4b78
Commit
8bab4b78
authored
Feb 22, 2026
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove _IRR_WCHAR_FILESYSTEM and make DataManager::LoadDB accept char*
parent
bbd99ad4
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
54 deletions
+24
-54
gframe/data_manager.cpp
gframe/data_manager.cpp
+1
-13
gframe/data_manager.h
gframe/data_manager.h
+1
-1
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+0
-4
gframe/game.cpp
gframe/game.cpp
+16
-32
gframe/gframe.cpp
gframe/gframe.cpp
+6
-2
gframe/premake5.lua
gframe/premake5.lua
+0
-1
premake/irrlicht/premake5.lua
premake/irrlicht/premake5.lua
+0
-1
No files found.
gframe/data_manager.cpp
View file @
8bab4b78
...
@@ -77,14 +77,8 @@ bool DataManager::ReadDB(sqlite3* pDB) {
...
@@ -77,14 +77,8 @@ bool DataManager::ReadDB(sqlite3* pDB) {
}
}
return
true
;
return
true
;
}
}
bool
DataManager
::
LoadDB
(
const
wchar_t
*
wfile
)
{
bool
DataManager
::
LoadDB
(
const
char
*
file
)
{
char
file
[
256
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
FileSystem
->
createAndOpenFile
(
wfile
);
#else
auto
reader
=
FileSystem
->
createAndOpenFile
(
file
);
auto
reader
=
FileSystem
->
createAndOpenFile
(
file
);
#endif
if
(
reader
==
nullptr
)
if
(
reader
==
nullptr
)
return
false
;
return
false
;
spmemvfs_db_t
db
;
spmemvfs_db_t
db
;
...
@@ -394,13 +388,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
...
@@ -394,13 +388,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
return
nullptr
;
return
nullptr
;
}
}
unsigned
char
*
DataManager
::
ReadScriptFromIrrFS
(
const
char
*
script_name
,
int
*
slen
)
{
unsigned
char
*
DataManager
::
ReadScriptFromIrrFS
(
const
char
*
script_name
,
int
*
slen
)
{
#ifdef _IRR_WCHAR_FILESYSTEM
wchar_t
fname
[
256
]{};
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
fname
);
#else
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
script_name
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
script_name
);
#endif
if
(
!
reader
)
if
(
!
reader
)
return
nullptr
;
return
nullptr
;
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
...
...
gframe/data_manager.h
View file @
8bab4b78
...
@@ -65,7 +65,7 @@ class DataManager {
...
@@ -65,7 +65,7 @@ class DataManager {
public:
public:
DataManager
();
DataManager
();
bool
ReadDB
(
sqlite3
*
pDB
);
bool
ReadDB
(
sqlite3
*
pDB
);
bool
LoadDB
(
const
wchar_t
*
w
file
);
bool
LoadDB
(
const
char
*
file
);
bool
LoadStrings
(
const
char
*
file
);
bool
LoadStrings
(
const
char
*
file
);
bool
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
);
bool
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
...
...
gframe/deck_manager.cpp
View file @
8bab4b78
...
@@ -278,13 +278,9 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
...
@@ -278,13 +278,9 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
return
fp
;
return
fp
;
}
}
irr
::
io
::
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
irr
::
io
::
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file
);
#else
char
file2
[
256
];
char
file2
[
256
];
BufferIO
::
EncodeUTF8
(
file
,
file2
);
BufferIO
::
EncodeUTF8
(
file
,
file2
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file2
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file2
);
#endif
return
reader
;
return
reader
;
}
}
bool
DeckManager
::
LoadCurrentDeck
(
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
bool
DeckManager
::
LoadCurrentDeck
(
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
...
...
gframe/game.cpp
View file @
8bab4b78
...
@@ -75,7 +75,7 @@ bool Game::Initialize() {
...
@@ -75,7 +75,7 @@ bool Game::Initialize() {
return
false
;
return
false
;
}
}
dataManager
.
FileSystem
=
device
->
getFileSystem
();
dataManager
.
FileSystem
=
device
->
getFileSystem
();
if
(
!
dataManager
.
LoadDB
(
L
"cards.cdb"
))
{
if
(
!
dataManager
.
LoadDB
(
"cards.cdb"
))
{
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
return
false
;
return
false
;
}
}
...
@@ -1127,56 +1127,40 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cW
...
@@ -1127,56 +1127,40 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cW
return
result
;
return
result
;
}
}
void
Game
::
LoadExpansions
()
{
void
Game
::
LoadExpansions
()
{
FileSystem
::
TraversalDir
(
L"./expansions"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
"./expansions"
,
[](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
)
if
(
isdir
)
return
;
return
;
wchar_t
fpath
[
1024
];
char
fpath
[
1024
];
mys
wprintf
(
fpath
,
L"./expansions/%l
s"
,
name
);
mys
nprintf
(
fpath
,
"./expansions/%
s"
,
name
);
if
(
IsExtension
(
name
,
L
".cdb"
))
{
if
(
IsExtension
(
name
,
".cdb"
))
{
dataManager
.
LoadDB
(
fpath
);
dataManager
.
LoadDB
(
fpath
);
return
;
return
;
}
}
if
(
IsExtension
(
name
,
L".conf"
))
{
if
(
IsExtension
(
name
,
".conf"
))
{
char
upath
[
1024
];
dataManager
.
LoadStrings
(
fpath
);
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
LoadStrings
(
upath
);
return
;
return
;
}
}
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
if
(
IsExtension
(
name
,
".zip"
)
||
IsExtension
(
name
,
".ypk"
))
{
#ifdef _IRR_WCHAR_FILESYSTEM
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#else
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#endif
return
;
return
;
}
}
});
});
for
(
irr
::
u32
i
=
0
;
i
<
dataManager
.
FileSystem
->
getFileArchiveCount
();
++
i
)
{
for
(
irr
::
u32
i
=
0
;
i
<
dataManager
.
FileSystem
->
getFileArchiveCount
();
++
i
)
{
auto
archive
=
dataManager
.
FileSystem
->
getFileArchive
(
i
)
->
getFileList
();
auto
archive
=
dataManager
.
FileSystem
->
getFileArchive
(
i
)
->
getFileList
();
for
(
irr
::
u32
j
=
0
;
j
<
archive
->
getFileCount
();
++
j
)
{
for
(
irr
::
u32
j
=
0
;
j
<
archive
->
getFileCount
();
++
j
)
{
#ifdef _IRR_WCHAR_FILESYSTEM
const
char
*
name
=
archive
->
getFullFileName
(
j
).
c_str
();
const
wchar_t
*
fname
=
archive
->
getFullFileName
(
j
).
c_str
();
if
(
IsExtension
(
name
,
".cdb"
))
{
#else
dataManager
.
LoadDB
(
name
);
wchar_t
fname
[
1024
];
const
char
*
uname
=
archive
->
getFullFileName
(
j
).
c_str
();
BufferIO
::
DecodeUTF8
(
uname
,
fname
);
#endif
if
(
IsExtension
(
fname
,
L".cdb"
))
{
dataManager
.
LoadDB
(
fname
);
continue
;
continue
;
}
}
if
(
IsExtension
(
fname
,
L".conf"
))
{
if
(
IsExtension
(
name
,
".conf"
))
{
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
name
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
fname
);
#else
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
uname
);
#endif
dataManager
.
LoadStrings
(
reader
);
dataManager
.
LoadStrings
(
reader
);
continue
;
continue
;
}
}
if
(
!
mywcsncasecmp
(
fname
,
L"pack/"
,
5
)
&&
IsExtension
(
fname
,
L".ydk"
))
{
if
(
!
mystrncasecmp
(
name
,
"pack/"
,
5
)
&&
IsExtension
(
name
,
".ydk"
))
{
wchar_t
fname
[
1024
];
BufferIO
::
DecodeUTF8
(
name
,
fname
);
deckBuilder
.
expansionPacks
.
push_back
(
fname
);
deckBuilder
.
expansionPacks
.
push_back
(
fname
);
continue
;
continue
;
}
}
...
...
gframe/gframe.cpp
View file @
8bab4b78
...
@@ -109,13 +109,17 @@ int main(int argc, char* argv[]) {
...
@@ -109,13 +109,17 @@ int main(int argc, char* argv[]) {
}
}
}
}
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L'\0'
)
{
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L'\0'
)
{
ygo
::
dataManager
.
LoadDB
(
&
wargv
[
i
][
2
]);
char
file
[
1024
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
]
+
2
,
file
);
ygo
::
dataManager
.
LoadDB
(
file
);
continue
;
continue
;
}
}
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-e"
))
{
// extra database
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-e"
))
{
// extra database
++
i
;
++
i
;
if
(
i
<
wargc
)
{
if
(
i
<
wargc
)
{
ygo
::
dataManager
.
LoadDB
(
wargv
[
i
]);
char
file
[
1024
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
],
file
);
ygo
::
dataManager
.
LoadDB
(
file
);
}
}
continue
;
continue
;
}
else
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-n"
))
{
// nickName
}
else
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-n"
))
{
// nickName
...
...
gframe/premake5.lua
View file @
8bab4b78
...
@@ -72,7 +72,6 @@ project "YGOPro"
...
@@ -72,7 +72,6 @@ project "YGOPro"
filter
"system:windows"
filter
"system:windows"
entrypoint
"mainCRTStartup"
entrypoint
"mainCRTStartup"
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
files
"ygopro.rc"
links
{
"ws2_32"
,
"iphlpapi"
}
links
{
"ws2_32"
,
"iphlpapi"
}
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
...
...
premake/irrlicht/premake5.lua
View file @
8bab4b78
...
@@ -154,7 +154,6 @@ project "irrlicht"
...
@@ -154,7 +154,6 @@ project "irrlicht"
}
}
filter
{
"system:windows"
}
filter
{
"system:windows"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
if
USE_DXSDK
then
if
USE_DXSDK
then
includedirs
{
"$(DXSDK_DIR)Include"
}
includedirs
{
"$(DXSDK_DIR)Include"
}
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment