\hypertarget{Sprite_8hpp_source}{}\doxysection{Sprite.\+hpp}
\label{Sprite_8hpp_source}\index{include/Sprite.hpp@{include/Sprite.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ SPRITE\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ SPRITE\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00005\ }
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}IGraphicsEngineRenderer.hpp"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}TinyMath.hpp"{}}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}TransformComponent.hpp"{}}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00014\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classSpriteComponent}{SpriteComponent}}\ :\ \textcolor{keyword}{public}\ \mbox{\hyperlink{classComponent}{Component}}}
\DoxyCodeLine{00015\ \{}
\DoxyCodeLine{00016\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00022\ \ \ \ \ \mbox{\hyperlink{classSpriteComponent}{SpriteComponent}}(\mbox{\hyperlink{classTransformComponent}{TransformComponent}}\ *transform);}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00027\ \ \ \ \ \mbox{\hyperlink{classSpriteComponent_add14acc8523a724c112e6c93b750b60e}{\string~SpriteComponent}}();}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classSpriteComponent_a70bc3139c9721612b1cdb3e514d4dd46}{LoadImage}}(std::string\ filePath,\ SDL\_Renderer\ *ren,\ \textcolor{keywordtype}{int}\ w,\ \textcolor{keywordtype}{int}\ h,\ \textcolor{keywordtype}{int}\ frames,\ \mbox{\hyperlink{structVec2D}{Vec2D}}\ targetDisplay);}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00046\ \ \ \ \ \mbox{\hyperlink{structVec2D}{Vec2D}}\ \mbox{\hyperlink{classSpriteComponent_aea73c1a8481eb269e495acd51a05697f}{getDimensions}}();}
\DoxyCodeLine{00047\ }
\DoxyCodeLine{00052\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classSpriteComponent_ae8f47512e84273fd8f5312920affb275}{Update}}(SDL\_Event\ e,\ \textcolor{keywordtype}{int}\ frame,\ std::vector<std::string>\ broadcastList)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00053\ }
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classSpriteComponent_a843ce3d3a2f37cce8ecc8418969b3607}{Render}}(SDL\_Renderer\ *ren)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00060\ }
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classSpriteComponent_a574dfd6e371ececbcb9067a9d18453ea}{ShowComponentEditor}}(\textcolor{keywordtype}{bool}\ *showEditor)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00062\ }
\DoxyCodeLine{00063\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{char}\ *\mbox{\hyperlink{classSpriteComponent_a9f2e32f4d314f0b5f903c0730011656e}{ComponentTypeName}}()\textcolor{keyword}{\ override\ }\{\ \textcolor{keywordflow}{return}\ \textcolor{stringliteral}{"{}Sprite\ Component"{}};\ \}}
\DoxyCodeLine{00064\ }
\DoxyCodeLine{00065\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00066\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ mCurrentFrame\{0\};}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keywordtype}{unsigned}\ \textcolor{keywordtype}{int}\ mLastFrame\{7\};}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{comment}{//\ An\ SDL\ Surface\ contains\ pixel\ data\ to\ draw\ an\ image}}
\DoxyCodeLine{00069\ \ \ \ \ SDL\_Surface\ *mSpriteSheet\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00070\ \ \ \ \ SDL\_Texture\ *mTexture\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \ \ \ \ SDL\_Rect\ mSrc;}
\DoxyCodeLine{00073\ \ \ \ \ SDL\_Rect\ mDest;}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keywordtype}{int}\ width;}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{int}\ height;}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordtype}{int}\ frameCount;}
\DoxyCodeLine{00078\ }
\DoxyCodeLine{00079\ \ \ \ \ \mbox{\hyperlink{structVec2D}{Vec2D}}\ dimensions;}
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00081\ \ \ \ \ \mbox{\hyperlink{classTransformComponent}{TransformComponent}}\ *transform;}
\DoxyCodeLine{00082\ \ \ \ \ SDL\_Renderer\ *last\_used\ =\ \textcolor{keyword}{nullptr};}
\DoxyCodeLine{00083\ \};}
\DoxyCodeLine{00084\ }
\DoxyCodeLine{00085\ \textcolor{preprocessor}{\#endif}}

\end{DoxyCode}
