J :
* Update for linux support.
This commit is contained in:
+9
-8
@@ -19,8 +19,9 @@
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
|
||||
#pragma comment( lib, "freetype.lib" )
|
||||
|
||||
#ifndef LINUX
|
||||
#pragma comment( lib, "freetype.lib" )
|
||||
#endif
|
||||
|
||||
#include "../include/JGE.h"
|
||||
#include "../include/JRenderer.h"
|
||||
@@ -257,7 +258,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
|
||||
FT_GlyphSlot slot = mFace->glyph;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
DWORD *texBuffer = new DWORD[mMaxCharWidth*mMaxCharHeight];
|
||||
memset(texBuffer, 0, mMaxCharWidth*mMaxCharHeight*sizeof(DWORD));
|
||||
#else
|
||||
@@ -277,7 +278,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
int top = mSize-slot->bitmap_top+1;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
int offset = top*mMaxCharWidth + slot->bitmap_left + 2;
|
||||
#else
|
||||
int xx = x + slot->bitmap_left + 2;
|
||||
@@ -302,7 +303,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
grey = slot->bitmap.buffer[i * slot->bitmap.width + j];
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
texBuffer[i*mMaxCharWidth+j+offset] = RGBA(255, 255, 255, grey);
|
||||
#else
|
||||
SwizzlePlot(pTexture, ARGB(grey,255,255,255), (xx+j)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE, mTexHeight);
|
||||
@@ -325,7 +326,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
{
|
||||
if (bits&mask)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
texBuffer[i*mMaxCharWidth+j*8+k+offset] = RGBA(255, 255, 255, 255);
|
||||
#else
|
||||
SwizzlePlot(pTexture, ARGB(255,255,255,255), (xx+j*8+k)*PIXEL_SIZE, yy+i, mTexWidth*PIXEL_SIZE, mTexHeight);
|
||||
@@ -343,7 +344,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
|
||||
mXAdvance[mCurr] = (u8)(slot->advance.x>>6);
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, mMaxCharWidth, mMaxCharHeight, GL_RGBA, GL_UNSIGNED_BYTE, texBuffer);
|
||||
#else
|
||||
sceKernelDcacheWritebackAll();
|
||||
@@ -357,7 +358,7 @@ int JTTFont::PreCacheChar(u16 ch, u16 cachedCode)
|
||||
if (mCurr >= mMaxCharCount)
|
||||
mCurr = 0;
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined (WIN32) || defined (LINUX)
|
||||
delete [] texBuffer;
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user