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
dce0da28
Commit
dce0da28
authored
Oct 09, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'salix5/patch-wcscpy' into develop
parents
00db8d75
26c2446f
Pipeline
#30294
passed with stages
in 9 minutes and 57 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
17 deletions
+24
-17
gframe/game.cpp
gframe/game.cpp
+4
-6
gframe/gframe.cpp
gframe/gframe.cpp
+14
-7
gframe/menu_handler.cpp
gframe/menu_handler.cpp
+4
-2
gframe/myfilesystem.h
gframe/myfilesystem.h
+2
-2
No files found.
gframe/game.cpp
View file @
dce0da28
...
...
@@ -1605,8 +1605,8 @@ void Game::ShowCardInfo(int code, bool resize) {
offset_info
=
15
;
if
(
!
(
cd
.
type
&
TYPE_LINK
))
{
const
wchar_t
*
form
=
L"\u2605"
;
if
(
cd
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"[%ls%d] "
,
form
,
cd
.
level
)
;
if
(
cd
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
wchar_t
adBuffer
[
16
];
if
(
cd
.
attack
<
0
&&
cd
.
defense
<
0
)
myswprintf
(
adBuffer
,
L"?/?"
);
...
...
@@ -1616,16 +1616,14 @@ void Game::ShowCardInfo(int code, bool resize) {
myswprintf
(
adBuffer
,
L"%d/?"
,
cd
.
attack
);
else
myswprintf
(
adBuffer
,
L"%d/%d"
,
cd
.
attack
,
cd
.
defense
);
wcscat
(
formatBuffer
,
adBuffer
);
myswprintf
(
formatBuffer
,
L"[%ls%d] %ls"
,
form
,
cd
.
level
,
adBuffer
);
}
else
{
myswprintf
(
formatBuffer
,
L"[LINK-%d] "
,
cd
.
level
);
wchar_t
adBuffer
[
16
];
if
(
cd
.
attack
<
0
)
myswprintf
(
adBuffer
,
L"?/- "
);
else
myswprintf
(
adBuffer
,
L"%d/- "
,
cd
.
attack
);
wcscat
(
formatBuffer
,
adBuffer
);
wcscat
(
formatBuffer
,
dataManager
.
FormatLinkMarker
(
cd
.
link_marker
));
myswprintf
(
formatBuffer
,
L"[LINK-%d] %ls%ls"
,
cd
.
level
,
adBuffer
,
dataManager
.
FormatLinkMarker
(
cd
.
link_marker
));
}
if
(
cd
.
type
&
TYPE_PENDULUM
)
{
wchar_t
scaleBuffer
[
16
];
...
...
gframe/gframe.cpp
View file @
dce0da28
...
...
@@ -115,14 +115,16 @@ int main(int argc, char* argv[]) {
++
i
;
if
(
i
<
wargc
)
{
deckCategorySpecified
=
true
;
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
]);
wcsncpy
(
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
],
sizeof
ygo
::
mainGame
->
gameConf
.
lastcategory
/
sizeof
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]);
BufferIO
::
NullTerminate
(
ygo
::
mainGame
->
gameConf
.
lastcategory
);
}
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L"-d"
))
{
// Deck
++
i
;
if
(
!
deckCategorySpecified
)
ygo
::
mainGame
->
gameConf
.
lastcategory
[
0
]
=
0
;
if
(
i
+
1
<
wargc
)
{
// select deck
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
]);
wcsncpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
],
sizeof
ygo
::
mainGame
->
gameConf
.
lastdeck
/
sizeof
ygo
::
mainGame
->
gameConf
.
lastdeck
[
0
]);
BufferIO
::
NullTerminate
(
ygo
::
mainGame
->
gameConf
.
lastdeck
);
continue
;
}
else
{
// open deck
exit_on_return
=
!
keep_on_return
;
...
...
@@ -135,7 +137,8 @@ int main(int argc, char* argv[]) {
myswprintf
(
open_file_name
,
L"%ls/%ls"
,
ygo
::
mainGame
->
gameConf
.
lastcategory
,
wargv
[
i
]);
#endif
}
else
{
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcsncpy
(
open_file_name
,
wargv
[
i
],
sizeof
open_file_name
/
sizeof
open_file_name
[
0
]);
BufferIO
::
NullTerminate
(
open_file_name
);
}
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
...
...
@@ -156,7 +159,8 @@ int main(int argc, char* argv[]) {
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcsncpy
(
open_file_name
,
wargv
[
i
],
sizeof
open_file_name
/
sizeof
open_file_name
[
0
]);
BufferIO
::
NullTerminate
(
open_file_name
);
}
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
if
(
open_file
)
...
...
@@ -167,7 +171,8 @@ int main(int argc, char* argv[]) {
++
i
;
if
(
i
<
wargc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcsncpy
(
open_file_name
,
wargv
[
i
],
sizeof
open_file_name
/
sizeof
open_file_name
[
0
]);
BufferIO
::
NullTerminate
(
open_file_name
);
}
ClickButton
(
ygo
::
mainGame
->
btnSingleMode
);
if
(
open_file
)
...
...
@@ -177,14 +182,16 @@ int main(int argc, char* argv[]) {
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
wargv
[
1
])
-
4
;
if
(
!
mywcsncasecmp
(
pstrext
,
L".ydk"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcsncpy
(
open_file_name
,
wargv
[
i
],
sizeof
open_file_name
/
sizeof
open_file_name
[
0
]);
BufferIO
::
NullTerminate
(
open_file_name
);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
if
(
!
mywcsncasecmp
(
pstrext
,
L".yrp"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
wcsncpy
(
open_file_name
,
wargv
[
i
],
sizeof
open_file_name
/
sizeof
open_file_name
[
0
]);
BufferIO
::
NullTerminate
(
open_file_name
);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnReplayMode
);
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
...
...
gframe/menu_handler.cpp
View file @
dce0da28
...
...
@@ -448,7 +448,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
wcsncpy
(
deck_name
,
dash
+
1
,
256
);
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
deck_name
))
{
wcscpy
(
mainGame
->
gameConf
.
lastdeck
,
deck_name
);
wcsncpy
(
mainGame
->
gameConf
.
lastdeck
,
deck_name
,
sizeof
mainGame
->
gameConf
.
lastdeck
/
sizeof
mainGame
->
gameConf
.
lastdeck
[
0
]);
BufferIO
::
NullTerminate
(
mainGame
->
gameConf
.
lastdeck
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
break
;
}
...
...
@@ -456,7 +457,8 @@ bool MenuHandler::OnEvent(const irr::SEvent& event) {
}
else
{
// only deck name
for
(
size_t
i
=
0
;
i
<
mainGame
->
cbDBDecks
->
getItemCount
();
++
i
)
{
if
(
!
wcscmp
(
mainGame
->
cbDBDecks
->
getItem
(
i
),
open_file_name
))
{
wcscpy
(
mainGame
->
gameConf
.
lastdeck
,
open_file_name
);
wcsncpy
(
mainGame
->
gameConf
.
lastdeck
,
open_file_name
,
sizeof
mainGame
->
gameConf
.
lastdeck
/
sizeof
mainGame
->
gameConf
.
lastdeck
[
0
]);
BufferIO
::
NullTerminate
(
mainGame
->
gameConf
.
lastdeck
);
mainGame
->
cbDBDecks
->
setSelected
(
i
);
break
;
}
...
...
gframe/myfilesystem.h
View file @
dce0da28
...
...
@@ -14,6 +14,7 @@
#ifdef _WIN32
#include <wchar.h>
#define NOMINMAX
#include <Windows.h>
...
...
@@ -89,8 +90,7 @@ public:
static
void
TraversalDir
(
const
wchar_t
*
wpath
,
const
std
::
function
<
void
(
const
wchar_t
*
,
bool
)
>&
cb
)
{
wchar_t
findstr
[
1024
];
wcscpy
(
findstr
,
wpath
);
wcscat
(
findstr
,
L"/*"
);
swprintf
(
findstr
,
1024
,
L"%s/*"
,
wpath
);
WIN32_FIND_DATAW
fdataw
;
HANDLE
fh
=
FindFirstFileW
(
findstr
,
&
fdataw
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
...
...
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