|
|
@ -308,6 +308,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawBitmap");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawBitmap");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::TexCoord0Flag);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
@ -326,6 +327,7 @@ void CDRU::drawBitmap (float x, float y, float width, float height, ITexture& te
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawBitmap");
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawBitmap");
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setNumIndexes (6);
|
|
|
|
pb.setNumIndexes (6);
|
|
|
|
|
|
|
|
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
pb.lock (iba);
|
|
|
|
pb.lock (iba);
|
|
|
@ -360,6 +362,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawLine");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawLine");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setNumVertices (2);
|
|
|
|
vb.setNumVertices (2);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
@ -372,6 +375,7 @@ void CDRU::drawLine (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawLine");
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawLine");
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setNumIndexes (2);
|
|
|
|
pb.setNumIndexes (2);
|
|
|
|
|
|
|
|
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
pb.lock (iba);
|
|
|
|
pb.lock (iba);
|
|
|
@ -405,6 +409,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawTriangle");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawTriangle");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setNumVertices (3);
|
|
|
|
vb.setNumVertices (3);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
@ -418,6 +423,7 @@ void CDRU::drawTriangle (float x0, float y0, float x1, float y1, float x2, float
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawTriangle");
|
|
|
|
if (pb.getName().empty()) NL_SET_IB_NAME(pb, "CDRU::drawTriangle");
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setNumIndexes (3);
|
|
|
|
pb.setNumIndexes (3);
|
|
|
|
|
|
|
|
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
CIndexBufferReadWrite iba;
|
|
|
|
pb.lock (iba);
|
|
|
|
pb.lock (iba);
|
|
|
@ -452,6 +458,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, IDriver& driver, CR
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
@ -488,6 +495,7 @@ void CDRU::drawQuad (float xcenter, float ycenter, float radius, IDriver& driver
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
@ -537,10 +545,12 @@ void CDRU::drawTrianglesUnlit(const NLMISC::CTriangleUV *trilist, sint ntris,
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawTrianglesUnlit");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawTrianglesUnlit");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag | CVertexBuffer::TexCoord0Flag);
|
|
|
|
vb.setNumVertices (ntris*3);
|
|
|
|
vb.setNumVertices (ntris*3);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
|
|
|
|
|
|
|
|
static CIndexBuffer pb;
|
|
|
|
static CIndexBuffer pb;
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setNumIndexes(ntris*3);
|
|
|
|
pb.setNumIndexes(ntris*3);
|
|
|
|
|
|
|
|
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
|
|
|
if (pb.getFormat() == CIndexBuffer::Indices16)
|
|
|
|
if (pb.getFormat() == CIndexBuffer::Indices16)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
nlassert(ntris * 3 <= 0xffff);
|
|
|
|
nlassert(ntris * 3 <= 0xffff);
|
|
|
@ -585,10 +595,12 @@ void CDRU::drawLinesUnlit(const NLMISC::CLine *linelist, sint nlines, CMateria
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawLinesUnlit");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawLinesUnlit");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag);
|
|
|
|
vb.setNumVertices (nlines*2);
|
|
|
|
vb.setNumVertices (nlines*2);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
|
|
|
|
|
|
|
|
static CIndexBuffer pb;
|
|
|
|
static CIndexBuffer pb;
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setFormat(NL_DEFAULT_INDEX_BUFFER_FORMAT);
|
|
|
|
pb.setNumIndexes(nlines*2);
|
|
|
|
pb.setNumIndexes(nlines*2);
|
|
|
|
|
|
|
|
pb.setPreferredMemory (CIndexBuffer::RAMVolatile, false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -656,6 +668,7 @@ void CDRU::drawQuad (float x0, float y0, float x1, float y1, CRGBA col0, CRGBA
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
if (vb.getName().empty()) vb.setName("CDRU::drawQuad");
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::PrimaryColorFlag);
|
|
|
|
vb.setVertexFormat (CVertexBuffer::PositionFlag|CVertexBuffer::PrimaryColorFlag);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
vb.setNumVertices (4);
|
|
|
|
|
|
|
|
vb.setPreferredMemory (CVertexBuffer::RAMVolatile, false);
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
CVertexBufferReadWrite vba;
|
|
|
|
vb.lock (vba);
|
|
|
|
vb.lock (vba);
|
|
|
|