// Copyright (c) 2023 Alex Diener. All rights reserved. #ifndef __PROJECT_NAME_Drawing_H__ #define __PROJECT_NAME_Drawing_H__ #include "gamemath/Scalar.h" #include "gamemath/Vector2f.h" #include "gamemath/Vector2i.h" #include "PROJECT_NAME/SharedDefinitions.h" #include "renderer/Drawing.h" #include "renderer/VertexIO.h" #include "renderer/VertexTypes.h" #include "tileset/SpriteCollection.h" #define drawRect(rect, color, vertexIO) \ writeQuad2DMultitexture(rect, g_whiteAtlasEntry, color, 0, vertexIO) void drawRectOutline(Rect4f rect, float inset, Color4f color, VertexIO * vertexIO); void drawSprite(SpriteID spriteID, unsigned int animationTime, bool loop, Vector2f position, Color4f color, VertexIO * vertexIO); static inline Vector2f worldToScreenPosition(Vector2i worldPosition) { return VECTOR2f(roundpositivef(worldPosition.x * TILE_WIDTH), roundpositivef(DISPLAY_HEIGHT - worldPosition.y * TILE_HEIGHT)); } #endif