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
Hide 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) {
}
return
true
;
}
bool
DataManager
::
LoadDB
(
const
wchar_t
*
wfile
)
{
char
file
[
256
];
BufferIO
::
EncodeUTF8
(
wfile
,
file
);
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
FileSystem
->
createAndOpenFile
(
wfile
);
#else
bool
DataManager
::
LoadDB
(
const
char
*
file
)
{
auto
reader
=
FileSystem
->
createAndOpenFile
(
file
);
#endif
if
(
reader
==
nullptr
)
return
false
;
spmemvfs_db_t
db
;
...
...
@@ -394,13 +388,7 @@ unsigned char* DataManager::ScriptReaderEx(const char* script_path, int* slen) {
return
nullptr
;
}
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
);
#endif
if
(
!
reader
)
return
nullptr
;
int
size
=
reader
->
read
(
scriptBuffer
,
sizeof
scriptBuffer
);
...
...
gframe/data_manager.h
View file @
8bab4b78
...
...
@@ -65,7 +65,7 @@ class DataManager {
public:
DataManager
();
bool
ReadDB
(
sqlite3
*
pDB
);
bool
LoadDB
(
const
wchar_t
*
w
file
);
bool
LoadDB
(
const
char
*
file
);
bool
LoadStrings
(
const
char
*
file
);
bool
LoadStrings
(
irr
::
io
::
IReadFile
*
reader
);
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) {
return
fp
;
}
irr
::
io
::
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file
);
#else
char
file2
[
256
];
BufferIO
::
EncodeUTF8
(
file
,
file2
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file2
);
#endif
return
reader
;
}
bool
DeckManager
::
LoadCurrentDeck
(
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
...
...
gframe/game.cpp
View file @
8bab4b78
...
...
@@ -75,7 +75,7 @@ bool Game::Initialize() {
return
false
;
}
dataManager
.
FileSystem
=
device
->
getFileSystem
();
if
(
!
dataManager
.
LoadDB
(
L
"cards.cdb"
))
{
if
(
!
dataManager
.
LoadDB
(
"cards.cdb"
))
{
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
return
false
;
}
...
...
@@ -1127,56 +1127,40 @@ std::wstring Game::SetStaticText(irr::gui::IGUIStaticText* pControl, irr::u32 cW
return
result
;
}
void
Game
::
LoadExpansions
()
{
FileSystem
::
TraversalDir
(
L"./expansions"
,
[](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
"./expansions"
,
[](
const
char
*
name
,
bool
isdir
)
{
if
(
isdir
)
return
;
wchar_t
fpath
[
1024
];
mys
wprintf
(
fpath
,
L"./expansions/%l
s"
,
name
);
if
(
IsExtension
(
name
,
L
".cdb"
))
{
char
fpath
[
1024
];
mys
nprintf
(
fpath
,
"./expansions/%
s"
,
name
);
if
(
IsExtension
(
name
,
".cdb"
))
{
dataManager
.
LoadDB
(
fpath
);
return
;
}
if
(
IsExtension
(
name
,
L".conf"
))
{
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
dataManager
.
LoadStrings
(
upath
);
if
(
IsExtension
(
name
,
".conf"
))
{
dataManager
.
LoadStrings
(
fpath
);
return
;
}
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
#ifdef _IRR_WCHAR_FILESYSTEM
if
(
IsExtension
(
name
,
".zip"
)
||
IsExtension
(
name
,
".ypk"
))
{
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
;
}
});
for
(
irr
::
u32
i
=
0
;
i
<
dataManager
.
FileSystem
->
getFileArchiveCount
();
++
i
)
{
auto
archive
=
dataManager
.
FileSystem
->
getFileArchive
(
i
)
->
getFileList
();
for
(
irr
::
u32
j
=
0
;
j
<
archive
->
getFileCount
();
++
j
)
{
#ifdef _IRR_WCHAR_FILESYSTEM
const
wchar_t
*
fname
=
archive
->
getFullFileName
(
j
).
c_str
();
#else
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
);
const
char
*
name
=
archive
->
getFullFileName
(
j
).
c_str
();
if
(
IsExtension
(
name
,
".cdb"
))
{
dataManager
.
LoadDB
(
name
);
continue
;
}
if
(
IsExtension
(
fname
,
L".conf"
))
{
#ifdef _IRR_WCHAR_FILESYSTEM
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
fname
);
#else
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
uname
);
#endif
if
(
IsExtension
(
name
,
".conf"
))
{
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
name
);
dataManager
.
LoadStrings
(
reader
);
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
);
continue
;
}
...
...
gframe/gframe.cpp
View file @
8bab4b78
...
...
@@ -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'
)
{
ygo
::
dataManager
.
LoadDB
(
&
wargv
[
i
][
2
]);
char
file
[
1024
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
]
+
2
,
file
);
ygo
::
dataManager
.
LoadDB
(
file
);
continue
;
}
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-e"
))
{
// extra database
++
i
;
if
(
i
<
wargc
)
{
ygo
::
dataManager
.
LoadDB
(
wargv
[
i
]);
char
file
[
1024
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
],
file
);
ygo
::
dataManager
.
LoadDB
(
file
);
}
continue
;
}
else
if
(
!
std
::
wcscmp
(
wargv
[
i
],
L"-n"
))
{
// nickName
...
...
gframe/premake5.lua
View file @
8bab4b78
...
...
@@ -72,7 +72,6 @@ project "YGOPro"
filter
"system:windows"
entrypoint
"mainCRTStartup"
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
files
"ygopro.rc"
links
{
"ws2_32"
,
"iphlpapi"
}
if
USE_AUDIO
and
AUDIO_LIB
==
"irrklang"
then
...
...
premake/irrlicht/premake5.lua
View file @
8bab4b78
...
...
@@ -154,7 +154,6 @@ project "irrlicht"
}
filter
{
"system:windows"
}
defines
{
"_IRR_WCHAR_FILESYSTEM"
}
if
USE_DXSDK
then
includedirs
{
"$(DXSDK_DIR)Include"
}
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