SuperSpaceInvaderTurboApoca.../doc/SAE102-SpaceInvaders/latex/d5/d60/utils_8h_source.tex
2022-01-10 18:25:13 +01:00

61 lines
6.9 KiB
TeX

\hypertarget{utils_8h_source}{}\doxysection{utils.\+h}
\label{utils_8h_source}\index{headers/utils.h@{headers/utils.h}}
\mbox{\hyperlink{utils_8h}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00001}00001 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00011}00011 \textcolor{preprocessor}{\#ifndef GUARD\_UTILS\_H}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00012}00012 \textcolor{preprocessor}{\#define GUARD\_UTILS\_H}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00013}00013 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00014}00014 \textcolor{preprocessor}{\#include<vector>}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00015}00015 \textcolor{preprocessor}{\#include "{}mingl/mingl.h"{}}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00016}00016 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00017}00017 \textcolor{comment}{// hardcoded values}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00018}\mbox{\hyperlink{utils_8h_a2712b06fd52f25adca031d05c3e0c09b}{00018}} \textcolor{preprocessor}{\#define PLAYER\_HEIGHT 100}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00019}\mbox{\hyperlink{utils_8h_a1f75c733009cd39459a13c7cdbb5410d}{00019}} \textcolor{preprocessor}{\#define PROJ\_LENGTH\_FACTOR 2}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00020}00020 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00021}00021 \textcolor{comment}{/* Copy constructuor and assignement are disabled in most of}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00022}00022 \textcolor{comment}{ * our classes so we're sure we can't accidentally copy players}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00023}00023 \textcolor{comment}{ * (We need to explicitly specify the default constructor)*/}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00024}\mbox{\hyperlink{utils_8h_a815cc3532f834befd1c85e0e8d3bc9f7}{00024}} \textcolor{preprocessor}{\#define INV\_GET\_POS(i) confData.invadersSize*(i)+confData.invadersDistance*(i)}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00025}00025 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00026}00026 \textcolor{comment}{// Syntax : DEBUG(cout << "{}hey"{} << endl)}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00027}00027 \textcolor{comment}{// The debug flag defintion has been set here, but normally we would add it to the MakeFile}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00028}00028 \textcolor{comment}{//\#define DEBUG\_FLAG}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00029}00029 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00030}00030 \textcolor{preprocessor}{\#ifdef DEBUG\_FLAG}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00031}00031 \textcolor{preprocessor}{\#define DEBUG\_MSG(X) cerr << "{}DEBUG: "{}} << X << endl;}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00032}00032 \textcolor{preprocessor}{\#define DEBUG\_INSTR(X) X;}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00033}00033 \textcolor{preprocessor}{\#else}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00034}\mbox{\hyperlink{utils_8h_aa1bc11933ce4506010028d354b3364b4}{00034}} \textcolor{preprocessor}{\#define DEBUG\_MSG(X)}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00035}\mbox{\hyperlink{utils_8h_ac9476fcfc18faf6d47d13b9774eea2a4}{00035}} \textcolor{preprocessor}{\#define DEBUG\_INSTR(X)}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00036}00036 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00037}00037 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00039}00039 \textcolor{keyword}{using namespace }std;}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00040}00040 \textcolor{keyword}{using} nsGraphics::RGBAcolor;}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00045}\mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318de}{00045}} \textcolor{keyword}{enum class} \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318de}{WinValue}}\{}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00046}00046 \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318deab0a805cee749933cf3e707de70a80dbf}{NOBODY}}, \textcolor{comment}{// should never be used}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00047}00047 \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318deae334ea4bb6fd38968f6809b091120ad8}{PLAYERS}},}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00048}00048 \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318dea6c5e2f894ce45b3f0b6c6a9f35165354}{INVADERS}},}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00049}00049 \mbox{\hyperlink{utils_8h_acd2eabcda2cfc7902077f1f9a9e318dea0d28cba0bd4f26e16d766000d27e49fa}{GOD}},}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00050}00050 \};}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00051}00051 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00053}\mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{00053}} \textcolor{keyword}{typedef} nsGraphics::Vec2D \mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}};}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00054}\mbox{\hyperlink{utils_8h_a19f2f2312637b6ed67b6d24598b6f470}{00054}} \textcolor{keyword}{typedef} \textcolor{keywordtype}{unsigned} \mbox{\hyperlink{utils_8h_a19f2f2312637b6ed67b6d24598b6f470}{playerID}};}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00055}\mbox{\hyperlink{utils_8h_aff32b2add5186520b5ae86864ebaf51a}{00055}} \textcolor{preprocessor}{\#define PLAYER1 0}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00056}\mbox{\hyperlink{utils_8h_a7a2041512655fbd01e15d4516f7fb7cc}{00056}} \textcolor{preprocessor}{\#define PLAYER2 1}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00057}00057 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00058}00058 \textcolor{comment}{// didn't want to use Position because of the semantic with x and y}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00059}00059 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00068}00068 \textcolor{keywordtype}{bool} \mbox{\hyperlink{utils_8h_a8d01e61a45fe7072e45f22044013e358}{areLinesColliding}}(\textcolor{keywordtype}{unsigned} start1, \textcolor{keywordtype}{unsigned} end1, \textcolor{keywordtype}{unsigned} start2, \textcolor{keywordtype}{unsigned} end2);}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00069}00069 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00070}00070 \textcolor{comment}{// change draw position for a specified size (keeps the same center)}}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00071}00071 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00078}00078 \textcolor{keywordtype}{void} \mbox{\hyperlink{utils_8h_a984f84273044b866085f08117f942b8f}{applyTransformation}}(\mbox{\hyperlink{utils_8h_aaa06d516441b519f8892f37adafeade2}{Position}}\& pos, \textcolor{keywordtype}{unsigned} sizeFrom, \textcolor{keywordtype}{unsigned} sizeTo);}
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00079}00079 }
\DoxyCodeLine{\Hypertarget{utils_8h_source_l00080}00080 \textcolor{preprocessor}{\#endif}}
\end{DoxyCode}