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
94727cd3
Commit
94727cd3
authored
Mar 13, 2024
by
wind2009
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into develop
parents
a395256a
2491768e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
57 additions
and
38 deletions
+57
-38
gframe/CGUITTFont.cpp
gframe/CGUITTFont.cpp
+6
-6
gframe/drawing.cpp
gframe/drawing.cpp
+3
-3
gframe/duelclient.cpp
gframe/duelclient.cpp
+2
-2
gframe/duelclient.h
gframe/duelclient.h
+16
-8
gframe/netserver.cpp
gframe/netserver.cpp
+2
-2
gframe/netserver.h
gframe/netserver.h
+21
-13
gframe/network.h
gframe/network.h
+2
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+1
-1
ocgcore
ocgcore
+1
-1
script
script
+1
-1
strings.conf
strings.conf
+2
-1
No files found.
gframe/CGUITTFont.cpp
View file @
94727cd3
...
...
@@ -79,9 +79,9 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
const
u32
image_pitch
=
image
->
getPitch
()
/
sizeof
(
u16
);
u16
*
image_data
=
(
u16
*
)
image
->
lock
();
u8
*
glyph_data
=
bits
.
buffer
;
for
(
s32
y
=
0
;
y
<
bits
.
rows
;
++
y
)
{
for
(
s32
y
=
0
;
y
<
(
s32
)
bits
.
rows
;
++
y
)
{
u16
*
row
=
image_data
;
for
(
s32
x
=
0
;
x
<
bits
.
width
;
++
x
)
{
for
(
s32
x
=
0
;
x
<
(
s32
)
bits
.
width
;
++
x
)
{
// Monochrome bitmaps store 8 pixels per byte. The left-most pixel is the bit 0x80.
// So, we go through the data each bit at a time.
if
((
glyph_data
[
y
*
bits
.
pitch
+
(
x
/
8
)]
&
(
0x80
>>
(
x
%
8
)))
!=
0
)
...
...
@@ -105,9 +105,9 @@ video::IImage* SGUITTGlyph::createGlyphImage(const FT_Bitmap& bits, video::IVide
const
u32
image_pitch
=
image
->
getPitch
()
/
sizeof
(
u32
);
u32
*
image_data
=
(
u32
*
)
image
->
lock
();
u8
*
glyph_data
=
bits
.
buffer
;
for
(
s32
y
=
0
;
y
<
bits
.
rows
;
++
y
)
{
for
(
s32
y
=
0
;
y
<
(
s32
)
bits
.
rows
;
++
y
)
{
u8
*
row
=
glyph_data
;
for
(
s32
x
=
0
;
x
<
bits
.
width
;
++
x
)
{
for
(
s32
x
=
0
;
x
<
(
s32
)
bits
.
width
;
++
x
)
{
image_data
[
y
*
image_pitch
+
x
]
|=
static_cast
<
u32
>
(
255.0
f
*
(
static_cast
<
float
>
(
*
row
++
)
/
gray_count
))
<<
24
;
//data[y * image_pitch + x] |= ((u32)(*bitsdata++) << 24);
}
...
...
@@ -154,8 +154,8 @@ void SGUITTGlyph::preload(u32 char_index, FT_Face face, video::IVideoDriver* dri
glyph_page
=
parent
->
getLastGlyphPageIndex
();
u32
texture_side_length
=
page
->
texture_size
.
Width
-
font_size
;
u32
margin
=
font_size
*
0.5
;
u32
sprite_size
=
font_size
*
1.5
;
u32
margin
=
(
u32
)(
font_size
*
0.5
)
;
u32
sprite_size
=
(
u32
)(
font_size
*
1.5
)
;
core
::
vector2di
page_position
(
(
s32
)(
page
->
used_slots
%
(
s32
)(
texture_side_length
/
sprite_size
))
*
sprite_size
+
margin
,
(
s32
)(
page
->
used_slots
/
(
s32
)(
texture_side_length
/
sprite_size
))
*
sprite_size
+
margin
...
...
gframe/drawing.cpp
View file @
94727cd3
...
...
@@ -1197,10 +1197,10 @@ void Game::DrawDeckBd() {
dx
=
436.0
f
/
(
lx
-
1
);
}
int
padding
=
scrPackCards
->
getPos
()
*
lx
;
for
(
size_
t
i
=
0
;
i
<
mainsize
-
padding
&&
i
<
7
*
lx
;
++
i
)
{
size_
t
j
=
i
+
padding
;
for
(
in
t
i
=
0
;
i
<
mainsize
-
padding
&&
i
<
7
*
lx
;
++
i
)
{
in
t
j
=
i
+
padding
;
DrawThumb
(
deckManager
.
current_deck
.
main
[
j
],
position2di
(
314
+
(
i
%
lx
)
*
dx
,
164
+
(
i
/
lx
)
*
dy
),
deckBuilder
.
filterList
);
if
(
deckBuilder
.
hovered_pos
==
1
&&
deckBuilder
.
hovered_seq
==
(
int
)
j
)
if
(
deckBuilder
.
hovered_pos
==
1
&&
deckBuilder
.
hovered_seq
==
j
)
driver
->
draw2DRectangleOutline
(
Resize
(
313
+
(
i
%
lx
)
*
dx
,
163
+
(
i
/
lx
)
*
dy
,
359
+
(
i
%
lx
)
*
dx
,
228
+
(
i
/
lx
)
*
dy
));
}
if
(
!
deckBuilder
.
showing_pack
)
{
...
...
gframe/duelclient.cpp
View file @
94727cd3
...
...
@@ -19,8 +19,8 @@ unsigned char DuelClient::selftype = 0;
bool
DuelClient
::
is_host
=
false
;
event_base
*
DuelClient
::
client_base
=
0
;
bufferevent
*
DuelClient
::
client_bev
=
0
;
unsigned
char
DuelClient
::
duel_client_read
[
0x2000
];
unsigned
char
DuelClient
::
duel_client_write
[
0x2000
];
unsigned
char
DuelClient
::
duel_client_read
[
SIZE_NETWORK_BUFFER
];
unsigned
char
DuelClient
::
duel_client_write
[
SIZE_NETWORK_BUFFER
];
bool
DuelClient
::
is_closing
=
false
;
bool
DuelClient
::
is_swapping
=
false
;
int
DuelClient
::
select_hint
=
0
;
...
...
gframe/duelclient.h
View file @
94727cd3
...
...
@@ -27,8 +27,8 @@ private:
static
bool
is_host
;
static
event_base
*
client_base
;
static
bufferevent
*
client_bev
;
static
unsigned
char
duel_client_read
[
0x2000
];
static
unsigned
char
duel_client_write
[
0x2000
];
static
unsigned
char
duel_client_read
[
SIZE_NETWORK_BUFFER
];
static
unsigned
char
duel_client_write
[
SIZE_NETWORK_BUFFER
];
static
bool
is_closing
;
static
bool
is_swapping
;
static
int
select_hint
;
...
...
@@ -60,17 +60,25 @@ public:
template
<
typename
ST
>
static
void
SendPacketToServer
(
unsigned
char
proto
,
ST
&
st
)
{
auto
p
=
duel_client_write
;
BufferIO
::
WriteInt16
(
p
,
1
+
sizeof
(
ST
));
int
blen
=
sizeof
(
ST
);
if
(
blen
>
MAX_DATA_SIZE
)
blen
=
MAX_DATA_SIZE
;
BufferIO
::
WriteInt16
(
p
,
(
short
)(
1
+
blen
));
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
&
st
,
sizeof
(
ST
)
);
bufferevent_write
(
client_bev
,
duel_client_write
,
sizeof
(
ST
)
+
3
);
memcpy
(
p
,
&
st
,
blen
);
bufferevent_write
(
client_bev
,
duel_client_write
,
blen
+
3
);
}
static
void
SendBufferToServer
(
unsigned
char
proto
,
void
*
buffer
,
size_t
len
)
{
auto
p
=
duel_client_write
;
BufferIO
::
WriteInt16
(
p
,
1
+
len
);
int
blen
=
len
;
if
(
blen
<
0
)
return
;
if
(
blen
>
MAX_DATA_SIZE
)
blen
=
MAX_DATA_SIZE
;
BufferIO
::
WriteInt16
(
p
,
(
short
)(
1
+
blen
));
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
buffer
,
len
);
bufferevent_write
(
client_bev
,
duel_client_write
,
len
+
3
);
memcpy
(
p
,
buffer
,
b
len
);
bufferevent_write
(
client_bev
,
duel_client_write
,
b
len
+
3
);
}
protected:
...
...
gframe/netserver.cpp
View file @
94727cd3
...
...
@@ -9,8 +9,8 @@ event_base* NetServer::net_evbase = 0;
event
*
NetServer
::
broadcast_ev
=
0
;
evconnlistener
*
NetServer
::
listener
=
0
;
DuelMode
*
NetServer
::
duel_mode
=
0
;
unsigned
char
NetServer
::
net_server_read
[
0x2000
];
unsigned
char
NetServer
::
net_server_write
[
0x2000
];
unsigned
char
NetServer
::
net_server_read
[
SIZE_NETWORK_BUFFER
];
unsigned
char
NetServer
::
net_server_write
[
SIZE_NETWORK_BUFFER
];
unsigned
short
NetServer
::
last_sent
=
0
;
bool
NetServer
::
StartServer
(
unsigned
short
port
)
{
...
...
gframe/netserver.h
View file @
94727cd3
...
...
@@ -18,8 +18,8 @@ private:
static
event
*
broadcast_ev
;
static
evconnlistener
*
listener
;
static
DuelMode
*
duel_mode
;
static
unsigned
char
net_server_read
[
0x2000
];
static
unsigned
char
net_server_write
[
0x2000
];
static
unsigned
char
net_server_read
[
SIZE_NETWORK_BUFFER
];
static
unsigned
char
net_server_write
[
SIZE_NETWORK_BUFFER
];
static
unsigned
short
last_sent
;
public:
...
...
@@ -43,26 +43,34 @@ public:
last_sent
=
3
;
if
(
!
dp
)
return
;
bufferevent_write
(
dp
->
bev
,
net_server_write
,
last_sent
);
bufferevent_write
(
dp
->
bev
,
net_server_write
,
3
);
}
template
<
typename
ST
>
static
void
SendPacketToPlayer
(
DuelPlayer
*
dp
,
unsigned
char
proto
,
ST
&
st
)
{
auto
p
=
net_server_write
;
BufferIO
::
WriteInt16
(
p
,
1
+
sizeof
(
ST
));
int
blen
=
sizeof
(
ST
);
if
(
blen
>
MAX_DATA_SIZE
)
blen
=
MAX_DATA_SIZE
;
BufferIO
::
WriteInt16
(
p
,
(
short
)(
1
+
blen
));
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
&
st
,
sizeof
(
ST
)
);
last_sent
=
sizeof
(
ST
)
+
3
;
if
(
dp
)
bufferevent_write
(
dp
->
bev
,
net_server_write
,
last_sent
);
memcpy
(
p
,
&
st
,
blen
);
last_sent
=
blen
+
3
;
if
(
dp
)
bufferevent_write
(
dp
->
bev
,
net_server_write
,
blen
+
3
);
}
static
void
SendBufferToPlayer
(
DuelPlayer
*
dp
,
unsigned
char
proto
,
void
*
buffer
,
size_t
len
)
{
auto
p
=
net_server_write
;
BufferIO
::
WriteInt16
(
p
,
1
+
len
);
int
blen
=
len
;
if
(
blen
<
0
)
return
;
if
(
blen
>
MAX_DATA_SIZE
)
blen
=
MAX_DATA_SIZE
;
BufferIO
::
WriteInt16
(
p
,
(
short
)(
1
+
blen
));
BufferIO
::
WriteInt8
(
p
,
proto
);
memcpy
(
p
,
buffer
,
len
);
last_sent
=
len
+
3
;
if
(
dp
)
bufferevent_write
(
dp
->
bev
,
net_server_write
,
last_sent
);
memcpy
(
p
,
buffer
,
b
len
);
last_sent
=
b
len
+
3
;
if
(
dp
)
bufferevent_write
(
dp
->
bev
,
net_server_write
,
blen
+
3
);
}
static
void
ReSendToPlayer
(
DuelPlayer
*
dp
)
{
if
(
dp
)
...
...
gframe/network.h
View file @
94727cd3
...
...
@@ -10,6 +10,8 @@
#include <event2/thread.h>
namespace
ygo
{
constexpr
int
SIZE_NETWORK_BUFFER
=
0x2000
;
constexpr
int
MAX_DATA_SIZE
=
SIZE_NETWORK_BUFFER
-
3
;
struct
HostInfo
{
unsigned
int
lflist
{
0
};
...
...
gframe/single_mode.cpp
View file @
94727cd3
...
...
@@ -55,7 +55,7 @@ int SingleMode::SinglePlayThread() {
if
(
mainGame
->
chkSinglePlayReturnDeckTop
->
isChecked
())
opt
|=
DUEL_RETURN_DECK_TOP
;
char
filename
[
256
];
size_
t
slen
=
0
;
in
t
slen
=
0
;
if
(
open_file
)
{
open_file
=
false
;
slen
=
BufferIO
::
EncodeUTF8
(
open_file_name
,
filename
);
...
...
ocgcore
@
e3073cdf
Subproject commit
98805fe3ea10a2e57503eac8a137fd22fa652aeb
Subproject commit
e3073cdfbae25a491df9f1f7c35cc9e87ceb65a9
script
@
3a13cea9
Subproject commit
0b0c3cc6f9e172e490f35fb0876ff6e4763d2e3c
Subproject commit
3a13cea9a4ce92426a48039965a83fb6cf296cf7
strings.conf
View file @
94727cd3
...
...
@@ -1183,7 +1183,7 @@
!
setname
0
x18f
防火 ファイアウォール
!
setname
0
x190
末那愚子族 マナドゥム
!
setname
0
x191
妮穆蕾莉娅 ネムレリア
!
setname
0
x192
金傲大奖赛
GP
(ゴールド・プライド)
!
setname
0
x192
黄金荣耀
GP
(ゴールド・プライド)
!
setname
0
x193
迷宫壁 ラビリンス・ウォール
!
setname
0
x194
至爱 フェイバリット
!
setname
0
x195
征服斗魂
VS
(ヴァンキッシュ・ソウル)
...
...
@@ -1211,3 +1211,4 @@
!
setname
0
x1aa
天杯龙 天盃龍
!
setname
0
x1ab
蕾祸 蕾禍
!
setname
0
x1ac
飞龙炎
Salamandra
!
setname
0
x1ad
灰尽
Ashened
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