diff options
author | Fire_Head <Fire-Head@users.noreply.github.com> | 2020-05-26 21:16:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-26 21:16:56 +0200 |
commit | ae8a377f26f9b56b5156b0462c30c5c49af7dd8a (patch) | |
tree | f15b8d6bb195ad71ffd9e7051c26a5b42e2f71a7 /src/render/Sprite2d.cpp | |
parent | Merge pull request #550 from erorcun/miami (diff) | |
parent | fix UB shit (diff) | |
download | re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.gz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.bz2 re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.lz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.xz re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.tar.zst re3-ae8a377f26f9b56b5156b0462c30c5c49af7dd8a.zip |
Diffstat (limited to 'src/render/Sprite2d.cpp')
-rw-r--r-- | src/render/Sprite2d.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp index 189c9797..2675c95f 100644 --- a/src/render/Sprite2d.cpp +++ b/src/render/Sprite2d.cpp @@ -4,11 +4,11 @@ #include "Draw.h" #include "Camera.h" #include "Sprite2d.h" +#include "Font.h" RwIm2DVertex CSprite2d::maVertices[8]; float CSprite2d::RecipNearClip; int32 CSprite2d::mCurrentBank; -RwTexture *CSprite2d::mpBankTextures[10]; int32 CSprite2d::mCurrentSprite[10]; int32 CSprite2d::mBankStart[10]; RwIm2DVertex CSprite2d::maBankVertices[500]; @@ -16,7 +16,7 @@ RwIm2DVertex CSprite2d::maBankVertices[500]; void CSprite2d::SetRecipNearClip(void) { - RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera); + // Used but empty in VC, instead they set in InitPerFrame. Isn't that great? } void @@ -24,17 +24,15 @@ CSprite2d::InitPerFrame(void) { int i; + RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera); mCurrentBank = 0; for(i = 0; i < 10; i++) mCurrentSprite[i] = 0; - for(i = 0; i < 10; i++) - mpBankTextures[i] = nil; } int32 CSprite2d::GetBank(int32 n, RwTexture *tex) { - mpBankTextures[mCurrentBank] = tex; mCurrentSprite[mCurrentBank] = 0; mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n; return mCurrentBank++; @@ -59,13 +57,14 @@ CSprite2d::DrawBank(int32 bank) { if(mCurrentSprite[bank] == 0) return; - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, - mpBankTextures[bank] ? RwTextureGetRaster(mpBankTextures[bank]) : nil); + + // This is hacked III function to make it work with VC frontend. + CFont::Sprite[bank].SetRenderState(); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR); RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]); mCurrentSprite[bank] = 0; - RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); + //RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); } |