Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
3e8fb8db
Commit
3e8fb8db
authored
5 years ago
by
LJ Sonic
Browse files
Options
Downloads
Patches
Plain Diff
Optimise boolean archiving
parent
2e3c1105
No related branches found
No related tags found
2 merge requests
!985
Shaders next merge
,
!904
Optimise net-archiving of Lua strings, numbers and booleans
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua_script.c
+9
-5
9 additions, 5 deletions
src/lua_script.c
with
9 additions
and
5 deletions
src/lua_script.c
+
9
−
5
View file @
3e8fb8db
...
@@ -730,7 +730,8 @@ void LUA_InvalidatePlayer(player_t *player)
...
@@ -730,7 +730,8 @@ void LUA_InvalidatePlayer(player_t *player)
enum
enum
{
{
ARCH_NULL
=
0
,
ARCH_NULL
=
0
,
ARCH_BOOLEAN
,
ARCH_TRUE
,
ARCH_FALSE
,
ARCH_SIGNED
,
ARCH_SIGNED
,
ARCH_SMALLSTRING
,
ARCH_SMALLSTRING
,
ARCH_LARGESTRING
,
ARCH_LARGESTRING
,
...
@@ -818,8 +819,7 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
...
@@ -818,8 +819,7 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
WRITEUINT8
(
save_p
,
ARCH_NULL
);
WRITEUINT8
(
save_p
,
ARCH_NULL
);
return
2
;
return
2
;
case
LUA_TBOOLEAN
:
case
LUA_TBOOLEAN
:
WRITEUINT8
(
save_p
,
ARCH_BOOLEAN
);
WRITEUINT8
(
save_p
,
lua_toboolean
(
gL
,
myindex
)
?
ARCH_TRUE
:
ARCH_FALSE
);
WRITEUINT8
(
save_p
,
lua_toboolean
(
gL
,
myindex
));
break
;
break
;
case
LUA_TNUMBER
:
case
LUA_TNUMBER
:
{
{
...
@@ -1187,8 +1187,12 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
...
@@ -1187,8 +1187,12 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
case
ARCH_NULL
:
case
ARCH_NULL
:
lua_pushnil
(
gL
);
lua_pushnil
(
gL
);
break
;
break
;
case
ARCH_BOOLEAN
:
case
ARCH_TRUE
:
lua_pushboolean
(
gL
,
READUINT8
(
save_p
));
lua_pushboolean
(
gL
,
true
);
break
;
case
ARCH_FALSE
:
lua_pushboolean
(
gL
,
false
);
break
;
break
;
break
;
case
ARCH_SIGNED
:
case
ARCH_SIGNED
:
lua_pushinteger
(
gL
,
READFIXED
(
save_p
));
lua_pushinteger
(
gL
,
READFIXED
(
save_p
));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment