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
221d8332
Commit
221d8332
authored
Oct 08, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'salix5/patch-draw' into develop
parents
9ca5470e
be0e4492
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
290 additions
and
108 deletions
+290
-108
gframe/data_manager.cpp
gframe/data_manager.cpp
+24
-44
gframe/data_manager.h
gframe/data_manager.h
+11
-14
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+1
-1
gframe/deck_manager.h
gframe/deck_manager.h
+1
-0
gframe/drawing.cpp
gframe/drawing.cpp
+31
-22
gframe/game.h
gframe/game.h
+1
-0
lflist.conf
lflist.conf
+221
-27
No files found.
gframe/data_manager.cpp
View file @
221d8332
...
@@ -117,8 +117,6 @@ bool DataManager::LoadStrings(const char* file) {
...
@@ -117,8 +117,6 @@ bool DataManager::LoadStrings(const char* file) {
ReadStringConfLine
(
linebuf
);
ReadStringConfLine
(
linebuf
);
}
}
fclose
(
fp
);
fclose
(
fp
);
for
(
int
i
=
0
;
i
<
301
;
++
i
)
myswprintf
(
numStrings
[
i
],
L"%d"
,
i
);
return
true
;
return
true
;
}
}
bool
DataManager
::
LoadStrings
(
IReadFile
*
reader
)
{
bool
DataManager
::
LoadStrings
(
IReadFile
*
reader
)
{
...
@@ -176,24 +174,12 @@ bool DataManager::Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt) {
...
@@ -176,24 +174,12 @@ bool DataManager::Error(spmemvfs_db_t* pDB, sqlite3_stmt* pStmt) {
spmemvfs_env_fini
();
spmemvfs_env_fini
();
return
false
;
return
false
;
}
}
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
{
bool
DataManager
::
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
{
code_pointer
cdit
=
_datas
.
find
(
code
);
auto
cdit
=
_datas
.
find
(
code
);
if
(
cdit
==
_datas
.
end
())
if
(
cdit
==
_datas
.
end
())
return
false
;
return
false
;
auto
&
data
=
cdit
->
second
;
if
(
pData
)
{
if
(
pData
)
{
pData
->
code
=
data
.
code
;
*
pData
=
cdit
->
second
;
pData
->
alias
=
data
.
alias
;
std
::
memcpy
(
pData
->
setcode
,
data
.
setcode
,
SIZE_SETCODE
);
pData
->
type
=
data
.
type
;
pData
->
level
=
data
.
level
;
pData
->
attribute
=
data
.
attribute
;
pData
->
race
=
data
.
race
;
pData
->
attack
=
data
.
attack
;
pData
->
defense
=
data
.
defense
;
pData
->
lscale
=
data
.
lscale
;
pData
->
rscale
=
data
.
rscale
;
pData
->
link_marker
=
data
.
link_marker
;
}
}
return
true
;
return
true
;
}
}
...
@@ -203,7 +189,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
...
@@ -203,7 +189,7 @@ code_pointer DataManager::GetCodePointer(unsigned int code) const {
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
string_pointer
DataManager
::
GetStringPointer
(
unsigned
int
code
)
const
{
return
_strings
.
find
(
code
);
return
_strings
.
find
(
code
);
}
}
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
{
bool
DataManager
::
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
{
if
(
csit
==
_strings
.
end
())
{
pStr
->
name
=
unknown_string
;
pStr
->
name
=
unknown_string
;
...
@@ -213,7 +199,7 @@ bool DataManager::GetString(unsigned int code, CardString* pStr) {
...
@@ -213,7 +199,7 @@ bool DataManager::GetString(unsigned int code, CardString* pStr) {
*
pStr
=
csit
->
second
;
*
pStr
=
csit
->
second
;
return
true
;
return
true
;
}
}
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
{
const
wchar_t
*
DataManager
::
GetName
(
unsigned
int
code
)
const
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
return
unknown_string
;
...
@@ -221,7 +207,7 @@ const wchar_t* DataManager::GetName(unsigned int code) {
...
@@ -221,7 +207,7 @@ const wchar_t* DataManager::GetName(unsigned int code) {
return
csit
->
second
.
name
.
c_str
();
return
csit
->
second
.
name
.
c_str
();
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
{
const
wchar_t
*
DataManager
::
GetText
(
unsigned
int
code
)
const
{
auto
csit
=
_strings
.
find
(
code
);
auto
csit
=
_strings
.
find
(
code
);
if
(
csit
==
_strings
.
end
())
if
(
csit
==
_strings
.
end
())
return
unknown_string
;
return
unknown_string
;
...
@@ -229,7 +215,7 @@ const wchar_t* DataManager::GetText(unsigned int code) {
...
@@ -229,7 +215,7 @@ const wchar_t* DataManager::GetText(unsigned int code) {
return
csit
->
second
.
text
.
c_str
();
return
csit
->
second
.
text
.
c_str
();
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
{
const
wchar_t
*
DataManager
::
GetDesc
(
unsigned
int
strCode
)
const
{
if
(
strCode
<
(
MIN_CARD_ID
<<
4
))
if
(
strCode
<
(
MIN_CARD_ID
<<
4
))
return
GetSysString
(
strCode
);
return
GetSysString
(
strCode
);
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
unsigned
int
code
=
(
strCode
>>
4
)
&
0x0fffffff
;
...
@@ -241,7 +227,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
...
@@ -241,7 +227,7 @@ const wchar_t* DataManager::GetDesc(unsigned int strCode) {
return
csit
->
second
.
desc
[
offset
].
c_str
();
return
csit
->
second
.
desc
[
offset
].
c_str
();
return
unknown_string
;
return
unknown_string
;
}
}
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSysString
(
int
code
)
const
{
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
if
(
code
<
0
||
code
>
MAX_STRING_ID
)
return
unknown_string
;
return
unknown_string
;
auto
csit
=
_sysStrings
.
find
(
code
);
auto
csit
=
_sysStrings
.
find
(
code
);
...
@@ -249,25 +235,25 @@ const wchar_t* DataManager::GetSysString(int code) {
...
@@ -249,25 +235,25 @@ const wchar_t* DataManager::GetSysString(int code) {
return
unknown_string
;
return
unknown_string
;
return
csit
->
second
.
c_str
();
return
csit
->
second
.
c_str
();
}
}
const
wchar_t
*
DataManager
::
GetVictoryString
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetVictoryString
(
int
code
)
const
{
auto
csit
=
_victoryStrings
.
find
(
code
);
auto
csit
=
_victoryStrings
.
find
(
code
);
if
(
csit
==
_victoryStrings
.
end
())
if
(
csit
==
_victoryStrings
.
end
())
return
unknown_string
;
return
unknown_string
;
return
csit
->
second
.
c_str
();
return
csit
->
second
.
c_str
();
}
}
const
wchar_t
*
DataManager
::
GetCounterName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetCounterName
(
int
code
)
const
{
auto
csit
=
_counterStrings
.
find
(
code
);
auto
csit
=
_counterStrings
.
find
(
code
);
if
(
csit
==
_counterStrings
.
end
())
if
(
csit
==
_counterStrings
.
end
())
return
unknown_string
;
return
unknown_string
;
return
csit
->
second
.
c_str
();
return
csit
->
second
.
c_str
();
}
}
const
wchar_t
*
DataManager
::
GetSetName
(
int
code
)
{
const
wchar_t
*
DataManager
::
GetSetName
(
int
code
)
const
{
auto
csit
=
_setnameStrings
.
find
(
code
);
auto
csit
=
_setnameStrings
.
find
(
code
);
if
(
csit
==
_setnameStrings
.
end
())
if
(
csit
==
_setnameStrings
.
end
())
return
NULL
;
return
nullptr
;
return
csit
->
second
.
c_str
();
return
csit
->
second
.
c_str
();
}
}
std
::
vector
<
unsigned
int
>
DataManager
::
GetSetCodes
(
std
::
wstring
setname
)
{
std
::
vector
<
unsigned
int
>
DataManager
::
GetSetCodes
(
std
::
wstring
setname
)
const
{
std
::
vector
<
unsigned
int
>
matchingCodes
;
std
::
vector
<
unsigned
int
>
matchingCodes
;
for
(
auto
csit
=
_setnameStrings
.
begin
();
csit
!=
_setnameStrings
.
end
();
++
csit
)
{
for
(
auto
csit
=
_setnameStrings
.
begin
();
csit
!=
_setnameStrings
.
end
();
++
csit
)
{
auto
xpos
=
csit
->
second
.
find_first_of
(
L'|'
);
//setname|another setname or extra info
auto
xpos
=
csit
->
second
.
find_first_of
(
L'|'
);
//setname|another setname or extra info
...
@@ -284,18 +270,8 @@ std::vector<unsigned int> DataManager::GetSetCodes(std::wstring setname) {
...
@@ -284,18 +270,8 @@ std::vector<unsigned int> DataManager::GetSetCodes(std::wstring setname) {
}
}
return
matchingCodes
;
return
matchingCodes
;
}
}
const
wchar_t
*
DataManager
::
GetNumString
(
int
num
,
bool
bracket
)
{
const
wchar_t
*
DataManager
::
FormatLocation
(
int
location
,
int
sequence
)
const
{
if
(
!
bracket
)
if
(
location
==
LOCATION_SZONE
)
{
return
numStrings
[
num
];
wchar_t
*
p
=
numBuffer
;
*
p
++
=
L'('
;
BufferIO
::
CopyWStrRef
(
numStrings
[
num
],
p
,
4
);
*
p
=
L')'
;
*++
p
=
0
;
return
numBuffer
;
}
const
wchar_t
*
DataManager
::
FormatLocation
(
int
location
,
int
sequence
)
{
if
(
location
==
0x8
)
{
if
(
sequence
<
5
)
if
(
sequence
<
5
)
return
GetSysString
(
1003
);
return
GetSysString
(
1003
);
else
if
(
sequence
==
5
)
else
if
(
sequence
==
5
)
...
@@ -303,12 +279,16 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
...
@@ -303,12 +279,16 @@ const wchar_t* DataManager::FormatLocation(int location, int sequence) {
else
else
return
GetSysString
(
1009
);
return
GetSysString
(
1009
);
}
}
unsigned
filter
=
1
;
int
i
=
1000
;
int
i
=
1000
;
for
(;
filter
!=
0x100
&&
filter
!=
location
;
filter
<<=
1
)
int
string_id
=
0
;
++
i
;
for
(
unsigned
filter
=
LOCATION_DECK
;
filter
<=
LOCATION_PZONE
;
filter
<<=
1
,
++
i
)
{
if
(
filter
==
location
)
if
(
filter
==
location
)
{
return
GetSysString
(
i
);
string_id
=
i
;
break
;
}
}
if
(
string_id
)
return
GetSysString
(
string_id
);
else
else
return
unknown_string
;
return
unknown_string
;
}
}
...
...
gframe/data_manager.h
View file @
221d8332
...
@@ -19,20 +19,19 @@ public:
...
@@ -19,20 +19,19 @@ public:
bool
LoadStrings
(
IReadFile
*
reader
);
bool
LoadStrings
(
IReadFile
*
reader
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
void
ReadStringConfLine
(
const
char
*
linebuf
);
bool
Error
(
spmemvfs_db_t
*
pDB
,
sqlite3_stmt
*
pStmt
=
0
);
bool
Error
(
spmemvfs_db_t
*
pDB
,
sqlite3_stmt
*
pStmt
=
0
);
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
);
bool
GetData
(
unsigned
int
code
,
CardData
*
pData
)
const
;
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
code_pointer
GetCodePointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
string_pointer
GetStringPointer
(
unsigned
int
code
)
const
;
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
);
bool
GetString
(
unsigned
int
code
,
CardString
*
pStr
)
const
;
const
wchar_t
*
GetName
(
unsigned
int
code
);
const
wchar_t
*
GetName
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetText
(
unsigned
int
code
);
const
wchar_t
*
GetText
(
unsigned
int
code
)
const
;
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
);
const
wchar_t
*
GetDesc
(
unsigned
int
strCode
)
const
;
const
wchar_t
*
GetSysString
(
int
code
);
const
wchar_t
*
GetSysString
(
int
code
)
const
;
const
wchar_t
*
GetVictoryString
(
int
code
);
const
wchar_t
*
GetVictoryString
(
int
code
)
const
;
const
wchar_t
*
GetCounterName
(
int
code
);
const
wchar_t
*
GetCounterName
(
int
code
)
const
;
const
wchar_t
*
GetSetName
(
int
code
);
const
wchar_t
*
GetSetName
(
int
code
)
const
;
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
);
std
::
vector
<
unsigned
int
>
GetSetCodes
(
std
::
wstring
setname
)
const
;
const
wchar_t
*
GetNumString
(
int
num
,
bool
bracket
=
false
);
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
)
const
;
const
wchar_t
*
FormatLocation
(
int
location
,
int
sequence
);
const
wchar_t
*
FormatAttribute
(
int
attribute
);
const
wchar_t
*
FormatAttribute
(
int
attribute
);
const
wchar_t
*
FormatRace
(
int
race
);
const
wchar_t
*
FormatRace
(
int
race
);
const
wchar_t
*
FormatType
(
int
type
);
const
wchar_t
*
FormatType
(
int
type
);
...
@@ -48,8 +47,6 @@ public:
...
@@ -48,8 +47,6 @@ public:
string_pointer
strings_begin
;
string_pointer
strings_begin
;
string_pointer
strings_end
;
string_pointer
strings_end
;
wchar_t
numStrings
[
301
][
4
]{};
wchar_t
numBuffer
[
6
]{};
wchar_t
attBuffer
[
128
]{};
wchar_t
attBuffer
[
128
]{};
wchar_t
racBuffer
[
128
]{};
wchar_t
racBuffer
[
128
]{};
wchar_t
tpBuffer
[
128
]{};
wchar_t
tpBuffer
[
128
]{};
...
...
gframe/deck_manager.cpp
View file @
221d8332
...
@@ -186,7 +186,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
...
@@ -186,7 +186,7 @@ int DeckManager::LoadDeck(Deck& deck, int* dbuf, int mainc, int sidec, bool is_p
}
}
int
DeckManager
::
LoadDeck
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
int
DeckManager
::
LoadDeck
(
Deck
&
deck
,
std
::
istringstream
&
deckStream
,
bool
is_packlist
)
{
int
ct
=
0
,
mainc
=
0
,
sidec
=
0
,
code
=
0
;
int
ct
=
0
,
mainc
=
0
,
sidec
=
0
,
code
=
0
;
int
cardlist
[
300
]{};
int
cardlist
[
PACK_MAX_SIZE
]{};
bool
is_side
=
false
;
bool
is_side
=
false
;
std
::
string
linebuf
;
std
::
string
linebuf
;
while
(
std
::
getline
(
deckStream
,
linebuf
,
'\n'
)
&&
ct
<
(
int
)(
sizeof
cardlist
/
sizeof
cardlist
[
0
]))
{
while
(
std
::
getline
(
deckStream
,
linebuf
,
'\n'
)
&&
ct
<
(
int
)(
sizeof
cardlist
/
sizeof
cardlist
[
0
]))
{
...
...
gframe/deck_manager.h
View file @
221d8332
...
@@ -12,6 +12,7 @@ namespace ygo {
...
@@ -12,6 +12,7 @@ namespace ygo {
constexpr
int
DECK_MIN_SIZE
=
40
;
constexpr
int
DECK_MIN_SIZE
=
40
;
constexpr
int
EXTRA_MAX_SIZE
=
15
;
constexpr
int
EXTRA_MAX_SIZE
=
15
;
constexpr
int
SIDE_MAX_SIZE
=
15
;
constexpr
int
SIDE_MAX_SIZE
=
15
;
constexpr
int
PACK_MAX_SIZE
=
1000
;
struct
LFList
{
struct
LFList
{
unsigned
int
hash
{};
unsigned
int
hash
{};
...
...
gframe/drawing.cpp
View file @
221d8332
This diff is collapsed.
Click to expand it.
gframe/game.h
View file @
221d8332
...
@@ -156,6 +156,7 @@ public:
...
@@ -156,6 +156,7 @@ public:
void
DrawCards
();
void
DrawCards
();
void
DrawCard
(
ClientCard
*
pcard
);
void
DrawCard
(
ClientCard
*
pcard
);
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
core
::
stringw
&
text
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
video
::
SColor
color
=
0xffffffff
,
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
core
::
rect
<
s32
>*
clip
=
0
);
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
const
core
::
stringw
&
text
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
video
::
SColor
color
=
0xffffffff
,
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
core
::
rect
<
s32
>*
clip
=
0
);
void
DrawShadowText
(
irr
::
gui
::
CGUITTFont
*
font
,
int
number
,
const
core
::
rect
<
s32
>&
position
,
const
core
::
rect
<
s32
>&
padding
,
video
::
SColor
color
=
0xffffffff
,
video
::
SColor
shadowcolor
=
0xff000000
,
bool
hcenter
=
false
,
bool
vcenter
=
false
,
const
core
::
rect
<
s32
>*
clip
=
0
);
void
DrawMisc
();
void
DrawMisc
();
void
DrawStatus
(
ClientCard
*
pcard
,
int
x1
,
int
y1
,
int
x2
,
int
y2
);
void
DrawStatus
(
ClientCard
*
pcard
,
int
x1
,
int
y1
,
int
x2
,
int
y2
);
void
DrawGUI
();
void
DrawGUI
();
...
...
lflist.conf
View file @
221d8332
This diff is collapsed.
Click to expand it.
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