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
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
Commits
0c777eb1
Commit
0c777eb1
authored
Dec 19, 2024
by
Chen Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use array index
parent
d859ab3c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
gframe/replay.cpp
gframe/replay.cpp
+3
-5
gframe/replay.h
gframe/replay.h
+0
-1
No files found.
gframe/replay.cpp
View file @
0c777eb1
...
@@ -28,7 +28,6 @@ void Replay::BeginRecord() {
...
@@ -28,7 +28,6 @@ void Replay::BeginRecord() {
if
(
!
fp
)
if
(
!
fp
)
return
;
return
;
#endif
#endif
pwrite
=
replay_data
;
replay_size
=
0
;
replay_size
=
0
;
comp_size
=
0
;
comp_size
=
0
;
is_replaying
=
false
;
is_replaying
=
false
;
...
@@ -47,10 +46,10 @@ void Replay::WriteHeader(ReplayHeader& header) {
...
@@ -47,10 +46,10 @@ void Replay::WriteHeader(ReplayHeader& header) {
void
Replay
::
WriteData
(
const
void
*
data
,
size_t
length
,
bool
flush
)
{
void
Replay
::
WriteData
(
const
void
*
data
,
size_t
length
,
bool
flush
)
{
if
(
!
is_recording
)
if
(
!
is_recording
)
return
;
return
;
if
(
(
pwrite
-
replay_data
)
+
length
>
MAX_REPLAY_SIZE
)
if
(
replay_size
+
length
>
MAX_REPLAY_SIZE
)
return
;
return
;
std
::
memcpy
(
pwrit
e
,
data
,
length
);
std
::
memcpy
(
replay_data
+
replay_siz
e
,
data
,
length
);
pwrit
e
+=
length
;
replay_siz
e
+=
length
;
#ifdef _WIN32
#ifdef _WIN32
DWORD
size
;
DWORD
size
;
WriteFile
(
recording_fp
,
data
,
length
,
&
size
,
nullptr
);
WriteFile
(
recording_fp
,
data
,
length
,
&
size
,
nullptr
);
...
@@ -79,7 +78,6 @@ void Replay::EndRecord() {
...
@@ -79,7 +78,6 @@ void Replay::EndRecord() {
#else
#else
fclose
(
fp
);
fclose
(
fp
);
#endif
#endif
replay_size
=
pwrite
-
replay_data
;
pheader
.
datasize
=
replay_size
;
pheader
.
datasize
=
replay_size
;
pheader
.
flag
|=
REPLAY_COMPRESSED
;
pheader
.
flag
|=
REPLAY_COMPRESSED
;
size_t
propsize
=
5
;
size_t
propsize
=
5
;
...
...
gframe/replay.h
View file @
0c777eb1
...
@@ -74,7 +74,6 @@ public:
...
@@ -74,7 +74,6 @@ public:
private:
private:
unsigned
char
*
replay_data
;
unsigned
char
*
replay_data
;
size_t
replay_size
{};
size_t
replay_size
{};
unsigned
char
*
pwrite
{};
size_t
data_position
{};
size_t
data_position
{};
bool
is_recording
{};
bool
is_recording
{};
bool
is_replaying
{};
bool
is_replaying
{};
...
...
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