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
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
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
nanahira
ygopro
Commits
d921cd0f
Commit
d921cd0f
authored
Aug 23, 2025
by
Chen Bill
Committed by
GitHub
Aug 23, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DataManager: change unknown_string, FileSystem to instance member (#2907)
parent
17715fe4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
18 deletions
+15
-18
gframe/client_field.cpp
gframe/client_field.cpp
+1
-1
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-4
gframe/data_manager.h
gframe/data_manager.h
+2
-3
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+2
-2
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+7
-7
No files found.
gframe/client_field.cpp
View file @
d921cd0f
...
@@ -455,7 +455,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
...
@@ -455,7 +455,7 @@ void ClientField::ShowSelectCard(bool buttonok, bool chain) {
// text
// text
wchar_t
formatBuffer
[
2048
];
wchar_t
formatBuffer
[
2048
];
if
(
conti_selecting
)
if
(
conti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
]
->
location
==
LOCATION_OVERLAY
)
...
...
gframe/data_manager.cpp
View file @
d921cd0f
...
@@ -4,9 +4,7 @@
...
@@ -4,9 +4,7 @@
namespace
ygo
{
namespace
ygo
{
const
wchar_t
*
DataManager
::
unknown_string
=
L"???"
;
unsigned
char
DataManager
::
scriptBuffer
[
0x100000
]
=
{};
unsigned
char
DataManager
::
scriptBuffer
[
0x100000
]
=
{};
irr
::
io
::
IFileSystem
*
DataManager
::
FileSystem
=
nullptr
;
DataManager
dataManager
;
DataManager
dataManager
;
DataManager
::
DataManager
()
:
_datas
(
32768
),
_strings
(
32768
)
{
DataManager
::
DataManager
()
:
_datas
(
32768
),
_strings
(
32768
)
{
...
@@ -403,9 +401,9 @@ unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* sl
...
@@ -403,9 +401,9 @@ unsigned char* DataManager::ReadScriptFromIrrFS(const char* script_name, int* sl
#ifdef _WIN32
#ifdef _WIN32
wchar_t
fname
[
256
]{};
wchar_t
fname
[
256
]{};
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
auto
reader
=
FileSystem
->
createAndOpenFile
(
fname
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
fname
);
#else
#else
auto
reader
=
FileSystem
->
createAndOpenFile
(
script_name
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
script_name
);
#endif
#endif
if
(
!
reader
)
if
(
!
reader
)
return
nullptr
;
return
nullptr
;
...
...
gframe/data_manager.h
View file @
d921cd0f
...
@@ -97,9 +97,10 @@ public:
...
@@ -97,9 +97,10 @@ public:
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_setnameStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_setnameStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_sysStrings
;
std
::
unordered_map
<
unsigned
int
,
std
::
wstring
>
_sysStrings
;
char
errmsg
[
512
]{};
char
errmsg
[
512
]{};
const
wchar_t
*
unknown_string
{
L"???"
};
irr
::
io
::
IFileSystem
*
FileSystem
{};
static
unsigned
char
scriptBuffer
[
0x100000
];
static
unsigned
char
scriptBuffer
[
0x100000
];
static
const
wchar_t
*
unknown_string
;
static
uint32_t
CardReader
(
uint32_t
,
card_data
*
);
static
uint32_t
CardReader
(
uint32_t
,
card_data
*
);
static
unsigned
char
*
ScriptReaderEx
(
const
char
*
script_path
,
int
*
slen
);
static
unsigned
char
*
ScriptReaderEx
(
const
char
*
script_path
,
int
*
slen
);
...
@@ -108,8 +109,6 @@ public:
...
@@ -108,8 +109,6 @@ public:
//read by fread
//read by fread
static
unsigned
char
*
ReadScriptFromFile
(
const
char
*
script_name
,
int
*
slen
);
static
unsigned
char
*
ReadScriptFromFile
(
const
char
*
script_name
,
int
*
slen
);
static
irr
::
io
::
IFileSystem
*
FileSystem
;
static
bool
deck_sort_lv
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_lv
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_atk
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_atk
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_def
(
code_pointer
l1
,
code_pointer
l2
);
static
bool
deck_sort_def
(
code_pointer
l1
,
code_pointer
l2
);
...
...
gframe/deck_manager.cpp
View file @
d921cd0f
...
@@ -280,11 +280,11 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
...
@@ -280,11 +280,11 @@ FILE* DeckManager::OpenDeckFile(const wchar_t* file, const char* mode) {
}
}
irr
::
io
::
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
irr
::
io
::
IReadFile
*
DeckManager
::
OpenDeckReader
(
const
wchar_t
*
file
)
{
#ifdef _WIN32
#ifdef _WIN32
auto
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
file
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
file
);
#else
#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
#endif
return
reader
;
return
reader
;
}
}
...
...
gframe/event_handler.cpp
View file @
d921cd0f
...
@@ -906,7 +906,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
...
@@ -906,7 +906,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf
(
formatBuffer
,
L""
);
myswprintf
(
formatBuffer
,
L""
);
}
else
{
}
else
{
if
(
conti_selecting
)
if
(
conti_selecting
)
myswprintf
(
formatBuffer
,
L"%ls"
,
DataManager
::
unknown_string
);
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
unknown_string
);
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
else
if
(
cant_check_grave
&&
selectable_cards
[
i
]
->
location
==
LOCATION_GRAVE
)
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
myswprintf
(
formatBuffer
,
L"%ls"
,
dataManager
.
FormatLocation
(
selectable_cards
[
i
]
->
location
,
0
));
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
else
if
(
selectable_cards
[
i
+
pos
]
->
location
==
LOCATION_OVERLAY
)
...
...
gframe/game.cpp
View file @
d921cd0f
...
@@ -76,7 +76,7 @@ bool Game::Initialize() {
...
@@ -76,7 +76,7 @@ bool Game::Initialize() {
ErrorLog
(
"Failed to load textures!"
);
ErrorLog
(
"Failed to load textures!"
);
return
false
;
return
false
;
}
}
DataManager
::
FileSystem
=
device
->
getFileSystem
();
dataManager
.
FileSystem
=
device
->
getFileSystem
();
if
(
!
dataManager
.
LoadDB
(
L"cards.cdb"
))
{
if
(
!
dataManager
.
LoadDB
(
L"cards.cdb"
))
{
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
ErrorLog
(
"Failed to load card database (cards.cdb)!"
);
return
false
;
return
false
;
...
@@ -1145,17 +1145,17 @@ void Game::LoadExpansions() {
...
@@ -1145,17 +1145,17 @@ void Game::LoadExpansions() {
}
}
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
if
(
IsExtension
(
name
,
L".zip"
)
||
IsExtension
(
name
,
L".ypk"
))
{
#ifdef _WIN32
#ifdef _WIN32
DataManager
::
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
dataManager
.
FileSystem
->
addFileArchive
(
fpath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#else
#else
char
upath
[
1024
];
char
upath
[
1024
];
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
BufferIO
::
EncodeUTF8
(
fpath
,
upath
);
DataManager
::
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
dataManager
.
FileSystem
->
addFileArchive
(
upath
,
true
,
false
,
irr
::
io
::
EFAT_ZIP
);
#endif
#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 _WIN32
#ifdef _WIN32
const
wchar_t
*
fname
=
archive
->
getFullFileName
(
j
).
c_str
();
const
wchar_t
*
fname
=
archive
->
getFullFileName
(
j
).
c_str
();
...
@@ -1170,9 +1170,9 @@ void Game::LoadExpansions() {
...
@@ -1170,9 +1170,9 @@ void Game::LoadExpansions() {
}
}
if
(
IsExtension
(
fname
,
L".conf"
))
{
if
(
IsExtension
(
fname
,
L".conf"
))
{
#ifdef _WIN32
#ifdef _WIN32
auto
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
fname
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
fname
);
#else
#else
auto
reader
=
DataManager
::
FileSystem
->
createAndOpenFile
(
uname
);
auto
reader
=
dataManager
.
FileSystem
->
createAndOpenFile
(
uname
);
#endif
#endif
dataManager
.
LoadStrings
(
reader
);
dataManager
.
LoadStrings
(
reader
);
continue
;
continue
;
...
...
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