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
364f86ca
Commit
364f86ca
authored
Jun 13, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
GL updates
parent
296619ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
10 deletions
+34
-10
GLDraw.c
macsrc/GLDraw.c
+27
-3
TODO
macsrc/TODO
+5
-1
vi_glx.c
macsrc/vi_glx.c
+2
-6
No files found.
macsrc/GLDraw.c
View file @
364f86ca
...
...
@@ -20,6 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <math.h>
#include <GL/gl.h>
...
...
@@ -32,6 +34,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#endif
int
UseSharedTexturePalette
=
0
;
PFNGLCOLORTABLEEXTPROC
pglColorTableEXT
;
Byte
Pal
[
768
];
/*
Utility Functions
...
...
@@ -50,6 +54,23 @@ void xgluPerspective(GLdouble fovx, GLdouble aspect, GLdouble zNear, GLdouble zF
glFrustum
(
xmin
,
xmax
,
ymin
,
ymax
,
zNear
,
zFar
);
}
int
CheckToken
(
const
char
*
str
,
const
char
*
item
)
{
const
char
*
p
;
int
len
=
strlen
(
item
);
p
=
str
;
while
((
p
=
strstr
(
p
,
item
))
!=
NULL
)
{
char
x
=
*
(
p
+
len
);
char
y
=
(
p
==
str
)
?
0
:
*
(
p
-
1
);
if
(
((
y
==
0
)
||
(
isspace
(
y
)))
&&
((
x
==
0
)
||
(
isspace
(
x
)))
)
return
1
;
p
+=
len
;
}
return
0
;
}
/*
Temp Stuff
*/
...
...
@@ -58,8 +79,6 @@ void DisplayScreen(Word res)
{
}
extern
Byte
Pal
[
768
];
void
FadeToPtr
(
unsigned
char
*
PalPtr
)
{
SetPalette
(
PalPtr
);
...
...
@@ -70,6 +89,11 @@ void SetAPalettePtr(unsigned char *PalPtr)
SetPalette
(
PalPtr
);
}
void
SetPalette
(
Byte
*
pal
)
{
memcpy
(
Pal
,
pal
,
768
);
}
void
ClearTheScreen
(
Word
c
)
{
glClearColor
((
double
)
Pal
[
c
*
3
+
0
]
/
255
.
0
,
(
double
)
Pal
[
c
*
3
+
1
]
/
255
.
0
,
(
double
)
Pal
[
c
*
3
+
2
]
/
255
.
0
,
0
.
0
);
...
...
@@ -145,7 +169,7 @@ void IO_DrawStatusBar(void)
void
IO_DisplayViewBuffer
(
void
)
{
BlastScreen
();
if
(
firstframe
)
{
if
(
firstframe
)
{
FadeTo
(
rGamePal
);
firstframe
=
0
;
}
...
...
macsrc/TODO
View file @
364f86ca
...
...
@@ -21,6 +21,7 @@ TODO:
- When all drawing is implemented, remove any unnecessary state/matrix
changes.
- Split up GLDraw.c
- GL_EXT_shared_texture_palette
* Save/Load Games
* Documentation
* Sound!
...
...
@@ -43,7 +44,10 @@ TODO:
* Different depths/visuals for software clients.
+ Different functions to draw with different bpps.
- 15 bpp uses same draw routes as 16 but different palette one
- not sure how to do palette fades
+ not sure how to do palette fades
- 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.
* SDL version (software)
* Mouse
...
...
macsrc/vi_glx.c
View file @
364f86ca
...
...
@@ -40,7 +40,8 @@ XVisualInfo *vi;
GLXContext
ctx
;
Atom
wmDeleteWindow
;
Byte
Pal
[
768
];
extern
int
UseSharedTexturePalette
;
extern
PFNGLCOLORTABLEEXTPROC
pglColorTableEXT
;
int
attrib
[]
=
{
GLX_RGBA
,
...
...
@@ -199,11 +200,6 @@ void Quit(char *str)
exit
(
EXIT_SUCCESS
);
}
void
SetPalette
(
Byte
*
pal
)
{
memcpy
(
Pal
,
pal
,
768
);
}
void
BlastScreen2
(
Rect
*
BlastRect
)
{
BlastScreen
();
...
...
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