From bbdc924d409f74594bd8c8b0d4bf55d5e5f32209 Mon Sep 17 00:00:00 2001 From: drumsetmonkey Date: Mon, 21 Mar 2016 08:04:33 -0400 Subject: Created currency and new inventory --- include/common.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 58d561f..6f453b0 100644 --- a/include/common.h +++ b/include/common.h @@ -1,6 +1,6 @@ /** @file common.h * @brief Common items needed by most other files. - * + * * This file contains headers, variables and functions that are needed in * most other files included in this project. */ @@ -14,12 +14,13 @@ #include #include #include -#include +#include #include #include #include #include #include +#include #define GLEW_STATIC #include @@ -48,6 +49,17 @@ N abso(N v){ return v; } +template +float averagef(A v){ + float avg = 0; + for(auto &a : v){ + avg += a; + } + avg /= v.size(); + return avg; +} + + extern GLuint colorIndex; // Texture.cpp? /** @@ -130,7 +142,7 @@ extern std::mutex mtx; * definition was made. Every item being drawn to the screen and most object detection/physic * handling is done based off of this number. Increasing it will give the game a zoomed-in * feel, while decreasing it will do the opposite. - * + * */ extern unsigned int HLINE; @@ -159,7 +171,7 @@ extern float VOLUME_SFX; * Included in common.h is a prototype for DEBUG_prints, which writes a formatted * string to the console containing the callee's file and line number. This macro simplifies * it to a simple printf call. - * + * * DEBUG must be defined for this macro to function. */ @@ -181,7 +193,7 @@ extern unsigned int deltaTime; /** * References the variable in main.cpp, used for drawing with the player. */ - + extern vec2 offset; /** @@ -211,11 +223,12 @@ void safeSetColor(int r,int g,int b); void safeSetColorA(int r,int g,int b,int a); + /** * We've encountered many problems when attempting to create delays for triggering * the logic function. As a result, we decided on using the timing libraries given * by in the standard C++ library. This function simply returns the amount - * of milliseconds that have passed sine the epoch. + * of milliseconds that have passed since the epoch. */ #ifdef __WIN32__ -- cgit v1.2.3