Path: blob/main/RSDKv4/Drawing.hpp
817 views
#ifndef DRAWING_H1#define DRAWING_H23#define SURFACE_COUNT (24)4#define GFXDATA_SIZE (0x800 * 0x800)56#if RETRO_REV037#define DRAWLAYER_COUNT (8)8#else9#define DRAWLAYER_COUNT (7)10#endif1112enum FlipFlags { FLIP_NONE, FLIP_X, FLIP_Y, FLIP_XY };13enum InkFlags { INK_NONE, INK_BLEND, INK_ALPHA, INK_ADD, INK_SUB };14enum DrawFXFlags { FX_SCALE, FX_ROTATE, FX_ROTOZOOM, FX_INK, FX_TINT, FX_FLIP };1516struct DrawListEntry {17int entityRefs[ENTITY_COUNT];18int listSize;19};2021struct GFXSurface {22char fileName[0x40];23int height;24int width;25#if RETRO_SOFTWARE_RENDER26int widthShift;27#endif28int depth;29int dataPosition;30};3132struct DisplaySettings {33int offsetX;34int width;35int height;36int unknown1;37int maxWidth;38byte unknown2;39};4041extern ushort blendLookupTable[0x20 * 0x100];42extern ushort subtractLookupTable[0x20 * 0x100];43extern ushort tintLookupTable[0x10000];4445extern int SCREEN_XSIZE_CONFIG;46extern int SCREEN_XSIZE;47extern int SCREEN_CENTERX;4849extern float SCREEN_XSIZE_F;50extern float SCREEN_CENTERX_F;5152extern float SCREEN_YSIZE_F;53extern float SCREEN_CENTERY_F;5455extern int touchWidth;56extern int touchHeight;57extern float touchWidthF;58extern float touchHeightF;5960extern DrawListEntry drawListEntries[DRAWLAYER_COUNT];6162extern int gfxDataPosition;63extern GFXSurface gfxSurface[SURFACE_COUNT];64extern byte graphicData[GFXDATA_SIZE];6566extern DisplaySettings displaySettings;67extern bool convertTo32Bit;68extern bool mixFiltersOnJekyll;6970#if RETRO_USING_OPENGL71extern GLint defaultFramebuffer;72extern GLuint framebufferHiRes;73extern GLuint renderbufferHiRes;74#endif7576int InitRenderDevice();77void FlipScreen();78void ReleaseRenderDevice(bool refresh = false);7980void GenerateBlendLookupTable();8182inline void ClearGraphicsData()83{84for (int i = 0; i < SURFACE_COUNT; ++i) MEM_ZERO(gfxSurface[i]);85gfxDataPosition = 0;86}87void ClearScreen(byte index);88void SetScreenDimensions(int width, int height);89void SetScreenSize(int width, int lineSize);9091#if RETRO_SOFTWARE_RENDER92void CopyFrameOverlay2x();93#endif9495void SetupViewport();96void SetFullScreen(bool fs);9798// Layer Drawing99void DrawObjectList(int layer);100void DrawStageGFX();101#if !RETRO_USE_ORIGINAL_CODE102void DrawDebugOverlays();103#endif104105// TileLayer Drawing106void DrawHLineScrollLayer(int layerID);107void DrawVLineScrollLayer(int layerID);108void Draw3DFloorLayer(int layerID);109void Draw3DSkyLayer(int layerID);110111// Shape Drawing112void DrawRectangle(int XPos, int YPos, int width, int height, int R, int G, int B, int A);113void SetFadeHQ(int R, int G, int B, int A);114void DrawTintRectangle(int XPos, int YPos, int width, int height);115void DrawScaledTintMask(int direction, int XPos, int YPos, int pivotX, int pivotY, int scaleX, int scaleY, int width, int height, int sprX, int sprY,116int sheetID);117118// Sprite Drawing119void DrawSprite(int XPos, int YPos, int width, int height, int sprX, int sprY, int sheetID);120#if RETRO_REV00121void DrawSpriteClipped(int XPos, int YPos, int width, int height, int sprX, int sprY, int sheetID, int clipY);122#endif123void DrawSpriteFlipped(int XPos, int YPos, int width, int height, int sprX, int sprY, int direction, int sheetID);124void DrawSpriteScaled(int direction, int XPos, int YPos, int pivotX, int pivotY, int scaleX, int scaleY, int width, int height, int sprX, int sprY,125int sheetID);126#if !RETRO_REV02127void DrawScaledChar(int direction, int XPos, int YPos, int pivotX, int pivotY, int scaleX, int scaleY, int width, int height, int sprX, int sprY,128int sheetID);129#endif130void DrawSpriteRotated(int direction, int XPos, int YPos, int pivotX, int pivotY, int sprX, int sprY, int width, int height, int rotation,131int sheetID);132void DrawSpriteRotozoom(int direction, int XPos, int YPos, int pivotX, int pivotY, int sprX, int sprY, int width, int height, int rotation, int scale,133int sheetID);134135void DrawBlendedSprite(int XPos, int YPos, int width, int height, int sprX, int sprY, int sheetID);136void DrawAlphaBlendedSprite(int XPos, int YPos, int width, int height, int sprX, int sprY, int alpha, int sheetID);137void DrawAdditiveBlendedSprite(int XPos, int YPos, int width, int height, int sprX, int sprY, int alpha, int sheetID);138void DrawSubtractiveBlendedSprite(int XPos, int YPos, int width, int height, int sprX, int sprY, int alpha, int sheetID);139140void DrawObjectAnimation(void *objScr, void *ent, int XPos, int YPos);141142void DrawFace(void *v, uint color);143void DrawFadedFace(void *v, uint color, uint fogColor, int alpha);144void DrawTexturedFace(void *v, byte sheetID);145void DrawTexturedFaceBlended(void *v, byte sheetID);146147#if !RETRO_REV02148void DrawBitmapText(void *menu, int XPos, int YPos, int scale, int spacing, int rowStart, int rowCount);149#endif150151void DrawTextMenu(void *menu, int XPos, int YPos);152void DrawTextMenuEntry(void *menu, int rowID, int XPos, int YPos, int textHighlight);153void DrawStageTextEntry(void *menu, int rowID, int XPos, int YPos, int textHighlight);154void DrawBlendedTextMenuEntry(void *menu, int rowID, int XPos, int YPos, int textHighlight);155156#endif // !DRAWING_H157158159