Lines Matching refs:pFont

102 static void UpdateScale(DEMOFontFontData* pFont, f32 scaleX, f32 scaleY);
103 static void SetFontTexture(DEMOGfxShader* pShader, FontData_t* pFont);
104 static void GetFontCharData(FontData_t* pFont,
108 static void InitFontTexture(DEMOGfxShader* pShader, FontData_t* pFont);
110 static u32 BSearchIndex(FontData_t* pFont, u32 id);
213 FontData_t* pFont = GetCurrentFont(); in DEMOFontPuts() local
227 DEMOAssert(pFont->pCharDataBuffer && in DEMOFontPuts()
233 offsetX = (s32)(column * pFont->gridOffsetX); in DEMOFontPuts()
234 offsetY = -(s32)((line + 1) * pFont->gridOffsetY); in DEMOFontPuts()
237 SetFontTexture(&s_Shader, pFont); in DEMOFontPuts()
264 offsetY -= pFont->gridOffsetY; in DEMOFontPuts()
271 index = BSearchIndex(pFont,id); in DEMOFontPuts()
274 px1 = (u32)(pFont->pCharDataBuffer[index].minX + advanceX); in DEMOFontPuts()
275 px2 = (u32)(pFont->pCharDataBuffer[index].maxX + advanceX); in DEMOFontPuts()
276 py1 = (u32)(pFont->pCharDataBuffer[index].minY); in DEMOFontPuts()
277 py2 = (u32)(pFont->pCharDataBuffer[index].maxY); in DEMOFontPuts()
286 ps1 = (u32)pFont->pCharDataBuffer[index].minS; in DEMOFontPuts()
287 ps2 = (u32)pFont->pCharDataBuffer[index].maxS; in DEMOFontPuts()
288 pt1 = (u32)pFont->pCharDataBuffer[index].minT; in DEMOFontPuts()
289 pt2 = (u32)pFont->pCharDataBuffer[index].maxT; in DEMOFontPuts()
303 advanceX += pFont->pCharDataBuffer[index].xAdvance; in DEMOFontPuts()
378 FontData_t* pFont = GetCurrentFont(); in DEMOFontGetCharSize() local
381 *pCharWidth = pFont->gridOffsetX; in DEMOFontGetCharSize()
382 *pCharHeight = pFont->gridOffsetY; in DEMOFontGetCharSize()
402 static void UpdateScale(DEMOFontFontData* pFont, f32 scaleX, f32 scaleY) in UpdateScale() argument
405 pFont->charMagScaleF[0] = 2.0f/(scaleX * s_FontF.gridOffsetX); in UpdateScale()
406 pFont->charMagScaleF[1] = 2.0f/(scaleY * s_FontF.gridOffsetY); in UpdateScale()
408 pFont->charMagScaleP[0] = 2.0f/(scaleX * s_FontP.gridOffsetX); in UpdateScale()
409 pFont->charMagScaleP[1] = 2.0f/(scaleY * s_FontP.gridOffsetY); in UpdateScale()
413 static void GetFontCharData(FontData_t* pFont, in GetFontCharData() argument
428 if (pFont->pCharDataBuffer) in GetFontCharData()
435 pFont->fontTextureWidth = (f32)pFontHeader[0]; in GetFontCharData()
436 pFont->fontTextureHeight = (f32)pFontHeader[1]; in GetFontCharData()
438 pFont->numCharData = pFontHeader[5]; in GetFontCharData()
439 pFont->gridOffsetX = 0; in GetFontCharData()
440 pFont->gridOffsetY = 0; in GetFontCharData()
442 if(pFont == &s_FontP) in GetFontCharData()
444 pFont->pCharDataBuffer = s_CharDataBufferP; in GetFontCharData()
448 pFont->pCharDataBuffer = s_CharDataBufferF; in GetFontCharData()
452 DEMOAssert(pFont->numCharData <= MAX_NUM_CHARS && in GetFontCharData()
456 for(i = 0; i < pFont->numCharData; ++i) in GetFontCharData()
469 pFont->pCharDataBuffer[i].id = id; in GetFontCharData()
470 pFont->pCharDataBuffer[i].minS = (s32)x; in GetFontCharData()
471 pFont->pCharDataBuffer[i].minT = (s32)(pFont->fontTextureHeight - h - y - 1); in GetFontCharData()
472 pFont->pCharDataBuffer[i].maxS = (s32)(x + w); in GetFontCharData()
473 pFont->pCharDataBuffer[i].maxT = (s32)(pFont->fontTextureHeight - y - 1); in GetFontCharData()
474 pFont->pCharDataBuffer[i].minX = (s32)xOffset; in GetFontCharData()
475 pFont->pCharDataBuffer[i].minY = (s32)(lineHeight - yOffset - h); in GetFontCharData()
476 pFont->pCharDataBuffer[i].maxX = (s32)(xOffset + w); in GetFontCharData()
477 pFont->pCharDataBuffer[i].maxY = (s32)(lineHeight - yOffset); in GetFontCharData()
478 pFont->pCharDataBuffer[i].xAdvance = (s32)xAdvance; in GetFontCharData()
486 if(pFont->pCharDataBuffer[i].xAdvance > maxCharWidth) in GetFontCharData()
488 maxCharWidth = (f32)pFont->pCharDataBuffer[i].xAdvance; in GetFontCharData()
493 pFont->gridOffsetX = maxCharWidth; in GetFontCharData()
496 pFont->gridOffsetY = maxCharHeight; in GetFontCharData()
499 pFont->pFontImageData = (u8*)pFontImageData; in GetFontCharData()
503 static void InitFontTexture(DEMOGfxShader* pShader, FontData_t* pFont) in InitFontTexture() argument
506 u32 width =(u32)pFont->fontTextureWidth; in InitFontTexture()
507 u32 height=(u32)pFont->fontTextureHeight; in InitFontTexture()
509 GX2InitTexture(&pFont->TexData, in InitFontTexture()
518 GX2InitTexturePtrs(&pFont->TexData, in InitFontTexture()
519 DEMOGfxAllocMEM2(pFont->TexData.surface.imageSize, in InitFontTexture()
520 pFont->TexData.surface.alignment), 0); in InitFontTexture()
523 GX2NotifyMemAlloc(pFont->pFontImageData, width*height, 32); in InitFontTexture()
526 GX2TileTexture(&pFont->TexData, // dst in InitFontTexture()
527 pFont->pFontImageData); // src in InitFontTexture()
528 GX2NotifyMemFree(pFont->pFontImageData); in InitFontTexture()
537 static void SetFontTexture(DEMOGfxShader* pShader, FontData_t* pFont) in SetFontTexture() argument
540 GX2SetPixelTexture(&pFont->TexData, pShader->samplersPS.location[0]); in SetFontTexture()
573 static u32 BSearchIndex(FontData_t* pFont, u32 id) in BSearchIndex() argument
580 if (id >= 32 && id < 32+pFont->numCharData && in BSearchIndex()
581 pFont->pCharDataBuffer[id-32].id == id ) in BSearchIndex()
585 last = pFont->numCharData-1; in BSearchIndex()
591 if( pFont->pCharDataBuffer[mid].id < id ) in BSearchIndex()
595 else if( id < pFont->pCharDataBuffer[mid].id ) in BSearchIndex()