Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
James Hale
SRB2
Commits
2ec4f202
Commit
2ec4f202
authored
6 years ago
by
Monster Iestyn
Browse files
Options
Downloads
Patches
Plain Diff
Added support for pslope_t userdata variables in Lua archive/unarchive code
parent
9296aaa2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lua_script.c
+27
-0
27 additions, 0 deletions
src/lua_script.c
with
27 additions
and
0 deletions
src/lua_script.c
+
27
−
0
View file @
2ec4f202
...
@@ -22,6 +22,9 @@
...
@@ -22,6 +22,9 @@
#include
"byteptr.h"
#include
"byteptr.h"
#include
"p_saveg.h"
#include
"p_saveg.h"
#include
"p_local.h"
#include
"p_local.h"
#ifdef ESLOPE
#include
"p_slopes.h"
// for P_SlopeById
#endif
#ifdef LUA_ALLOW_BYTECODE
#ifdef LUA_ALLOW_BYTECODE
#include
"d_netfil.h"
// for LUA_DumpFile
#include
"d_netfil.h"
// for LUA_DumpFile
#endif
#endif
...
@@ -457,6 +460,9 @@ enum
...
@@ -457,6 +460,9 @@ enum
ARCH_SIDE
,
ARCH_SIDE
,
ARCH_SUBSECTOR
,
ARCH_SUBSECTOR
,
ARCH_SECTOR
,
ARCH_SECTOR
,
#ifdef ESLOPE
ARCH_SLOPE
,
#endif
ARCH_MAPHEADER
,
ARCH_MAPHEADER
,
ARCH_TEND
=
0xFF
,
ARCH_TEND
=
0xFF
,
...
@@ -476,6 +482,9 @@ static const struct {
...
@@ -476,6 +482,9 @@ static const struct {
{
META_SIDE
,
ARCH_SIDE
},
{
META_SIDE
,
ARCH_SIDE
},
{
META_SUBSECTOR
,
ARCH_SUBSECTOR
},
{
META_SUBSECTOR
,
ARCH_SUBSECTOR
},
{
META_SECTOR
,
ARCH_SECTOR
},
{
META_SECTOR
,
ARCH_SECTOR
},
#ifdef ESLOPE
{
META_SLOPE
,
ARCH_SLOPE
},
#endif
{
META_MAPHEADER
,
ARCH_MAPHEADER
},
{
META_MAPHEADER
,
ARCH_MAPHEADER
},
{
NULL
,
ARCH_NULL
}
{
NULL
,
ARCH_NULL
}
};
};
...
@@ -680,6 +689,19 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
...
@@ -680,6 +689,19 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
}
}
break
;
break
;
}
}
#ifdef ESLOPE
case
ARCH_SLOPE
:
{
pslope_t
*
slope
=
*
((
pslope_t
**
)
lua_touserdata
(
gL
,
myindex
));
if
(
!
slope
)
WRITEUINT8
(
save_p
,
ARCH_NULL
);
else
{
WRITEUINT8
(
save_p
,
ARCH_SLOPE
);
WRITEUINT16
(
save_p
,
slope
->
id
);
}
break
;
}
#endif
case
ARCH_MAPHEADER
:
case
ARCH_MAPHEADER
:
{
{
mapheader_t
*
header
=
*
((
mapheader_t
**
)
lua_touserdata
(
gL
,
myindex
));
mapheader_t
*
header
=
*
((
mapheader_t
**
)
lua_touserdata
(
gL
,
myindex
));
...
@@ -884,6 +906,11 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
...
@@ -884,6 +906,11 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
case
ARCH_SECTOR
:
case
ARCH_SECTOR
:
LUA_PushUserdata
(
gL
,
&
sectors
[
READUINT16
(
save_p
)],
META_SECTOR
);
LUA_PushUserdata
(
gL
,
&
sectors
[
READUINT16
(
save_p
)],
META_SECTOR
);
break
;
break
;
#ifdef ESLOPE
case
ARCH_SLOPE
:
LUA_PushUserdata
(
gL
,
P_SlopeById
(
READUINT16
(
save_p
)),
META_SLOPE
);
break
;
#endif
case
ARCH_MAPHEADER
:
case
ARCH_MAPHEADER
:
LUA_PushUserdata
(
gL
,
&
sectors
[
READUINT16
(
save_p
)],
META_MAPHEADER
);
LUA_PushUserdata
(
gL
,
&
sectors
[
READUINT16
(
save_p
)],
META_MAPHEADER
);
break
;
break
;
...
...
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