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
cdea31c5
Commit
cdea31c5
authored
Mar 29, 2001
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed brain-dead file reading in res.c
parent
c6be39fe
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
34 deletions
+63
-34
GLDraw.c
macsrc/GLDraw.c
+14
-13
README
macsrc/README
+1
-1
TODO
macsrc/TODO
+1
-3
res.c
macsrc/res.c
+46
-16
vi_glx.c
macsrc/vi_glx.c
+1
-1
No files found.
macsrc/GLDraw.c
View file @
cdea31c5
...
...
@@ -745,13 +745,13 @@ void InitRenderView()
glBindTexture
(
GL_TEXTURE_2D
,
waltex
[
i
]);
buf
=
FlipWall
(
ArtData
[
i
],
128
,
128
);
/*
#ifdef USE_NEAREST
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
*/
#else
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
#endif
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_REPEAT
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_REPEAT
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
...
...
@@ -786,13 +786,13 @@ void InitRenderView()
}
glBindTexture
(
GL_TEXTURE_2D
,
sprtex
[
i
]);
/*
#ifdef USE_NEAREST
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
*/
#else
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
#endif
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_REPEAT
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_REPEAT
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
...
...
@@ -832,13 +832,13 @@ void InitRenderView()
glBindTexture
(
GL_TEXTURE_2D
,
weptex
[
i
]);
/*
#ifdef USE_NEAREST
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
*/
#else
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_LINEAR
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_LINEAR
);
#endif
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_S
,
GL_REPEAT
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_REPEAT
);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
...
...
@@ -1321,8 +1321,8 @@ void P_DrawSeg(saveseg_t *seg)
Word
segplane
;
Word
door
;
door_t
*
door_p
;
unsigned
short
span
,
tspan
;
unsigned
short
angle1
=
0
,
angle2
=
0
;
unsigned
short
int
span
,
tspan
;
unsigned
short
int
angle1
=
0
,
angle2
=
0
;
WallSeen
=
0
;
...
...
@@ -1386,9 +1386,10 @@ void P_DrawSeg(saveseg_t *seg)
/* clip to view edges*/
span
=
(
angle1
-
angle2
);
if
(
span
>=
0x8000
)
{
/* Test for negative (32 bit clean) */
if
(
span
>=
0x8000
)
{
return
;
}
angle1
-=
centershort
;
angle2
-=
centershort
;
++
angle2
;
/* make angle 2 non inclusive*/
...
...
macsrc/README
View file @
cdea31c5
...
...
@@ -14,7 +14,7 @@ thought "Why not?" So here it is. My goal is to implement everything the
Macintosh version had, and then somehow improve on that.
To use this, you need the resource fork from the First Encounter (the three
level shareware version) or the Second Encounter (the
for-sel
l version).
level shareware version) or the Second Encounter (the
retai
l version).
You can find the First Encounter on many web sites (Search for: Macintosh
Wolfenstein 3D download) and you can get the Second Encounter on eBay (I
believe it is no longer sold by Interplay, but I got my unopened copy from
...
...
macsrc/TODO
View file @
cdea31c5
...
...
@@ -43,6 +43,7 @@ TODO:
- Would like to have a "lower level" X Toolkit, to provide menus and
dialog boxes, and various widgets, but I rather not be "forced" into
losing the ability to call Xlib functions directly.
- Make them like PC Wolf3D.
* Different depths/visuals for software clients.
+ Different functions to draw with different bpps.
- 15 bpp uses same draw routes as 16 but different set palette
...
...
@@ -50,8 +51,6 @@ TODO:
- don't support them generally
- MacPlay->Id Logo: have some sort of redraw.
- Fades in game can just call renderview each time
* Get it to compile/work with g++ if it is not too much trouble.
- Have to rename class..
* SDL version (software)
* Mouse
* Psyched bar
...
...
@@ -59,7 +58,6 @@ TODO:
* vi_glx.c will probably be the most updated of the frontends. Be sure to
update the others later.
* Finish moving things out of stub.c
* Name conflicts between wolf3d and Xt types
BUGS:
* Software Drawing seems like its imprecise, stationary sprites move back and
...
...
macsrc/res.c
View file @
cdea31c5
...
...
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "wolfdef.h"
...
...
@@ -37,6 +38,33 @@ typedef struct ResItem_t
ResItem
*
lr
;
static
int32_t
Read32M
(
FILE
*
fp
)
{
unsigned
char
d
[
4
];
fread
(
d
,
1
,
4
,
fp
);
return
(
d
[
0
]
<<
24
)
|
(
d
[
1
]
<<
16
)
|
(
d
[
2
]
<<
8
)
|
(
d
[
3
]
<<
0
);
}
static
int32_t
Read24M
(
FILE
*
fp
)
{
unsigned
char
d
[
3
];
fread
(
d
,
1
,
3
,
fp
);
return
(
d
[
0
]
<<
16
)
|
(
d
[
1
]
<<
8
)
|
(
d
[
2
]
<<
0
);
}
static
int16_t
Read16M
(
FILE
*
fp
)
{
unsigned
char
d
[
2
];
fread
(
d
,
1
,
2
,
fp
);
return
(
d
[
0
]
<<
8
)
|
(
d
[
1
]
<<
0
);
}
int
InitResources
(
char
*
name
)
{
FILE
*
fp
;
...
...
@@ -51,26 +79,26 @@ int InitResources(char *name)
if
(
fp
==
NULL
)
return
-
1
;
resfork
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
resmap
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
forklen
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
maplen
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
resfork
=
Read32M
(
fp
);
resmap
=
Read32M
(
fp
);
forklen
=
Read32M
(
fp
);
maplen
=
Read32M
(
fp
);
fseek
(
fp
,
resmap
,
SEEK_SET
);
fseek
(
fp
,
24
,
SEEK_CUR
);
/* Skip over reserved */
typelist
=
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
namelist
=
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
typecount
=
((
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
)
)
+
1
;
typelist
=
Read16M
(
fp
);
namelist
=
Read16M
(
fp
);
typecount
=
Read16M
(
fp
)
+
1
;
for
(
i
=
0
;
i
<
typecount
;
i
++
)
{
int
type
;
int
off
,
bak
,
bak2
,
data
,
count
,
x
;
type
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
type
=
Read32M
(
fp
);
count
=
((
fgetc
(
fp
)
<<
8
)
|
fgetc
(
fp
)
)
+
1
;
off
=
(
fgetc
(
fp
)
<<
8
)
|
fgetc
(
fp
);
count
=
Read16M
(
fp
)
+
1
;
off
=
Read16M
(
fp
);
bak
=
ftell
(
fp
);
...
...
@@ -78,16 +106,18 @@ int InitResources(char *name)
for
(
x
=
0
;
x
<
count
;
x
++
)
{
int
id
;
id
=
(
fgetc
(
fp
)
<<
8
)
|
fgetc
(
fp
);
off
=
(
fgetc
(
fp
)
<<
8
)
|
fgetc
(
fp
);
fgetc
(
fp
);
data
=
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
id
=
Read16M
(
fp
);
off
=
Read16M
(
fp
);
fgetc
(
fp
);
/* not needed */
data
=
Read24M
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
fgetc
(
fp
);
/* not needed */
bak2
=
ftell
(
fp
);
fseek
(
fp
,
resfork
+
data
,
SEEK_SET
);
datalen
=
(
fgetc
(
fp
)
<<
24
)
|
(
fgetc
(
fp
)
<<
16
)
|
(
fgetc
(
fp
)
<<
8
)
|
(
fgetc
(
fp
)
<<
0
);
datalen
=
Read32M
(
fp
);
t
=
(
ResItem
*
)
malloc
(
sizeof
(
ResItem
));
...
...
macsrc/vi_glx.c
View file @
cdea31c5
...
...
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
if
(
CheckToken
(
ext
,
"GL_EXT_shared_texture_palette"
))
{
pglColorTableEXT
=
glXGetProcAddressARB
((
unsigned
const
char
*
)
"glColorTableEXT"
);
if
(
pglColorTableEXT
)
{
UseSharedTexturePalette
=
1
;
UseSharedTexturePalette
=
0
;
printf
(
"GL_EXT_shared_texture_palette found...
\n
"
);
}
}
...
...
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