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
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
wind2009
ygopro
Commits
497b364a
Commit
497b364a
authored
Apr 28, 2024
by
Chen Bill
Committed by
GitHub
Apr 28, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add constant MAX_STRING_ID, MIN_CARD_ID (#2538)
MAX_STRING_ID=2047, MIN_CARD_ID=128
parent
41d0ed07
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
gframe/data_manager.cpp
gframe/data_manager.cpp
+2
-2
gframe/data_manager.h
gframe/data_manager.h
+2
-0
No files found.
gframe/data_manager.cpp
View file @
497b364a
...
@@ -224,7 +224,7 @@ const wchar_t* DataManager::GetText(unsigned int code) {
...
@@ -224,7 +224,7 @@ const wchar_t* DataManager::GetText(unsigned int code) {
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
if
(
strCode
<
10000u
)
if
(
strCode
<
(
MIN_CARD_ID
<<
4
)
)
return
GetSysString
(
strCode
);
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
offset
=
strCode
&
0xf
;
unsigned
int
offset
=
strCode
&
0xf
;
...
@@ -236,7 +236,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
...
@@ -236,7 +236,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
if
(
code
<
0
||
code
>=
2048
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
auto
csit
=
_sysStrings
.
find
(
code
);
if
(
csit
==
_sysStrings
.
end
())
if
(
csit
==
_sysStrings
.
end
())
...
...
gframe/data_manager.h
View file @
497b364a
...
@@ -8,6 +8,8 @@
...
@@ -8,6 +8,8 @@
#include <unordered_map>
#include <unordered_map>
namespace
ygo
{
namespace
ygo
{
constexpr
int
MAX_STRING_ID
=
0x7ff
;
constexpr
unsigned
int
MIN_CARD_ID
=
(
unsigned
int
)(
MAX_STRING_ID
+
1
)
>>
4
;
class
DataManager
{
class
DataManager
{
public:
public:
...
...
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