diff --git a/source/fx/fx.cpp b/source/fx/fx.cpp index df9a6b496..f710ad983 100644 --- a/source/fx/fx.cpp +++ b/source/fx/fx.cpp @@ -86,7 +86,7 @@ CFXBaseAnim::sFXAnim FXFireData= FRM__FIRE01,FRM__FIRE06, 1, 127,127,127, - CFXBaseAnim::FXANIM_FLAG_LOOP, + CFXBaseAnim::FXANIM_FLAG_LOOP | CFXBaseAnim::FXANIM_FLAG_TRANS, {0,0}, 0 }; diff --git a/source/fx/fxbaseanim.cpp b/source/fx/fxbaseanim.cpp index cd1fce2c0..e1e13abba 100644 --- a/source/fx/fxbaseanim.cpp +++ b/source/fx/fxbaseanim.cpp @@ -104,13 +104,10 @@ DVECTOR RenderPos; if (!canRender() || !IsVisible) return; SpriteBank *SprBank=CGameScene::getSpriteBank(); - -//POLY_FT4 *Ft4=SprBank->printFT4Scaled(renderFrame,RenderPos.vx,RenderPos.vy,0,0,OtPos*0,CurrentScale>>4); -POLY_FT4 *Ft4=SprBank->printRotatedScaledSprite(renderFrame,RenderPos.vx,RenderPos.vy,CurrentScaleX,CurrentScaleY,CurrentHeading,OtPos*0); - Ft4->u1--; Ft4->u3--; - Ft4->v2--; Ft4->v3--; +POLY_FT4 *Ft4=SprBank->printRotatedScaledSprite(renderFrame,RenderPos.vx,RenderPos.vy,CurrentScaleX,CurrentScaleY,CurrentHeading,OtPos); setShadeTex(Ft4,0); setRGB0(Ft4,DataPtr->R,DataPtr->G,DataPtr->B); + setSemiTrans(Ft4,DataPtr->Flags & FXANIM_FLAG_TRANS); } /*****************************************************************************/ diff --git a/source/fx/fxbaseanim.h b/source/fx/fxbaseanim.h index b1c86a409..50ddc2ac8 100644 --- a/source/fx/fxbaseanim.h +++ b/source/fx/fxbaseanim.h @@ -28,6 +28,7 @@ public: FXANIM_FLAG_HAS_GRAVITY =1<<2, FXANIM_FLAG_INJURE_PLAYER =1<<3, FXANIM_FLAG_KILL_PLAYER =1<<4, + FXANIM_FLAG_TRANS =1<<5, }; virtual void init(DVECTOR const &Pos); diff --git a/source/fx/fxbasetrail.cpp b/source/fx/fxbasetrail.cpp index 63b9149e5..84bfb7636 100644 --- a/source/fx/fxbasetrail.cpp +++ b/source/fx/fxbasetrail.cpp @@ -83,7 +83,7 @@ DVECTOR RenderPos; RenderPos.vy+=ThisElem.Ofs.vy>>2; if (ThisElem.Shade) { - Ft4=SprBank->printRotatedScaledSprite(ThisElem.Frame,RenderPos.vx,RenderPos.vy,ThisElem.Scale,ThisElem.Scale,ThisElem.Angle,OtPos*0); + Ft4=SprBank->printRotatedScaledSprite(ThisElem.Frame,RenderPos.vx,RenderPos.vy,ThisElem.Scale,ThisElem.Scale,ThisElem.Angle,OtPos); setShadeTex(Ft4,0); setRGB0(Ft4,ThisElem.Shade,ThisElem.Shade,ThisElem.Shade); setSemiTrans(Ft4,1); diff --git a/source/game/game.cpp b/source/game/game.cpp index 944782ffa..b317fcbc0 100644 --- a/source/game/game.cpp +++ b/source/game/game.cpp @@ -86,7 +86,7 @@ #include "gfx\actor.h" -int RenderZ=256; +int RenderZ=378;//256; Increased to make depth less, and SB more visible /*****************************************************************************/ diff --git a/source/gfx/actor.cpp b/source/gfx/actor.cpp index 7aae84d3f..a14244cd6 100644 --- a/source/gfx/actor.cpp +++ b/source/gfx/actor.cpp @@ -61,12 +61,10 @@ int SlotW=+32000,SlotH=+32000; if (SlotList[Slot].WidthWidth); - int V=Y*ThisSlot->Height; - int TexX=CACHE_X+CurrentTPX+(U>>2); - int TexY=CACHE_Y+V; + int V=(Y*ThisSlot->Height); + int TexX=(CACHE_X+CurrentTPX+(U>>2)); + int TexY=(CACHE_Y+V); List->Frame=0; List->DstRect.x=TexX; @@ -654,12 +652,16 @@ int dX,dY; int CosAngle,SinAngle; int CosX,CosY,SinX,SinY; sBBox SBox,CBox; - +int W=Ft4->x1-Ft4->x0; +int H=Ft4->y2-Ft4->y0; Angle&=4095; - dX=(CurrentFrameGfx->W*XScale)>>(12+1); // +1 for half - dY=(CurrentFrameGfx->H*YScale)>>(12); +// dX=(CurrentFrameGfx->W*XScale)>>(12+1); // +1 for half +// dY=(CurrentFrameGfx->H*YScale)>>(12); + + dX=(W*XScale)>>(12+1); // +1 for half + dY=(H*YScale)>>(12); CosAngle=mcos(Angle); SinAngle=msin(Angle); @@ -727,9 +729,9 @@ u8 V=Node->V; X-=CurrentFrame->XOfs; X-=W; Ft4->u0=U+W-1; - Ft4->u1=U;//-1; + Ft4->u1=U;//-1;// Ft4->u2=U+W-1; - Ft4->u3=U;//-1; + Ft4->u3=U;//-1;// } else @@ -748,8 +750,8 @@ u8 V=Node->V; Y-=H; Ft4->v0=V+H-1; Ft4->v1=V+H-1; - Ft4->v2=V;//-1; - Ft4->v3=V;//-1; + Ft4->v2=V-1;// + Ft4->v3=V-1;// } else { @@ -761,6 +763,7 @@ u8 V=Node->V; } setXYWH(Ft4,X,Y,W,H); + CorrectAspect(Ft4); } diff --git a/source/gfx/prim.cpp b/source/gfx/prim.cpp index 1c6f69b72..cad4ef32f 100644 --- a/source/gfx/prim.cpp +++ b/source/gfx/prim.cpp @@ -172,3 +172,5 @@ LINE_G2 *DrawGLine(int _x0,int _y0,int _x1,int _y1,int _r1,int _g1,int _b1,int AddPrimToList(lg2,_ot); return lg2; } + +/*****************************************************************************/ diff --git a/source/gfx/prim.h b/source/gfx/prim.h index 9458812c9..ade4145dd 100644 --- a/source/gfx/prim.h +++ b/source/gfx/prim.h @@ -349,6 +349,31 @@ inline void GetFrameWH(sFrameHdr *Fr,u8 *W,u8 *H) {*W=Fr->W; *H=Fr->H;} inline int GetFrameClut(sFrameHdr *Fr) {return(Fr->Clut);} inline int GetFrameTPage(sFrameHdr *Fr) {return(Fr->TPage);} +const int aspectX=4096+1024;//(512<<12)/320; +//int aspectY=(256<<12)/320; +inline void CorrectAspect(POLY_FT4 *P) +{ +int W=P->x1-P->x0; +int aW=(W*aspectX)>>12; +int dW=(W-aW)>>1; + + P->x0+=dW; + P->x1-=dW; + P->x2+=dW; + P->x3-=dW; +} +inline void CorrectAspect(POLY_GT4 *P) +{ +int W=P->x1-P->x0; +int aW=(W*aspectX)>>12; +int dW=(W-aW)>>1; + + P->x0+=dW; + P->x1-=dW; + P->x2+=dW; + P->x3-=dW; +} + #endif diff --git a/source/gfx/sprbank.cpp b/source/gfx/sprbank.cpp index ef651eb5e..fe336cd9f 100644 --- a/source/gfx/sprbank.cpp +++ b/source/gfx/sprbank.cpp @@ -268,6 +268,7 @@ void SpriteBank::prepareFT4(POLY_FT4 *_ft4,sFrameHdr *_fh,int _x,int _y,bool _xF setXYWH(_ft4,_x,_y,W,H); setUVTp(_fh,_ft4,_xFlip,_yFlip); +//!! CorrectAspect(_ft4); } /*---------------------------------------------------------------------- @@ -337,6 +338,7 @@ void SpriteBank::prepareFT4Scaled(POLY_FT4 *_ft4,sFrameHdr *_fh,int _x,int _y,bo setXYWH(_ft4,_x,_y,W,H); setUVTp(_fh,_ft4,_xFlip,_yFlip); +//!! CorrectAspect(_ft4); } @@ -411,6 +413,8 @@ void SpriteBank::prepareFT4RotatedScaled(POLY_FT4 *_ft4,sFrameHdr *_fh,int _xCen _ft4->tpage=_fh->TPage; _ft4->clut=_fh->Clut; //////////////////////////////// +//!! CorrectAspect(_ft4); + }