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
nanahira
ygopro
Commits
daf09692
Commit
daf09692
authored
Jul 11, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set script reader for single mode
parent
e363219c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
1 deletion
+28
-1
gframe/single_mode.cpp
gframe/single_mode.cpp
+26
-0
gframe/single_mode.h
gframe/single_mode.h
+1
-0
ocgcore
ocgcore
+1
-1
No files found.
gframe/single_mode.cpp
View file @
daf09692
...
...
@@ -11,6 +11,8 @@ long SingleMode::pduel = 0;
bool
SingleMode
::
is_closing
=
false
;
bool
SingleMode
::
is_continuing
=
false
;
byte
buffer
[
0x10000
];
bool
SingleMode
::
StartPlay
()
{
Thread
::
NewThread
(
SinglePlayThread
,
0
);
return
true
;
...
...
@@ -35,6 +37,7 @@ int SingleMode::SinglePlayThread(void* param) {
mtrandom
rnd
;
time_t
seed
=
time
(
0
);
rnd
.
reset
(
seed
);
set_script_reader
((
script_reader
)
ScriptReader
);
set_card_reader
((
card_reader
)
DataManager
::
CardReader
);
set_message_handler
((
message_handler
)
MessageHandler
);
pduel
=
create_duel
(
rnd
.
rand
());
...
...
@@ -781,6 +784,29 @@ void SingleMode::SinglePlayReload() {
/*len = */
query_field_card
(
pduel
,
1
,
LOCATION_REMOVED
,
flag
,
queryBuffer
,
0
);
mainGame
->
dField
.
UpdateFieldCard
(
mainGame
->
LocalPlayer
(
1
),
LOCATION_REMOVED
,
(
char
*
)
queryBuffer
);
}
byte
*
SingleMode
::
ScriptReader
(
const
char
*
script_name
,
int
*
slen
)
{
FILE
*
fp
;
#ifdef _WIN32
wchar_t
fname
[
256
];
BufferIO
::
DecodeUTF8
(
script_name
,
fname
);
fp
=
_wfopen
(
fname
,
L"rb"
);
#else
fp
=
fopen
(
script_name
,
"rb"
);
#endif
if
(
!
fp
)
return
0
;
fseek
(
fp
,
0
,
SEEK_END
);
unsigned
int
len
=
ftell
(
fp
);
if
(
len
>
0x10000
)
{
fclose
(
fp
);
return
0
;
}
fseek
(
fp
,
0
,
SEEK_SET
);
fread
(
buffer
,
len
,
1
,
fp
);
fclose
(
fp
);
*
slen
=
len
;
return
buffer
;
}
int
SingleMode
::
MessageHandler
(
long
fduel
,
int
type
)
{
if
(
!
enable_log
)
return
0
;
...
...
gframe/single_mode.h
View file @
daf09692
...
...
@@ -29,6 +29,7 @@ public:
static
void
SinglePlayRefreshSingle
(
int
player
,
int
location
,
int
sequence
,
int
flag
=
0x781fff
);
static
void
SinglePlayReload
();
static
byte
*
ScriptReader
(
const
char
*
script_name
,
int
*
slen
);
static
int
MessageHandler
(
long
fduel
,
int
type
);
};
...
...
ocgcore
@
4ba2a90f
Subproject commit
dd955dbac2836581307777463d8fcc6f054b4384
Subproject commit
4ba2a90ffa737d7975437079113c22ae6968fcf5
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