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
baichixing
ygopro
Commits
b11f8ec2
Commit
b11f8ec2
authored
May 07, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
449fa240
50df3b4b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
112 additions
and
87 deletions
+112
-87
gframe/config.h
gframe/config.h
+1
-1
gframe/data_manager.cpp
gframe/data_manager.cpp
+14
-8
gframe/deck_manager.cpp
gframe/deck_manager.cpp
+14
-15
gframe/game.cpp
gframe/game.cpp
+82
-62
gframe/gframe.cpp
gframe/gframe.cpp
+1
-1
No files found.
gframe/config.h
View file @
b11f8ec2
...
@@ -87,7 +87,7 @@ using namespace io;
...
@@ -87,7 +87,7 @@ using namespace io;
using
namespace
gui
;
using
namespace
gui
;
extern
const
unsigned
short
PRO_VERSION
;
extern
const
unsigned
short
PRO_VERSION
;
extern
int
enable_log
;
extern
unsigned
int
enable_log
;
extern
bool
exit_on_return
;
extern
bool
exit_on_return
;
extern
bool
open_file
;
extern
bool
open_file
;
extern
wchar_t
open_file_name
[
256
];
extern
wchar_t
open_file_name
[
256
];
...
...
gframe/data_manager.cpp
View file @
b11f8ec2
...
@@ -139,24 +139,30 @@ bool DataManager::LoadStrings(IReadFile* reader) {
...
@@ -139,24 +139,30 @@ bool DataManager::LoadStrings(IReadFile* reader) {
void
DataManager
::
ReadStringConfLine
(
const
char
*
linebuf
)
{
void
DataManager
::
ReadStringConfLine
(
const
char
*
linebuf
)
{
if
(
linebuf
[
0
]
!=
'!'
)
if
(
linebuf
[
0
]
!=
'!'
)
return
;
return
;
char
strbuf
[
256
];
char
strbuf
[
256
]{};
int
value
;
int
value
{};
wchar_t
strBuffer
[
4096
];
wchar_t
strBuffer
[
4096
]{};
sscanf
(
linebuf
,
"!%s"
,
strbuf
);
if
(
sscanf
(
linebuf
,
"!%63s"
,
strbuf
)
!=
1
)
return
;
if
(
!
strcmp
(
strbuf
,
"system"
))
{
if
(
!
strcmp
(
strbuf
,
"system"
))
{
sscanf
(
&
linebuf
[
7
],
"%d %240[^
\n
]"
,
&
value
,
strbuf
);
if
(
sscanf
(
&
linebuf
[
7
],
"%d %240[^
\n
]"
,
&
value
,
strbuf
)
!=
2
)
return
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_sysStrings
[
value
]
=
strBuffer
;
_sysStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"victory"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"victory"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
);
if
(
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
)
!=
2
)
return
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_victoryStrings
[
value
]
=
strBuffer
;
_victoryStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"counter"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"counter"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
);
if
(
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\n
]"
,
&
value
,
strbuf
)
!=
2
)
return
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_counterStrings
[
value
]
=
strBuffer
;
_counterStrings
[
value
]
=
strBuffer
;
}
else
if
(
!
strcmp
(
strbuf
,
"setname"
))
{
}
else
if
(
!
strcmp
(
strbuf
,
"setname"
))
{
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\t\n
]"
,
&
value
,
strbuf
);
//using tab for comment
//using tab for comment
if
(
sscanf
(
&
linebuf
[
8
],
"%x %240[^
\t\n
]"
,
&
value
,
strbuf
)
!=
2
)
return
;
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
BufferIO
::
DecodeUTF8
(
strbuf
,
strBuffer
);
_setnameStrings
[
value
]
=
strBuffer
;
_setnameStrings
[
value
]
=
strBuffer
;
}
}
...
...
gframe/deck_manager.cpp
View file @
b11f8ec2
...
@@ -11,15 +11,16 @@ DeckManager deckManager;
...
@@ -11,15 +11,16 @@ DeckManager deckManager;
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
void
DeckManager
::
LoadLFListSingle
(
const
char
*
path
)
{
LFList
*
cur
=
nullptr
;
LFList
*
cur
=
nullptr
;
FILE
*
fp
=
fopen
(
path
,
"r"
);
FILE
*
fp
=
fopen
(
path
,
"r"
);
char
linebuf
[
256
];
char
linebuf
[
256
]
{}
;
wchar_t
strBuffer
[
256
];
wchar_t
strBuffer
[
256
]
{}
;
if
(
fp
)
{
if
(
fp
)
{
while
(
fgets
(
linebuf
,
256
,
fp
))
{
while
(
fgets
(
linebuf
,
256
,
fp
))
{
if
(
linebuf
[
0
]
==
'#'
)
if
(
linebuf
[
0
]
==
'#'
)
continue
;
continue
;
if
(
linebuf
[
0
]
==
'!'
)
{
if
(
linebuf
[
0
]
==
'!'
)
{
int
sa
=
BufferIO
::
DecodeUTF8
(
&
linebuf
[
1
],
strBuffer
);
int
sa
=
BufferIO
::
DecodeUTF8
(
&
linebuf
[
1
],
strBuffer
);
while
(
strBuffer
[
sa
-
1
]
==
L'\r'
||
strBuffer
[
sa
-
1
]
==
L'\n'
)
sa
--
;
while
(
strBuffer
[
sa
-
1
]
==
L'\r'
||
strBuffer
[
sa
-
1
]
==
L'\n'
)
sa
--
;
strBuffer
[
sa
]
=
0
;
strBuffer
[
sa
]
=
0
;
LFList
newlist
;
LFList
newlist
;
_lfList
.
push_back
(
newlist
);
_lfList
.
push_back
(
newlist
);
...
@@ -28,20 +29,18 @@ void DeckManager::LoadLFListSingle(const char* path) {
...
@@ -28,20 +29,18 @@ void DeckManager::LoadLFListSingle(const char* path) {
cur
->
hash
=
0x7dfcee6a
;
cur
->
hash
=
0x7dfcee6a
;
continue
;
continue
;
}
}
int
p
=
0
;
if
(
linebuf
[
0
]
==
0
)
while
(
linebuf
[
p
]
!=
' '
&&
linebuf
[
p
]
!=
'\t'
&&
linebuf
[
p
]
!=
0
)
p
++
;
if
(
linebuf
[
p
]
==
0
)
continue
;
continue
;
linebuf
[
p
++
]
=
0
;
int
code
=
0
;
int
sa
=
p
;
int
count
=
-
1
;
int
code
=
atoi
(
linebuf
);
if
(
sscanf
(
linebuf
,
"%d %d"
,
&
code
,
&
count
)
!=
2
)
if
(
code
==
0
)
continue
;
if
(
code
<=
0
||
code
>
99999999
)
continue
;
if
(
count
<
0
||
count
>
2
)
continue
;
if
(
!
cur
)
continue
;
continue
;
while
(
linebuf
[
p
]
==
' '
||
linebuf
[
p
]
==
'\t'
)
p
++
;
while
(
linebuf
[
p
]
!=
' '
&&
linebuf
[
p
]
!=
'\t'
&&
linebuf
[
p
]
!=
0
)
p
++
;
linebuf
[
p
]
=
0
;
int
count
=
atoi
(
&
linebuf
[
sa
]);
if
(
!
cur
)
continue
;
cur
->
content
[
code
]
=
count
;
cur
->
content
[
code
]
=
count
;
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
cur
->
hash
=
cur
->
hash
^
((
code
<<
18
)
|
(
code
>>
14
))
^
((
code
<<
(
27
+
count
))
|
(
code
>>
(
5
-
count
)));
}
}
...
...
gframe/game.cpp
View file @
b11f8ec2
This diff is collapsed.
Click to expand it.
gframe/gframe.cpp
View file @
b11f8ec2
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#import <CoreFoundation/CoreFoundation.h>
#import <CoreFoundation/CoreFoundation.h>
#endif
#endif
int
enable_log
=
0
;
unsigned
int
enable_log
=
0x3
;
bool
exit_on_return
=
false
;
bool
exit_on_return
=
false
;
bool
open_file
=
false
;
bool
open_file
=
false
;
wchar_t
open_file_name
[
256
]
=
L""
;
wchar_t
open_file_name
[
256
]
=
L""
;
...
...
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