Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
vitaquake3
Commits
264125f4
Commit
264125f4
authored
Mar 30, 2018
by
Rinnegatamante
Browse files
Optimized a bit game renderer.
parent
b6d362cf
Changes
5
Show whitespace changes
Inline
Side-by-side
code/psp2/psp2_glimp.c
View file @
264125f4
...
...
@@ -80,6 +80,9 @@ uint16_t* indices;
float
*
gVertexBuffer
;
float
*
gColorBuffer
;
float
*
gTexCoordBuffer
;
float
*
gVertexBufferPtr
;
float
*
gColorBufferPtr
;
float
*
gTexCoordBufferPtr
;
uint8_t
inited
=
0
;
typedef
struct
vidmode_s
...
...
@@ -114,7 +117,7 @@ void GLimp_Init( qboolean coreContext)
glConfig
.
isFullscreen
=
qtrue
;
if
(
!
inited
){
vglInitExtended
(
0x
8
00000
,
glConfig
.
vidWidth
,
glConfig
.
vidHeight
,
0x1000000
);
vglInitExtended
(
0x
1
00000
,
glConfig
.
vidWidth
,
glConfig
.
vidHeight
,
0x1000000
);
vglUseVram
(
GL_TRUE
);
vglMapHeapMem
();
inited
=
1
;
...
...
@@ -130,9 +133,12 @@ void GLimp_Init( qboolean coreContext)
}
vglIndexPointerMapped
(
indices
);
glEnableClientState
(
GL_VERTEX_ARRAY
);
gVertexBuffer
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
VERTEXARRAYSIZE
);
gColorBuffer
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
VERTEXARRAYSIZE
);
gTexCoordBuffer
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
VERTEXARRAYSIZE
);
gVertexBufferPtr
=
(
float
*
)
malloc
(
0x400000
);
gColorBufferPtr
=
(
float
*
)
malloc
(
0x200000
);
gTexCoordBufferPtr
=
(
float
*
)
malloc
(
0x200000
);
gVertexBuffer
=
gVertexBufferPtr
;
gColorBuffer
=
gColorBufferPtr
;
gTexCoordBuffer
=
gTexCoordBufferPtr
;
strncpy
(
glConfig
.
vendor_string
,
glGetString
(
GL_VENDOR
),
sizeof
(
glConfig
.
vendor_string
));
strncpy
(
glConfig
.
renderer_string
,
glGetString
(
GL_RENDERER
),
sizeof
(
glConfig
.
renderer_string
));
...
...
@@ -157,4 +163,7 @@ void GLimp_EndFrame( void )
vglStopRendering
();
vglStartRendering
();
vglIndexPointerMapped
(
indices
);
gVertexBuffer
=
gVertexBufferPtr
;
gColorBuffer
=
gColorBufferPtr
;
gTexCoordBuffer
=
gTexCoordBufferPtr
;
}
code/renderercommon/qgl.h
View file @
264125f4
...
...
@@ -33,6 +33,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
extern
float
*
gVertexBuffer
;
extern
float
*
gColorBuffer
;
extern
float
*
gTexCoordBuffer
;
extern
float
*
gVertexBufferPtr
;
extern
float
*
gColorBufferPtr
;
extern
float
*
gTexCoordBufferPtr
;
extern
uint16_t
*
indices
;
#include "vitaGL.h"
...
...
code/renderergl1/tr_shade.c
View file @
264125f4
...
...
@@ -111,10 +111,10 @@ static void DrawTris (shaderCommands_t *input) {
float
*
vertices
=
gVertexBuffer
;
int
i
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
){
memcpy
(
v
ert
ices
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
memcpy
(
gV
ert
exBuffer
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gVertexBuffer
);
vglVertexPointer
Mapped
(
vertices
);
//->if (qglLockArraysEXT) {
//-> qglLockArraysEXT(0, input->numVertexes);
...
...
@@ -149,13 +149,13 @@ static void DrawNormals (shaderCommands_t *input) {
float
*
vertices
=
gVertexBuffer
;
for
(
i
=
0
;
i
<
input
->
numVertexes
;
i
++
)
{
memcpy
(
v
ert
ices
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
memcpy
(
gV
ert
exBuffer
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
VectorMA
(
input
->
xyz
[
input
->
indexes
[
i
]],
2
,
input
->
normal
[
input
->
indexes
[
i
]],
temp
);
memcpy
(
v
ert
ices
,
temp
,
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
memcpy
(
gV
ert
exBuffer
,
temp
,
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
input
->
numVertexes
*
2
,
gVertexBuffer
);
vglVertexPointer
Mapped
(
vertices
);
vglDrawObjects
(
GL_LINES
,
input
->
numVertexes
*
2
,
GL_TRUE
);
qglDepthRange
(
0
,
1
);
...
...
@@ -221,10 +221,10 @@ static void DrawMultitextured( shaderCommands_t *input, int stage ) {
float
*
texcoord
=
gTexCoordBuffer
;
int
i
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
input
->
svars
.
texcoords
[
0
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
input
->
svars
.
texcoords
[
0
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
}
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gT
ex
C
oord
Buffer
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
R_BindAnimatedImage
(
&
pStage
->
bundle
[
0
]
);
R_DrawElements
(
input
->
numIndexes
,
input
->
indexes
);
...
...
@@ -244,10 +244,10 @@ static void DrawMultitextured( shaderCommands_t *input, int stage ) {
texcoord
=
gTexCoordBuffer
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
input
->
svars
.
texcoords
[
1
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
input
->
svars
.
texcoords
[
1
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
}
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gT
ex
C
oord
Buffer
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
R_BindAnimatedImage
(
&
pStage
->
bundle
[
1
]
);
R_DrawElements
(
input
->
numIndexes
,
input
->
indexes
);
...
...
@@ -406,13 +406,13 @@ static void ProjectDlightTexture_scalar( void ) {
float
*
texcoord
=
gTexCoordBuffer
;
float
*
colorbuf
=
gColorBuffer
;
for
(
i
=
0
;
i
<
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
texCoordsArray
[
hitIndexes
[
i
]],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
c
olor
b
uf
,
colorArray
[
hitIndexes
[
i
]],
sizeof
(
vec4_t
));
c
olor
b
uf
+=
4
;
memcpy
(
gT
ex
C
oord
Buffer
,
texCoordsArray
[
hitIndexes
[
i
]],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
memcpy
(
gC
olor
B
uf
fer
,
colorArray
[
hitIndexes
[
i
]],
sizeof
(
vec4_t
));
gC
olor
B
uf
fer
+=
4
;
}
vglColorPointer
(
4
,
GL_FLOAT
,
0
,
numIndexes
,
gC
olor
B
uf
fer
);
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
numIndexes
,
gTexCoordBuffer
);
vglColorPointer
Mapped
(
GL_FLOAT
,
c
olor
b
uf
);
vglTexCoordPointer
Mapped
(
texcoord
);
GL_Bind
(
tr
.
dlightImage
);
// include GLS_DEPTHFUNC_EQUAL so alpha tested surfaces don't add light
...
...
@@ -466,16 +466,16 @@ static void RB_FogPass( void ) {
float
*
texcoord
=
gTexCoordBuffer
;
float
*
colorbuf
=
gColorBuffer
;
for
(
i
=
0
;
i
<
tess
.
numIndexes
;
i
++
)
{
c
olor
b
uf
[
0
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
0
])
/
255
.
0
f
;
c
olor
b
uf
[
1
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
1
])
/
255
.
0
f
;
c
olor
b
uf
[
2
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
2
])
/
255
.
0
f
;
c
olor
b
uf
[
3
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
3
])
/
255
.
0
f
;
memcpy
(
t
ex
c
oord
,
tess
.
svars
.
texcoords
[
0
][
tess
.
indexes
[
i
]],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
c
olor
b
uf
+=
4
;
gC
olor
B
uf
fer
[
0
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
0
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
1
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
1
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
2
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
2
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
3
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
3
])
/
255
.
0
f
;
memcpy
(
gT
ex
C
oord
Buffer
,
tess
.
svars
.
texcoords
[
0
][
tess
.
indexes
[
i
]],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
gC
olor
B
uf
fer
+=
4
;
}
vglColorPointer
(
4
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gC
olor
B
uf
fer
);
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gTexCoordBuffer
);
vglColorPointer
Mapped
(
GL_FLOAT
,
c
olor
b
uf
);
vglTexCoordPointer
Mapped
(
texcoord
);
R_DrawElements
(
tess
.
numIndexes
,
tess
.
indexes
);
}
...
...
@@ -823,13 +823,13 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
float
*
colorbuf
=
gColorBuffer
;
int
i
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
)
{
c
olor
b
uf
[
0
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
0
])
/
255
.
0
f
;
c
olor
b
uf
[
1
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
1
])
/
255
.
0
f
;
c
olor
b
uf
[
2
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
2
])
/
255
.
0
f
;
c
olor
b
uf
[
3
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
3
])
/
255
.
0
f
;
c
olor
b
uf
+=
4
;
gC
olor
B
uf
fer
[
0
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
0
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
1
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
1
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
2
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
2
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
3
]
=
(
float
)(
input
->
svars
.
colors
[
input
->
indexes
[
i
]][
3
])
/
255
.
0
f
;
gC
olor
B
uf
fer
+=
4
;
}
vglColorPointer
(
4
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gC
olor
B
uf
fer
);
vglColorPointer
Mapped
(
GL_FLOAT
,
c
olor
b
uf
);
//}
//
...
...
@@ -846,10 +846,10 @@ static void RB_IterateStagesGeneric( shaderCommands_t *input )
float
*
texcoord
=
gTexCoordBuffer
;
int
i
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
input
->
svars
.
texcoords
[
0
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
input
->
svars
.
texcoords
[
0
][
input
->
indexes
[
i
]],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
}
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gTexCoordBuffer
);
vglTexCoordPointer
Mapped
(
texcoord
);
//}
//
...
...
@@ -912,10 +912,10 @@ void RB_StageIteratorGeneric( void )
float
*
vertices
=
gVertexBuffer
;
int
i
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
){
memcpy
(
v
ert
ices
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
memcpy
(
gV
ert
exBuffer
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gVertexBuffer
);
vglVertexPointer
Mapped
(
vertices
);
//->if (qglLockArraysEXT)
//->{
...
...
@@ -1004,19 +1004,19 @@ void RB_StageIteratorVertexLitTexture( void )
float
*
vertices
=
gVertexBuffer
;
int
i
;
for
(
i
=
0
;
i
<
tess
.
numIndexes
;
i
++
)
{
c
olor
b
uf
[
0
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
0
])
/
255
.
0
f
;
c
olor
b
uf
[
1
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
1
])
/
255
.
0
f
;
c
olor
b
uf
[
2
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
2
])
/
255
.
0
f
;
c
olor
b
uf
[
3
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
3
])
/
255
.
0
f
;
c
olor
b
uf
+=
4
;
memcpy
(
t
ex
c
oord
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
0
],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
v
ert
ices
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
}
vglColorPointer
(
4
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gC
olor
B
uf
fer
);
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gT
ex
C
oord
Buffer
);
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gVertexBuffer
);
gC
olor
B
uf
fer
[
0
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
0
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
1
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
1
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
2
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
2
])
/
255
.
0
f
;
gC
olor
B
uf
fer
[
3
]
=
(
float
)(
tess
.
svars
.
colors
[
tess
.
indexes
[
i
]][
3
])
/
255
.
0
f
;
gC
olor
B
uf
fer
+=
4
;
memcpy
(
gT
ex
C
oord
Buffer
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
0
],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
memcpy
(
gV
ert
exBuffer
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
}
vglColorPointer
Mapped
(
GL_FLOAT
,
c
olor
b
uf
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
vglVertexPointer
Mapped
(
vertices
);
//->if ( qglLockArraysEXT )
//->{
...
...
@@ -1087,16 +1087,16 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
float
*
vertices
=
gVertexBuffer
;
float
*
colorbuf
=
gColorBuffer
;
for
(
i
=
0
;
i
<
input
->
numIndexes
;
i
++
)
{
memcpy
(
v
ert
ices
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
c
olor
b
uf
[
0
]
=
1
.
0
f
;
c
olor
b
uf
[
1
]
=
1
.
0
f
;
c
olor
b
uf
[
2
]
=
1
.
0
f
;
c
olor
b
uf
[
3
]
=
1
.
0
f
;
c
olor
b
uf
+=
4
;
memcpy
(
gV
ert
exBuffer
,
input
->
xyz
[
input
->
indexes
[
i
]],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
gC
olor
B
uf
fer
[
0
]
=
1
.
0
f
;
gC
olor
B
uf
fer
[
1
]
=
1
.
0
f
;
gC
olor
B
uf
fer
[
2
]
=
1
.
0
f
;
gC
olor
B
uf
fer
[
3
]
=
1
.
0
f
;
gC
olor
B
uf
fer
+=
4
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
input
->
numIndexes
,
gVertexBuffer
);
vglColorPointer
(
4
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gC
olor
B
uf
fer
);
vglVertexPointer
Mapped
(
vertices
);
vglColorPointer
Mapped
(
GL_FLOAT
,
c
olor
b
uf
);
//
// select base stage
...
...
@@ -1108,10 +1108,10 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
float
*
texcoord
=
gTexCoordBuffer
;
for
(
i
=
0
;
i
<
tess
.
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
0
],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
0
],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
}
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gT
ex
C
oord
Buffer
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
R_DrawElements
(
input
->
numIndexes
,
input
->
indexes
);
//
...
...
@@ -1127,10 +1127,10 @@ void RB_StageIteratorLightmappedMultitexture( void ) {
R_BindAnimatedImage
(
&
tess
.
xstages
[
0
]
->
bundle
[
1
]
);
texcoord
=
gTexCoordBuffer
;
for
(
i
=
0
;
i
<
tess
.
numIndexes
;
i
++
)
{
memcpy
(
t
ex
c
oord
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
1
],
sizeof
(
vec2_t
));
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
tess
.
texCoords
[
tess
.
indexes
[
i
]][
1
],
sizeof
(
vec2_t
));
gT
ex
C
oord
Buffer
+=
2
;
}
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
tess
.
numIndexes
,
gT
ex
C
oord
Buffer
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
//
// lock arrays
...
...
code/renderergl1/tr_sky.c
View file @
264125f4
...
...
@@ -375,18 +375,18 @@ static void DrawSkySide( struct image_s *image, const int mins[2], const int max
int
numindices
=
0
;
for
(
s
=
mins
[
0
]
+
HALF_SKY_SUBDIVISIONS
;
s
<=
maxs
[
0
]
+
HALF_SKY_SUBDIVISIONS
;
s
++
)
{
memcpy
(
t
ex
c
oord
,
s_skyTexCoords
[
t
][
s
],
sizeof
(
vec2_t
));
memcpy
(
v
ert
ices
,
s_skyPoints
[
t
][
s
],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
t
ex
c
oord
+=
2
;
memcpy
(
t
ex
c
oord
,
s_skyTexCoords
[
t
+
1
][
s
],
sizeof
(
vec2_t
));
memcpy
(
v
ert
ices
,
s_skyPoints
[
t
+
1
][
s
],
sizeof
(
vec3_t
));
v
ert
ices
+=
3
;
t
ex
c
oord
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
s_skyTexCoords
[
t
][
s
],
sizeof
(
vec2_t
));
memcpy
(
gV
ert
exBuffer
,
s_skyPoints
[
t
][
s
],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
gT
ex
C
oord
Buffer
+=
2
;
memcpy
(
gT
ex
C
oord
Buffer
,
s_skyTexCoords
[
t
+
1
][
s
],
sizeof
(
vec2_t
));
memcpy
(
gV
ert
exBuffer
,
s_skyPoints
[
t
+
1
][
s
],
sizeof
(
vec3_t
));
gV
ert
exBuffer
+=
3
;
gT
ex
C
oord
Buffer
+=
2
;
numindices
+=
2
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
numindices
,
gVertexBuffer
);
vglTexCoordPointer
(
2
,
GL_FLOAT
,
0
,
numindices
,
gT
ex
C
oord
Buffer
);
vglVertexPointer
Mapped
(
vertices
);
vglTexCoordPointer
Mapped
(
t
ex
c
oord
);
vglDrawObjects
(
GL_TRIANGLE_STRIP
,
numindices
,
GL_TRUE
);
}
//glDisableClientState(GL_TEXTURE_COORD_ARRAY);
...
...
code/renderergl1/tr_surface.c
View file @
264125f4
...
...
@@ -327,12 +327,12 @@ static void RB_SurfaceBeam( void )
float
*
pPos
=
gVertexBuffer
;
for
(
i
=
0
;
i
<=
NUM_BEAM_SEGS
;
i
++
)
{
memcpy
(
pPos
,
start_points
[
i
%
NUM_BEAM_SEGS
],
sizeof
(
vec3_t
));
pPos
+=
3
;
memcpy
(
pPos
,
end_points
[
i
%
NUM_BEAM_SEGS
],
sizeof
(
vec3_t
));
pPos
+=
3
;
memcpy
(
gVertexBuffer
,
start_points
[
i
%
NUM_BEAM_SEGS
],
sizeof
(
vec3_t
));
gVertexBuffer
+=
3
;
memcpy
(
gVertexBuffer
,
end_points
[
i
%
NUM_BEAM_SEGS
],
sizeof
(
vec3_t
));
gVertexBuffer
+=
3
;
}
vglVertexPointer
(
3
,
GL_FLOAT
,
0
,
(
NUM_BEAM_SEGS
+
1
)
*
2
,
gVertexBuffer
);
vglVertexPointer
Mapped
(
pPos
);
vglDrawObjects
(
GL_TRIANGLE_STRIP
,
(
NUM_BEAM_SEGS
+
1
)
*
2
,
GL_TRUE
);
}
...
...
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