Add rayman2 source files
This commit is contained in:
725
Rayman_X/cpa/tempgrp/GAM/Locale/FON_Eff.c
Normal file
725
Rayman_X/cpa/tempgrp/GAM/Locale/FON_Eff.c
Normal file
@@ -0,0 +1,725 @@
|
||||
/*#include "fonhdls.h"
|
||||
|
||||
#include "ACP_Base.h"
|
||||
*/
|
||||
#include "MTH.h"
|
||||
/*
|
||||
#include "DPT.h"
|
||||
#include "GEO.h"
|
||||
#include "GLI.h"
|
||||
*/
|
||||
#include "SCR.h"
|
||||
|
||||
#include "RND.h"
|
||||
/*
|
||||
#include "POS.h"
|
||||
#include "SPO.h"
|
||||
#include "LST.h"
|
||||
*/
|
||||
|
||||
#include "fonfont.h"
|
||||
|
||||
/*************************************************************************/
|
||||
void FON_fn_vSetElapsedTime(unsigned long ulTime)
|
||||
{
|
||||
FON_g_stGeneral.ulElapsedTime = ulTime;
|
||||
}
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitEffectFor(FON_tdxHandleOfString _hText,FON_tdeTypeOfDisplay _eTypeOfDisplay)
|
||||
{
|
||||
switch(_eTypeOfDisplay)
|
||||
{
|
||||
case FON_Disabled:
|
||||
FON_fn_vReinitTextEffectWithEffect(_hText,&FON_g_stEffectByDisplay.stDisabledEffect);
|
||||
break;
|
||||
case FON_Enabled:
|
||||
FON_fn_vReinitTextEffectWithEffect(_hText,&FON_g_stEffectByDisplay.stEnabledEffect);
|
||||
break;
|
||||
case FON_Selected:
|
||||
FON_fn_vReinitTextEffectWithEffect(_hText,&FON_g_stEffectByDisplay.stSelectedEffect);
|
||||
break;
|
||||
case FON_Pressed:
|
||||
FON_fn_vReinitTextEffectWithEffect(_hText,&FON_g_stEffectByDisplay.stPressedEffect);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitEffectOfOneCharactFor(FON_tdxHandleOfString _hText,FON_tdeTypeOfDisplay _eTypeOfDisplay,unsigned long _ulIndex)
|
||||
{
|
||||
switch(_eTypeOfDisplay)
|
||||
{
|
||||
case FON_Disabled:
|
||||
FON_fn_vReinitTextEffectOfOneCharactWithEffect(_hText,&FON_g_stEffectByDisplay.stDisabledEffect,_ulIndex);
|
||||
break;
|
||||
case FON_Enabled:
|
||||
FON_fn_vReinitTextEffectOfOneCharactWithEffect(_hText,&FON_g_stEffectByDisplay.stEnabledEffect,_ulIndex);
|
||||
break;
|
||||
case FON_Selected:
|
||||
FON_fn_vReinitTextEffectOfOneCharactWithEffect(_hText,&FON_g_stEffectByDisplay.stSelectedEffect,_ulIndex);
|
||||
break;
|
||||
case FON_Pressed:
|
||||
FON_fn_vReinitTextEffectOfOneCharactWithEffect(_hText,&FON_g_stEffectByDisplay.stPressedEffect,_ulIndex);
|
||||
break;
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vReinitTextEffect(FON_tdxHandleOfString _hText)
|
||||
{
|
||||
FON_fn_vReinitTextEffectWithEffect(_hText,&FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vReinitTextEffectOfOneCharact(FON_tdxHandleOfString _hText,unsigned long _ulIndex)
|
||||
{
|
||||
FON_fn_vReinitTextEffectOfOneCharactWithEffect(_hText,&FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect,_ulIndex);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vDesinitTextEffectOfOneCharact(FON_tdxHandleOfString _hText,unsigned long _ulIndex)
|
||||
{
|
||||
POS_fn_vSetIdentityMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[_ulIndex]);
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[_ulIndex],0.0,0.0,0.0);
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[_ulIndex],0.0,0.0,0.0);
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[_ulIndex],1.0,1.0,1.0);
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hText)->d_p_stLight[_ulIndex]=NULL;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vCopyEffectOfOneCharact(FON_tdxHandleOfString _hTextDest,unsigned long _ulIndexDest,FON_tdxHandleOfString _hTextSrc,unsigned long _ulIndexSrc)
|
||||
{
|
||||
if ( FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalMatrix!=NULL
|
||||
&&FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalMatrix[_ulIndexSrc]!=NULL)
|
||||
POS_fn_vCopyMatrix(FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalMatrix[_ulIndexDest],
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalMatrix[_ulIndexSrc]);
|
||||
|
||||
if ( FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynTranslation!=NULL
|
||||
&&FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynTranslation!=NULL)
|
||||
POS_fn_vCopyCompletDyn(FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynTranslation[_ulIndexDest],
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynTranslation[_ulIndexSrc]);
|
||||
if ( FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynRotation!=NULL
|
||||
&&FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynRotation!=NULL)
|
||||
POS_fn_vCopyCompletDyn(FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynRotation[_ulIndexDest],
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynRotation[_ulIndexSrc]);
|
||||
if ( FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynScale!=NULL
|
||||
&&FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynScale!=NULL)
|
||||
POS_fn_vCopyCompletDyn(FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_hLocalDynScale[_ulIndexDest],
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_hLocalDynScale[_ulIndexSrc]);
|
||||
|
||||
if ( FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_p_stLight!=NULL
|
||||
&&FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_p_stLight!=NULL)
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hTextDest)->d_p_stLight[_ulIndexDest]=FON_fn_p_stGetTextPointerOfHandle(_hTextSrc)->d_p_stLight[_ulIndexSrc];
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vReinitTextEffectWithEffect(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect)
|
||||
{
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationXTo0)
|
||||
FON_fn_vInitTextEffectTranslationXTo0(_hText,p_stEffect,p_stEffect->ulTranslationXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationYTo0)
|
||||
FON_fn_vInitTextEffectTranslationYTo0(_hText,p_stEffect,p_stEffect->ulTranslationYParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationZTo0)
|
||||
FON_fn_vInitTextEffectTranslationZTo0(_hText,p_stEffect,p_stEffect->ulTranslationZParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectRotation)
|
||||
FON_fn_vInitTextEffectRotation(_hText,p_stEffect,p_stEffect->ulRotationParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectRotationTo0)
|
||||
FON_fn_vInitTextEffectRotationTo0(_hText,p_stEffect,p_stEffect->ulRotationParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXTo1)
|
||||
FON_fn_vInitTextEffectScaleXTo1(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYTo1)
|
||||
FON_fn_vInitTextEffectScaleYTo1(_hText,p_stEffect,p_stEffect->ulScaleYParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZTo1)
|
||||
FON_fn_vInitTextEffectScaleZTo1(_hText,p_stEffect,p_stEffect->ulScaleZParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXWave)
|
||||
FON_fn_vInitTextEffectScaleXWave(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYWave)
|
||||
FON_fn_vInitTextEffectScaleYWave(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZWave)
|
||||
FON_fn_vInitTextEffectScaleZWave(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleXWaveTo1(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleYWaveTo1(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleZWaveTo1(_hText,p_stEffect,p_stEffect->ulScaleXParam);
|
||||
if (p_stEffect->eEffect&FON_E_EffectLight)
|
||||
FON_fn_vInitTextEffectLight(_hText,p_stEffect,p_stEffect->ulRotationParam);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vReinitTextEffectOfOneCharactWithEffect(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulIndex)
|
||||
{
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationXTo0)
|
||||
FON_fn_vInitTextEffectTranslationXTo0OfOneCharact(_hText,p_stEffect,p_stEffect->ulTranslationXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationYTo0)
|
||||
FON_fn_vInitTextEffectTranslationYTo0OfOneCharact(_hText,p_stEffect,p_stEffect->ulTranslationYParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectTranslationZTo0)
|
||||
FON_fn_vInitTextEffectTranslationZTo0OfOneCharact(_hText,p_stEffect,p_stEffect->ulTranslationZParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectRotation)
|
||||
FON_fn_vInitTextEffectRotationOfOneCharact(_hText,p_stEffect,p_stEffect->ulRotationParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectRotationTo0)
|
||||
FON_fn_vInitTextEffectRotationTo0OfOneCharact(_hText,p_stEffect,p_stEffect->ulRotationParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXTo1)
|
||||
FON_fn_vInitTextEffectScaleXTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYTo1)
|
||||
FON_fn_vInitTextEffectScaleYTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleYParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZTo1)
|
||||
FON_fn_vInitTextEffectScaleZTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleZParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXWave)
|
||||
FON_fn_vInitTextEffectScaleXWaveOfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYWave)
|
||||
FON_fn_vInitTextEffectScaleYWaveOfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZWave)
|
||||
FON_fn_vInitTextEffectScaleZWaveOfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleXWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleXWaveTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleYWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleYWaveTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectScaleZWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleZWaveTo1OfOneCharact(_hText,p_stEffect,p_stEffect->ulScaleXParam,_ulIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectLight)
|
||||
FON_fn_vInitTextEffectLightOfOneCharact(_hText,p_stEffect,p_stEffect->ulRotationParam,_ulIndex);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffect(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,FON_tdeEffect _eEffect,unsigned long _ulParam)
|
||||
{
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.eEffect |= _eEffect;
|
||||
|
||||
if (_eEffect&FON_E_EffectTranslationXTo0)
|
||||
FON_fn_vInitTextEffectTranslationXTo0(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectTranslationYTo0)
|
||||
FON_fn_vInitTextEffectTranslationYTo0(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectTranslationZTo0)
|
||||
FON_fn_vInitTextEffectTranslationZTo0(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectRotation)
|
||||
FON_fn_vInitTextEffectRotation(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectRotationTo0)
|
||||
FON_fn_vInitTextEffectRotationTo0(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleXTo1)
|
||||
FON_fn_vInitTextEffectScaleXTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleYTo1)
|
||||
FON_fn_vInitTextEffectScaleYTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleZTo1)
|
||||
FON_fn_vInitTextEffectScaleZTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleXWave)
|
||||
FON_fn_vInitTextEffectScaleXWave(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleYWave)
|
||||
FON_fn_vInitTextEffectScaleYWave(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleZWave)
|
||||
FON_fn_vInitTextEffectScaleZWave(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleXWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleXWaveTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleYWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleYWaveTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectScaleZWaveTo1)
|
||||
FON_fn_vInitTextEffectScaleZWaveTo1(_hText,p_stEffect,_ulParam);
|
||||
else if (_eEffect&FON_E_EffectLight)
|
||||
FON_fn_vInitTextEffectLight(_hText,p_stEffect,_ulParam);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffect(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
if ( p_stEffect->eEffect&FON_E_EffectTranslationXTo0
|
||||
||p_stEffect->eEffect&FON_E_EffectTranslationYTo0
|
||||
||p_stEffect->eEffect&FON_E_EffectTranslationZTo0)
|
||||
FON_fn_vPlayLetterEffectTranslationXYZTo0(_hText,p_stEffect,lIndex);
|
||||
if ( p_stEffect->eEffect&FON_E_EffectRotation
|
||||
||p_stEffect->eEffect&FON_E_EffectRotationTo0)
|
||||
FON_fn_vPlayLetterEffectRotation(_hText,p_stEffect,lIndex);
|
||||
if ( p_stEffect->eEffect&FON_E_EffectScaleXTo1
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleYTo1
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleZTo1)
|
||||
FON_fn_vPlayLetterEffectScaleXYZTo1(_hText,p_stEffect,lIndex);
|
||||
if ( p_stEffect->eEffect&FON_E_EffectScaleXWave
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleYWave
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleZWave
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleXWaveTo1
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleYWaveTo1
|
||||
||p_stEffect->eEffect&FON_E_EffectScaleZWaveTo1)
|
||||
FON_fn_vPlayLetterEffectScaleXYZWave(_hText,p_stEffect,lIndex);
|
||||
if (p_stEffect->eEffect&FON_E_EffectLight)
|
||||
FON_fn_vPlayLetterEffectLight(_hText,p_stEffect,lIndex);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationXTo0(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulTranslationXParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulTranslationXParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectTranslationXTo0OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationXTo0OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistX;
|
||||
MTH_tdxReal xAlphaDistX;
|
||||
MTH3D_tdstVector stI;
|
||||
|
||||
xBasedDistX = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff));
|
||||
xAlphaDistX = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/10.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],
|
||||
xBasedDistX+lIndex*xAlphaDistX,
|
||||
POS_fn_xGetDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]),
|
||||
POS_fn_xGetDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]));
|
||||
POS_fn_vGetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
MTH3D_M_vSetXofVector(&stI,xBasedDistX+lIndex*xAlphaDistX);
|
||||
POS_fn_vSetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
|
||||
POS_fn_vBeginDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/1000.0f);
|
||||
POS_fn_vStopDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],0,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationYTo0(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulTranslationYParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulTranslationYParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectTranslationYTo0OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationYTo0OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistY;
|
||||
MTH_tdxReal xAlphaDistY;
|
||||
MTH3D_tdstVector stI;
|
||||
|
||||
xBasedDistY = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff));
|
||||
xAlphaDistY = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/10.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],
|
||||
POS_fn_xGetDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]),
|
||||
xBasedDistY+lIndex*xAlphaDistY,
|
||||
POS_fn_xGetDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]));
|
||||
POS_fn_vGetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
MTH3D_M_vSetYofVector(&stI,xBasedDistY+lIndex*xAlphaDistY);
|
||||
POS_fn_vSetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
|
||||
POS_fn_vBeginDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/1000.0f);
|
||||
POS_fn_vStopDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],0,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationZTo0(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulTranslationZParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulTranslationZParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectTranslationZTo0OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectTranslationZTo0OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistZ;
|
||||
MTH_tdxReal xAlphaDistZ;
|
||||
MTH3D_tdstVector stI;
|
||||
|
||||
xBasedDistZ = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff));
|
||||
xAlphaDistZ = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/10.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],
|
||||
POS_fn_xGetDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]),
|
||||
POS_fn_xGetDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]),
|
||||
xBasedDistZ+lIndex*xAlphaDistZ);
|
||||
POS_fn_vGetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
MTH3D_M_vSetZofVector(&stI,xBasedDistZ+lIndex*xAlphaDistZ);
|
||||
POS_fn_vSetTranslationVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI);
|
||||
|
||||
POS_fn_vBeginDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/1000.0f);
|
||||
POS_fn_vStopDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],0,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectTranslationXYZTo0(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect=p_stEffect;
|
||||
|
||||
POS_fn_vPlayTrans(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex],FON_g_stGeneral.ulElapsedTime);
|
||||
POS_fn_vGetMatrixFromDynTrans(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynTranslation[lIndex]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectRotation(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulRotationParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulRotationParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectRotationOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectRotationOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect = p_stEffect;
|
||||
POS_fn_vBeginDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/10000.0f);
|
||||
POS_fn_vBeginDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/10000.0f);
|
||||
POS_fn_vBeginDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x000000ff)>> 0)))/10000.0f);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectRotationTo0(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulRotationParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulRotationParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectRotationTo0OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectRotationTo0OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
FON_fn_vInitTextEffectRotationOfOneCharact(_hText,p_stEffect,_ulParam,lIndex);
|
||||
|
||||
POS_fn_vStopDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],0,TRUE);
|
||||
POS_fn_vStopDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],0,TRUE);
|
||||
POS_fn_vStopDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],0,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectRotation(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect=p_stEffect;
|
||||
|
||||
POS_fn_vPlayRot(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex],FON_g_stGeneral.ulElapsedTime);
|
||||
POS_fn_vGetMatrixFromRot(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynRotation[lIndex]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleX(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleXParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleXParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleXOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect = p_stEffect;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectScaleX(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect=p_stEffect;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleXParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleXParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleXTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistX;
|
||||
MTH_tdxReal xAlphaDistX;
|
||||
MTH3D_tdstVector stI,stJ,stK;
|
||||
|
||||
xBasedDistX = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff))/10.0f;
|
||||
xAlphaDistX = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/100.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],
|
||||
xBasedDistX+lIndex*xAlphaDistX,
|
||||
POS_fn_xGetDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
POS_fn_xGetDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]));
|
||||
POS_fn_vGetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
MTH3D_M_vSetXofVector(&stI,xBasedDistX+lIndex*xAlphaDistX);
|
||||
POS_fn_vSetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
|
||||
POS_fn_vBeginDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/10000.0f);
|
||||
POS_fn_vStopDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleYParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleYParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleYTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistY;
|
||||
MTH_tdxReal xAlphaDistY;
|
||||
MTH3D_tdstVector stI,stJ,stK;
|
||||
|
||||
xBasedDistY = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff))/10.0f;
|
||||
xAlphaDistY = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/100.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],
|
||||
POS_fn_xGetDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
xBasedDistY+lIndex*xAlphaDistY,
|
||||
POS_fn_xGetDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]));
|
||||
POS_fn_vGetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
MTH3D_M_vSetYofVector(&stJ,xBasedDistY+lIndex*xAlphaDistY);
|
||||
POS_fn_vSetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
|
||||
POS_fn_vBeginDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/10000.0f);
|
||||
POS_fn_vStopDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleZParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleZParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleZTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xBasedDistZ;
|
||||
MTH_tdxReal xAlphaDistZ;
|
||||
MTH3D_tdstVector stI,stJ,stK;
|
||||
|
||||
xBasedDistZ = (MTH_tdxReal)((signed char)(_ulParam&0x000000ff))/10.0f;
|
||||
xAlphaDistZ = ((MTH_tdxReal)((signed char)((_ulParam&0x0000ff00)>> 8)))/100.0f;
|
||||
|
||||
POS_fn_vSetDynVector(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],
|
||||
POS_fn_xGetDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
POS_fn_xGetDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
xBasedDistZ+lIndex*xAlphaDistZ);
|
||||
POS_fn_vGetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
MTH3D_M_vSetZofVector(&stK,xBasedDistZ+lIndex*xAlphaDistZ);
|
||||
POS_fn_vSetScaleMatrix(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],&stI,&stJ,&stK);
|
||||
|
||||
POS_fn_vBeginDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],((MTH_tdxReal)((signed char)((_ulParam&0x00ff0000)>>16)))/10000.0f);
|
||||
POS_fn_vStopDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectScaleXYZTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
p_stEffect=p_stEffect;
|
||||
|
||||
POS_fn_vPlayScale(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],FON_g_stGeneral.ulElapsedTime);
|
||||
POS_fn_vGetMatrixFromScale(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXWave(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleXParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleXParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleXWaveOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXWaveOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xRandomValue;
|
||||
|
||||
xRandomValue = RND_fn_xGetRealRandomValue(FON_g_stGeneral.hRandomHandle,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0x00ff0000)>>16)))/10000.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0xff000000)>>24)))/10000.0f);
|
||||
POS_fn_vBeginDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],xRandomValue);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXWaveTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleXParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleXParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleXWaveTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleXWaveTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleXWaveOfOneCharact(_hText,p_stEffect,_ulParam,lIndex);
|
||||
POS_fn_vStopDynX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYWave(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleYParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleYParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleYWaveOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYWaveOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xRandomValue;
|
||||
|
||||
xRandomValue = RND_fn_xGetRealRandomValue(FON_g_stGeneral.hRandomHandle,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0x00ff0000)>>16)))/10000.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0xff000000)>>24)))/10000.0f);
|
||||
POS_fn_vBeginDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],xRandomValue);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYWaveTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleYParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleYParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleYWaveTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleYWaveTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleYWaveOfOneCharact(_hText,p_stEffect,_ulParam,lIndex);
|
||||
POS_fn_vStopDynY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZWave(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleZParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleZParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleZWaveOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZWaveOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xRandomValue;
|
||||
|
||||
xRandomValue = RND_fn_xGetRealRandomValue(FON_g_stGeneral.hRandomHandle,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0x00ff0000)>>16)))/10000.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0xff000000)>>24)))/10000.0f);
|
||||
POS_fn_vBeginDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],xRandomValue);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZWaveTo1(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
p_stEffect->ulScaleZParam = _ulParam;
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.ulScaleZParam = _ulParam;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleZWaveTo1OfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectScaleZWaveTo1OfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
FON_fn_vInitTextEffectScaleZWaveOfOneCharact(_hText,p_stEffect,_ulParam,lIndex);
|
||||
POS_fn_vStopDynZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex],1,TRUE);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectScaleXYZWave(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
POS_fn_vPlayDynValue(POS_fn_hGetDynValueX(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
(MTH_tdxReal)((signed char)(p_stEffect->ulScaleXParam&0x000000ff))/50.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleXParam&0x0000ff00)>> 8)))/50.0f,
|
||||
POS_E_Wave,
|
||||
FON_g_stGeneral.ulElapsedTime);
|
||||
POS_fn_vPlayDynValue(POS_fn_hGetDynValueY(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
(MTH_tdxReal)((signed char)(p_stEffect->ulScaleYParam&0x000000ff))/50.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleYParam&0x0000ff00)>> 8)))/50.0f,
|
||||
POS_E_Wave,
|
||||
FON_g_stGeneral.ulElapsedTime);
|
||||
POS_fn_vPlayDynValue(POS_fn_hGetDynValueZ(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]),
|
||||
(MTH_tdxReal)((signed char)(p_stEffect->ulScaleZParam&0x000000ff))/50.0f,
|
||||
((MTH_tdxReal)((signed char)((p_stEffect->ulScaleZParam&0x0000ff00)>> 8)))/50.0f,
|
||||
POS_E_Wave,
|
||||
FON_g_stGeneral.ulElapsedTime);
|
||||
|
||||
POS_fn_vGetMatrixFromScale(FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalMatrix[lIndex],FON_fn_p_stGetTextPointerOfHandle(_hText)->d_hLocalDynScale[lIndex]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectLight(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
FON_fn_p_stGetFontAndEffectPointerOfHandle(_hText)->stEffect.p_stLight=p_stEffect->p_stLight;
|
||||
|
||||
for (i=0;i<FON_fn_ulGetTrueLenghtOfText(_hText);i++)
|
||||
{
|
||||
FON_fn_vInitTextEffectLightOfOneCharact(_hText,p_stEffect,_ulParam,i);
|
||||
}
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vInitTextEffectLightOfOneCharact(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long _ulParam,unsigned long lIndex)
|
||||
{
|
||||
lIndex = lIndex;
|
||||
_ulParam = _ulParam;
|
||||
FON_fn_p_stGetTextPointerOfHandle(_hText)->d_p_stLight[lIndex]=p_stEffect->p_stLight;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vPlayLetterEffectLight(FON_tdxHandleOfString _hText,FON_tdstEffect *p_stEffect,unsigned long lIndex)
|
||||
{
|
||||
_hText = _hText;
|
||||
p_stEffect = p_stEffect;
|
||||
lIndex = lIndex;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
150
Rayman_X/cpa/tempgrp/GAM/Locale/fonerm.h
Normal file
150
Rayman_X/cpa/tempgrp/GAM/Locale/fonerm.h
Normal file
@@ -0,0 +1,150 @@
|
||||
#ifndef __FONERM_H__
|
||||
#define __FONERM_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define C_szFONVersion "FON V1.0.0" /* The format is XXX Va.b.c with Xxx is the Tag of the module */
|
||||
#define C_szFONFullName "2D-FONT module"/* the complete and clear name of the module */
|
||||
#define C_szFONDate __DATE__ /*The format is "Mmm dd yyyy".You can use __DATE__ but be careful that you have the control of the compilation*/
|
||||
|
||||
#include "ERM.h"
|
||||
|
||||
#undef EXTERN
|
||||
#if !defined(FON_MainFile)
|
||||
#define EXTERN extern
|
||||
#else /* !FON_MainFile */
|
||||
#define EXTERN
|
||||
#endif /* !FON_MainFile */
|
||||
|
||||
#define __FATAL_ERR_FON__
|
||||
#define __WARNING1_ERR_FON__
|
||||
|
||||
/* error of the FON Module*/
|
||||
enum e_uwFONErrNumber{
|
||||
E_uwFONFatalErr,
|
||||
#ifdef __FATAL_ERR_FON__
|
||||
/* Fatals error :*/
|
||||
E_uwFONFatalNotAFatalError,
|
||||
E_uwFONWarningErrorIsNotAWarningError,
|
||||
E_uwFONTooMuchFonts,
|
||||
E_uwFONTooMuchFONs,
|
||||
E_uwFONMemoryError,
|
||||
E_uwFONNotEnoughStringSpace,
|
||||
E_uwFontScriptBadNumberOfArg,
|
||||
E_uwTooManyCharactersInFont,
|
||||
#endif /*__FATAL_ERR_FON__*/
|
||||
E_uwFONStartOfWarning,/* important constant, it allows to recognize if an error is fatal or not.*/
|
||||
#ifdef __WARNING1_ERR_FON__
|
||||
E_uwFONUnknownLetter,
|
||||
E_uwFONUnknownFON,
|
||||
E_uwFONUnknownFont,
|
||||
E_uwFONUnknownText,
|
||||
E_uwFONTooManyCharacterInFont,
|
||||
|
||||
E_uwFONWarningShouldNotHappen,/* should never happen, but....*/
|
||||
#endif /*__WARNING1_ERR_FON__*/
|
||||
E_uwFONErrNumber
|
||||
};
|
||||
|
||||
EXTERN unsigned char g_ucFONModuleId /*number of identification of the Erm module*/
|
||||
#ifdef FON_MainFile
|
||||
= C_ucModuleNotInitialized
|
||||
#endif /*FON_MainFile*/
|
||||
;
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
EXTERN CPA_EXPORT char * g_a_szFONInformationModule []
|
||||
#if defined(FON_MainFile) && !defined(CPA_WANTS_IMPORT)
|
||||
= {C_szFONVersion, C_szFONFullName, C_szFONDate}
|
||||
#endif /*FON_MainFile && CPA_WANTS_IMPORT*/
|
||||
;
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
EXTERN char * g_szFONModuleName /* Obliged syntax 'g_sz'+[Abbreviation of ModuleName]+'ModuleName'*/
|
||||
#ifdef FON_MainFile
|
||||
= "Module FON"
|
||||
#endif /*FON_MainFile*/
|
||||
;
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
#if defined(__ERROR_STRINGS__)
|
||||
EXTERN tdstErrorMsg g_a_stFONTabErr [] /* Obliged syntax 'g_a_st'+[Abbreviation of ModuleName]+'TabErr'*/
|
||||
#ifdef FON_MainFile
|
||||
={
|
||||
#ifdef __FATAL_ERR_FON__
|
||||
E_uwFONFatalNotAFatalError, "This is not a valide FON Debug fatal error",
|
||||
E_uwFONWarningErrorIsNotAWarningError,"M_GameWarningError : Try to raise a fatal or a information",
|
||||
E_uwFONTooMuchFonts, "Too much fonts are defined",
|
||||
E_uwFONTooMuchFONs, "Too much FONs are defined",
|
||||
E_uwFONMemoryError,"Not enough memory.",
|
||||
E_uwFONNotEnoughStringSpace,"No enough strings space",
|
||||
E_uwFontScriptBadNumberOfArg,"Script : bad number of arguments",
|
||||
E_uwTooManyCharactersInFont,"To many characters in font",
|
||||
#endif /*__FATAL_ERR_FON__*/
|
||||
|
||||
E_uwFONStartOfWarning,"This is a strange FON Debug Warning",
|
||||
#ifdef __WARNING1_ERR_FON__
|
||||
E_uwFONUnknownLetter,"Unknown Letter",
|
||||
E_uwFONUnknownFON,"Unknown FON",
|
||||
E_uwFONUnknownFont,"Unknown font",
|
||||
E_uwFONUnknownText,"Unknown text",
|
||||
E_uwFONTooManyCharacterInFont,"To many characters in font",
|
||||
|
||||
E_uwFONWarningShouldNotHappen,"This error should never happen!!!!",
|
||||
#endif /*__WARNING1_ERR_FON__*/
|
||||
|
||||
0xFFFF, "\0"/*fin*/
|
||||
}
|
||||
#endif /*FON_MainFile*/
|
||||
;
|
||||
#endif /*__ERROR_STRINGS__*/
|
||||
|
||||
|
||||
#define M_FONFatalError(ErrorNum) \
|
||||
{ \
|
||||
if (ErrorNum>E_uwFONFatalErr&&ErrorNum<E_uwFONStartOfWarning) \
|
||||
{ \
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
|
||||
Erm_M_UpdateLastError(FON,C_ucErmDefaultChannel,(unsigned short)ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
Erm_M_ClearLastError((unsigned short)C_ucErmDefaultChannel);\
|
||||
Erm_M_UpdateLastError(FON,C_ucErmDefaultChannel,(unsigned short)E_uwFONFatalNotAFatalError,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
|
||||
} \
|
||||
}
|
||||
|
||||
#define M_FONWarningError(ErrorNum) \
|
||||
{ \
|
||||
if (ErrorNum>E_uwFONStartOfWarning&&ErrorNum<E_uwFONErrNumber) \
|
||||
{ \
|
||||
Erm_M_ClearLastError((unsigned short)C_ucErmDefaultChannel);\
|
||||
Erm_M_UpdateLastError(FON,C_ucErmDefaultChannel,(unsigned short)ErrorNum,C_lErmNoDebugData,C_ucErmOpenInfoWindow,C_ucAllowStopForDebug, NULL);\
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
M_FONFatalError(E_uwFONWarningErrorIsNotAWarningError); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define M_FONInformationErrorWithString(ErrorNum,szString) \
|
||||
{ \
|
||||
if (ErrorNum>E_uwFONStartOfWarning&&ErrorNum<E_uwFONErrNumber) \
|
||||
{ \
|
||||
Erm_M_UpdateLastError(FON,C_ucErmDefaultChannel,(unsigned short)ErrorNum,C_lErmNoDebugData,C_ucErmNoOpenInfoWindow,C_ucNeverStopForDebug, szString);\
|
||||
Erm_M_ClearLastError(C_ucErmDefaultChannel);\
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
M_FONFatalError(E_uwFONWarningErrorIsNotAWarningError); \
|
||||
} \
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __FONITEM_H__ */
|
479
Rayman_X/cpa/tempgrp/GAM/Locale/fonfont.c
Normal file
479
Rayman_X/cpa/tempgrp/GAM/Locale/fonfont.c
Normal file
@@ -0,0 +1,479 @@
|
||||
/*=========================================================================
|
||||
* mnufont.c : Functions for the menus management
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date 27/05/97
|
||||
* Revision date
|
||||
*
|
||||
* That file needs to be compatible for all platforms.
|
||||
*
|
||||
* (c) Ubi R&D 1997
|
||||
*=======================================================================*/
|
||||
/*
|
||||
*=======================================================================
|
||||
Modifications:
|
||||
*=======================================================================*/
|
||||
/*
|
||||
#include "fonhdls.h"
|
||||
*/
|
||||
#include "ACP_Base.h"
|
||||
#include "ToolsCPA.h"
|
||||
/*
|
||||
#include "DPT.h"
|
||||
#include "GEO.h"
|
||||
#include "GLI.h"
|
||||
*/
|
||||
#include "SCR.h"
|
||||
#include "RND.h"
|
||||
/*
|
||||
#include "POS.h"
|
||||
#include "SPO.h"
|
||||
#include "LST.h"
|
||||
#include "SNA.h"
|
||||
*/
|
||||
|
||||
#define FON_MainFile
|
||||
|
||||
#include "fonmem.h"
|
||||
#include "fonerm.h"
|
||||
|
||||
#include "fonpub.h"
|
||||
#include "fonfont.h"
|
||||
#include "FON_Eff.h"
|
||||
#include "fontext.h"
|
||||
|
||||
/*#if defined (U64)
|
||||
void qsort(void *,size_t,size_t,int (*)(const void *,const void *));
|
||||
#endif*/
|
||||
|
||||
/*extern void SNA_fn_vWritePointerInGlobalPointersFile(unsigned long ulPointerAdr);*/
|
||||
/*extern unsigned long SNA_fn_vReadPointerFromGlobalPointersFile();*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Create a font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Name of the font
|
||||
* Output : Handle of the font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*FON_tdxHandleOfFont FON_fn_xCreateFont(char *szFontName,unsigned long ulMaxNumberOfCharacters)
|
||||
{
|
||||
FON_tdxHandleOfFont hFont;
|
||||
|
||||
// Allocate the memory
|
||||
hFont=FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,sizeof(FON_tdstFont));
|
||||
|
||||
#if !defined(U64)
|
||||
hFont->p_szFontName = FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,(strlen(szFontName)+1)*sizeof(char));
|
||||
#endif / U64
|
||||
strcpy(hFont->p_szFontName,szFontName);
|
||||
|
||||
hFont->dLetter = FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,ulMaxNumberOfCharacters*sizeof(FON_tdxHandleOfVisual));
|
||||
hFont->ulMaxNumberOfCharacters = ulMaxNumberOfCharacters;
|
||||
|
||||
#if !defined(U64)
|
||||
// SCR_fnp_st_Link_SetValue(&FON_g_stGeneral.stFontLinkTable,szFontName,(unsigned long)hFont);
|
||||
LST2_M_StaticInitElement(hFont);
|
||||
LST2_M_StaticAddTail(&FON_g_stGeneral.hFontList,hFont);
|
||||
#endif // U64
|
||||
|
||||
return (hFont);
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Release a font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Handle of a font
|
||||
* Output : None
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*void FON_fn_vReleaseFont(FON_tdxHandleOfFont hFont)
|
||||
{
|
||||
FON_fn_vFreeInBloc(E_ucFONMemoryBlock,hFont->dLetter);
|
||||
#if !defined(U64)
|
||||
FON_fn_vFreeInBloc(E_ucFONMemoryBlock,hFont->p_szFontName);
|
||||
#endif // U64
|
||||
FON_fn_vFreeInBloc(E_ucFONMemoryBlock,hFont);
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Remove a font from the global array
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Name of the font
|
||||
* Output : None
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*void FON_fn_vRemoveFont(char *szFontName)
|
||||
{
|
||||
FON_fn_vReleaseFont(FON_fn_xGetFont(szFontName));
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Return a font from its name
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Name of the font
|
||||
* Output : Handle of the font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*FON_tdxHandleOfFont FON_fn_xGetFont(char *szFontName)
|
||||
{
|
||||
FON_tdxHandleOfFont hReturn = NULL;
|
||||
|
||||
#if !defined(U64)
|
||||
long i;
|
||||
FON_tdxHandleOfFont hFontElement;
|
||||
|
||||
/ *
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchKey(&FON_g_stGeneral.stFontLinkTable,szFontName);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
hReturn = (FON_tdxHandleOfFont)SCR_M_ul_Link_GetValue(p_xIndex);
|
||||
else
|
||||
* /
|
||||
|
||||
LST2_M_StaticForEachElementOf(&FON_g_stGeneral.hFontList,hFontElement,i)
|
||||
{
|
||||
if (!stricmp(hFontElement->p_szFontName,szFontName))
|
||||
hReturn = hFontElement;
|
||||
}
|
||||
|
||||
if (hReturn==NULL)
|
||||
M_FONWarningError(E_uwFONUnknownFont);
|
||||
#endif // U64
|
||||
|
||||
return(hReturn);
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Return the name of a font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Font
|
||||
* Output : Name of the font
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 27/10/97 Author : Fran<61>ois
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*char *FON_fn_szGetFontName(FON_tdxHandleOfFont hFont)
|
||||
{
|
||||
char *p_szFontName = NULL;
|
||||
|
||||
#if !defined(U64)
|
||||
long i;
|
||||
FON_tdxHandleOfFont hFontElement;
|
||||
|
||||
LST2_M_StaticForEachElementOf(&FON_g_stGeneral.hFontList,hFontElement,i)
|
||||
{
|
||||
if (hFontElement==hFont)
|
||||
p_szFontName = hFontElement->p_szFontName;
|
||||
}
|
||||
|
||||
/ *
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchValue(&FON_g_stGeneral.stFontLinkTable,(unsigned long)hFont);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
p_szFontName = SCR_M_p_sz_Link_GetKey(p_xIndex);
|
||||
else
|
||||
* /
|
||||
|
||||
if (p_szFontName==NULL)
|
||||
M_FONWarningError(E_uwFONUnknownFont);
|
||||
#endif // U64
|
||||
|
||||
return(p_szFontName);
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : Return TRUE if a font exists
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Name of the font
|
||||
* Output : TRUE/FALSE
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
/*unsigned char FON_fn_bIsFontExists(char *szFontName)
|
||||
{
|
||||
unsigned char ucReturn = FALSE;
|
||||
|
||||
#if !defined(U64)
|
||||
long i;
|
||||
FON_tdxHandleOfFont hFontElement;
|
||||
|
||||
LST2_M_StaticForEachElementOf(&FON_g_stGeneral.hFontList,hFontElement,i)
|
||||
{
|
||||
if (!stricmp(hFontElement->p_szFontName,szFontName))
|
||||
ucReturn = TRUE;
|
||||
}
|
||||
/ *
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchKey(&FON_g_stGeneral.stFontLinkTable,szFontName);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
{
|
||||
ucReturn = TRUE;
|
||||
}
|
||||
* /
|
||||
#endif // U64
|
||||
|
||||
return(ucReturn);
|
||||
}*/
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Description : General inits for the fonts
|
||||
*-----------------------------------------------------------------------------
|
||||
* Input : Nothing
|
||||
* Output : Nothing
|
||||
*-----------------------------------------------------------------------------
|
||||
* Creation date : 2./05/96 Author : Micha<68>l
|
||||
*-----------------------------------------------------------------------------
|
||||
* Modification date : Modification Author :
|
||||
* Modifications :
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
void FON_fn_vInitFonts(void)
|
||||
{
|
||||
/*FON_g_stGeneral.hMatrix = GEO_fn_hCreateMatrix();
|
||||
POS_fn_vSetIdentityMatrix(FON_g_stGeneral.hMatrix);*/
|
||||
|
||||
#if !defined(U64)
|
||||
SCR_fn_v_Link_InitTable(&FON_g_stTextLinkTable);
|
||||
/* SCR_fn_v_Link_InitTable(&FON_g_stGeneral.stFontLinkTable);*/
|
||||
/*LST2_M_StaticInitAnchor(&FON_g_stGeneral.hFontList);*/
|
||||
#endif /* U64 */
|
||||
|
||||
FON_g_stGeneral.uwNumberOfLanguages = 0; /* number of defined languages */
|
||||
FON_g_stGeneral.d_sLanguageArray = NULL; /* array of defined languages */
|
||||
FON_g_stGeneral.p_stCommonLanguage = NULL ; /* common language strings */
|
||||
|
||||
FON_g_stGeneral.ulElapsedTime = 0;
|
||||
|
||||
FON_g_stGeneral.hRandomHandle = RND_fn_hReserveANewHandleIndex();
|
||||
|
||||
/*memset(&FON_g_stEffectByDisplay,0,sizeof(FON_stEffectByDisplay));*/
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
/*************************************************************************/
|
||||
/*int FON_fn_iQSortCmp(const void *hElement1,const void *hElement2)
|
||||
{
|
||||
unsigned short uwChar1,uwChar2;
|
||||
|
||||
uwChar1 = (*(struct FON_tdstVisualFont_ **)hElement1)->uwCharacter;
|
||||
uwChar2 = (*(struct FON_tdstVisualFont_ **)hElement2)->uwCharacter;
|
||||
|
||||
return(uwChar1-uwChar2);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vTreatLoadedFont(FON_tdxHandleOfFont hFont)
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
// *** Leave all non used characters *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
for (i=hFont->ulMaxNumberOfCharacters-1;i>0&&hFont->dLetter[i]==NULL;i--);
|
||||
if (hFont->ulMaxNumberOfCharacters!=i+1)
|
||||
{
|
||||
M_FONInformationErrorWithString(E_uwFONTooManyCharacterInFont,FON_fn_szGetFontName(hFont));
|
||||
hFont->ulMaxNumberOfCharacters = i+1;
|
||||
}
|
||||
|
||||
qsort((void*)hFont->dLetter,hFont->ulMaxNumberOfCharacters,sizeof(FON_tdxHandleOfVisual),FON_fn_iQSortCmp);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
void FON_fn_vDesInitFonts ( void )
|
||||
{
|
||||
FON_fn_vDesinitFONMemory ( ) ;
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
void FON_fn_vReInitFonts ( void )
|
||||
{
|
||||
FON_fn_vInitFonts ( ) ;
|
||||
|
||||
/* also clear the GAM list of available languages */
|
||||
g_stEngineStructure . ucNbLanguages = 0 ;
|
||||
if ( g_stEngineStructure . p_stLanguageTable )
|
||||
{
|
||||
/* this macro clears the pointer, so no need to do it ourselves */
|
||||
M_GameFreeInHLM ( g_stEngineStructure . p_stLanguageTable ) ;
|
||||
}
|
||||
}
|
||||
#endif /* ACTIVE_EDITOR */
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vAddCharacterInFont(FON_tdxHandleOfFont hFont,unsigned long ulCharacterNumber,unsigned short uwCharacter,struct FON_st3DFont_ *h3DObject,MTH_tdxReal xBaseY)
|
||||
{
|
||||
hFont->dLetter[ulCharacterNumber]=FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,sizeof(struct FON_tdstVisualFont_));
|
||||
hFont->dLetter[ulCharacterNumber]->uwCharacter = uwCharacter;
|
||||
hFont->dLetter[ulCharacterNumber]->xBaseY = xBaseY;
|
||||
hFont->dLetter[ulCharacterNumber]->h3DObject = h3DObject;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*struct FON_st3DFont_ *FON_fn_p_stGet3dObjectOfCharacter(FON_tdxHandleOfFont hFont,unsigned short uwCharacher)
|
||||
{
|
||||
struct FON_st3DFont_ *h3DObject = NULL;
|
||||
unsigned long i;
|
||||
|
||||
for (i=0;i<hFont->ulMaxNumberOfCharacters&&hFont->dLetter[i]->uwCharacter!=uwCharacher;i++)
|
||||
{
|
||||
if (h3DObject==NULL&&hFont->dLetter[i]->uwCharacter==' ')
|
||||
h3DObject = hFont->dLetter[i]->h3DObject;
|
||||
}
|
||||
|
||||
if (i<hFont->ulMaxNumberOfCharacters&&hFont->dLetter[i]->uwCharacter==uwCharacher)
|
||||
h3DObject = hFont->dLetter[i]->h3DObject;
|
||||
|
||||
return (h3DObject);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xGetBaseYOfCharacter(FON_tdxHandleOfFont hFont,unsigned short uwCharacher)
|
||||
{
|
||||
MTH_tdxReal xBaseY=0;
|
||||
unsigned long i;
|
||||
|
||||
for (i=0;i<hFont->ulMaxNumberOfCharacters&&hFont->dLetter[i]->uwCharacter!=uwCharacher;i++)
|
||||
{
|
||||
if (xBaseY==0&&hFont->dLetter[i]->uwCharacter==' ')
|
||||
xBaseY = hFont->dLetter[i]->xBaseY;
|
||||
}
|
||||
|
||||
if (i<hFont->ulMaxNumberOfCharacters&&hFont->dLetter[i]->uwCharacter==uwCharacher)
|
||||
xBaseY = hFont->dLetter[i]->xBaseY;
|
||||
|
||||
return (xBaseY);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*unsigned short FON_fn_uwGetDisplayedCharacter(FON_tdxHandleOfFont hFont,char *szText,unsigned long lIndex)
|
||||
{
|
||||
unsigned short uwReturn = 0;
|
||||
|
||||
if (hFont->eTypeOfFont&FON_eGeneralStandard)
|
||||
uwReturn = (unsigned char)szText[lIndex];
|
||||
else if (hFont->eTypeOfFont&FON_eGeneralUnicode)
|
||||
{
|
||||
if ((unsigned char)szText[lIndex]<128)
|
||||
uwReturn = (unsigned char)szText[lIndex];
|
||||
else
|
||||
uwReturn = (unsigned short)((((unsigned char)szText[lIndex])<<8)+(unsigned char)szText[lIndex+1]);
|
||||
}
|
||||
|
||||
return(uwReturn);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*unsigned long FON_fn_vGetNextCharacter(FON_tdxHandleOfFont hFont,char *szText,unsigned long lIndex)
|
||||
{
|
||||
unsigned long ulReturn = 0;
|
||||
|
||||
if (hFont->eTypeOfFont&FON_eGeneralStandard)
|
||||
ulReturn = lIndex+1;
|
||||
else if (hFont->eTypeOfFont&FON_eGeneralUnicode)
|
||||
{
|
||||
if ((unsigned char)szText[lIndex]<128)
|
||||
ulReturn = lIndex+1;
|
||||
else
|
||||
ulReturn = lIndex+2;
|
||||
}
|
||||
return(ulReturn);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vRemoveAllFonts()
|
||||
{
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*GLI_tdstLight *FON_fn_p_stCreateLight(MTH_tdxReal xR,MTH_tdxReal xG,MTH_tdxReal xB,MTH_tdxReal xA)
|
||||
{
|
||||
GLI_tdstLight *p_stLight;
|
||||
POS_tdstCompletePosition stLightMatrix;
|
||||
GLI_tdstColor stColor;
|
||||
MTH3D_tdstVector stI;
|
||||
MTH3D_tdstVector stJ;
|
||||
MTH3D_tdstVector stK;
|
||||
|
||||
GLI_xCreateLight (&p_stLight,GLI_C_lParallelLight);
|
||||
stColor.xR = xR;
|
||||
stColor.xG = xG;
|
||||
stColor.xB = xB;
|
||||
stColor.xA = xA;
|
||||
GLI_xSetLightColor (p_stLight,&stColor );
|
||||
|
||||
GLI_xGetLightMatrix(p_stLight,&stLightMatrix);
|
||||
POS_fn_vGetRotationMatrix(&stLightMatrix, &stI, &stJ, &stK);
|
||||
|
||||
MTH3D_M_vSetVectorElements(&stI,MTH_C_MinusONE,MTH_C_ZERO,MTH_C_ZERO);
|
||||
MTH3D_M_vSetVectorElements(&stJ,MTH_C_ZERO,MTH_C_ZERO,MTH_C_ONE);
|
||||
MTH3D_M_vSetVectorElements(&stK,MTH_C_ZERO,MTH_C_ZERO,MTH_C_ONE);
|
||||
|
||||
POS_fn_vSetRotationMatrix(&stLightMatrix, &stI, &stJ, &stK);
|
||||
|
||||
POS_fn_vComputeTransformMatrix (&stLightMatrix);
|
||||
|
||||
GLI_xSetLightMatrix(p_stLight,&stLightMatrix);
|
||||
|
||||
return(p_stLight);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
|
||||
/* MR0410*/
|
||||
/*void fn_vSaveFONGeneral()
|
||||
{
|
||||
unsigned long i;
|
||||
|
||||
#if !defined(U64)
|
||||
//SNA_fn_vWriteStructureInGlobalPointersFile((unsigned long *)&FON_g_stGeneral,sizeof(FON_tdstGeneral));
|
||||
SNA_fn_vWritePointerInGlobalPointersFile((unsigned long) FON_g_stGeneral.d_stFontAndEffectArray);
|
||||
for (i=0;i<FON_g_stGeneral.ulNumberOfTexts;i++)
|
||||
{
|
||||
SNA_fn_vWritePointerInGlobalPointersFile((unsigned long) FON_g_stGeneral.d_stFontAndEffectArray[i]);
|
||||
}
|
||||
|
||||
// *** DFM 13/01/98 *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
SNA_fn_vWriteStructureInGlobalPointersFile((unsigned long *)&FON_g_stGeneral.hFontList,sizeof(LST2_M_StaticAnchorDeclaration(FON_tdxHandleOfFont)));
|
||||
#endif // U64
|
||||
}*/
|
||||
|
||||
/*void fn_vReadFONGeneral()
|
||||
{
|
||||
unsigned long i;
|
||||
FON_tdxHandleOfFont hLastElementFont,hCurrentFont,hNextFont;
|
||||
|
||||
#if !defined(U64)
|
||||
//SNA_fn_vReadStructureFromGlobalPointersFile((unsigned long *)&FON_g_stGeneral,sizeof(FON_tdstGeneral));
|
||||
FON_g_stGeneral.d_stFontAndEffectArray=(struct FON_tdstFontAndEffect_ **)SNA_fn_vReadPointerFromGlobalPointersFile();
|
||||
for (i=0;i<FON_g_stGeneral.ulNumberOfTexts;i++)
|
||||
{
|
||||
FON_g_stGeneral.d_stFontAndEffectArray[i]=(struct FON_tdstFontAndEffect_ *)SNA_fn_vReadPointerFromGlobalPointersFile();
|
||||
}
|
||||
|
||||
// *** DFM 13/01/98 *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
SNA_fn_vReadStructureFromGlobalPointersFile((unsigned long *)&FON_g_stGeneral.hFontList,sizeof(LST2_M_StaticAnchorDeclaration(FON_tdxHandleOfFont)));
|
||||
hLastElementFont=LST2_M_StaticGetLastElement(&FON_g_stGeneral.hFontList);
|
||||
SNA_M_vValidateStaticLst(&FON_g_stGeneral.hFontList,hLastElementFont,hCurrentFont,hNextFont);
|
||||
#endif // U64
|
||||
}*/
|
108
Rayman_X/cpa/tempgrp/GAM/Locale/fonfont.h
Normal file
108
Rayman_X/cpa/tempgrp/GAM/Locale/fonfont.h
Normal file
@@ -0,0 +1,108 @@
|
||||
#ifndef __FONFONT_H__
|
||||
#define __FONFONT_H__
|
||||
|
||||
#include "CPA_Expt.h"
|
||||
|
||||
#undef EXTERN
|
||||
#undef extern
|
||||
#if !defined(FON_MainFile)
|
||||
#define EXTERN extern
|
||||
#else
|
||||
#define EXTERN
|
||||
#endif /* FON_MainFile */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*typedef struct FON_tdstVisualFont_
|
||||
{
|
||||
unsigned short uwCharacter; // *** For normal and unicode characters ***
|
||||
MTH_tdxReal xBaseY;
|
||||
struct FON_st3DFont_ *h3DObject;
|
||||
} FON_tdstVisualFont;*/
|
||||
|
||||
/*typedef struct FON_tdstVisualFont_ *FON_tdxHandleOfVisual;*/
|
||||
|
||||
/*#if !defined(U64)
|
||||
LST2_M_StaticUseListOf(FON_tdxHandleOfFont);
|
||||
#endif // U64
|
||||
*/
|
||||
|
||||
/* Font structure*/
|
||||
/*typedef struct FON_stFont_
|
||||
{
|
||||
#if !defined(U64)
|
||||
LST2_M_StaticElementDeclaration(FON_tdxHandleOfFont)
|
||||
char *p_szFontName;
|
||||
#endif // U64
|
||||
|
||||
enum FON_tdeTypeOfFont_ eTypeOfFont;
|
||||
|
||||
unsigned long ulMaxNumberOfCharacters;
|
||||
FON_tdxHandleOfVisual *dLetter;
|
||||
MTH_tdxReal xCharacterSpace;
|
||||
} FON_tdstFont;*/
|
||||
|
||||
/*
|
||||
typedef enum eLanguageDefinition_
|
||||
{
|
||||
E_ld_French,
|
||||
E_ld_English,
|
||||
E_ld_German,
|
||||
E_ld_Italian,
|
||||
E_ld_Spanish,
|
||||
E_ld_Japanese,
|
||||
E_ld_Chinese,
|
||||
E_ld_MaxNumberOfLanguages
|
||||
} tdeLanguageDefinition;
|
||||
*/
|
||||
|
||||
#define FON_C_HandleOffsetForCommonLanguage 20000
|
||||
|
||||
typedef struct stLanguage_
|
||||
{
|
||||
char **d_pTextsArray; /* an array of pointers to strings*/
|
||||
unsigned short uwMaxNumberOfTexts; /*size of this array*/
|
||||
unsigned short uwNumberOfTexts; /*used elements in this array*/
|
||||
} tdstLanguage;
|
||||
|
||||
typedef struct FON_tdstGeneral_
|
||||
{
|
||||
unsigned long ulElapsedTime;
|
||||
RND_tdxHandleToRandomIndex hRandomHandle;
|
||||
|
||||
unsigned short uwNumberOfLanguages; /*number of defined languages*/
|
||||
tdstLanguage *d_sLanguageArray; /*array of defined languages*/
|
||||
tdstLanguage *p_stCommonLanguage ; /* structure for common strings */
|
||||
/*FB010199 (for controller pak)*/
|
||||
#ifdef U64
|
||||
unsigned long ulIndexOfFirstControllerPakText;
|
||||
#endif /*U64*/
|
||||
} FON_tdstGeneral;
|
||||
|
||||
/* Function prototypes*/
|
||||
/*void FON_fn_vTreatLoadedFont(FON_tdxHandleOfFont hFont);*/
|
||||
/*void FON_fn_vAddCharacterInFont(FON_tdxHandleOfFont hFont,unsigned long ulCharacterNumber,unsigned short uwCharacter,struct FON_st3DFont_ *h3DObject,MTH_tdxReal xBaseY);*/
|
||||
/*struct FON_st3DFont_ *FON_fn_p_stGet3dObjectOfCharacter(FON_tdxHandleOfFont hFont,unsigned short uwCharacter);*/
|
||||
/*MTH_tdxReal FON_fn_xGetBaseYOfCharacter(FON_tdxHandleOfFont hFont,unsigned short uwCharacher);*/
|
||||
/*FON_tdxHandleOfFont FON_fn_xCreateFont(char *szFontName,unsigned long ulMaxNumberOfCharacters);*/
|
||||
/*void FON_fn_vReleaseFont(FON_tdxHandleOfFont hFont);*/
|
||||
/*void FON_fn_vRemoveFont(char *szFontName);*/
|
||||
|
||||
/*void FON_fn_vRemoveAllFonts();*/
|
||||
|
||||
#if !defined(U64)
|
||||
/*LST2_M_StaticAnchorDeclaration(FON_tdxHandleOfFont) hFontList;*/
|
||||
SCR_tdst_Link_Table FON_g_stTextLinkTable;
|
||||
/* SCR_tdst_Link_Table stFontLinkTable;*/
|
||||
#endif /* U64 */
|
||||
|
||||
EXTERN FON_tdstGeneral FON_g_stGeneral;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __FONFONT_H__ */
|
||||
|
482
Rayman_X/cpa/tempgrp/GAM/Locale/fonload.c
Normal file
482
Rayman_X/cpa/tempgrp/GAM/Locale/fonload.c
Normal file
@@ -0,0 +1,482 @@
|
||||
/*=========================================================================
|
||||
* mnuload.c : Script interpretation for the menus
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date 2./05/97
|
||||
* Revision date
|
||||
*
|
||||
* That file needs to be compatible for all platforms.
|
||||
*
|
||||
* (c) Ubi R&D 1997
|
||||
*=======================================================================*/
|
||||
/*
|
||||
*=======================================================================
|
||||
Modifications:
|
||||
*=======================================================================*/
|
||||
/*#include "fonhdls.h"*/
|
||||
|
||||
#include "ACP_Base.h"
|
||||
#include "ToolsCPA.h"
|
||||
|
||||
/*#include "SCR.h"*/
|
||||
/*#include "DPT.h"*/
|
||||
/*#include "GEO.h"*/
|
||||
/*#include "GLI.h"*/
|
||||
/*#include "TEX.h"*/
|
||||
/*#include "SCR.h"*/
|
||||
/*#include "VIG.h"*/
|
||||
#include "RND.h"
|
||||
/*#include "LST.h"*/
|
||||
|
||||
#include "fonerm.h"
|
||||
#include "fonmem.h"
|
||||
#include "Structur/EngMode.h"
|
||||
|
||||
/*#include "fonpub.h"*/
|
||||
/*#include "FON_Eff.h"*/
|
||||
#include "fonfont.h"
|
||||
#include "fonload.h"
|
||||
/*#include "fontext.h"*/
|
||||
|
||||
static BOOL s_bIncoherenceInTxtFiles = FALSE;
|
||||
|
||||
/* Global array of fonts*/
|
||||
#if !defined(U64)
|
||||
/*SCR_tdst_Link_Table FON_g_stFontLinkTable; // For binarisation purpose only*/
|
||||
|
||||
SCR_tdst_Link_Table *FON_fn_p_stGetLinkTable()
|
||||
{
|
||||
return &FON_g_stTextLinkTable;
|
||||
}
|
||||
#endif /* U64 */
|
||||
|
||||
/*************************************************************************/
|
||||
void FON_fn_vInitLoad()
|
||||
{
|
||||
#if !defined(U64)
|
||||
SCR_fn_v_RdL0_RegisterCallback(FON_C_SectionAddNewStrings,FON_fn_eLoadTextString,SCR_CRC_c_RdL0_ForSection);
|
||||
|
||||
/*SCR_fn_v_Link_InitTable(&FON_g_stFontLinkTable); // for binarisation purposes only*/
|
||||
#endif /* U64 */
|
||||
}
|
||||
/*************************************************************************/
|
||||
|
||||
#if !defined(U64)
|
||||
|
||||
|
||||
#if 0
|
||||
|
||||
/* convert lowercase to uppercase, and accented characters to their unaccented version... */
|
||||
void fn_vConvertStringChars ( char *_p_szString )
|
||||
{
|
||||
int j = strlen ( _p_szString ) , i ;
|
||||
|
||||
for ( i = 0 ; i < j ; i ++ )
|
||||
{
|
||||
#if 1
|
||||
if ( _p_szString [ i ] >= 'a' && _p_szString [ i ] <= 'z' )
|
||||
_p_szString [ i ] = toupper ( _p_szString [ i ] ) ;
|
||||
#else
|
||||
switch ( _p_szString [ i ] )
|
||||
{
|
||||
case '<27>':
|
||||
_p_szString [ i ] = 'c' ;
|
||||
break ;
|
||||
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
_p_szString [ i ] = 'e' ;
|
||||
break ;
|
||||
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
_p_szString [ i ] = 'a' ;
|
||||
break ;
|
||||
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
_p_szString [ i ] = 'o' ;
|
||||
break ;
|
||||
|
||||
case '<27>':
|
||||
case '<27>':
|
||||
_p_szString [ i ] = 'i' ;
|
||||
break ;
|
||||
|
||||
case '<27>' :
|
||||
case '<27>' :
|
||||
case '<27>' :
|
||||
case '<27>' :
|
||||
_p_szString [ i ] = 'u' ;
|
||||
break ;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* 0 */
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
#ifdef M_CheckScriptParamNumber
|
||||
#undef M_CheckScriptParamNumber
|
||||
#endif
|
||||
|
||||
#define M_CheckScriptParamNumber(ulNumber) \
|
||||
{ \
|
||||
if (SCR_fn_uc_RdL0_GetNumberOfParameters(szParams)!=ulNumber) \
|
||||
M_FONFatalError(E_uwFontScriptBadNumberOfArg); \
|
||||
}
|
||||
|
||||
SCR_tde_Anl_ReturnValue FON_fn_eLoadTextString(SCR_tdst_File_Description *p_fFile, char *szAction, char *szParams[], SCR_tde_Anl_Action cType)
|
||||
{
|
||||
/*enum FON_tdeTextEffect_ _eTextEffect = FON_e_Nothing;*/
|
||||
/*static tdeLanguageDefinition wLanguageId;*/
|
||||
static short s_wLanguageId ;
|
||||
static tdstLanguage * s_p_stLoadedLanguage ;
|
||||
|
||||
switch (cType)
|
||||
{
|
||||
case SCR_EA_Anl_BeginSection:
|
||||
{
|
||||
/*allocate the pointer of lists of languages*/
|
||||
register unsigned short uwLanguage = 0;
|
||||
|
||||
if ( !stricmp(szAction, "Common") )
|
||||
{
|
||||
/* special value for common language strings */
|
||||
s_wLanguageId = -1 ;
|
||||
if ( ! FON_g_stGeneral . p_stCommonLanguage )
|
||||
{
|
||||
FON_g_stGeneral.p_stCommonLanguage = (tdstLanguage *) FON_fn_p_vAllocInBloc (
|
||||
E_ucFONTextMemoryBlock ,
|
||||
sizeof ( tdstLanguage )
|
||||
);
|
||||
}
|
||||
/* the subsequent loaded strings are to be associated with this language definition */
|
||||
s_p_stLoadedLanguage = FON_g_stGeneral . p_stCommonLanguage ;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* by default if any problem */
|
||||
s_wLanguageId = 0;
|
||||
do
|
||||
{
|
||||
if ( !stricmp(szAction, g_stEngineStructure.p_stLanguageTable[uwLanguage].szLanguageCode) )
|
||||
{
|
||||
s_wLanguageId = uwLanguage;
|
||||
uwLanguage = g_stEngineStructure.ucNbLanguages;
|
||||
}
|
||||
} while ( uwLanguage ++ < g_stEngineStructure . ucNbLanguages ) ;
|
||||
|
||||
/*allocate a new language definition structure if necessary*/
|
||||
if ( FON_g_stGeneral.uwNumberOfLanguages <= s_wLanguageId )
|
||||
{
|
||||
long lIndex;
|
||||
|
||||
if ( FON_g_stGeneral.d_sLanguageArray )
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray = (tdstLanguage *) FON_fn_p_vReallocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
FON_g_stGeneral.d_sLanguageArray,
|
||||
(s_wLanguageId + 1) * sizeof(tdstLanguage)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray = (tdstLanguage *) FON_fn_p_vAllocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
(s_wLanguageId + 1) * sizeof(tdstLanguage)
|
||||
);
|
||||
}
|
||||
|
||||
/*initialize all new allocated structures*/
|
||||
for ( lIndex = FON_g_stGeneral.uwNumberOfLanguages; lIndex < s_wLanguageId + 1; lIndex ++ )
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray = NULL;
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].uwMaxNumberOfTexts = 0;
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].uwNumberOfTexts = 0;
|
||||
}
|
||||
FON_g_stGeneral.uwNumberOfLanguages = (unsigned short) (s_wLanguageId + 1);
|
||||
}
|
||||
/* the subsequent loaded strings are to be associated with this language definition */
|
||||
s_p_stLoadedLanguage = FON_g_stGeneral . d_sLanguageArray + s_wLanguageId ;
|
||||
}
|
||||
|
||||
/*update the size of the string pointers array*/
|
||||
s_p_stLoadedLanguage -> uwMaxNumberOfTexts += (unsigned short) (atoi(szParams[0]));
|
||||
if ( s_p_stLoadedLanguage -> d_pTextsArray )
|
||||
{
|
||||
s_p_stLoadedLanguage -> d_pTextsArray = (char/*struct FON_stText_*/ **) FON_fn_p_vReallocInBloc (
|
||||
E_ucFONTextMemoryBlock,
|
||||
s_p_stLoadedLanguage -> d_pTextsArray,
|
||||
s_p_stLoadedLanguage -> uwMaxNumberOfTexts * sizeof(char/*struct FON_stText_*/ *)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
s_p_stLoadedLanguage -> d_pTextsArray = (char/*struct FON_stText_*/ **) FON_fn_p_vAllocInBloc (
|
||||
E_ucFONTextMemoryBlock,
|
||||
s_p_stLoadedLanguage -> uwMaxNumberOfTexts * sizeof(char/*struct FON_stText_*/ *)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/*FON_g_stGeneral.d_stFontAndEffectArray = (struct FON_tdstFontAndEffect_ **)FON_fn_p_vReallocInBloc(E_ucFONMemoryBlock,FON_g_stGeneral.d_stFontAndEffectArray,FON_g_stGeneral.ulMaxNumberOfTexts*sizeof(struct FON_tdstFontAndEffect_ *));*/
|
||||
break;
|
||||
|
||||
case SCR_EA_Anl_Entry :
|
||||
if ( ! stricmp( szAction , FON_C_SectionNewString ) || !stricmp( szAction , FON_C_SectionNewUpperString ) )
|
||||
{
|
||||
char *hText = NULL;
|
||||
if (s_p_stLoadedLanguage -> uwNumberOfTexts >= s_p_stLoadedLanguage -> uwMaxNumberOfTexts)
|
||||
{
|
||||
M_FONFatalError(E_uwFONNotEnoughStringSpace);
|
||||
}
|
||||
|
||||
/* if the text is empty, try to find a non-empty version in any other language (the string is common to all)*/
|
||||
if ( strlen(szParams[1]) == 0 )
|
||||
{
|
||||
long lIndex;
|
||||
for (lIndex = 0; lIndex < FON_g_stGeneral.uwNumberOfLanguages; lIndex ++)
|
||||
if ( FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray )
|
||||
{
|
||||
/* get the text in the other language*/
|
||||
hText = FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray[s_p_stLoadedLanguage -> uwNumberOfTexts];
|
||||
if ( hText )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SCR_tdst_Link_Value * p_stRegisteredValue ;
|
||||
char szRegisteredString [ 256 ] ;
|
||||
long lSize = strlen ( szParams [ 1 ] ) ;
|
||||
|
||||
hText = FON_fn_p_vAllocInBloc(
|
||||
E_ucFONTextMemoryBlock ,
|
||||
lSize + 1
|
||||
#ifdef ACTIVE_EDITOR
|
||||
+ 2 /* 2 bytes for the string length */
|
||||
#endif
|
||||
) ;
|
||||
#ifdef ACTIVE_EDITOR
|
||||
/* for debug purposes (only for certain AI calls), store the size of the string after it */
|
||||
* ( short * ) ( & hText [ lSize + 1 ] ) = ( short ) lSize ;
|
||||
#endif
|
||||
strcpy ( hText , szParams [ 1 ] ) ;
|
||||
/* convert strange characters to more normal characters */
|
||||
#if 0
|
||||
fn_vConvertStringChars ( hText ) ;
|
||||
#endif
|
||||
/* upper ? */
|
||||
if ( ! stricmp ( szAction , FON_C_SectionNewUpperString ) )
|
||||
strupr ( hText ) ;
|
||||
|
||||
|
||||
/* First we check if the string is already registered with a different index */
|
||||
if (!s_bIncoherenceInTxtFiles)
|
||||
{
|
||||
p_stRegisteredValue = SCR_fnp_st_Link_SearchKey(&FON_g_stTextLinkTable, szParams[0]);
|
||||
if ( p_stRegisteredValue != NULL )
|
||||
{
|
||||
long lRegisteredIndex = SCR_M_ul_Link_GetValue(p_stRegisteredValue);
|
||||
|
||||
/* common strings have special indexes to identify them */
|
||||
if ( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
lRegisteredIndex -= FON_C_HandleOffsetForCommonLanguage ;
|
||||
|
||||
if ( lRegisteredIndex != s_p_stLoadedLanguage -> uwNumberOfTexts )
|
||||
{
|
||||
char szMessage[256];
|
||||
|
||||
sprintf(szMessage, "There is an incoherence in the text file %s, at the string %s", p_fFile->a_szFileName, szParams[0]);
|
||||
MessageBox(NULL,szMessage,"Incoherence in a TXT file",MB_OK|MB_ICONWARNING);
|
||||
s_bIncoherenceInTxtFiles = TRUE;
|
||||
#if defined ( ACTIVE_EDITOR )
|
||||
fn_vForceEditor();
|
||||
#endif /* ! ACTIVE_EDITOR */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Then we check if the index is already registered with a different string */
|
||||
if ( ! s_bIncoherenceInTxtFiles )
|
||||
{
|
||||
long lRegisteredIndex = s_p_stLoadedLanguage -> uwNumberOfTexts ;
|
||||
/* common strings have special indexes to identify them */
|
||||
if ( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
lRegisteredIndex += FON_C_HandleOffsetForCommonLanguage ;
|
||||
|
||||
p_stRegisteredValue = SCR_fnp_st_Link_SearchValue(&FON_g_stTextLinkTable, lRegisteredIndex ) ;
|
||||
if ( p_stRegisteredValue != NULL )
|
||||
{
|
||||
strcpy(szRegisteredString, SCR_M_p_sz_Link_GetKey(p_stRegisteredValue));
|
||||
if (stricmp(szRegisteredString, szParams[0]))
|
||||
{
|
||||
char szMessage[256];
|
||||
|
||||
sprintf(szMessage, "There is an incoherence in the text file %s, at the string %s", p_fFile->a_szFileName, szParams[0]);
|
||||
MessageBox(NULL,szMessage,"Incoherence in a TXT file",MB_OK|MB_ICONWARNING);
|
||||
s_bIncoherenceInTxtFiles = TRUE;
|
||||
#if defined ( ACTIVE_EDITOR )
|
||||
fn_vForceEditor();
|
||||
#endif /* ! ACTIVE_EDITOR */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* normally this line should occur once per text per language -> everything will be fine if a given text name*/
|
||||
/* always has the same index in the section, because only one linktable entry may exist with a given name*/
|
||||
SCR_fnp_st_Link_SetValue(
|
||||
&FON_g_stTextLinkTable,
|
||||
szParams[0],
|
||||
s_p_stLoadedLanguage -> uwNumberOfTexts
|
||||
+ (
|
||||
( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
? FON_C_HandleOffsetForCommonLanguage
|
||||
: 0
|
||||
)
|
||||
) ;
|
||||
}
|
||||
|
||||
s_p_stLoadedLanguage -> d_pTextsArray[ s_p_stLoadedLanguage -> uwNumberOfTexts ] = hText ;
|
||||
s_p_stLoadedLanguage -> uwNumberOfTexts ++;
|
||||
}
|
||||
else if ( !stricmp(szAction, FON_C_SectionNewStringLength) )
|
||||
{
|
||||
char *hText = NULL;
|
||||
if ( s_p_stLoadedLanguage -> uwNumberOfTexts >= s_p_stLoadedLanguage -> uwMaxNumberOfTexts )
|
||||
{
|
||||
M_FONFatalError(E_uwFONNotEnoughStringSpace);
|
||||
}
|
||||
|
||||
/* if the text is empty, try to find a non-empty version in any other language (the string is common to all)*/
|
||||
if ( atoi(szParams[1]) == 0 )
|
||||
{
|
||||
long lIndex;
|
||||
for (lIndex = 0; lIndex < FON_g_stGeneral.uwNumberOfLanguages; lIndex ++)
|
||||
if ( FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray )
|
||||
{
|
||||
/* get the text in the other language*/
|
||||
hText = FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray[ s_p_stLoadedLanguage -> uwNumberOfTexts ] ;
|
||||
if ( hText )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
SCR_tdst_Link_Value *p_stRegisteredValue;
|
||||
char szRegisteredString[256];
|
||||
long lRegisteredIndex;
|
||||
|
||||
long lSize;
|
||||
lSize = atoi(szParams[1]);
|
||||
/* allocate a string and fill it with whitespaces (so that strlen() is non-zero)*/
|
||||
hText = FON_fn_p_vAllocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
lSize + 1 /* string + zero terminator */
|
||||
#ifdef ACTIVE_EDITOR
|
||||
+ 2 /* 2 bytes for the string length */
|
||||
#endif
|
||||
);
|
||||
/* fill with whitespaces for clarity */
|
||||
memset(hText, ' ', lSize );
|
||||
/* don't forget to set the zero terminator */
|
||||
hText [ lSize ] = 0 ;
|
||||
|
||||
#ifdef ACTIVE_EDITOR
|
||||
/* for debug purposes (only for certain AI calls), store the size of the string after it */
|
||||
* ( short * ) ( & hText [ lSize + 1 ] ) = ( short ) lSize ;
|
||||
#endif
|
||||
|
||||
/* First we check if the string is already registered with a different index */
|
||||
if (!s_bIncoherenceInTxtFiles)
|
||||
{
|
||||
p_stRegisteredValue = SCR_fnp_st_Link_SearchKey(&FON_g_stTextLinkTable, szParams[0]);
|
||||
if (p_stRegisteredValue!=NULL)
|
||||
{
|
||||
lRegisteredIndex = SCR_M_ul_Link_GetValue(p_stRegisteredValue);
|
||||
|
||||
/* common strings have special indexes to identify them */
|
||||
if ( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
lRegisteredIndex -= FON_C_HandleOffsetForCommonLanguage ;
|
||||
|
||||
if ( lRegisteredIndex != s_p_stLoadedLanguage -> uwNumberOfTexts )
|
||||
{
|
||||
char szMessage[256];
|
||||
|
||||
sprintf(szMessage, "There is an incoherence in the text file %s, at the string %s", p_fFile->a_szFileName, szParams[0]);
|
||||
MessageBox(NULL,szMessage,"Incoherence in a TXT file",MB_OK|MB_ICONWARNING);
|
||||
s_bIncoherenceInTxtFiles = TRUE;
|
||||
#if defined ( ACTIVE_EDITOR )
|
||||
fn_vForceEditor();
|
||||
#endif /* ! ACTIVE_EDITOR */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Then we check if the index is already registered with a different string */
|
||||
if (!s_bIncoherenceInTxtFiles)
|
||||
{
|
||||
long lRegisteredIndex = s_p_stLoadedLanguage -> uwNumberOfTexts ;
|
||||
/* common strings have special indexes to identify them */
|
||||
if ( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
lRegisteredIndex += FON_C_HandleOffsetForCommonLanguage ;
|
||||
|
||||
p_stRegisteredValue = SCR_fnp_st_Link_SearchValue(&FON_g_stTextLinkTable, lRegisteredIndex ) ;
|
||||
if ( p_stRegisteredValue != NULL )
|
||||
{
|
||||
strcpy(szRegisteredString, SCR_M_p_sz_Link_GetKey(p_stRegisteredValue));
|
||||
if (stricmp(szRegisteredString, szParams[0]))
|
||||
{
|
||||
char szMessage[256];
|
||||
|
||||
sprintf(szMessage, "There is an incoherence in the text file %s, at the string %s", p_fFile->a_szFileName, szParams[0]);
|
||||
MessageBox(NULL,szMessage,"Incoherence in a TXT file",MB_OK|MB_ICONWARNING);
|
||||
s_bIncoherenceInTxtFiles = TRUE;
|
||||
#if defined ( ACTIVE_EDITOR )
|
||||
fn_vForceEditor();
|
||||
#endif /* ! ACTIVE_EDITOR */
|
||||
}
|
||||
}
|
||||
}
|
||||
/* normally this line should occur once per text per language -> everything will be fine if a given text name*/
|
||||
/* always has the same index in the section, because only one linktable entry may exist with a given name*/
|
||||
SCR_fnp_st_Link_SetValue(
|
||||
&FON_g_stTextLinkTable,
|
||||
szParams[0],
|
||||
s_p_stLoadedLanguage -> uwNumberOfTexts
|
||||
+ (
|
||||
( s_p_stLoadedLanguage == FON_g_stGeneral . p_stCommonLanguage )
|
||||
? FON_C_HandleOffsetForCommonLanguage
|
||||
: 0
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
s_p_stLoadedLanguage -> d_pTextsArray[ s_p_stLoadedLanguage -> uwNumberOfTexts ] = hText ;
|
||||
s_p_stLoadedLanguage -> uwNumberOfTexts ++ ;
|
||||
}
|
||||
break;
|
||||
|
||||
case SCR_EA_Anl_EndSection:
|
||||
break;
|
||||
}
|
||||
|
||||
return SCR_ERV_Anl_NormalReturn;
|
||||
}
|
||||
#endif /* U64 */
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* Binarisation functions*/
|
||||
/* See with Alain Robin for any problem or question*/
|
||||
|
||||
|
||||
/*char* FON_fn_p_cAlloc(unsigned long _ulSize)
|
||||
{
|
||||
return (char*)FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,_ulSize);
|
||||
}*/
|
222
Rayman_X/cpa/tempgrp/GAM/Locale/fonloadCB.c
Normal file
222
Rayman_X/cpa/tempgrp/GAM/Locale/fonloadCB.c
Normal file
@@ -0,0 +1,222 @@
|
||||
#include "ACP_Base.h"
|
||||
#include "ToolsCPA.h"
|
||||
|
||||
/*#include "SCR.h"*/
|
||||
/*#include "DPT.h"*/
|
||||
/*#include "GEO.h"*/
|
||||
/*#include "GLI.h"*/
|
||||
/*#include "TEX.h"*/
|
||||
/*#include "SCR.h"*/
|
||||
/*#include "VIG.h"*/
|
||||
#include "RND.h"
|
||||
/*#include "LST.h"*/
|
||||
|
||||
#include "fonerm.h"
|
||||
#include "fonmem.h"
|
||||
#include "Structur/EngMode.h"
|
||||
|
||||
/*#include "fonpub.h"*/
|
||||
/*#include "FON_Eff.h"*/
|
||||
#include "fonfont.h"
|
||||
#include "fonload.h"
|
||||
/*#include "fontext.h"*/
|
||||
#include "ldt.h"
|
||||
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
Function name : fn_iCreateTextString
|
||||
Description :
|
||||
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
|
||||
Creation Date : 13-Oct-98
|
||||
Modified :
|
||||
Return type : int
|
||||
Argument : LDT_tdst_Link *pLink
|
||||
*****************************************************************/
|
||||
int fn_iCreateTextString( LDT_tdst_Link *pLink )
|
||||
{
|
||||
char *szAction;
|
||||
short wLanguageId;
|
||||
/*allocate the pointer of lists of languages*/
|
||||
register unsigned short uwLanguage = 0;
|
||||
|
||||
szAction = LDT_szGetSectionName();
|
||||
|
||||
|
||||
/* by default if any problem*/
|
||||
wLanguageId = 0;
|
||||
do
|
||||
{
|
||||
if ( !stricmp(szAction, g_stEngineStructure.p_stLanguageTable[uwLanguage].szLanguageCode) )
|
||||
{
|
||||
wLanguageId = uwLanguage;
|
||||
uwLanguage = g_stEngineStructure.ucNbLanguages;
|
||||
}
|
||||
} while( uwLanguage++<g_stEngineStructure.ucNbLanguages );
|
||||
|
||||
LDT_SetLinkValue( pLink, (unsigned long)wLanguageId );
|
||||
|
||||
|
||||
/*allocate a new language definition structure if necessary*/
|
||||
if ( FON_g_stGeneral.uwNumberOfLanguages <= wLanguageId )
|
||||
{
|
||||
long lIndex;
|
||||
|
||||
if ( FON_g_stGeneral.d_sLanguageArray )
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray = (tdstLanguage *) FON_fn_p_vReallocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
FON_g_stGeneral.d_sLanguageArray,
|
||||
(wLanguageId + 1) * sizeof(tdstLanguage)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray = (tdstLanguage *) FON_fn_p_vAllocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
(wLanguageId + 1) * sizeof(tdstLanguage)
|
||||
);
|
||||
}
|
||||
|
||||
/*initialize all new allocated structures*/
|
||||
for ( lIndex = FON_g_stGeneral.uwNumberOfLanguages; lIndex < wLanguageId + 1; lIndex ++ )
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray = NULL;
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].uwMaxNumberOfTexts = 0;
|
||||
FON_g_stGeneral.d_sLanguageArray[lIndex].uwNumberOfTexts = 0;
|
||||
}
|
||||
FON_g_stGeneral.uwNumberOfLanguages = (unsigned short) (wLanguageId + 1);
|
||||
}
|
||||
|
||||
/*update the size of the string pointers array*/
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwMaxNumberOfTexts += (unsigned short) (atoi(LDT_szGetParam(1)));
|
||||
if ( FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray ) {
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray = (char/*struct FON_stText_*/ **) FON_fn_p_vReallocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray,
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwMaxNumberOfTexts * sizeof(char/*struct FON_stText_*/ *)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray = (char/*struct FON_stText_*/ **) FON_fn_p_vAllocInBloc(
|
||||
E_ucFONTextMemoryBlock,
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwMaxNumberOfTexts * sizeof(char/*struct FON_stText_*/ *)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************
|
||||
Function name : fn_iLoadTextString
|
||||
Description :
|
||||
Author : Ovidiu Scripa (oscripa@ubisoft.ro) - ROMTEAM
|
||||
Creation Date : 13-Oct-98
|
||||
Modified :
|
||||
Return type : int
|
||||
Argument : LDT_tdst_Link *pLink
|
||||
*****************************************************************/
|
||||
int fn_iLoadTextString( LDT_tdst_Link *pLink )
|
||||
{
|
||||
LDT_tdeParseResult result=ParseResult_BeginSection;
|
||||
short wLanguageId = (short)LDT_GetLinkValue(pLink);
|
||||
|
||||
while( result!=ParseResult_EndSection )
|
||||
{
|
||||
result=LDT_GetNextEntry();
|
||||
switch( result )
|
||||
{
|
||||
case ParseResult_Entry: /* an entry */
|
||||
{
|
||||
char *szEntry=LDT_szGetEntryName();
|
||||
if ( !stricmp(szEntry, FON_C_SectionNewString) || !stricmp(szEntry, FON_C_SectionNewUpperString) )
|
||||
{
|
||||
char *hText;
|
||||
if (FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts >= FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwMaxNumberOfTexts)
|
||||
{
|
||||
M_FONFatalError(E_uwFONNotEnoughStringSpace);
|
||||
}
|
||||
|
||||
/* if the text is empty, try to find a non-empty version in any other language (the string is common to all)*/
|
||||
if ( strlen(LDT_szGetParam(2)) == 0 )
|
||||
{
|
||||
long lIndex;
|
||||
for (lIndex = 0; lIndex < FON_g_stGeneral.uwNumberOfLanguages; lIndex ++)
|
||||
if ( FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray )
|
||||
{
|
||||
/* get the text in the other language*/
|
||||
hText = FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray[FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts];
|
||||
if ( hText )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
hText = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,strlen(LDT_szGetParam(2))+1);
|
||||
strcpy(hText, LDT_szGetParam(2));
|
||||
if ( !stricmp(szEntry,FON_C_SectionNewUpperString) )
|
||||
strupr(hText);
|
||||
|
||||
/* normally this line should occur once per text per language -> everything will be fine if a given text name*/
|
||||
/* always has the same index in the section, because only one linktable entry may exist with a given name*/
|
||||
SCR_fnp_st_Link_SetValue(&FON_g_stTextLinkTable, LDT_szGetParam(1), FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts);
|
||||
}
|
||||
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray[FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts] = hText;
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts ++;
|
||||
}
|
||||
else if (!stricmp(szEntry, FON_C_SectionNewStringLength))
|
||||
{
|
||||
char *hText;
|
||||
if (FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts >= FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwMaxNumberOfTexts)
|
||||
{
|
||||
M_FONFatalError(E_uwFONNotEnoughStringSpace);
|
||||
}
|
||||
|
||||
/* if the text is empty, try to find a non-empty version in any other language (the string is common to all)*/
|
||||
if ( atoi(LDT_szGetParam(2)) == 0 )
|
||||
{
|
||||
long lIndex;
|
||||
for (lIndex = 0; lIndex < FON_g_stGeneral.uwNumberOfLanguages; lIndex ++)
|
||||
if ( FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray )
|
||||
{
|
||||
/* get the text in the other language*/
|
||||
hText = FON_g_stGeneral.d_sLanguageArray[lIndex].d_pTextsArray[FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts];
|
||||
if ( hText )
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
long lSize;
|
||||
lSize = atoi(LDT_szGetParam(2));
|
||||
|
||||
/* allocate a string and fill it with whitespaces (so that strlen() is non-zero)*/
|
||||
hText = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,lSize + 1);
|
||||
memset(hText, 0, lSize + 1);
|
||||
memset(hText, ' ', lSize);
|
||||
|
||||
*(short *) (hText + lSize) = (short) lSize;
|
||||
|
||||
/* normally this line should occur once per text per language -> everything will be fine if a given text name*/
|
||||
/* always has the same index in the section, because only one linktable entry may exist with a given name*/
|
||||
SCR_fnp_st_Link_SetValue(&FON_g_stTextLinkTable, LDT_szGetParam(1), FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts);
|
||||
}
|
||||
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].d_pTextsArray[FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts] = hText;
|
||||
FON_g_stGeneral.d_sLanguageArray[wLanguageId].uwNumberOfTexts ++;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
166
Rayman_X/cpa/tempgrp/GAM/Locale/fonmem.c
Normal file
166
Rayman_X/cpa/tempgrp/GAM/Locale/fonmem.c
Normal file
@@ -0,0 +1,166 @@
|
||||
/*=========================================================================
|
||||
* mnubase.c : MEmory management of the menus
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date 27/05/97
|
||||
* Revision date
|
||||
*
|
||||
* That file needs to be compatible for all platforms.
|
||||
*
|
||||
* (c) Ubi R&D 1997
|
||||
*=======================================================================*/
|
||||
/*
|
||||
*=======================================================================
|
||||
Modifications:
|
||||
*=======================================================================*/
|
||||
/*#include "fonhdls.h"*/
|
||||
#include "ACP_Base.h"
|
||||
#include "ToolsCPA.h"
|
||||
|
||||
#include "fonerm.h"
|
||||
#include "fonmem.h"
|
||||
|
||||
static unsigned long gs_ulFontTextMemorySize;
|
||||
|
||||
//FB300699
|
||||
#ifdef U64
|
||||
#ifndef FINAL_VERSION
|
||||
#define CHECK_STRING
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**************************************************************************/
|
||||
void *FON_fn_p_vAllocInBloc(enum e_ucFONStaticBlocks eBloc,unsigned long lSize)
|
||||
{
|
||||
void *p_vPointer;
|
||||
|
||||
/* Note : should not use Mmg_M_BigBoundSize !!*/
|
||||
/* Mmg_M_BigBoundSize (lSize , C_uwAllocSize);*/
|
||||
Mmg_M_SetModeAlloc4Ch(FON,(unsigned char)eBloc,C_ucMmgDefaultChannel);
|
||||
MMG_fn_vAddMemoryInfo (MMG_C_lTypeGAM , MMG_C_lSubTypeFont , NULL);
|
||||
p_vPointer = Mmg_fn_p_vAlloc4Ch(lSize,C_ucMmgDefaultChannel);
|
||||
|
||||
#ifndef CHECK_STRING
|
||||
if (p_vPointer==NULL)
|
||||
M_FONFatalError(E_uwFONMemoryError);
|
||||
|
||||
memset(p_vPointer,0,lSize);
|
||||
#endif
|
||||
|
||||
return (p_vPointer);
|
||||
}
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
void *FON_fn_p_vReallocInBloc(enum e_ucFONStaticBlocks eBloc,void *p_vPointer,unsigned long lSize)
|
||||
{
|
||||
Mmg_M_SetModeAlloc4Ch(FON,(unsigned char)eBloc,C_ucMmgDefaultChannel);
|
||||
p_vPointer = Mmg_fn_p_vRealloc4Ch(p_vPointer,lSize,C_ucMmgDefaultChannel);
|
||||
if (p_vPointer==NULL)
|
||||
M_FONFatalError(E_uwFONMemoryError);
|
||||
|
||||
return (p_vPointer);
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
//XB 21/04/99
|
||||
//#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
//End XB
|
||||
void FON_fn_vFreeInBloc(enum e_ucFONStaticBlocks eBloc,void *p_vPointer)
|
||||
{
|
||||
Mmg_M_SetModeAlloc4Ch(FON,(unsigned char)eBloc,C_ucMmgDefaultChannel);
|
||||
MMG_fn_vAddMemoryInfo (MMG_C_lTypeGAM , MMG_C_lSubTypeFont , NULL);
|
||||
Mmg_fn_vFree4Ch(p_vPointer,C_ucMmgDefaultChannel);
|
||||
}
|
||||
//XB 21/04/99
|
||||
//#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
//End XB
|
||||
|
||||
/**************************************************************************/
|
||||
void FON_fn_vFirstInitFONMemory(unsigned long _ulFontTextMemorySize)
|
||||
{
|
||||
Erm_M_InitErrMsg(FON); /* Init the error module*/
|
||||
Mmg_M_InitMmg(FON);
|
||||
|
||||
|
||||
#if !defined(U64)
|
||||
/**** Check the ACP memory module ****/
|
||||
Mmg_fn_cCheckAlignmentValidity();
|
||||
|
||||
|
||||
Mmg_M_InitBlock(FON,E_ucFONTextMemoryBlock,_ulFontTextMemorySize);
|
||||
#else /* !U64 */
|
||||
#ifdef CHECK_MEMORY
|
||||
Mmg_M_InitSpecificBlock(FON,E_ucFONTextMemoryBlock, _ulFontTextMemorySize, 10000, 4, C_BlockWithFreeFlag | C_Check_AlignementFlag | C_Check_OverflowFlag);
|
||||
#else /* CHECK_MEMORY */
|
||||
//XB 21/04/99
|
||||
//Mmg_M_InitSpecificBlock(FON,E_ucFONTextMemoryBlock, _ulFontTextMemorySize, 10000, 4, C_BlockWithoutFreeFlag | C_Check_AlignementFlag | C_Check_OverflowFlag);
|
||||
Mmg_M_InitSpecificBlock(FON,E_ucFONTextMemoryBlock, _ulFontTextMemorySize, 10000, 4, C_BlockWithFreeFlag | C_Check_AlignementFlag | C_Check_OverflowFlag);
|
||||
//End XB
|
||||
#endif /* CHECK_MEMORY */
|
||||
#endif /* U64 */
|
||||
|
||||
|
||||
/**** Save memory size (for reinit) ****/
|
||||
gs_ulFontTextMemorySize = _ulFontTextMemorySize;
|
||||
}
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
void FON_fn_vDesinitFONMemory(void)
|
||||
{
|
||||
/*Mmg_M_FreeBlock(FON,E_ucFONMemoryBlock);*/
|
||||
/*Mmg_M_DeleteBlock(FON,E_ucFONMemoryBlock);*/
|
||||
Mmg_M_FreeBlock(FON,E_ucFONTextMemoryBlock);
|
||||
Mmg_M_DeleteBlock(FON,E_ucFONTextMemoryBlock);
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
/**************************************************************************/
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
void FON_fn_vReinitFONMemory(void)
|
||||
{
|
||||
/**** free the block*/
|
||||
Mmg_M_FreeBlock(FON,E_ucFONTextMemoryBlock);
|
||||
Mmg_M_DeleteBlock(FON,E_ucFONTextMemoryBlock);
|
||||
|
||||
/**** Check the ACP memory module ****/
|
||||
Mmg_fn_cCheckAlignmentValidity();
|
||||
|
||||
/**** Reinit the block*/
|
||||
Mmg_M_InitBlock(FON,E_ucFONTextMemoryBlock,gs_ulFontTextMemorySize);
|
||||
}
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
/**************************************************************************/
|
||||
|
||||
|
||||
#if !defined(RETAIL) || defined(FINAL_VERSION_FOR_TESTERS)
|
||||
void FON_PrintUsedStaticMemory(void)
|
||||
{
|
||||
Mmg_M_PrintUsedStaticMemoryInModule(FON);
|
||||
}
|
||||
#endif /* !defined(RETAIL) || defined(FINAL_VERSION_FOR_TESTERS) */
|
||||
/**************************************************************************/
|
||||
/*XB*/
|
||||
#ifdef CHECK_MEMORY
|
||||
void FON_CheckMemory(void)
|
||||
{
|
||||
Mmg_M_CheckMemory(FON);
|
||||
}
|
||||
#endif /* CHECK_MEMORY */
|
||||
/*End XB*/
|
||||
|
||||
/**************************************************************************/
|
||||
/* XB 02/06/99 */
|
||||
#ifndef FINAL_VERSION
|
||||
unsigned long FON_fn_ulGetUsedStaticMemory(void)
|
||||
{
|
||||
return Mmg_M_GetUsedStaticMemory(FON);
|
||||
}
|
||||
#endif /* FINAL_VERSION */
|
||||
/* End XB 02/06/99 */
|
||||
|
||||
/**************************************************************************/
|
54
Rayman_X/cpa/tempgrp/GAM/Locale/fonmem.h
Normal file
54
Rayman_X/cpa/tempgrp/GAM/Locale/fonmem.h
Normal file
@@ -0,0 +1,54 @@
|
||||
#ifndef __FONMEM_H__
|
||||
#define __FONMEM_H__
|
||||
|
||||
#include "CPA_Expt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "mmg.h"
|
||||
|
||||
/******************************************/
|
||||
#if _MSC_VER >= 1000
|
||||
#pragma once
|
||||
#endif /* _MSC_VER >= 1000 */
|
||||
/******************************************/
|
||||
|
||||
enum e_ucFONStaticBlocks
|
||||
{
|
||||
E_ucFONTextMemoryBlock,
|
||||
/*E_ucFONMemoryBlock,*/
|
||||
E_ucFONMaxBlocksNb
|
||||
};
|
||||
|
||||
#undef EXTERN
|
||||
#undef extern
|
||||
#if !defined(FON_MainFile)
|
||||
#define EXTERN extern
|
||||
#else
|
||||
#define EXTERN
|
||||
#endif /* MNU_MainFile */
|
||||
|
||||
#ifndef _FIRE_DEADCODE_U64_ /* Added by RUC */
|
||||
EXTERN tdstBlockInfo g_a_stFONBlocksInfo[E_ucFONMaxBlocksNb];
|
||||
#endif /* _FIRE_DEADCODE_U64_ */ /* Added by RUC */
|
||||
|
||||
#ifdef __DYNAMIC_MALLOC_ALLOWED__
|
||||
#ifdef __DEBUG_MALLOC_MODE__
|
||||
EXTERN tdstDynInfo g_stFONDynInfo;
|
||||
#endif /* __DEBUG_MALLOC_MODE__ */
|
||||
#endif /* __DYNAMIC_MALLOC_ALLOWED__ */
|
||||
|
||||
#undef EXTERN
|
||||
#undef extern
|
||||
|
||||
extern CPA_EXPORT void *FON_fn_p_vAllocInBloc(enum e_ucFONStaticBlocks eBloc,unsigned long lSize);
|
||||
extern CPA_EXPORT void *FON_fn_p_vReallocInBloc(enum e_ucFONStaticBlocks eBloc,void *p_vPointer,unsigned long lSize);
|
||||
extern CPA_EXPORT void FON_fn_vFreeInBloc(enum e_ucFONStaticBlocks eBloc,void *p_vPointer);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}/* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* __FONMEM_H__ */
|
625
Rayman_X/cpa/tempgrp/GAM/Locale/fontext.c
Normal file
625
Rayman_X/cpa/tempgrp/GAM/Locale/fontext.c
Normal file
@@ -0,0 +1,625 @@
|
||||
/*=========================================================================
|
||||
* mittext.c : Functions for the menus management
|
||||
*
|
||||
* Version 1.0
|
||||
* Creation date 2./05/97
|
||||
* Revision date
|
||||
*
|
||||
* That file needs to be compatible for all platforms.
|
||||
*
|
||||
* (c) Ubi R&D 1997
|
||||
*=======================================================================*/
|
||||
/*
|
||||
*=======================================================================
|
||||
Modifications:
|
||||
*=======================================================================*/
|
||||
/*#include "fonhdls.h"*/
|
||||
|
||||
#include "ACP_Base.h"
|
||||
#include "ToolsCPA.h"
|
||||
#include "macros.h"
|
||||
#include "Structur/EngMode.h"
|
||||
|
||||
#include "MTH.h"
|
||||
/*#include "DPT.h"*/
|
||||
/*#include "GEO.h"*/
|
||||
/*#include "GLI.h"*/
|
||||
#include "SCR.h"
|
||||
#include "RND.h"
|
||||
/*#include "POS.h"*/
|
||||
/*#include "SPO.h"*/
|
||||
/*#include "LST.h"*/
|
||||
|
||||
#include "fonpub.h"
|
||||
/*#include "fonmem.h"*/
|
||||
#include "fonerm.h"
|
||||
#include "fonfont.h"
|
||||
/*#include "FON_Eff.h"*/
|
||||
#include "fontext.h"
|
||||
|
||||
/*XB*/
|
||||
/*#include <string.h>*/
|
||||
/*End XB*/
|
||||
|
||||
/*************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xComputePartXWithAlign(FON_tdxHandleOfString hText,long lIndex,MTH_tdxReal x,enum FON_tdeAlignment_ eXAlign)
|
||||
{
|
||||
MTH_tdxReal xPosX = 0.0f;
|
||||
|
||||
if (eXAlign==FON_E_LeftAlign)
|
||||
xPosX=x;
|
||||
else if (eXAlign==FON_E_MiddleAlign)
|
||||
xPosX=x-FON_fn_xWidthOfText(hText,lIndex)/2;
|
||||
else if (eXAlign==FON_E_RightAlign)
|
||||
xPosX=x-FON_fn_xWidthOfText(hText,lIndex);
|
||||
|
||||
return(xPosX);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xComputeXWithAlign(FON_tdxHandleOfString hText,MTH_tdxReal x,enum FON_tdeAlignment_ eXAlign)
|
||||
{
|
||||
MTH_tdxReal xPosX = 0.0f;
|
||||
|
||||
if (eXAlign==FON_E_LeftAlign)
|
||||
xPosX=x;
|
||||
else if (eXAlign==FON_E_MiddleAlign)
|
||||
xPosX=x-FON_fn_xWidthOfMultipleText(hText)/2;
|
||||
else if (eXAlign==FON_E_RightAlign)
|
||||
xPosX=x-FON_fn_xWidthOfMultipleText(hText);
|
||||
|
||||
return(xPosX);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xComputeYWithAlign(FON_tdxHandleOfString hText,MTH_tdxReal y,enum FON_tdeAlignment_ eYAlign)
|
||||
{
|
||||
MTH_tdxReal xPosY = 0.0f;
|
||||
|
||||
if (eYAlign==FON_E_UpAlign)
|
||||
xPosY=y/ *-FON_fn_xHeightOfMultipleText(hText)* /;
|
||||
else if (eYAlign==FON_E_MiddleAlign)
|
||||
xPosY=y-FON_fn_xHeightOfMultipleText(hText)/2;
|
||||
else if (eYAlign==FON_E_DownAlign)
|
||||
xPosY=y-FON_fn_xHeightOfMultipleText(hText);
|
||||
|
||||
return(xPosY);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vDrawText(FON_tdxHandleOfString hText,MTH_tdxReal x,MTH_tdxReal y,enum FON_tdeAlignment_ eXAlign,enum FON_tdeAlignment_ eYAlign,FON_tdeTypeOfDisplay _eDisplayType)
|
||||
{
|
||||
FON_fn_vDrawText3D(hText,x,y,0.0,eXAlign,eYAlign,_eDisplayType);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vDrawText3D(FON_tdxHandleOfString hText,MTH_tdxReal x,MTH_tdxReal y,MTH_tdxReal z,enum FON_tdeAlignment_ eXAlign,enum FON_tdeAlignment_ eYAlign,FON_tdeTypeOfDisplay _eDisplayType)
|
||||
{
|
||||
char *szText;
|
||||
MTH3D_tdstVector stVector;
|
||||
MTH3D_tdstVector stI,stJ,stK;
|
||||
MTH_tdxReal xZDecalValue;
|
||||
|
||||
FON_tdxHandleOfFont hFont;
|
||||
struct FON_st3DFont_ *h3DObject;
|
||||
unsigned long i,j;
|
||||
unsigned long ulNextCharacter;
|
||||
|
||||
unsigned short uwDisplayedCharacter;
|
||||
|
||||
struct FON_stText_ *p_stText;
|
||||
|
||||
POS_fn_vSetIdentityMatrix(FON_g_stGeneral.hMatrix);
|
||||
|
||||
p_stText = FON_fn_p_stGetTextPointerOfHandle(hText);
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
szText=p_stText->szText;
|
||||
|
||||
MTH3D_M_vSetZofVector(&stVector,FON_fn_xComputeYWithAlign(hText,(MTH_tdxReal)y,eYAlign));
|
||||
MTH3D_M_vSetYofVector(&stVector,z);
|
||||
|
||||
xZDecalValue = FON_fn_xHeightOfText(hText);
|
||||
for (j=0;szText[j]!=0;j=i)
|
||||
{
|
||||
MTH3D_M_vSetXofVector(&stVector,FON_fn_xComputePartXWithAlign(hText,j,(MTH_tdxReal)x,eXAlign));
|
||||
for (i=j;szText[i]!=0&&szText[i]!=0x5E;i=ulNextCharacter)
|
||||
{
|
||||
uwDisplayedCharacter = FON_fn_uwGetDisplayedCharacter(hFont,szText,i);
|
||||
ulNextCharacter = FON_fn_vGetNextCharacter(hFont,szText,i);
|
||||
|
||||
if (p_stText->d_hLocalMatrix!=NULL)
|
||||
{
|
||||
POS_fn_vGetTranslationVector(p_stText->d_hLocalMatrix[i],&stI);
|
||||
MTH3D_M_vAddVector(&stI,&stI,&stVector);
|
||||
POS_fn_vSetTranslationVector(FON_g_stGeneral.hMatrix,&stI);
|
||||
POS_fn_vGetRotationMatrix(p_stText->d_hLocalMatrix[i],&stI,&stJ,&stK);
|
||||
POS_fn_vSetRotationMatrix(FON_g_stGeneral.hMatrix,&stI,&stJ,&stK);
|
||||
POS_fn_vGetScaleMatrix(p_stText->d_hLocalMatrix[i],&stI,&stJ,&stK);
|
||||
POS_fn_vSetScaleMatrix(FON_g_stGeneral.hMatrix,&stI,&stJ,&stK);
|
||||
}
|
||||
else
|
||||
{
|
||||
POS_fn_vSetTranslationVector(FON_g_stGeneral.hMatrix,&stVector);
|
||||
MTH3D_M_vSetVectorElements(&stI,1,0,0);
|
||||
MTH3D_M_vSetVectorElements(&stJ,0,1,0);
|
||||
MTH3D_M_vSetVectorElements(&stK,0,0,1);
|
||||
POS_fn_vSetRotationMatrix(FON_g_stGeneral.hMatrix,&stI,&stJ,&stK);
|
||||
POS_fn_vSetScaleMatrix(FON_g_stGeneral.hMatrix,&stI,&stJ,&stK);
|
||||
}
|
||||
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,uwDisplayedCharacter);
|
||||
|
||||
POS_fn_vGetTranslationVector(FON_g_stGeneral.hMatrix,&stI);
|
||||
MTH3D_M_vSetZofVector(&stI,MTH3D_M_xGetZofVector(&stI)+xZDecalValue-h3DObject->xHeight+FON_fn_xGetBaseYOfCharacter(hFont,uwDisplayedCharacter));
|
||||
POS_fn_vSetTranslationVector(FON_g_stGeneral.hMatrix,&stI);
|
||||
|
||||
if (h3DObject->hGLIGeometric!=NULL)
|
||||
if (FON_fn_p_stGetTextPointerOfHandle(hText)->d_p_stLight!=NULL)
|
||||
FON_fn_vDraw3DObject(h3DObject,FON_g_stGeneral.hMatrix,FON_fn_p_stGetTextPointerOfHandle(hText)->d_p_stLight[i]);
|
||||
else
|
||||
FON_fn_vDraw3DObject(h3DObject,FON_g_stGeneral.hMatrix,NULL);
|
||||
|
||||
// *** Effect of text *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
FON_fn_vPlayLetterEffect(hText,FON_fn_p_stGetEffectPointerOfHandle(hText),i);
|
||||
|
||||
if (_eDisplayType==FON_Enabled)
|
||||
FON_fn_vPlayLetterEffect(hText,&FON_g_stEffectByDisplay.stEnabledEffect,i);
|
||||
else if (_eDisplayType==FON_Disabled)
|
||||
FON_fn_vPlayLetterEffect(hText,&FON_g_stEffectByDisplay.stDisabledEffect,i);
|
||||
else if (_eDisplayType==FON_Pressed)
|
||||
FON_fn_vPlayLetterEffect(hText,&FON_g_stEffectByDisplay.stPressedEffect,i);
|
||||
else if (_eDisplayType==FON_Selected)
|
||||
FON_fn_vPlayLetterEffect(hText,&FON_g_stEffectByDisplay.stSelectedEffect,i);
|
||||
|
||||
MTH3D_M_vSetXofVector(&stVector,
|
||||
MTH3D_M_xGetXofVector(&stVector)+
|
||||
h3DObject->xWidth/2+
|
||||
hFont->xCharacterSpace);
|
||||
if (szText[ulNextCharacter]!=0)
|
||||
{
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,FON_fn_uwGetDisplayedCharacter(hFont,szText,ulNextCharacter));
|
||||
MTH3D_M_vSetXofVector(&stVector,
|
||||
MTH3D_M_xGetXofVector(&stVector)+
|
||||
h3DObject->xWidth/2);
|
||||
}
|
||||
}
|
||||
if (szText[i]==0x5E)
|
||||
i++;
|
||||
MTH3D_M_vSetZofVector(&stVector,MTH3D_M_xGetZofVector(&stVector)+FON_fn_xHeightOfText(hText));
|
||||
}
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xWidthOfTextByHandle(FON_tdxHandleOfString hText,long lIndex)
|
||||
{
|
||||
return(FON_fn_xWidthOfText(hText,lIndex));
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xHeightOfTextByHandle(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_fn_xHeightOfText(hText));
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xWidthOfText(FON_tdxHandleOfString hText,long lIndex)
|
||||
{
|
||||
unsigned int i;
|
||||
MTH_tdxReal xPosX = 0.0f;
|
||||
char *szText=FON_fn_p_stGetTextPointerOfHandle(hText)->szText+lIndex;
|
||||
struct FON_st3DFont_ *h3DObject;
|
||||
unsigned long ulNextCharacter;
|
||||
FON_tdxHandleOfFont hFont;
|
||||
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
|
||||
for (i=0;szText[i]!=0&&szText[i]!=0x5E;i=ulNextCharacter)
|
||||
{
|
||||
ulNextCharacter = FON_fn_vGetNextCharacter(hFont,szText,i);
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,FON_fn_uwGetDisplayedCharacter(hFont,szText,i));
|
||||
|
||||
if (i==0&&(szText[i+1]==0||szText[ulNextCharacter]==0x5E))
|
||||
{
|
||||
xPosX=0.0f;
|
||||
}
|
||||
else if(szText[ulNextCharacter]==0||szText[ulNextCharacter]==0x5E)
|
||||
xPosX+=(h3DObject->xWidth)/2;
|
||||
else if(i==0)
|
||||
xPosX+=(h3DObject->xWidth)/2 + hFont->xCharacterSpace;
|
||||
else
|
||||
xPosX+=h3DObject->xWidth + hFont->xCharacterSpace;
|
||||
}
|
||||
return(xPosX);
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xHeightOfText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_fn_p_stGet3dObjectOfCharacter(FON_fn_p_stGetFontAndEffectPointerOfHandle(hText)->p_stFont,' ')->xHeight);
|
||||
return MTH_C_ZERO;
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xWidthOfLetter(FON_tdxHandleOfString hText,unsigned long lIndex)
|
||||
{
|
||||
MTH_tdxReal xPosX = 0.0f;
|
||||
char *szText=FON_fn_p_stGetTextPointerOfHandle(hText)->szText+lIndex;
|
||||
struct FON_st3DFont_ *h3DObject;
|
||||
FON_tdxHandleOfFont hFont;
|
||||
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,FON_fn_uwGetDisplayedCharacter(hFont,szText,0));
|
||||
xPosX=h3DObject->xWidth + hFont->xCharacterSpace;
|
||||
|
||||
return(xPosX);
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xWidthOfMultipleText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
unsigned long i;
|
||||
MTH_tdxReal xMaxPosX = 0.0f;
|
||||
MTH_tdxReal xPosX = 0.0f;
|
||||
char *szText=FON_fn_p_stGetTextPointerOfHandle(hText)->szText;
|
||||
struct FON_st3DFont_ *h3DObject;
|
||||
unsigned long ulNextCharacter;
|
||||
FON_tdxHandleOfFont hFont;
|
||||
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
|
||||
for (i=0;szText[i]!=0;i=ulNextCharacter)
|
||||
{
|
||||
ulNextCharacter = FON_fn_vGetNextCharacter(hFont,szText,i);
|
||||
if (szText[i]==0x5E)
|
||||
{
|
||||
xPosX = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,FON_fn_uwGetDisplayedCharacter(hFont,szText,i));
|
||||
if(szText[ulNextCharacter]==0||szText[ulNextCharacter]==0x5E)
|
||||
xPosX+=(h3DObject->xWidth)/2;
|
||||
else if(i==0)
|
||||
xPosX+=(h3DObject->xWidth)/2 + hFont->xCharacterSpace;
|
||||
else
|
||||
xPosX+=h3DObject->xWidth + hFont->xCharacterSpace;
|
||||
if (xPosX>xMaxPosX)
|
||||
xMaxPosX = xPosX;
|
||||
}
|
||||
}
|
||||
return(xMaxPosX);
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xHeightOfMultipleText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
char *p_szTemp = FON_fn_p_stGetTextPointerOfHandle(hText)->szText;
|
||||
unsigned long i;
|
||||
|
||||
for (i=1;strchr(p_szTemp,0x5E)!=NULL;i++,p_szTemp=strchr(p_szTemp,0x5E)+1);
|
||||
|
||||
return(i*(FON_fn_p_stGet3dObjectOfCharacter(FON_fn_p_stGetFontAndEffectPointerOfHandle(hText)->p_stFont,' ')->xHeight));
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*MTH_tdxReal FON_fn_xRealHeightOfText(FON_tdxHandleOfString hText,long lIndex)
|
||||
{
|
||||
unsigned int i;
|
||||
MTH_tdxReal xHeight = 0.0f;
|
||||
char *szText=FON_fn_p_stGetTextPointerOfHandle(hText)->szText+lIndex;
|
||||
struct FON_st3DFont_ *h3DObject = NULL;
|
||||
FON_tdxHandleOfFont hFont;
|
||||
unsigned long ulNextCharacter;
|
||||
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
|
||||
for (i=0;szText[i]!=0&&szText[i]!=0x5E;i=ulNextCharacter)
|
||||
{
|
||||
ulNextCharacter = FON_fn_vGetNextCharacter(hFont,szText,i);
|
||||
h3DObject=FON_fn_p_stGet3dObjectOfCharacter(hFont,FON_fn_uwGetDisplayedCharacter(hFont,szText,i));
|
||||
if (xHeight>h3DObject->xHeight)
|
||||
xHeight=h3DObject->xHeight;
|
||||
}
|
||||
return(xHeight);
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*void FON_fn_vAllocText(FON_tdxHandleOfString hTextNumber,unsigned long _ulSize/ *,enum FON_tdeTextEffect_ _eTextEffect* /)
|
||||
{
|
||||
char/ *struct FON_stText_* / *hText;
|
||||
//struct FON_tdstFontAndEffect_ *hFontAndEffect;
|
||||
// unsigned long i;
|
||||
|
||||
//hText = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,sizeof(struct FON_stText_));
|
||||
//hFontAndEffect=FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,sizeof(struct FON_tdstFontAndEffect_));
|
||||
|
||||
hText/ *->szText* / = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize+1);
|
||||
memset(hText/ *->szText* /,0,_ulSize+1);
|
||||
memset(hText/ *->szText* /,' ',_ulSize);
|
||||
|
||||
// *** Effect gestion *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
/ *if (_eTextEffect!=FON_e_Nothing)
|
||||
{
|
||||
if (_eTextEffect&FON_e_NeedMatrix)
|
||||
hText->d_hLocalMatrix = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
else
|
||||
hText->d_hLocalMatrix = NULL;
|
||||
if (_eTextEffect&FON_e_Translation)
|
||||
hText->d_hLocalDynTranslation = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
else
|
||||
hText->d_hLocalDynTranslation = NULL;
|
||||
if (_eTextEffect&FON_e_Rotation)
|
||||
hText->d_hLocalDynRotation = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
else
|
||||
hText->d_hLocalDynRotation = NULL;
|
||||
if (_eTextEffect&FON_e_Scale)
|
||||
hText->d_hLocalDynScale = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
else
|
||||
hText->d_hLocalDynScale = NULL;
|
||||
if (_eTextEffect&FON_e_Light)
|
||||
hText->d_p_stLight = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
else
|
||||
hText->d_p_stLight = NULL;
|
||||
|
||||
for (i=0;i<_ulSize;i++)
|
||||
{
|
||||
if (_eTextEffect&FON_e_NeedMatrix)
|
||||
{
|
||||
hText->d_hLocalMatrix[i] = GEO_fn_hCreateMatrix();
|
||||
POS_fn_vSetIdentityMatrix(hText->d_hLocalMatrix[i]);
|
||||
}
|
||||
if (_eTextEffect&FON_e_Translation)
|
||||
{
|
||||
hText->d_hLocalDynTranslation[i] = POS_fn_hCreateDynVector();
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynTranslation[i],0.0,0.0,0.0);
|
||||
}
|
||||
if (_eTextEffect&FON_e_Rotation)
|
||||
{
|
||||
hText->d_hLocalDynRotation[i] = POS_fn_hCreateDynVector();
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynRotation[i],0.0,0.0,0.0);
|
||||
}
|
||||
if (_eTextEffect&FON_e_Scale)
|
||||
{
|
||||
hText->d_hLocalDynScale[i] = POS_fn_hCreateDynVector();
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynScale[i],1.0,1.0,1.0);
|
||||
}
|
||||
if (_eTextEffect&FON_e_Light)
|
||||
hText->d_p_stLight[i] = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
hText->d_hLocalMatrix = NULL;
|
||||
hText->d_hLocalDynTranslation = NULL;
|
||||
hText->d_hLocalDynRotation = NULL;
|
||||
hText->d_hLocalDynScale = NULL;
|
||||
hText->d_p_stLight = NULL;
|
||||
}* /
|
||||
//hFontAndEffect->p_stFont = NULL;
|
||||
|
||||
FON_g_stGeneral.d_stTextsArray[hTextNumber] = hText;
|
||||
//FON_g_stGeneral.d_stFontAndEffectArray[hTextNumber] = hFontAndEffect;
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*
|
||||
void FON_fn_vAllocTextWithoutString(FON_tdxHandleOfString hTextNumber,unsigned long _ulSize)
|
||||
{
|
||||
struct FON_stText_ *hText;
|
||||
struct FON_tdstFontAndEffect_ *hFontAndEffect;
|
||||
unsigned long i;
|
||||
|
||||
hText=FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,sizeof(struct FON_stText_));
|
||||
hFontAndEffect=FON_fn_p_vAllocInBloc(E_ucFONMemoryBlock,sizeof(struct FON_tdstFontAndEffect_));
|
||||
|
||||
hText->d_hLocalMatrix = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
hText->d_hLocalDynTranslation = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
hText->d_hLocalDynRotation = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
hText->d_hLocalDynScale = FON_fn_p_vAllocInBloc(E_ucFONTextMemoryBlock,_ulSize*sizeof(void *));
|
||||
for (i=0;i<_ulSize;i++)
|
||||
{
|
||||
hText->d_hLocalMatrix[i] = GEO_fn_hCreateMatrix();
|
||||
POS_fn_vSetIdentityMatrix(hText->d_hLocalMatrix[i]);
|
||||
hText->d_hLocalDynTranslation[i] = POS_fn_hCreateDynVector();
|
||||
hText->d_hLocalDynRotation[i] = POS_fn_hCreateDynVector();
|
||||
hText->d_hLocalDynScale[i] = POS_fn_hCreateDynVector();
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynTranslation[i],0.0,0.0,0.0);
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynRotation[i],0.0,0.0,0.0);
|
||||
POS_fn_vSetDynVector(hText->d_hLocalDynScale[i],1.0,1.0,1.0);
|
||||
}
|
||||
hFontAndEffect->p_stFont = NULL;
|
||||
|
||||
FON_g_stGeneral.d_stTextsArray[hTextNumber] = hText;
|
||||
FON_g_stGeneral.d_stFontAndEffectArray[hTextNumber] = hFontAndEffect;
|
||||
}
|
||||
*/
|
||||
/**************************************************************************/
|
||||
/*unsigned long FON_fn_ulGetNumberOfTexts(void)
|
||||
{
|
||||
return(FON_g_stGeneral.ulNumberOfTexts);
|
||||
}*/
|
||||
|
||||
#if !defined(U64)
|
||||
/**************************************************************************/
|
||||
FON_tdxHandleOfText FON_fn_hGetTextHandle(char *_szLinkKey)
|
||||
{
|
||||
FON_tdxHandleOfText hReturn = FON_C_xInvalidTextHandle;
|
||||
|
||||
if ( _szLinkKey && strlen(_szLinkKey) )
|
||||
{
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchKey(&FON_g_stTextLinkTable,_szLinkKey);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
{
|
||||
hReturn = (FON_tdxHandleOfText) SCR_M_ul_Link_GetValue(p_xIndex);
|
||||
}
|
||||
|
||||
if ( hReturn == FON_C_xInvalidTextHandle )
|
||||
M_FONWarningError(E_uwFONUnknownText);
|
||||
}
|
||||
|
||||
return hReturn;
|
||||
}
|
||||
/**************************************************************************/
|
||||
FON_tdxHandleOfText FON_fn_hGetTextHandleWithoutWarning(char *_szLinkKey)
|
||||
{
|
||||
FON_tdxHandleOfText hReturn = FON_C_xInvalidTextHandle;
|
||||
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchKey(&FON_g_stTextLinkTable,_szLinkKey);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
{
|
||||
hReturn = (FON_tdxHandleOfText) SCR_M_ul_Link_GetValue(p_xIndex);
|
||||
}
|
||||
return hReturn;
|
||||
}
|
||||
/**************************************************************************/
|
||||
#ifdef ACTIVE_EDITOR
|
||||
char *FON_fn_szGetNameOfTextHandle(FON_tdxHandleOfText hString)
|
||||
{
|
||||
char *p_szReturn = NULL;
|
||||
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchValue(&FON_g_stTextLinkTable,(long) hString);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
{
|
||||
p_szReturn = (char *)SCR_M_p_sz_Link_GetKey(p_xIndex);
|
||||
}
|
||||
return p_szReturn;
|
||||
}
|
||||
#endif /* ACTIVE_EDITOR */
|
||||
/**************************************************************************/
|
||||
#endif /* U64 */
|
||||
|
||||
char *FON_fn_szLoadOneStringForCurrentLanguage(FON_tdxHandleOfText _IdOfString);
|
||||
|
||||
char *FON_fn_szGetTextPointerForHandle(FON_tdxHandleOfText hString)
|
||||
{
|
||||
return ( hString == FON_C_xInvalidTextHandle )
|
||||
? NULL
|
||||
#ifdef U64 // FB170399
|
||||
: FON_fn_szLoadOneStringForCurrentLanguage(hString);
|
||||
#else
|
||||
: (
|
||||
( hString < FON_C_HandleOffsetForCommonLanguage )
|
||||
? FON_g_stGeneral.d_sLanguageArray[g_stEngineStructure.ucCurrentLanguage].d_pTextsArray[hString]
|
||||
: FON_g_stGeneral . p_stCommonLanguage -> d_pTextsArray[ hString - FON_C_HandleOffsetForCommonLanguage ]
|
||||
) ;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
#if !defined(RETAIL) || defined(USE_MONITOR)
|
||||
unsigned short FON_fn_uwGetNumberOfAvailableLanguages()
|
||||
{
|
||||
return FON_g_stGeneral.uwNumberOfLanguages;
|
||||
}
|
||||
#endif !defined(RETAIL) || defined(USE_MONITOR)
|
||||
|
||||
|
||||
|
||||
/*FON_tdxHandleOfString FON_fn_hGetTextHandleWithFont(char *_szLinkKey,FON_tdxHandleOfFont hFont)
|
||||
{
|
||||
FON_tdxHandleOfString hReturn = FON_fn_hGetInvalidTextHandle();
|
||||
#if !defined(U64)
|
||||
SCR_tdst_Link_Value *p_xIndex;
|
||||
|
||||
p_xIndex = SCR_fnp_st_Link_SearchKey(&FON_g_stGeneral.stTextLinkTable,_szLinkKey);
|
||||
|
||||
if (p_xIndex!=NULL&&SCR_M_e_Link_GetState(p_xIndex)==SCR_ELS_Link_Initialized)
|
||||
{
|
||||
hReturn = (FON_tdxHandleOfString)SCR_M_ul_Link_GetValue(p_xIndex);
|
||||
FON_fn_vChangeFontOfText(hReturn,hFont);
|
||||
}
|
||||
|
||||
if (hReturn==FON_fn_hGetInvalidTextHandle())
|
||||
M_FONWarningError(E_uwFONUnknownText);
|
||||
|
||||
#endif // U64
|
||||
return (hReturn);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vChangeFontOfText(FON_tdxHandleOfString hText,FON_tdxHandleOfFont hFont)
|
||||
{
|
||||
FON_g_stGeneral.d_stFontAndEffectArray[hText]->p_stFont = hFont;
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*FON_tdxHandleOfFont FON_fn_xGetFontOfTextHandle(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_g_stGeneral.d_stFontAndEffectArray[hText]->p_stFont);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*char/ *struct FON_stText_* / *FON_fn_p_stGetTextPointerOfHandle(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_g_stGeneral.d_stTextsArray[hText]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*struct FON_tdstFontAndEffect_ *FON_fn_p_stGetFontAndEffectPointerOfHandle(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_g_stGeneral.d_stFontAndEffectArray[hText]);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*struct FON_tdstEffect_ *FON_fn_p_stGetEffectPointerOfHandle(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(&FON_g_stGeneral.d_stFontAndEffectArray[hText]->stEffect);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*enum FON_tdeTypeOfFont_ FON_fn_eGetTypeOfFontForText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
enum FON_tdeTypeOfFont_ eReturn = FON_eUnknow;
|
||||
|
||||
if (FON_fn_p_stGetFontAndEffectPointerOfHandle(hText)->p_stFont!=NULL)
|
||||
eReturn = FON_fn_p_stGetFontAndEffectPointerOfHandle(hText)->p_stFont->eTypeOfFont;
|
||||
|
||||
return(eReturn);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*unsigned long FON_fn_ulGetDisplayedLenghtOfText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
// *** Return the number of displayed characters *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
unsigned long i;
|
||||
unsigned long ulReturn = 0;
|
||||
char *p_szText;
|
||||
FON_tdxHandleOfFont hFont;
|
||||
|
||||
hFont = FON_fn_xGetFontOfTextHandle(hText);
|
||||
p_szText = FON_fn_p_stGetTextPointerOfHandle(hText)/ *->szText* /;
|
||||
|
||||
for (i=0;p_szText[i]!=0;i=FON_fn_vGetNextCharacter(hFont,p_szText,i),ulReturn++);
|
||||
|
||||
return(ulReturn);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*unsigned long FON_fn_ulGetTrueLenghtOfText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
// *** Return the number of char characters *** - Oliv' - Portage v15 - 1 warning removed here
|
||||
return(strlen(FON_fn_p_stGetTextPointerOfHandle(hText)->szText));
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*char *FON_fn_p_szGetStringPointer(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(FON_fn_p_stGetTextPointerOfHandle(hText)->szText);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vChangeText(FON_tdxHandleOfString hText,char *szText)
|
||||
{
|
||||
strcpy(FON_fn_p_stGetTextPointerOfHandle(hText)/ *->szText* /,szText);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*void FON_fn_vUpperText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
strupr(FON_fn_p_stGetTextPointerOfHandle(hText)/ *->szText* /);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*FON_tdxHandleOfString FON_fn_hGetInvalidTextHandle(void)
|
||||
{
|
||||
return(0xffffffff);
|
||||
}*/
|
||||
/*************************************************************************/
|
||||
/*unsigned char FON_fn_bIsAValidText(FON_tdxHandleOfString hText)
|
||||
{
|
||||
if (hText==FON_fn_hGetInvalidTextHandle())
|
||||
return(FALSE);
|
||||
else
|
||||
return(TRUE);
|
||||
}*/
|
||||
/**************************************************************************/
|
||||
/*struct FON_tdstEffect_ *FON_fn_p_stGetEffectPointer(FON_tdxHandleOfString hText)
|
||||
{
|
||||
return(&FON_fn_p_stGetFontAndEffectPointerOfHandle(hText)->stEffect);
|
||||
}*/
|
||||
/**************************************************************************/
|
Reference in New Issue
Block a user