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
7b2ca892
Commit
7b2ca892
authored
Jun 05, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* Working automap
parent
1eeb18de
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
96 additions
and
5 deletions
+96
-5
GLDraw.c
macsrc/GLDraw.c
+94
-3
TODO
macsrc/TODO
+2
-2
No files found.
macsrc/GLDraw.c
View file @
7b2ca892
...
...
@@ -72,22 +72,104 @@ GLuint smltex[65];
void
MakeSmallFont
()
{
Byte
*
buf
;
Byte
*
buf
,
*
buf2
,
*
pal
,
*
ArtStart
;
Byte
*
ptr
;
int
i
,
w
,
h
,
j
;
buf
=
(
Byte
*
)
malloc
(
16
*
16
);
pal
=
LoadAResource
(
rGamePal
);
for
(
i
=
0
;
i
<
64
;
i
++
)
{
ArtStart
=
ArtData
[
i
];
if
(
ArtStart
==
NULL
)
{
if
(
smltex
[
i
])
{
glDeleteTextures
(
1
,
&
smltex
[
i
]);
smltex
[
i
]
=
0
;
}
continue
;
}
else
{
if
(
smltex
[
i
])
continue
;
glGenTextures
(
1
,
&
smltex
[
i
]);
h
=
0
;
ptr
=
buf
;
do
{
w
=
16
;
j
=
h
*
8
;
do
{
*
ptr
=
ArtStart
[
j
];
ptr
++
;
j
+=
(
WALLHEIGHT
*
8
);
}
while
(
--
w
);
}
while
((
++
h
)
<
16
);
buf2
=
Pal256toRGB
(
buf
,
16
*
16
,
pal
);
glBindTexture
(
GL_TEXTURE_2D
,
smltex
[
i
]);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
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_MODULATE
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
16
,
16
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
buf2
);
free
(
buf2
);
}
}
free
(
buf
);
buf
=
LoadAResource
(
MyBJFace
);
buf2
=
Pal256toRGB
(
buf
,
16
*
16
,
pal
);
glGenTextures
(
1
,
&
smltex
[
i
]);
glBindTexture
(
GL_TEXTURE_2D
,
smltex
[
i
]);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MIN_FILTER
,
GL_NEAREST
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_MAG_FILTER
,
GL_NEAREST
);
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_MODULATE
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
16
,
16
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
buf2
);
free
(
buf2
);
ReleaseAResource
(
MyBJFace
);
ReleaseAResource
(
rGamePal
);
}
void
KillSmallFont
()
{
int
i
;
glDeleteTextures
(
65
,
smltex
);
for
(
i
=
0
;
i
<
65
;
i
++
)
smltex
[
i
]
=
0
;
}
void
DrawSmall
(
Word
x
,
Word
y
,
Word
tile
)
void
DrawSmall
(
Word
x
,
Word
y
,
Word
tile
)
{
GLfloat
w
,
h
;
GLfloat
xx
,
yy
;
GLfloat
x1
,
y1
,
x2
,
y2
;
w
=
(
int
)(
VidWidth
>>
4
);
h
=
(
int
)(
VidHeight
>>
4
);
xx
=
x
;
yy
=
y
;
x1
=
((
xx
*
2
.
0
f
)
-
w
)
+
1
.
0
;
x2
=
x1
-
2
.
0
;
y1
=
-
((
yy
*
2
.
0
f
)
-
h
)
+
1
.
0
;
y2
=
y1
-
2
.
0
;
x1
/=
w
;
x2
/=
w
;
y1
/=
h
;
y2
/=
h
;
glMatrixMode
(
GL_PROJECTION
);
glPushMatrix
();
glLoadIdentity
();
...
...
@@ -95,6 +177,15 @@ void DrawSmall(Word x,Word y,Word tile)
glPushMatrix
();
glLoadIdentity
();
glBindTexture
(
GL_TEXTURE_2D
,
smltex
[
tile
]);
glBegin
(
GL_QUADS
);
glTexCoord2f
(
0
.
0
,
1
.
0
);
glVertex2f
(
x2
,
y2
);
glTexCoord2f
(
0
.
0
,
0
.
0
);
glVertex2f
(
x2
,
y1
);
glTexCoord2f
(
1
.
0
,
0
.
0
);
glVertex2f
(
x1
,
y1
);
glTexCoord2f
(
1
.
0
,
1
.
0
);
glVertex2f
(
x1
,
y2
);
glEnd
();
glPopMatrix
();
glMatrixMode
(
GL_PROJECTION
);
glPopMatrix
();
...
...
macsrc/TODO
View file @
7b2ca892
...
...
@@ -15,7 +15,7 @@ TODO:
- Check if top sprite drawing is correct
- Status bars
- Draw(XM)Shape
-
Automap
-
Correct viewing frustum
* Save/Load Games
* Documentation
* Sound!
...
...
@@ -39,7 +39,7 @@ IDEAS:
- XXX: Save Game to Previously used File
- XXX: Options
* How about adding red/white shifts (from PC wolf3d)? So screen changes
color when you are hit or pick up items.
color when you are hit or pick up items.
* when saving/loading games, run them through htons/etc.
MISC:
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