Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
YGOMobile-Cn-Ko-En
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
fallenstardust
YGOMobile-Cn-Ko-En
Commits
15ed58d5
Commit
15ed58d5
authored
Aug 08, 2025
by
fallenstardust
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sync ocgcore
update gframe
parent
9ce1584d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
27 additions
and
16 deletions
+27
-16
Classes/gframe/client_card.cpp
Classes/gframe/client_card.cpp
+6
-6
Classes/gframe/drawing.cpp
Classes/gframe/drawing.cpp
+5
-1
Classes/ocgcore/duel.cpp
Classes/ocgcore/duel.cpp
+1
-1
Classes/ocgcore/interpreter.cpp
Classes/ocgcore/interpreter.cpp
+10
-5
Classes/ocgcore/interpreter.h
Classes/ocgcore/interpreter.h
+1
-1
Classes/ocgcore/libdebug.cpp
Classes/ocgcore/libdebug.cpp
+4
-2
No files found.
Classes/gframe/client_card.cpp
View file @
15ed58d5
...
@@ -35,8 +35,12 @@ void ClientCard::SetCode(unsigned int x) {
...
@@ -35,8 +35,12 @@ void ClientCard::SetCode(unsigned int x) {
if
((
location
==
LOCATION_HAND
)
&&
(
code
!=
x
))
{
if
((
location
==
LOCATION_HAND
)
&&
(
code
!=
x
))
{
code
=
x
;
code
=
x
;
mainGame
->
dField
.
MoveCard
(
this
,
5
);
mainGame
->
dField
.
MoveCard
(
this
,
5
);
}
else
}
else
{
if
(
x
==
0
&&
code
!=
0
)
{
chain_code
=
code
;
}
code
=
x
;
code
=
x
;
}
}
}
void
ClientCard
::
UpdateInfo
(
unsigned
char
*
buf
)
{
void
ClientCard
::
UpdateInfo
(
unsigned
char
*
buf
)
{
int
flag
=
BufferIO
::
Read
<
int32_t
>
(
buf
);
int
flag
=
BufferIO
::
Read
<
int32_t
>
(
buf
);
...
@@ -48,11 +52,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
...
@@ -48,11 +52,7 @@ void ClientCard::UpdateInfo(unsigned char* buf) {
int
pdata
=
BufferIO
::
Read
<
int32_t
>
(
buf
);
int
pdata
=
BufferIO
::
Read
<
int32_t
>
(
buf
);
if
(
!
pdata
)
if
(
!
pdata
)
ClearData
();
ClearData
();
if
((
location
==
LOCATION_HAND
)
&&
((
unsigned
int
)
pdata
!=
code
))
{
SetCode
(
pdata
);
code
=
pdata
;
mainGame
->
dField
.
MoveCard
(
this
,
5
);
}
else
code
=
pdata
;
}
}
if
(
flag
&
QUERY_POSITION
)
{
if
(
flag
&
QUERY_POSITION
)
{
int
pdata
=
(
BufferIO
::
Read
<
int32_t
>
(
buf
)
>>
24
)
&
0xff
;
int
pdata
=
(
BufferIO
::
Read
<
int32_t
>
(
buf
)
>>
24
)
&
0xff
;
...
...
Classes/gframe/drawing.cpp
View file @
15ed58d5
...
@@ -336,6 +336,7 @@ void Game::DrawCard(ClientCard* pcard) {
...
@@ -336,6 +336,7 @@ void Game::DrawCard(ClientCard* pcard) {
if
(
pcard
->
aniFrame
==
0
)
{
if
(
pcard
->
aniFrame
==
0
)
{
pcard
->
is_moving
=
false
;
pcard
->
is_moving
=
false
;
pcard
->
is_fading
=
false
;
pcard
->
is_fading
=
false
;
pcard
->
chain_code
=
0
;
}
}
}
}
matManager
.
mCard
.
AmbientColor
=
0xffffffff
;
matManager
.
mCard
.
AmbientColor
=
0xffffffff
;
...
@@ -343,7 +344,10 @@ void Game::DrawCard(ClientCard* pcard) {
...
@@ -343,7 +344,10 @@ void Game::DrawCard(ClientCard* pcard) {
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
pcard
->
mTransform
);
driver
->
setTransform
(
irr
::
video
::
ETS_WORLD
,
pcard
->
mTransform
);
auto
m22
=
pcard
->
mTransform
(
2
,
2
);
auto
m22
=
pcard
->
mTransform
(
2
,
2
);
if
(
m22
>
-
0.99
||
pcard
->
is_moving
)
{
if
(
m22
>
-
0.99
||
pcard
->
is_moving
)
{
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
GetTexture
(
pcard
->
code
));
auto
code
=
pcard
->
code
;
if
(
code
==
0
&&
pcard
->
is_moving
)
code
=
pcard
->
chain_code
;
matManager
.
mCard
.
setTexture
(
0
,
imageManager
.
GetTexture
(
code
));
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
setMaterial
(
matManager
.
mCard
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardFront
,
4
,
matManager
.
iRectangle
,
2
);
driver
->
drawVertexPrimitiveList
(
matManager
.
vCardFront
,
4
,
matManager
.
iRectangle
,
2
);
}
}
...
...
Classes/ocgcore/duel.cpp
View file @
15ed58d5
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
#include "buffer.h"
#include "buffer.h"
duel
::
duel
()
{
duel
::
duel
()
{
lua
=
new
interpreter
(
this
);
lua
=
new
interpreter
(
this
,
false
);
game_field
=
new
field
(
this
);
game_field
=
new
field
(
this
);
game_field
->
temp_card
=
new_card
(
TEMP_CARD_ID
);
game_field
->
temp_card
=
new_card
(
TEMP_CARD_ID
);
message_buffer
.
reserve
(
SIZE_MESSAGE_BUFFER
);
message_buffer
.
reserve
(
SIZE_MESSAGE_BUFFER
);
...
...
Classes/ocgcore/interpreter.cpp
View file @
15ed58d5
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#include "ocgapi.h"
#include "ocgapi.h"
#include "interpreter.h"
#include "interpreter.h"
interpreter
::
interpreter
(
duel
*
pd
)
:
coroutines
(
256
)
{
interpreter
::
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
)
:
coroutines
(
256
)
{
lua_state
=
luaL_newstate
();
lua_state
=
luaL_newstate
();
current_state
=
lua_state
;
current_state
=
lua_state
;
pduel
=
pd
;
pduel
=
pd
;
...
@@ -32,15 +32,20 @@ interpreter::interpreter(duel* pd): coroutines(256) {
...
@@ -32,15 +32,20 @@ interpreter::interpreter(duel* pd): coroutines(256) {
lua_pop
(
lua_state
,
1
);
lua_pop
(
lua_state
,
1
);
luaL_requiref
(
lua_state
,
"math"
,
luaopen_math
,
1
);
luaL_requiref
(
lua_state
,
"math"
,
luaopen_math
,
1
);
lua_pop
(
lua_state
,
1
);
lua_pop
(
lua_state
,
1
);
if
(
enable_unsafe_libraries
)
{
luaL_requiref
(
lua_state
,
"io"
,
luaopen_io
,
1
);
lua_pop
(
lua_state
,
1
);
}
auto
nil_out
=
[
&
](
const
char
*
name
)
{
auto
nil_out
=
[
&
](
const
char
*
name
)
{
lua_pushnil
(
lua_state
);
lua_pushnil
(
lua_state
);
lua_setglobal
(
lua_state
,
name
);
lua_setglobal
(
lua_state
,
name
);
};
};
nil_out
(
"collectgarbage"
);
nil_out
(
"collectgarbage"
);
#ifndef ENABLE_UNSAFE_LIBRARIES
if
(
!
enable_unsafe_libraries
)
{
nil_out
(
"dofile"
);
nil_out
(
"dofile"
);
nil_out
(
"loadfile"
);
nil_out
(
"loadfile"
);
#endif // ENABLE_UNSAFE_LIBRARIES
}
//open all libs
//open all libs
scriptlib
::
open_cardlib
(
lua_state
);
scriptlib
::
open_cardlib
(
lua_state
);
scriptlib
::
open_effectlib
(
lua_state
);
scriptlib
::
open_effectlib
(
lua_state
);
...
...
Classes/ocgcore/interpreter.h
View file @
15ed58d5
...
@@ -51,7 +51,7 @@ public:
...
@@ -51,7 +51,7 @@ public:
int32_t
no_action
;
int32_t
no_action
;
int32_t
call_depth
;
int32_t
call_depth
;
explicit
interpreter
(
duel
*
pd
);
explicit
interpreter
(
duel
*
pd
,
bool
enable_unsafe_libraries
);
~
interpreter
();
~
interpreter
();
void
register_card
(
card
*
pcard
);
void
register_card
(
card
*
pcard
);
...
...
Classes/ocgcore/libdebug.cpp
View file @
15ed58d5
...
@@ -176,10 +176,12 @@ int32_t scriptlib::debug_set_ai_name(lua_State *L) {
...
@@ -176,10 +176,12 @@ int32_t scriptlib::debug_set_ai_name(lua_State *L) {
}
}
int32_t
scriptlib
::
debug_show_hint
(
lua_State
*
L
)
{
int32_t
scriptlib
::
debug_show_hint
(
lua_State
*
L
)
{
check_param_count
(
L
,
1
);
check_param_count
(
L
,
1
);
check_param
(
L
,
PARAM_TYPE_STRING
,
1
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
duel
*
pduel
=
interpreter
::
get_duel_info
(
L
);
lua_getglobal
(
L
,
"tostring"
);
lua_pushvalue
(
L
,
-
2
);
lua_pcall
(
L
,
1
,
1
,
0
);
pduel
->
write_buffer8
(
MSG_SHOW_HINT
);
pduel
->
write_buffer8
(
MSG_SHOW_HINT
);
const
char
*
pstr
=
lua_tostring
(
L
,
1
);
const
char
*
pstr
=
lua_tostring
(
L
,
-
1
);
int
len
=
(
int
)
std
::
strlen
(
pstr
);
int
len
=
(
int
)
std
::
strlen
(
pstr
);
if
(
len
>
SIZE_HINT_MSG
-
1
)
if
(
len
>
SIZE_HINT_MSG
-
1
)
len
=
SIZE_HINT_MSG
-
1
;
len
=
SIZE_HINT_MSG
-
1
;
...
...
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