mikke89 on layout
Add tests for vertical-align an… Fix inline-block alignment Warn on missing font face when … and 1 more (compare)
mikke89 on layout
Add new inline formatting test Update line box, linked open fr… Allow splitting all open inline… (compare)
mikke89 on layout
Some cleanup, fix alignment of … Inline layout cleanup Refactor inline layout (compare)
mikke89 on layout
Fix float spacing Improved inline-block baseline Wrap if there is no available w… and 4 more (compare)
void CRmlRenderInterface::RenderGeometry(Rml::Vertex* vertices, int num_vertices, int* indices, int num_indices, Rml::TextureHandle texture, const Rml::Vector2f& translation)
{
static RwIm2DVertex rgVertices[4096];
static RwImVertexIndex rgIndices[4096];
if (num_vertices > ARRAY_COUNT(rgVertices) || num_indices > ARRAY_COUNT(rgIndices))
return;
float fZ = RwIm2DGetNearScreenZ();
float fRHW = 1.0f / CGTA::GetCurrentRWCamera()->nearPlane;
for (size_t i = 0; i < num_vertices; i++)
{
CVector3D::TransformCoordinate(CVector3D(vertices[i].position.x + translation.x, vertices[i].position.y + translation.y, fZ), m_matTransform, rgVertices[i].vec);
rgVertices[i].vec.x -= 0.5f;
rgVertices[i].vec.y -= 0.5f;
rgVertices[i].rhw = fRHW;
rgVertices[i].emissiveColor = CARGB(vertices[i].colour.alpha, vertices[i].colour.red, vertices[i].colour.green, vertices[i].colour.blue);
rgVertices[i].u = vertices[i].tex_coord.x;
rgVertices[i].v = vertices[i].tex_coord.y;
}
for (size_t i = 0; i < num_indices; i++)
{
rgIndices[i] = indices[i];
}
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
Texture* pTexture = (Texture*)texture;
RwRaster* pRwRaster = nullptr;
if (pTexture != nullptr)
pRwRaster = Rw2D.GetRwRaster(pTexture);
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, rwFILTERLINEAR);
RwRenderStateSet(rwRENDERSTATESRCBLEND, rwBLENDSRCALPHA);
RwRenderStateSet(rwRENDERSTATEDESTBLEND, rwBLENDINVSRCALPHA);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, TRUE);
RwRenderStateSet(rwRENDERSTATETEXTUREADDRESS, rwTEXTUREADDRESSCLAMP);
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (unsigned int)pRwRaster);
RwIm2DRenderIndexedPrimitive(rwPRIMTYPETRILIST, rgVertices, num_vertices, rgIndices, num_indices);
}
Looks like this for example.