29 #include "../idlib/precompiled.h"
69 for ( j = 0; j <
i; j++ )
84 for ( j = 0; j <
i; j++ ) {
90 for ( j = 0 ; j <
i ; j++ ) {
117 for ( j = 0; j <
i; j++ )
133 for ( j = 0; j <
i; j++ ) {
140 for ( j = 0 ; j <
i ; j++ ) {
191 memset( &renderEntity, 0,
sizeof( renderEntity ) );
209 float modelViewMatrix[16];
360 bool clip,
float min_x,
float min_y,
float max_x,
float max_y ) {
364 if ( !( dverts && dindexes && vertCount && indexCount && hShader ) ) {
373 const_cast<idMaterial *
>(hShader)->EnsureNotPurged();
385 for ( i = 0; i < indexCount; i += 3 ) {
387 w.
AddPoint(
idVec5(dverts[dindexes[i]].xyz.x, dverts[dindexes[i]].
xyz.
y, dverts[dindexes[i]].
xyz.
z, dverts[dindexes[i]].
st.
x, dverts[dindexes[i]].
st.
y));
388 w.
AddPoint(
idVec5(dverts[dindexes[i+1]].xyz.x, dverts[dindexes[i+1]].
xyz.
y, dverts[dindexes[i+1]].
xyz.
z, dverts[dindexes[i+1]].
st.
x, dverts[dindexes[i+1]].
st.
y));
389 w.
AddPoint(
idVec5(dverts[dindexes[i+2]].xyz.x, dverts[dindexes[i+2]].
xyz.
y, dverts[dindexes[i+2]].
xyz.
z, dverts[dindexes[i+2]].
st.
x, dverts[dindexes[i+2]].
st.
y));
391 for ( j = 0; j < 3; j++ ) {
392 if ( w[j].
x < min_x || w[j].
x > max_x ||
393 w[j].
y < min_y || w[j].
y > max_y ) {
444 for (
int i = 0;
i < indexCount;
i++ ) {
448 memcpy( &
verts[numVerts], dverts, vertCount *
sizeof(
verts[0] ) );
473 s1 += ( s2 - s1 ) * -x / w;
478 t1 += ( t2 - t1 ) * -y / h;
483 s2 -= ( s2 - s1 ) * ( x + w - 640 ) /
w;
487 t2 -= ( t2 - t1 ) * ( y + h - 480 ) / h;
491 if ( w <= 0 || h <= 0 ) {
515 verts[1].
xyz[0] = x +
w;
529 verts[2].
xyz[0] = x +
w;
530 verts[2].
xyz[1] = y + h;
544 verts[3].
xyz[1] = y + h;
558 DrawStretchPic( &verts[0], &indexes[0], 4, 6, hShader,
false, 0.0
f, 0.0
f, 640.0
f, 480.0
f );
584 tempVerts[0].
xyz[0] = p1.
x;
585 tempVerts[0].
xyz[1] = p1.
y;
586 tempVerts[0].
xyz[2] = 0;
587 tempVerts[0].
st[0] = t1.
x;
588 tempVerts[0].
st[1] = t1.
y;
589 tempVerts[0].
normal[0] = 0;
590 tempVerts[0].
normal[1] = 0;
591 tempVerts[0].
normal[2] = 1;
598 tempVerts[1].
xyz[0] = p2.
x;
599 tempVerts[1].
xyz[1] = p2.
y;
600 tempVerts[1].
xyz[2] = 0;
601 tempVerts[1].
st[0] = t2.
x;
602 tempVerts[1].
st[1] = t2.
y;
603 tempVerts[1].
normal[0] = 0;
604 tempVerts[1].
normal[1] = 0;
605 tempVerts[1].
normal[2] = 1;
612 tempVerts[2].
xyz[0] = p3.
x;
613 tempVerts[2].
xyz[1] = p3.
y;
614 tempVerts[2].
xyz[2] = 0;
615 tempVerts[2].
st[0] = t3.
x;
616 tempVerts[2].
st[1] = t3.
y;
617 tempVerts[2].
normal[0] = 0;
618 tempVerts[2].
normal[1] = 0;
619 tempVerts[2].
normal[2] = 1;
632 const_cast<idMaterial *
>(material)->EnsureNotPurged();
646 for (
int i = 0;
i < indexCount;
i++ ) {
650 memcpy( &
verts[numVerts], tempVerts, vertCount *
sizeof(
verts[0] ) );
virtual int ReadUnsignedChar(unsigned char &value)
virtual int WriteUnsignedChar(const unsigned char value)
virtual int virtual int ReadInt(int &value)
const idVec3 & Normal(void) const
void R_AddDrawSurf(const srfTriangles_t *tri, const viewEntity_t *space, const renderEntity_t *renderEntity, const idMaterial *shader, const idScreenRect &scissor)
void SetNum(int newnum, bool resize=true)
void AssureSize(int newSize)
void Set(const float x, const float y, const float z)
void SetGranularity(int newgranularity)
const char * GetName(void) const
idList< guiModelSurface_t > surfaces
virtual const idMaterial * FindMaterial(const char *name, bool makeDefault=true)=0
void EmitToCurrentView(float modelMatrix[16], bool depthHack)
void EmitSurface(guiModelSurface_t *surf, float modelMatrix[16], float modelViewMatrix[16], bool depthHack)
virtual int WriteVec2(const idVec2 &vec)
struct vertCache_s * ambientCache
float projectionMatrix[16]
void * R_ClearedFrameAlloc(int bytes)
void DrawStretchTri(idVec2 p1, idVec2 p2, idVec2 p3, idVec2 t1, idVec2 t2, idVec2 t3, const idMaterial *material)
void R_AddDrawViewCmd(viewDef_t *parms)
virtual int WriteInt(const int value)
int GetNumPoints(void) const
GLubyte GLubyte GLubyte GLubyte w
void SetDist(const float dist)
const idMaterial * material
idList< idDrawVert > verts
virtual int ReadVec2(idVec2 &vec)
virtual int ReadVec3(idVec3 &vec)
void RenderViewToViewport(const renderView_t *renderView, idScreenRect *viewport)
GLubyte GLubyte GLubyte a
void WriteToDemo(idDemoFile *demo)
vertCache_t * AllocFrameTemp(void *data, int bytes)
idDeclManager * declManager
void myGlMultMatrix(const float *a, const float *b, float *out)
int Append(const type &obj)
GLdouble GLdouble GLdouble r
idList< glIndex_t > indexes
void ReadFromDemo(idDemoFile *demo)
void DrawStretchPic(const idDrawVert *verts, const glIndex_t *indexes, int vertCount, int indexCount, const idMaterial *hShader, bool clip=true, float min_x=0.0f, float min_y=0.0f, float max_x=640.0f, float max_y=480.0f)
virtual int WriteFloat(const float value)
float modelViewMatrix[16]
void * R_FrameAlloc(int bytes)
idVertexCache vertexCache
void SetColor(float r, float g, float b, float a)
const char * ReadHashString()
virtual int ReadFloat(float &value)
void AddPoint(const idVec3 &v)
bool ClipInPlace(const idPlane &plane, const float epsilon=ON_EPSILON, const bool keepOn=false)
float shaderParms[MAX_ENTITY_SHADER_PARMS]
virtual int WriteVec3(const idVec3 &vec)
const idMaterial * defaultMaterial
void WriteHashString(const char *str)