\hypertarget{my_sprite_8cpp_source}{}\doxysection{my\+Sprite.\+cpp} \label{my_sprite_8cpp_source}\index{src/mySprite.cpp@{src/mySprite.cpp}} \mbox{\hyperlink{my_sprite_8cpp}{Go to the documentation of this file.}} \begin{DoxyCode}{0} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00001}00001 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{utils_8h}{utils.h}}"{}}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00002}00002 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{my_sprite_8h}{mySprite.h}}"{}}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00003}00003 } \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00004}\mbox{\hyperlink{class_my_sprite_ac7442b05691d9f8aa0ed3b0b727fa7b1}{00004}} future \mbox{\hyperlink{class_my_sprite_ac7442b05691d9f8aa0ed3b0b727fa7b1}{MySprite::asyncLoad}}(\textcolor{keyword}{const} \textcolor{keywordtype}{string}\& fname)\{} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00005}00005 \mbox{\hyperlink{utils_8h_aa1bc11933ce4506010028d354b3364b4}{DEBUG\_MSG}}(\textcolor{stringliteral}{"{}Load file "{}} << fname)} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00006}00006 \textcolor{keywordflow}{return} std::async(std::launch::async, [fname, \textcolor{keyword}{this}]() -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00007}00007 \mbox{\hyperlink{class_my_sprite_ad692844ef37dedcb0f78dfd27ecb780f}{ptr}} = std::make\_unique(fname);} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00008}00008 \});} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00009}00009 \}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00010}00010 } \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00011}\mbox{\hyperlink{class_my_sprite_ac80878b9bd025226a903705d3b8df9ae}{00011}} \textcolor{keywordtype}{void} \mbox{\hyperlink{class_my_sprite_ac80878b9bd025226a903705d3b8df9ae}{MySprite::mirror}}(\mbox{\hyperlink{class_my_sprite}{MySprite}}\& msp) \{} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00012}00012 \textcolor{keyword}{const} vector\& inPixels = msp.\mbox{\hyperlink{class_my_sprite_ad692844ef37dedcb0f78dfd27ecb780f}{ptr}}-\/>getPixelData();} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00013}00013 \textcolor{keywordtype}{unsigned} rowSize = msp.\mbox{\hyperlink{class_my_sprite_ad692844ef37dedcb0f78dfd27ecb780f}{ptr}}-\/>getRowSize();} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00014}00014 } \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00015}00015 vector outPixels;} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00016}00016 \textcolor{comment}{// we reserve size so the vector doesn't dynamically grows}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00017}00017 outPixels.reserve(inPixels.size());} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00018}00018 \textcolor{comment}{//for each line of pixel}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00019}00019 \textcolor{keywordflow}{for}(\textcolor{keywordtype}{unsigned} rowOffset=0; rowOffset < inPixels.size(); rowOffset+=rowSize)\{} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00020}00020 \textcolor{comment}{// for each pixel of that line}} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00021}00021 \textcolor{keywordflow}{for}(\textcolor{keywordtype}{unsigned} j=0;j(outPixels, rowSize);} \DoxyCodeLine{\Hypertarget{my_sprite_8cpp_source_l00027}00027 \}} \end{DoxyCode}