static void LoadMenuFont(void) { char buffer[100]; IndexedFont_Kerned_Column :: Create ( IntroFont_Light, // FontIndex I_Font_New, CL_GetImageFileName(buffer, 100, "Menus\\IntroFont.rim", LIO_RELATIVEPATH), 33,//21, // int HeightPerChar_New, 5, // int SpaceWidth_New, 32 // ASCIICodeForInitialCharacter ); }
void LoadDDGraphic(struct DDGraphicTag *DDGfxPtr, char *Filename) { /* set up the direct draw surface. we can take the width and height from the imageheader image */ GLOBALASSERT(DDGfxPtr); GLOBALASSERT(Filename); // get the filename that we need char szAbsFileName[MAX_PATH]; char * pszRet = CL_GetImageFileName(szAbsFileName,sizeof szAbsFileName / sizeof szAbsFileName[0], Filename, LIO_DDSURFACE|LIO_SYSMEM|LIO_TRANSPARENT|LIO_CHROMAKEY|LIO_RIFFPATH|LIO_RESTORABLE); GLOBALASSERT(pszRet); // we'll put the width and height in here unsigned nWidth, nHeight; // is it in a fast file? unsigned nFastFileLen; void const * pFastFileData = ffreadbuf(szAbsFileName,&nFastFileLen); if (pFastFileData) { DDGfxPtr->LPDDS = AwCreateSurface ( "pxfXYB", pFastFileData, nFastFileLen, AW_TLF_TRANSP|AW_TLF_CHROMAKEY, &nWidth, &nHeight, &DDGfxPtr->hBackup ); } else { DDGfxPtr->LPDDS = AwCreateSurface ( "sfXYB", &szAbsFileName[0], AW_TLF_TRANSP|AW_TLF_CHROMAKEY, &nWidth, &nHeight, &DDGfxPtr->hBackup ); } GLOBALASSERT(DDGfxPtr->LPDDS); GLOBALASSERT(DDGfxPtr->hBackup); ATIncludeSurface(DDGfxPtr->LPDDS,DDGfxPtr->hBackup); // set the rectangle size for blitting before padding to 4x4 has been done DDGfxPtr->SrcRect.left = 0; DDGfxPtr->SrcRect.right = nWidth; DDGfxPtr->SrcRect.top = 0; DDGfxPtr->SrcRect.bottom = nHeight; /*move the width and height to four byte bounadries*/ GLOBALASSERT((DDGfxPtr->SrcRect.right > 0)); GLOBALASSERT((DDGfxPtr->SrcRect.bottom > 0)); }
void LoadFont(PFFONT *pffont) { GLOBALASSERT(pffont); GLOBALASSERT(pffont->filename); // get the filename that we need char szAbsFileName[MAX_PATH]; char * pszRet = CL_GetImageFileName(szAbsFileName,sizeof szAbsFileName / sizeof szAbsFileName[0], pffont->filename, LIO_DDSURFACE|LIO_SYSMEM|LIO_CHROMAKEY|LIO_TRANSPARENT // hack for the moment so that the menu font is correctly loaded into an 8-bit vid mode |(strchr(pffont->filename,'\\') ? LIO_RELATIVEPATH : LIO_RIFFPATH)); GLOBALASSERT(pszRet); // we'll put the width and height in here unsigned nWidth, nHeight; // is it in a fast file? unsigned nFastFileLen; void const * pFastFileData = ffreadbuf(szAbsFileName,&nFastFileLen); if (pFastFileData) { pffont->data = AwCreateSurface ( "pxfXYB", pFastFileData, nFastFileLen, AW_TLF_TRANSP|AW_TLF_CHROMAKEY, &nWidth, &nHeight, &pffont->hBackup ); } else { pffont->data = AwCreateSurface ( "sfXYB", &szAbsFileName[0], AW_TLF_TRANSP|AW_TLF_CHROMAKEY, &nWidth, &nHeight, &pffont->hBackup ); } GLOBALASSERT(pffont->data); GLOBALASSERT(pffont->hBackup); ATIncludeSurface(pffont->data,pffont->hBackup); pffont->fttexBitDepth = VideoModeColourDepth; pffont->fttexWidth = nWidth; pffont->fttexHeight = nHeight; GLOBALASSERT((nHeight > 0)); GLOBALASSERT((nWidth > 0)); pffont->flags.loaded = 1; }