Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wolf3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
wolf3d
Commits
faa76f57
Commit
faa76f57
authored
Dec 29, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wl_draw.c: DeCompileSprite no longer relies on a struct
parent
55f2fbd3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
34 deletions
+30
-34
TODO
src/TODO
+0
-12
wl_draw.c
src/wl_draw.c
+30
-22
No files found.
src/TODO
View file @
faa76f57
...
...
@@ -28,8 +28,6 @@ works alright at some res, but breaks on most others currently
* would be nice if Quit() used vsnprintf, etc
* actor walking through door is drawn in front of door: near end of E1M1 for
example
* SDL version will have all the features for now, xlib will just be a
320x200 window
* getenv so that you can point an env. var to the proper dir
* rewrite hw (sound, input) code, remove stuff like SD_SetSoundMode
* fix config file and savegames
...
...
@@ -42,13 +40,6 @@ code, it really needs to be cleaned up
* rewrite id_ca.c: uniform memory handling system
* clean up header files, especially wl_def.h, where some declarations aren't
in the right place
* every structure that is read/written must be PACKED, with datatypes
specifially set to correct size
* or have PACKED versions of read/write structures, and transfer
to/from just for reading, so only non-packed structures are used during
actual gameplay/etc.
this isn't as much of a big deal since compensating for endianness will
require major changes also
* is that memory intro screen needed anymore? probably not, although it
would be nice to show what version is loaded, but doom just printed text
and the intro screen which came with wolf3d has copyrighted/trademarked images
...
...
@@ -84,7 +75,4 @@ at a time
* systems with no sound should still have working WaitSoundDone.. it's
possible to calculate the sound lengths in terms of 70Hz (adlib sound len / 2,
pcm sound len / 100).
Things to try:
* Create a native palette format instead of doing conversions each frame
------------------------------------------------------------------------------
src/wl_draw.c
View file @
faa76f57
...
...
@@ -755,22 +755,16 @@ static void ScaleLineTrans(unsigned int height, byte *source, int x)
static
unsigned
char
*
spritegfx
[
SPR_TOTAL
];
typedef
struct
{
word
leftpix
,
rightpix
;
word
dataofs
[
64
];
/* table data after dataofs[rightpix-leftpix+1] */
}
PACKED
t_compshape
;
static
void
DeCompileSprite
(
int
shapenum
)
{
t_compshape
*
ptr
;
unsigned
char
*
ptr
;
unsigned
char
*
buf
;
int
srcx
;
unsigned
short
int
*
cmdptr
;
short
int
*
linecmds
;
unsigned
char
*
cmdptr
;
unsigned
char
*
pixels
;
short
int
yoff
;
/* int16_t */
int
y
,
y0
,
y1
;
int
x
,
left
,
right
;
int
cmd
;
MM_GetPtr
((
void
*
)
&
buf
,
64
*
64
);
...
...
@@ -778,23 +772,37 @@ static void DeCompileSprite(int shapenum)
ptr
=
PM_GetSpritePage
(
shapenum
);
cmdptr
=
&
ptr
->
dataofs
[
0
];
for
(
srcx
=
ptr
->
leftpix
;
srcx
<=
ptr
->
rightpix
;
srcx
++
)
{
linecmds
=
(
short
*
)((
unsigned
char
*
)
ptr
+
*
cmdptr
++
);
while
(
linecmds
[
0
])
{
y0
=
linecmds
[
2
]
/
2
;
y1
=
linecmds
[
0
]
/
2
;
pixels
=
(
unsigned
char
*
)
ptr
+
y0
+
linecmds
[
1
];
/* left = ptr[0] | (ptr[1] << 8); */
left
=
ptr
[
0
];
/* right = ptr[2] | (ptr[3] << 8); */
right
=
ptr
[
2
];
cmdptr
=
&
ptr
[
4
];
for
(
x
=
left
;
x
<=
right
;
x
++
)
{
cmd
=
cmdptr
[
0
]
|
(
cmdptr
[
1
]
<<
8
);
cmdptr
+=
2
;
/* while (ptr[cmd+0] | (ptr[cmd+1] << 8)) { */
while
(
ptr
[
cmd
+
0
])
{
/* y1 = (ptr[cmd+0] | (ptr[cmd+1] << 8)) / 2; */
y1
=
ptr
[
cmd
+
0
]
/
2
;
yoff
=
ptr
[
cmd
+
2
]
|
(
ptr
[
cmd
+
3
]
<<
8
);
/* y0 = (ptr[cmd+4] | (ptr[cmd+5] << 8)) / 2; */
y0
=
ptr
[
cmd
+
4
]
/
2
;
pixels
=
&
ptr
[
y0
+
yoff
];
for
(
y
=
y0
;
y
<
y1
;
y
++
)
{
/
/*(buf + slinex + (y*64)) = *pixels;
*
(
buf
+
(
src
x
*
64
)
+
y
)
=
*
pixels
;
/
* *(buf + x + (y*64)) = *pixels; */
*
(
buf
+
(
x
*
64
)
+
y
)
=
*
pixels
;
pixels
++
;
}
linecmds
+=
3
;
cmd
+=
6
;
}
}
spritegfx
[
shapenum
]
=
buf
;
}
...
...
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