Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
f05c2e89
Commit
f05c2e89
authored
Sep 19, 2018
by
mercury233
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/Fluorohydride/ygopro
into resize
parents
988785de
7a89eeb9
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
527 additions
and
145 deletions
+527
-145
gframe/bufferio.h
gframe/bufferio.h
+27
-3
gframe/config.h
gframe/config.h
+5
-3
gframe/drawing.cpp
gframe/drawing.cpp
+1
-1
gframe/event_handler.cpp
gframe/event_handler.cpp
+1
-1
gframe/game.cpp
gframe/game.cpp
+1
-1
gframe/premake4.lua
gframe/premake4.lua
+1
-1
gframe/replay.cpp
gframe/replay.cpp
+6
-3
gframe/replay_mode.cpp
gframe/replay_mode.cpp
+1
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+4
-3
gframe/tag_duel.cpp
gframe/tag_duel.cpp
+6
-6
lflist.conf
lflist.conf
+470
-119
ocgcore
ocgcore
+1
-1
premake4.lua
premake4.lua
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+1
-0
No files found.
gframe/bufferio.h
View file @
f05c2e89
...
...
@@ -60,7 +60,7 @@ public:
*
pstr
=
0
;
return
l
;
}
// U
CS-
2 to UTF-8
// U
TF-16/UTF-3
2 to UTF-8
static
int
EncodeUTF8
(
const
wchar_t
*
wsrc
,
char
*
str
)
{
char
*
pstr
=
str
;
while
(
*
wsrc
!=
0
)
{
...
...
@@ -71,18 +71,35 @@ public:
str
[
0
]
=
((
*
wsrc
>>
6
)
&
0x1f
)
|
0xc0
;
str
[
1
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
2
;
}
else
{
}
else
if
(
*
wsrc
<
0x10000
&&
(
*
wsrc
<
0xd800
||
*
wsrc
>
0xdfff
))
{
str
[
0
]
=
((
*
wsrc
>>
12
)
&
0xf
)
|
0xe0
;
str
[
1
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
str
+=
3
;
}
else
{
#ifdef _WIN32
unsigned
unicode
=
0
;
unicode
|=
(
*
wsrc
++
&
0x3ff
)
<<
10
;
unicode
|=
*
wsrc
&
0x3ff
;
unicode
+=
0x10000
;
str
[
0
]
=
((
unicode
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
unicode
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
unicode
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
unicode
)
&
0x3f
)
|
0x80
;
#else
str
[
0
]
=
((
*
wsrc
>>
18
)
&
0x7
)
|
0xf0
;
str
[
1
]
=
((
*
wsrc
>>
12
)
&
0x3f
)
|
0x80
;
str
[
2
]
=
((
*
wsrc
>>
6
)
&
0x3f
)
|
0x80
;
str
[
3
]
=
((
*
wsrc
)
&
0x3f
)
|
0x80
;
#endif // _WIN32
str
+=
4
;
}
wsrc
++
;
}
*
str
=
0
;
return
str
-
pstr
;
}
// UTF-8 to U
CS-
2
// UTF-8 to U
TF-16/UTF-3
2
static
int
DecodeUTF8
(
const
char
*
src
,
wchar_t
*
wstr
)
{
const
char
*
p
=
src
;
wchar_t
*
wp
=
wstr
;
...
...
@@ -97,7 +114,14 @@ public:
*
wp
=
(((
unsigned
)
p
[
0
]
&
0xf
)
<<
12
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
2
]
&
0x3f
);
p
+=
3
;
}
else
if
((
*
p
&
0xf8
)
==
0xf0
)
{
#ifdef _WIN32
unsigned
unicode
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
unicode
-=
0x10000
;
*
wp
++
=
(
unicode
>>
10
)
|
0xd800
;
*
wp
=
(
unicode
&
0x3ff
)
|
0xdc00
;
#else
*
wp
=
(((
unsigned
)
p
[
0
]
&
0x7
)
<<
18
)
|
(((
unsigned
)
p
[
1
]
&
0x3f
)
<<
12
)
|
(((
unsigned
)
p
[
2
]
&
0x3f
)
<<
6
)
|
((
unsigned
)
p
[
3
]
&
0x3f
);
#endif // _WIN32
p
+=
4
;
}
else
p
++
;
...
...
gframe/config.h
View file @
f05c2e89
...
...
@@ -12,11 +12,9 @@
#include <ws2tcpip.h>
#ifdef _MSC_VER
#define myswprintf _swprintf
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else
#define myswprintf swprintf
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
#endif
...
...
@@ -44,7 +42,6 @@
#define SOCKET_ERRNO() (errno)
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
inline
int
_wtoi
(
const
wchar_t
*
s
)
{
...
...
@@ -53,6 +50,11 @@ inline int _wtoi(const wchar_t * s) {
}
#endif
template
<
size_t
N
,
typename
...
TR
>
inline
int
myswprintf
(
wchar_t
(
&
buf
)[
N
],
const
wchar_t
*
fmt
,
TR
...
args
)
{
return
swprintf
(
buf
,
N
,
fmt
,
args
...);
}
#include <irrlicht.h>
#include <GL/gl.h>
#include <GL/glu.h>
...
...
gframe/drawing.cpp
View file @
f05c2e89
...
...
@@ -1156,7 +1156,7 @@ void Game::DrawDeckBd() {
myswprintf
(
textBuffer
,
L"%ls"
,
dataManager
.
GetName
(
ptr
->
first
));
DrawShadowText
(
textFont
,
textBuffer
,
Resize
(
860
,
165
+
i
*
66
,
955
,
185
+
i
*
66
),
Resize
(
1
,
1
,
0
,
0
));
if
(
!
(
ptr
->
second
.
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
ptr
->
second
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
textBuffer
,
L"%ls/%ls %ls%d"
,
dataManager
.
FormatAttribute
(
ptr
->
second
.
attribute
),
dataManager
.
FormatRace
(
ptr
->
second
.
race
),
form
,
ptr
->
second
.
level
);
DrawShadowText
(
textFont
,
textBuffer
,
Resize
(
860
,
187
+
i
*
66
,
955
,
207
+
i
*
66
),
Resize
(
1
,
1
,
0
,
0
));
...
...
gframe/event_handler.cpp
View file @
f05c2e89
...
...
@@ -1526,7 +1526,7 @@ bool ClientField::OnEvent(const irr::SEvent& event) {
myswprintf
(
formatBuffer
,
L"
\n
%ls/%ls"
,
mcard
->
atkstring
,
mcard
->
defstring
);
str
.
append
(
formatBuffer
);
if
(
!
(
mcard
->
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
mcard
->
rank
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"
\n
%ls%d"
,
form
,
(
mcard
->
level
?
mcard
->
level
:
mcard
->
rank
));
str
.
append
(
formatBuffer
);
...
...
gframe/game.cpp
View file @
f05c2e89
...
...
@@ -1274,7 +1274,7 @@ void Game::ShowCardInfo(int code, bool resize) {
myswprintf
(
formatBuffer
,
L"[%ls] %ls/%ls"
,
dataManager
.
FormatType
(
cd
.
type
),
dataManager
.
FormatRace
(
cd
.
race
),
dataManager
.
FormatAttribute
(
cd
.
attribute
));
stInfo
->
setText
(
formatBuffer
);
if
(
!
(
cd
.
type
&
TYPE_LINK
))
{
wchar_t
*
form
=
L"\u2605"
;
const
wchar_t
*
form
=
L"\u2605"
;
if
(
cd
.
type
&
TYPE_XYZ
)
form
=
L"\u2606"
;
myswprintf
(
formatBuffer
,
L"[%ls%d] "
,
form
,
cd
.
level
);
wchar_t
adBuffer
[
16
];
...
...
gframe/premake4.lua
View file @
f05c2e89
...
...
@@ -26,7 +26,7 @@ project "ygopro"
configuration
{
"windows"
,
"not vs*"
}
includedirs
{
"/mingw/include/irrlicht"
,
"/mingw/include/freetype2"
}
configuration
"not vs*"
buildoptions
{
"-std=
gnu++0x
"
,
"-fno-rtti"
}
buildoptions
{
"-std=
c++14
"
,
"-fno-rtti"
}
configuration
"not windows"
includedirs
{
"/usr/include/lua"
,
"/usr/include/lua5.3"
,
"/usr/include/lua/5.3"
,
"/usr/include/irrlicht"
,
"/usr/include/freetype2"
}
excludes
{
"COSOperator.*"
}
...
...
gframe/replay.cpp
View file @
f05c2e89
...
...
@@ -159,7 +159,10 @@ bool Replay::OpenReplay(const wchar_t* name) {
}
if
(
!
fp
)
return
false
;
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
);
if
(
fread
(
&
pheader
,
sizeof
(
pheader
),
1
,
fp
)
<
1
)
{
fclose
(
fp
);
return
false
;
}
if
(
pheader
.
flag
&
REPLAY_COMPRESSED
)
{
comp_size
=
fread
(
comp_data
,
1
,
0x1000
,
fp
);
fclose
(
fp
);
...
...
@@ -188,9 +191,9 @@ bool Replay::CheckReplay(const wchar_t* name) {
if
(
!
rfp
)
return
false
;
ReplayHeader
rheader
;
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
size_t
count
=
fread
(
&
rheader
,
sizeof
(
ReplayHeader
),
1
,
rfp
);
fclose
(
rfp
);
return
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
return
count
==
1
&&
rheader
.
id
==
0x31707279
&&
rheader
.
version
>=
0x12d0
;
}
bool
Replay
::
DeleteReplay
(
const
wchar_t
*
name
)
{
wchar_t
fname
[
256
];
...
...
gframe/replay_mode.cpp
View file @
f05c2e89
...
...
@@ -218,7 +218,7 @@ bool ReplayMode::StartDuel() {
size_t
slen
=
cur_replay
.
ReadInt16
();
cur_replay
.
ReadData
(
filename
,
slen
);
filename
[
slen
]
=
0
;
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
{
if
(
!
preload_script
(
pduel
,
filename
,
0
))
{
return
false
;
}
}
...
...
gframe/single_mode.cpp
View file @
f05c2e89
...
...
@@ -50,17 +50,18 @@ int SingleMode::SinglePlayThread(void* param) {
myswprintf
(
mainGame
->
dInfo
.
strLP
[
1
],
L"%d"
,
mainGame
->
dInfo
.
lp
[
1
]);
BufferIO
::
CopyWStr
(
mainGame
->
ebNickName
->
getText
(),
mainGame
->
dInfo
.
hostname
,
20
);
mainGame
->
dInfo
.
clientname
[
0
]
=
0
;
mainGame
->
dInfo
.
player_type
=
0
;
mainGame
->
dInfo
.
turn
=
0
;
char
filename
[
256
];
size_t
slen
=
0
;
if
(
open_file
)
{
open_file
=
false
;
slen
=
BufferIO
::
EncodeUTF8
(
open_file_name
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
{
if
(
!
preload_script
(
pduel
,
filename
,
0
))
{
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
open_file_name
);
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
if
(
!
preload_script
(
pduel
,
filename
,
0
))
slen
=
0
;
}
}
else
{
...
...
@@ -68,7 +69,7 @@ int SingleMode::SinglePlayThread(void* param) {
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
filename
);
if
(
!
preload_script
(
pduel
,
filename
,
slen
))
if
(
!
preload_script
(
pduel
,
filename
,
0
))
slen
=
0
;
}
if
(
slen
==
0
)
{
...
...
gframe/tag_duel.cpp
View file @
f05c2e89
...
...
@@ -1526,7 +1526,7 @@ void TagDuel::TimeConfirm(DuelPlayer* dp) {
event_add
(
etimer
,
&
timeout
);
}
void
TagDuel
::
RefreshMzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1552,7 +1552,7 @@ void TagDuel::RefreshMzone(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshSzone
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1578,7 +1578,7 @@ void TagDuel::RefreshSzone(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshHand
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1606,7 +1606,7 @@ void TagDuel::RefreshHand(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshGrave
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1620,7 +1620,7 @@ void TagDuel::RefreshGrave(int player, int flag, int use_cache) {
NetServer
::
ReSendToPlayer
(
*
pit
);
}
void
TagDuel
::
RefreshExtra
(
int
player
,
int
flag
,
int
use_cache
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_DATA
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
@@ -1629,7 +1629,7 @@ void TagDuel::RefreshExtra(int player, int flag, int use_cache) {
NetServer
::
SendBufferToPlayer
(
cur_player
[
player
],
STOC_GAME_MSG
,
query_buffer
,
len
+
3
);
}
void
TagDuel
::
RefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
)
{
char
query_buffer
[
0x
2
000
];
char
query_buffer
[
0x
4
000
];
char
*
qbuf
=
query_buffer
;
BufferIO
::
WriteInt8
(
qbuf
,
MSG_UPDATE_CARD
);
BufferIO
::
WriteInt8
(
qbuf
,
player
);
...
...
lflist.conf
View file @
f05c2e89
This diff is collapsed.
Click to expand it.
ocgcore
@
89a46ce1
Subproject commit
b5f28bc46173c98b20a83ddada5442d5c5ce99f2
Subproject commit
89a46ce14367d0cdaf75b8f8550ebbe1ac29e78a
premake4.lua
View file @
f05c2e89
...
...
@@ -23,7 +23,7 @@ solution "ygo"
configuration
"vs*"
flags
"EnableSSE2"
buildoptions
{
"-wd4996"
}
buildoptions
{
"-wd4996"
,
"/utf-8"
}
defines
{
"_CRT_SECURE_NO_WARNINGS"
}
configuration
"not vs*"
...
...
script
@
64180307
Subproject commit
fa9a0e7ba5c6eb54a0c330bf90f83e90a6d187b0
Subproject commit
6418030726ac2e4c65e10e9a02cd32c52d953d58
strings.conf
View file @
f05c2e89
...
...
@@ -547,6 +547,7 @@
!
counter
0
x47
指示物(限制代码)
!
counter
0
x48
指示物(连接死亡炮塔)
!
counter
0
x1049
警逻指示物
!
counter
0
x4a
运动员指示物
#setnames, using tab for comment
!
setname
0
x1
正义盟军
A
・
O
・
J
!
setname
0
x2
次世代 ジェネクス
...
...
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