Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
engine_utils.cpp
Go to the documentation of this file.
1/*
2 engine_utils.cpp
3 Nicolas Chereau 2006
4 Olympe Engine ::2D Game Editor ::olympe.editor@gmail.com
5*/
6
7#pragma once
8
9#include "engine_utils.h"
10//#include <windows.h>
11#include "gameengine.h" //used as reference
12#include <iostream>
13#include "world.h"
14#include <fstream>
15
16
17//////////////////////////////////////////////////////////
18void MsgBox(string& stitle, string& smsg, bool _berror)
19{
20 /*if (_berror)
21 MessageBoxA(NULL, smsg.c_str(), stitle.c_str(), MB_OK | MB_ICONERROR | MB_APPLMODAL);
22 else
23 MessageBoxA(NULL, smsg.c_str(), stitle.c_str(), MB_OK | MB_ICONWARNING | MB_APPLMODAL);/**/
24}
25//////////////////////////////////////////////////////////
26// Clamp a float into a range
27float FloatClamp (float _f, float fMin, float fMax)
28{
29 if (_f <= fMin)
30 return fMin;
31
32 if (_f >= fMax)
33 return fMax;
34
35 return _f;
36}
37int IntClamp (int _i, int iMin, int iMax)
38{
39 if (_i <= iMin)
40 return iMin;
41
42 if (_i >= iMax)
43 return iMax;
44
45 return _i;
46}
48{
49 if (_v <= _vMin)
50 return _vMin;
51
52 if (_v >= _vMax)
53 return _vMax;
54 return _v;
55}
56//////////////////////////////////////////////////////////
57// float blending
58float fBlend ( float _f1, float _f2, float _fc)
59{
60 float f = (_f1 * _fc ) + (_f2 * (1.0f - _fc ));
61 return f;
62}
63
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
float fBlend(float _f1, float _f2, float _fc)
Vector VectorClamp(Vector _v, Vector _vMin, Vector _vMax)
void MsgBox(string &stitle, string &smsg, bool _berror)
int IntClamp(int _i, int iMin, int iMax)
float FloatClamp(float _f, float fMin, float fMax)