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
93464602
Commit
93464602
authored
May 02, 2000
by
Steven Fuller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor cleanups.. Unsuccessful attempts to get vi_ogl to do more
parent
1b487c9d
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
106 additions
and
13 deletions
+106
-13
TODO
src/TODO
+1
-0
id_heads.h
src/id_heads.h
+2
-1
id_vh.h
src/id_vh.h
+0
-1
version.h
src/version.h
+1
-1
vi_glx.c
src/vi_glx.c
+6
-1
vi_ogl.c
src/vi_ogl.c
+94
-3
wl_def.h
src/wl_def.h
+2
-0
wl_draw.c
src/wl_draw.c
+0
-2
wl_game.c
src/wl_game.c
+0
-2
wl_scale.c
src/wl_scale.c
+0
-2
No files found.
src/TODO
View file @
93464602
...
...
@@ -75,6 +75,7 @@ screen update
* GL_shared_texture_palette for opengl
* if window looses focus, should it clear the keys ?
* add DGA, clean up vi_xlib.c, fix vid mode changing
* fix broken opengl
Specific:
* memory/sound intro screen goes
...
...
src/id_heads.h
View file @
93464602
...
...
@@ -75,7 +75,8 @@ typedef struct {
#include "id_vh.h"
#include "id_us.h"
extern
byte
introscn
[];
extern
const
byte
introscn
[];
extern
const
byte
gamepal
[];
int
MS_CheckParm
(
char
*
string
);
int
WolfMain
(
int
argc
,
char
*
argv
[]);
...
...
src/id_vh.h
View file @
93464602
...
...
@@ -31,7 +31,6 @@ void VW_UpdateScreen (void);
void
VWB_DrawTile8
(
int
x
,
int
y
,
int
tile
);
void
VWB_DrawPic
(
int
x
,
int
y
,
int
chunknum
);
extern
byte
gamepal
[];
extern
boolean
screenfaded
;
#define VW_Startup VL_Startup
...
...
src/version.h
View file @
93464602
...
...
@@ -6,7 +6,7 @@
/* SDM = 2 */
/* SOD = 3 */
#ifndef WMODE
#define WMODE
0
#define WMODE
1
#endif
#if WMODE == 0
...
...
src/vi_glx.c
View file @
93464602
...
...
@@ -30,7 +30,7 @@ int attrib[] = {
GLX_GREEN_SIZE
,
5
,
GLX_BLUE_SIZE
,
5
,
GLX_DEPTH_SIZE
,
16
,
GLX_DOUBLEBUFFER
,
//
GLX_DOUBLEBUFFER,
None
};
...
...
@@ -154,6 +154,8 @@ void VL_WaitVBL(int vbls)
void
VW_UpdateScreen
()
{
// glXSwapBuffers(dpy, win);
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
/*
...
...
@@ -173,8 +175,11 @@ void VL_Startup()
XMapWindow
(
dpy
,
win
);
glColor4f
(
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
);
glClearColor
(
0
.
0
f
,
0
.
0
f
,
0
.
0
f
,
0
.
0
f
);
glEnable
(
GL_TEXTURE_2D
);
glMatrixMode
(
GL_PROJECTION
);
glLoadIdentity
();
glMatrixMode
(
GL_MODELVIEW
);
...
...
src/vi_ogl.c
View file @
93464602
...
...
@@ -6,7 +6,57 @@
byte
*
SprToLin
(
byte
*
source
)
{
return
source
;
byte
*
buf
=
malloc
(
64
*
64
);
t_compshape
*
ptr
=
(
t_compshape
*
)
source
;
memset
(
buf
,
'\0'
,
64
*
64
);
{
int
srcx
=
32
;
int
slinex
=
31
;
int
stopx
=
ptr
->
leftpix
;
word
*
cmdptr
=
&
ptr
->
dataofs
[
31
-
stopx
];
while
(
--
srcx
>=
stopx
)
{
short
*
linecmds
=
(
short
*
)((
unsigned
char
*
)
ptr
+
*
cmdptr
--
);
slinex
--
;
while
(
linecmds
[
0
])
{
int
y
;
int
y0
=
linecmds
[
2
]
/
2
;
int
y1
=
linecmds
[
0
]
/
2
-
1
;
unsigned
char
*
pixels
=
(
unsigned
char
*
)
ptr
+
y0
+
linecmds
[
1
];
for
(
y
=
y0
;
y
<=
y1
;
y
++
)
{
unsigned
char
color
=
*
pixels
++
;
*
(
buf
+
slinex
+
(
y
*
64
))
=
color
;
}
linecmds
+=
3
;
}
}
slinex
=
31
;
stopx
=
ptr
->
rightpix
;
if
(
ptr
->
leftpix
<
31
)
{
srcx
=
31
;
cmdptr
=
&
ptr
->
dataofs
[
32
-
ptr
->
leftpix
];
}
else
{
srcx
=
ptr
->
leftpix
-
1
;
cmdptr
=
&
ptr
->
dataofs
[
0
];
}
while
(
++
srcx
<=
stopx
)
{
short
*
linecmds
=
(
short
*
)((
unsigned
char
*
)
ptr
+
*
cmdptr
++
);
while
(
linecmds
[
0
])
{
int
y
;
int
y0
=
linecmds
[
2
]
/
2
;
int
y1
=
linecmds
[
0
]
/
2
-
1
;
unsigned
char
*
pixels
=
(
unsigned
char
*
)
ptr
+
y0
+
linecmds
[
1
];
for
(
y
=
y0
;
y
<=
y1
;
y
++
)
{
unsigned
char
color
=
*
pixels
++
;
*
(
buf
+
slinex
+
(
y
*
64
))
=
color
;
}
linecmds
+=
3
;
}
slinex
++
;
}
}
return
buf
;
}
byte
*
Pal_256_RGB
(
byte
*
source
)
...
...
@@ -58,13 +108,23 @@ void Init3D()
glGenTextures
(
walcount
,
waltex
);
glGenTextures
(
sprcount
,
sprtex
);
for
(
i
=
0
;
i
<
walcount
;
i
++
)
{
for
(
i
=
0
;
i
<
2
/*walcount*/
;
i
++
)
{
glBindTexture
(
GL_TEXTURE_2D
,
waltex
[
i
]);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
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_CLAMP
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGB
,
64
,
64
,
0
,
GL_RGB
,
GL_UNSIGNED_BYTE
,
Pal_256_RGB
(
PM_GetPage
(
i
)));
}
for
(
i
=
0
;
i
<
sprcount
;
i
++
)
{
for
(
i
=
0
;
i
<
2
/*sprcount*/
;
i
++
)
{
glBindTexture
(
GL_TEXTURE_2D
,
sprtex
[
i
]);
glTexEnvf
(
GL_TEXTURE_ENV
,
GL_TEXTURE_ENV_MODE
,
GL_REPLACE
);
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_CLAMP
);
glTexParameterf
(
GL_TEXTURE_2D
,
GL_TEXTURE_WRAP_T
,
GL_CLAMP
);
glTexImage2D
(
GL_TEXTURE_2D
,
0
,
GL_RGBA
,
64
,
64
,
0
,
GL_RGBA
,
GL_UNSIGNED_BYTE
,
Pal_256_RGBA
(
SprToLin
(
PM_GetSpritePage
(
i
))));
}
...
...
@@ -75,13 +135,44 @@ void SetupScaling(int maxheight)
{
}
int
weaponscale
[
NUMWEAPONS
]
=
{
SPR_KNIFEREADY
,
SPR_PISTOLREADY
,
SPR_MACHINEGUNREADY
,
SPR_CHAINREADY
};
void
DrawPlayerWeapon
()
{
int
shapenum
;
if
(
gamestate
.
weapon
!=
-
1
)
{
shapenum
=
weaponscale
[
gamestate
.
weapon
]
+
gamestate
.
weaponframe
;
glBindTexture
(
GL_TEXTURE_2D
,
waltex
[
0
]);
glBegin
(
GL_QUADS
);
glTexCoord2d
(
0
.
0
,
1
.
0
);
glVertex2d
(
-
1
.
0
,
-
1
.
0
);
glTexCoord2d
(
1
.
0
,
1
.
0
);
glVertex2d
(
+
1
.
0
,
-
1
.
0
);
glTexCoord2d
(
1
.
0
,
0
.
0
);
glVertex2d
(
+
1
.
0
,
+
1
.
0
);
glTexCoord2d
(
0
.
0
,
0
.
0
);
glVertex2d
(
-
1
.
0
,
+
1
.
0
);
glEnd
();
}
}
void
ThreeDRefresh
()
{
int
error
;
glViewport
(
xoffset
,
yoffset
+
viewheight
,
viewwidth
,
viewheight
);
DrawPlayerWeapon
();
VW_UpdateScreen
();
error
=
glGetError
();
if
(
error
!=
GL_NO_ERROR
)
{
do
{
fprintf
(
stderr
,
"GL Error: %d
\n
"
,
error
);
error
=
glGetError
();
}
while
(
error
!=
GL_NO_ERROR
);
exit
(
EXIT_FAILURE
);
}
frameon
++
;
}
src/wl_def.h
View file @
93464602
...
...
@@ -705,6 +705,8 @@ extern int dirangle[9];
extern
boolean
startgame
,
loadedgame
;
extern
int
mouseadjustment
;
extern
unsigned
xoffset
,
yoffset
;
//
// math tables
//
...
...
src/wl_draw.c
View file @
93464602
...
...
@@ -39,8 +39,6 @@ int xtilestep,ytilestep;
long
xintercept
,
yintercept
;
long
xstep
,
ystep
;
extern
unsigned
xoffset
,
yoffset
;
void
AsmRefresh
(
void
);
void
xBuildCompScale
(
int
height
,
byte
*
source
,
int
x
);
...
...
src/wl_game.c
View file @
93464602
...
...
@@ -10,8 +10,6 @@
=============================================================================
*/
extern
unsigned
xoffset
,
yoffset
;
boolean
ingame
,
fizzlein
;
gametype
gamestate
;
...
...
src/wl_scale.c
View file @
93464602
...
...
@@ -4,8 +4,6 @@
/* Originally from David Haslam -- dch@sirius.demon.co.uk */
extern
unsigned
xoffset
,
yoffset
;
/*
=============================================================================
...
...
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