mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-06-03 03:23:33 +02:00
Remove argument cast errors in defined functions
This commit is contained in:
parent
18450bf587
commit
ae8f58614f
|
@ -227,7 +227,7 @@ void entityclass::gravcreate( Game& game, int ypos, int dir, int xoff /*= 0*/, i
|
|||
}
|
||||
}
|
||||
|
||||
void entityclass::generateswnwave( Game& game, UtilityClass& help, int t )
|
||||
void entityclass::generateswnwave( Game& game, UtilityClass& /*help*/, int t )
|
||||
{
|
||||
//generate a wave for the SWN game
|
||||
if(game.swndelay<=0)
|
||||
|
@ -860,7 +860,7 @@ void entityclass::generateswnwave( Game& game, UtilityClass& help, int t )
|
|||
}
|
||||
}
|
||||
|
||||
void entityclass::createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/ )
|
||||
void entityclass::_createblock( int t, int xp, int yp, int w, int h, int trig /*= 0*/ )
|
||||
{
|
||||
if(nblocks == 0)
|
||||
{
|
||||
|
@ -1774,7 +1774,7 @@ void entityclass::settreadmillcolour( int t, int rx, int ry )
|
|||
}
|
||||
}
|
||||
|
||||
void entityclass::createentity( Game& game, float xp, float yp, int t, float vx /*= 0*/, float vy /*= 0*/, int p1 /*= 0*/, int p2 /*= 0*/, int p3 /*= 320*/, int p4 /*= 240 */ )
|
||||
void entityclass::_createentity( Game& game, float xp, float yp, int t, float vx /*= 0*/, float vy /*= 0*/, int p1 /*= 0*/, int p2 /*= 0*/, int p3 /*= 320*/, int p4 /*= 240 */ )
|
||||
{
|
||||
//Find the first inactive case z that we can use to index the new entity
|
||||
if (nentity == 0)
|
||||
|
@ -4941,7 +4941,7 @@ bool entityclass::entitycollideroof( mapclass& map, int t )
|
|||
return false;
|
||||
}
|
||||
|
||||
bool entityclass::testwallsx( int t, mapclass& map, int tx, int ty )
|
||||
bool entityclass::_testwallsx( int t, mapclass& map, int tx, int ty )
|
||||
{
|
||||
tempx = tx + entities[t].cx;
|
||||
tempy = ty + entities[t].cy;
|
||||
|
@ -4987,7 +4987,7 @@ bool entityclass::testwallsx( int t, mapclass& map, int tx, int ty )
|
|||
return true;
|
||||
}
|
||||
|
||||
bool entityclass::testwallsy( int t, mapclass& map, float tx, float ty )
|
||||
bool entityclass::_testwallsy( int t, mapclass& map, float tx, float ty )
|
||||
{
|
||||
tempx = static_cast<int>(tx) + entities[t].cx;
|
||||
tempy = static_cast<int>(ty) + entities[t].cy;
|
||||
|
|
|
@ -70,7 +70,17 @@ public:
|
|||
|
||||
void generateswnwave(Game& game, UtilityClass& help, int t);
|
||||
|
||||
void createblock(int t, int xp, int yp, int w, int h, int trig = 0);
|
||||
void _createblock(int t, int xp, int yp, int w, int h, int trig = 0);
|
||||
template<class A, class B, class C, class D, class E, class F>
|
||||
void createblock(A t, B xp, C yp, D w, E h, F trig)
|
||||
{
|
||||
_createblock(static_cast<int>(t), static_cast<int>(xp), static_cast<int>(yp), static_cast<int>(w), static_cast<int>(h), static_cast<int>(trig));
|
||||
}
|
||||
template<class A, class B, class C, class D, class E>
|
||||
void createblock(A t, B xp, C yp, D w, E h)
|
||||
{
|
||||
_createblock(static_cast<int>(t), static_cast<int>(xp), static_cast<int>(yp), static_cast<int>(w), static_cast<int>(h));
|
||||
}
|
||||
|
||||
void removeallblocks();
|
||||
|
||||
|
@ -93,10 +103,54 @@ public:
|
|||
void setenemy(int t, int r);
|
||||
|
||||
void settreadmillcolour(int t, int rx, int ry);
|
||||
|
||||
void createentity(Game& game, float xp, float yp, int t, float vx = 0, float vy = 0,
|
||||
/*
|
||||
* Callers of createentity relied on default casts, which would throw warnings by the compiler.
|
||||
* Instead of littering the code with static_casts, instead templatise the function and have the
|
||||
* compiler generate the required function parameter permutations for us.
|
||||
* static_cast to original function's types should make compiler error if a bad type is passed
|
||||
* in future; this isn't carte-blanche pass anything in.
|
||||
*/
|
||||
void _createentity(Game& game, float xp, float yp, int t, float vx = 0, float vy = 0,
|
||||
int p1 = 0, int p2 = 0, int p3 = 320, int p4 = 240 );
|
||||
|
||||
template <class A, class B, class C, class D, class E, class F, class G, class H, class I>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx, E vy, F p1, G p2, H p3, I p4 )
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx), static_cast<float>(vy), static_cast<int>(p1), static_cast<int>(p2), static_cast<int>(p3), static_cast<int>(p4));
|
||||
}
|
||||
/* Trouble is, templated parms can't be defaulted. So we need to supply more templates for
|
||||
* signatures which match missing parameters too
|
||||
*/
|
||||
template <class A, class B, class C, class D, class E, class F, class G, class H>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx, E vy, F p1, G p2, H p3)
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx), static_cast<float>(vy), static_cast<int>(p1), static_cast<int>(p2), static_cast<int>(p3));
|
||||
}
|
||||
template <class A, class B, class C, class D, class E, class F, class G>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx, E vy, F p1, G p2)
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx), static_cast<float>(vy), static_cast<int>(p1), static_cast<int>(p2));
|
||||
}
|
||||
template <class A, class B, class C, class D, class E, class F>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx, E vy, F p1)
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx), static_cast<float>(vy), static_cast<int>(p1));
|
||||
}
|
||||
template <class A, class B, class C, class D, class E>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx, E vy )
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx), static_cast<float>(vy));
|
||||
}
|
||||
template <class A, class B, class C, class D>
|
||||
void createentity(Game& game, A xp, B yp, C t, D vx )
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t), static_cast<float>(vx));
|
||||
}
|
||||
template <class A, class B, class C>
|
||||
void createentity(Game& game, A xp, B yp, C t)
|
||||
{
|
||||
return _createentity(game, static_cast<float>(xp), static_cast<float>(yp), static_cast<int>(t));
|
||||
}
|
||||
/* End of templates for createentity's variable number of parameters */
|
||||
bool updateentities(int i, UtilityClass& help, Game& game, musicclass& music);
|
||||
|
||||
void animateentities(int i, Game& game, UtilityClass& help);
|
||||
|
@ -167,9 +221,19 @@ public:
|
|||
|
||||
bool entitycollideroof(mapclass& map, int t);
|
||||
|
||||
bool testwallsx(int t, mapclass& map, int tx, int ty);
|
||||
bool _testwallsx(int t, mapclass& map, int tx, int ty);
|
||||
template<class A, class B, class C>
|
||||
bool testwallsx(A t, mapclass& map, B tx, C ty)
|
||||
{
|
||||
return _testwallsx(static_cast<int>(t), map, static_cast<int>(tx), static_cast<int>(ty));
|
||||
}
|
||||
|
||||
bool testwallsy(int t, mapclass& map, float tx, float ty);
|
||||
bool _testwallsy(int t, mapclass& map, float tx, float ty);
|
||||
template<class A, class B, class C>
|
||||
bool testwallsy(A t, mapclass& map, B tx, C ty)
|
||||
{
|
||||
return _testwallsy(static_cast<int>(t), map, static_cast<float>(tx), static_cast<float>(ty));
|
||||
}
|
||||
|
||||
void fixfriction(int t, float xfix, float xrate, float yrate);
|
||||
|
||||
|
|
|
@ -713,7 +713,7 @@ void Graphics::drawgui( UtilityClass& help )
|
|||
}
|
||||
}
|
||||
|
||||
void Graphics::drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ )
|
||||
void Graphics::_drawimagecol( int t, int xp, int yp, int r = 0, int g = 0, int b = 0, bool cent/*= false*/ )
|
||||
{
|
||||
SDL_Rect trect;
|
||||
if(r+g+b != 0)
|
||||
|
@ -935,7 +935,7 @@ void Graphics::drawcustompixeltextbox( int x, int y, int w, int h, int w2, int h
|
|||
drawcoloredtile(x + (w) - 8, y + (h) - 8, 47, r, g, b);
|
||||
}
|
||||
|
||||
void Graphics::drawtextbox( int x, int y, int w, int h, int r, int g, int b )
|
||||
void Graphics::_drawtextbox( int x, int y, int w, int h, int r, int g, int b )
|
||||
{
|
||||
//given these parameters, draw a textbox
|
||||
//madrect.x = x; madrect.y = y; madrect.w = w*8; madrect.h = h*8;
|
||||
|
@ -2427,7 +2427,7 @@ void Graphics::drawtowermap( mapclass& map )
|
|||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
temp = map.tower.at(i, j, map.ypos);
|
||||
temp = map.tower.at(i, j, static_cast<int>(map.ypos));
|
||||
if (temp > 0) drawtile3(i * 8, (j * 8) - ((int)map.ypos % 8), temp, map.colstate);
|
||||
}
|
||||
}
|
||||
|
@ -2440,7 +2440,7 @@ void Graphics::drawtowermap_nobackground( mapclass& map )
|
|||
{
|
||||
for (int i = 0; i < 40; i++)
|
||||
{
|
||||
temp = map.tower.at(i, j, map.ypos);
|
||||
temp = map.tower.at(i, j, static_cast<int>(map.ypos));
|
||||
if (temp > 0 && temp<28) drawtile3(i * 8, (j * 8) - ((int)map.ypos % 8), temp, map.colstate);
|
||||
}
|
||||
}
|
||||
|
@ -2536,7 +2536,7 @@ void Graphics::drawtowerentities( mapclass& map, entityclass& obj, UtilityClass&
|
|||
}
|
||||
else if (obj.entities[i].size == 4) // Small pickups
|
||||
{
|
||||
drawhuetile(obj.entities[i].xp, obj.entities[i].yp-map.ypos, obj.entities[i].tile, obj.entities[i].colour);
|
||||
drawhuetile(obj.entities[i].xp, static_cast<int>(obj.entities[i].yp-map.ypos), obj.entities[i].tile, obj.entities[i].colour);
|
||||
}
|
||||
else if (obj.entities[i].size == 5) //Horizontal Line
|
||||
{
|
||||
|
@ -3135,12 +3135,12 @@ void Graphics::drawtele(int x, int y, int t, int c, UtilityClass& help)
|
|||
BlitSurfaceColoured(tele[t], NULL, backBuffer, &telerect, ct);
|
||||
}
|
||||
|
||||
Uint32 Graphics::getRGB(Uint8 r, Uint8 g, Uint8 b)
|
||||
Uint32 Graphics::_getRGB(Uint8 r, Uint8 g, Uint8 b)
|
||||
{
|
||||
return SDL_MapRGB(backBuffer->format, b, g, r);
|
||||
}
|
||||
|
||||
Uint32 Graphics::getBGR(Uint8 r, Uint8 g, Uint8 b)
|
||||
Uint32 Graphics::_getBGR(Uint8 r, Uint8 g, Uint8 b)
|
||||
{
|
||||
return SDL_MapRGB(backBuffer->format, r, g, b);
|
||||
}
|
||||
|
@ -3150,17 +3150,17 @@ Uint32 Graphics::getRGB(Uint32 _col)
|
|||
return ( _col);
|
||||
}
|
||||
|
||||
Uint32 Graphics::RGBflip(Uint8 r, Uint8 g, Uint8 b)
|
||||
Uint32 Graphics::_RGBflip(Uint8 r, Uint8 g, Uint8 b)
|
||||
{
|
||||
return SDL_MapRGB(backBuffer->format, r, g, b);
|
||||
}
|
||||
|
||||
Uint32 Graphics::RGBf(int r, int g, int b)
|
||||
Uint32 Graphics::_RGBf(int r, int g, int b)
|
||||
{
|
||||
r = (r+128) / 3;
|
||||
g = (g+128) / 3;
|
||||
b = (b+128) / 3;
|
||||
return SDL_MapRGB(backBuffer->format, r, g, b);
|
||||
return SDL_MapRGB(backBuffer->format, static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
}
|
||||
|
||||
void Graphics::setcolreal(Uint32 t)
|
||||
|
|
|
@ -79,7 +79,12 @@ public:
|
|||
|
||||
void textboxactive();
|
||||
|
||||
void drawtextbox(int x, int y, int w, int h, int r, int g, int b);
|
||||
void _drawtextbox(int x, int y, int w, int h, int r, int g, int b);
|
||||
template<class A, class B, class C, class D, class E, class F, class G>
|
||||
void drawtextbox(A x, B y, C w, D h, E r, F g, G b)
|
||||
{
|
||||
_drawtextbox(static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h), static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
||||
}
|
||||
|
||||
void drawpixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo);
|
||||
void drawcustompixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo);
|
||||
|
@ -94,7 +99,12 @@ public:
|
|||
|
||||
void drawimage(int t, int xp, int yp, bool cent=false);
|
||||
|
||||
void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
|
||||
void _drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
|
||||
template <class A, class B, class C, class D, class E, class F>
|
||||
void drawimagecol(A t, B xp, C yp, D r, E g, F b, bool cent = false)
|
||||
{
|
||||
_drawimagecol(static_cast<int>(t), static_cast<int>(xp), static_cast<int>(yp), static_cast<int>(r), static_cast<int>(g), static_cast<int>(b), cent);
|
||||
}
|
||||
|
||||
void drawgui(UtilityClass& help);
|
||||
|
||||
|
@ -135,16 +145,40 @@ public:
|
|||
|
||||
void drawtele(int x, int y, int t, int c, UtilityClass& help);
|
||||
|
||||
Uint32 getRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
Uint32 getBGR(Uint8 r, Uint8 g, Uint8 b);
|
||||
Uint32 _getRGB(Uint8 r, Uint8 g, Uint8 b);
|
||||
/* rather than making hundreds of casts through the code, instead make these functions templates
|
||||
* which will accept aything which the compiler can static_cast to a Uint8
|
||||
* Compiler should error if non-castable parameter is given.
|
||||
*/
|
||||
template <class R, class G, class B>
|
||||
Uint32 getRGB(R r, G g, B b)
|
||||
{
|
||||
return _getRGB(static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
}
|
||||
Uint32 _getBGR(Uint8 r, Uint8 g, Uint8 b);
|
||||
template <class R, class G, class B>
|
||||
Uint32 getBGR(R r, G g, B b)
|
||||
{
|
||||
return _getBGR(static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
}
|
||||
Uint32 _RGBflip(Uint8 r, Uint8 g, Uint8 b);
|
||||
template <class R, class G, class B>
|
||||
Uint32 RGBflip(R r, G g, B b)
|
||||
{
|
||||
return _RGBflip(static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
}
|
||||
|
||||
Uint32 getRGB(Uint32 _col);
|
||||
|
||||
Uint32 RGBflip(Uint8 r, Uint8 g, Uint8 b);
|
||||
|
||||
|
||||
Uint32 RGBf(int r, int g, int b);
|
||||
Uint32 _RGBf(int r, int g, int b);
|
||||
template <class R, class G, class B>
|
||||
Uint32 RGBf(R r, G g, B b)
|
||||
{
|
||||
return _RGBf(static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
||||
}
|
||||
|
||||
void setcolreal(Uint32 t);
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
|
||||
void setRect( SDL_Rect& _r, int x, int y, int w, int h )
|
||||
void _setRect( SDL_Rect& _r, int x, int y, int w, int h )
|
||||
{
|
||||
_r.x = x;
|
||||
_r.y = y;
|
||||
|
@ -171,7 +171,7 @@ SDL_Surface * ScaleSurface( SDL_Surface *_surface, int Width, int Height, SDL_Su
|
|||
return _ret;
|
||||
}
|
||||
|
||||
SDL_Surface * ScaleSurfaceSlow( SDL_Surface *_surface, int Width, int Height)
|
||||
SDL_Surface * _ScaleSurfaceSlow( SDL_Surface *_surface, int Width, int Height)
|
||||
{
|
||||
if(!_surface || !Width || !Height)
|
||||
return 0;
|
||||
|
@ -387,7 +387,7 @@ void FillRect( SDL_Surface* _surface, const int _x, const int _y, const int _w,
|
|||
{
|
||||
SDL_Rect rect = {Sint16(_x),Sint16(_y),Sint16(_w),Sint16(_h)};
|
||||
Uint32 color;
|
||||
color = SDL_MapRGB(_surface->format, r, g, b);
|
||||
color = SDL_MapRGB(_surface->format, static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
SDL_FillRect(_surface, &rect, color);
|
||||
}
|
||||
|
||||
|
@ -395,7 +395,7 @@ void FillRect( SDL_Surface* _surface, const int r, int g, int b )
|
|||
{
|
||||
SDL_Rect rect = {0,0,Uint16(_surface->w) ,Uint16(_surface->h) };
|
||||
Uint32 color;
|
||||
color = SDL_MapRGB(_surface->format, r, g, b);
|
||||
color = SDL_MapRGB(_surface->format, static_cast<Uint8>(r), static_cast<Uint8>(g), static_cast<Uint8>(b));
|
||||
SDL_FillRect(_surface, &rect, color);
|
||||
}
|
||||
|
||||
|
@ -411,10 +411,10 @@ void FillRect( SDL_Surface* _surface, const int x, const int y, const int w, con
|
|||
SDL_FillRect(_surface, &rect, rgba);
|
||||
}
|
||||
|
||||
void FillRect( SDL_Surface* _surface, SDL_Rect& _rect, const int r, int g, int b )
|
||||
void _FillRect( SDL_Surface* _surface, SDL_Rect& _rect, const int r, int g, int b )
|
||||
{
|
||||
Uint32 color;
|
||||
color = SDL_MapRGB(_surface->format, r, g, b);
|
||||
color = SDL_MapRGB(_surface->format, static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
||||
SDL_FillRect(_surface, &_rect, color);
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ void FillRect( SDL_Surface* _surface, SDL_Rect rect, int rgba )
|
|||
SDL_FillRect(_surface, &rect, rgba);
|
||||
}
|
||||
|
||||
bool intersectRect( float left1, float right1, float bottom1, float top1, float left2, float right2, float bottom2, float top2 )
|
||||
bool _intersectRect( float left1, float right1, float bottom1, float top1, float left2, float right2, float bottom2, float top2 )
|
||||
{
|
||||
return !( left2 > right1 || right2 < left1 || top2 < bottom1 || bottom2 > top1);
|
||||
}
|
||||
|
|
|
@ -9,7 +9,12 @@ struct colourTransform
|
|||
};
|
||||
|
||||
|
||||
void setRect(SDL_Rect& _r, int x, int y, int w, int h);
|
||||
void _setRect(SDL_Rect& _r, int x, int y, int w, int h);
|
||||
template<class A, class B, class C, class D>
|
||||
void setRect(SDL_Rect& _r, A x, B y, C w, D h)
|
||||
{
|
||||
_setRect(_r, static_cast<int>(x), static_cast<int>(y), static_cast<int>(w), static_cast<int>(h));
|
||||
}
|
||||
|
||||
unsigned int endian_swap(unsigned int x);
|
||||
|
||||
|
@ -33,11 +38,21 @@ void FillRect( SDL_Surface* surface, const int color );
|
|||
|
||||
void FillRect( SDL_Surface* surface, const int x, const int y, const int w, const int h, int rgba );
|
||||
|
||||
void FillRect( SDL_Surface* surface, SDL_Rect& rect, const int r, int g, int b );
|
||||
void _FillRect( SDL_Surface* surface, SDL_Rect& rect, const int r, int g, int b );
|
||||
template<class R, class G, class B>
|
||||
void FillRect(SDL_Surface* surface, SDL_Rect& rect, const R r, G g, B b)
|
||||
{
|
||||
_FillRect(surface, rect, static_cast<int>(r), static_cast<int>(g), static_cast<int>(b));
|
||||
}
|
||||
|
||||
void FillRect( SDL_Surface* surface, SDL_Rect rect, int rgba );
|
||||
|
||||
bool intersectRect(float left1, float right1, float bottom1, float top1, float left2, float right2, float bottom2, float top2);
|
||||
bool _intersectRect(float left1, float right1, float bottom1, float top1, float left2, float right2, float bottom2, float top2);
|
||||
template<class A, class B, class C, class D, class E, class F, class G, class H>
|
||||
bool intersectRect(A left1, B right1, C bottom1, D top1, E left2, F right2, G bottom2, H top2)
|
||||
{
|
||||
return _intersectRect(static_cast<float>(left1), static_cast<float>(right1), static_cast<float>(bottom1), static_cast<float>(top1), static_cast<float>(left2), static_cast<float>(right2), static_cast<float>(bottom2), static_cast<float>(top2));
|
||||
}
|
||||
|
||||
void OverlaySurfaceKeyed(SDL_Surface* _src, SDL_Surface* _dest, Uint32 _key);
|
||||
|
||||
|
@ -45,7 +60,12 @@ void ScrollSurface(SDL_Surface* _src, int pX, int py);
|
|||
|
||||
SDL_Surface * FlipSurfaceHorizontal(SDL_Surface* _src);
|
||||
SDL_Surface * FlipSurfaceVerticle(SDL_Surface* _src);
|
||||
SDL_Surface * ScaleSurfaceSlow( SDL_Surface *_surface, int Width, int Height );
|
||||
SDL_Surface * _ScaleSurfaceSlow( SDL_Surface *_surface, int Width, int Height );
|
||||
template<class W, class H>
|
||||
SDL_Surface * ScaleSurfaceSlow( SDL_Surface *_surface, W Width, H Height )
|
||||
{
|
||||
return _ScaleSurfaceSlow(_surface, static_cast<int>(Width), static_cast<int>(Height));
|
||||
}
|
||||
SDL_Surface* ApplyFilter( SDL_Surface* _src );
|
||||
|
||||
#endif /* GRAPHICSUTIL_H */
|
||||
|
|
|
@ -124,7 +124,7 @@ mapclass::mapclass()
|
|||
fillareamap(tmap);
|
||||
}
|
||||
|
||||
int mapclass::RGB(int red,int green,int blue)
|
||||
int mapclass::_RGB(int red,int green,int blue)
|
||||
{
|
||||
return (blue | (green << 8) | (red << 16));
|
||||
}
|
||||
|
@ -565,9 +565,9 @@ void mapclass::changefinalcol(int t, entityclass& obj, Game& game)
|
|||
|
||||
void mapclass::setcol(const int r1, const int g1, const int b1 , const int r2, const int g2, const int b2, const int c)
|
||||
{
|
||||
r = intpol(r1, r2, c / 5);
|
||||
g = intpol(g1, g2, c / 5);
|
||||
b = intpol(b1, b2, c / 5);
|
||||
r = intpol(r1, r2, static_cast<float>(c / 5));
|
||||
g = intpol(g1, g2, static_cast<float>(c / 5));
|
||||
b = intpol(b1, b2, static_cast<float>(c / 5));
|
||||
}
|
||||
|
||||
void mapclass::updatetowerglow()
|
||||
|
|
|
@ -20,7 +20,12 @@ class mapclass
|
|||
public:
|
||||
mapclass();
|
||||
|
||||
int RGB(int red,int green,int blue);
|
||||
int _RGB(int red,int green,int blue);
|
||||
template<class R, class G, class B>
|
||||
int RGB(R red, G green, B blue)
|
||||
{
|
||||
return _RGB(static_cast<int>(red), static_cast<int>(green), static_cast<int>(blue));
|
||||
}
|
||||
|
||||
int intpol(int a, int b, float c);
|
||||
|
||||
|
|
|
@ -707,7 +707,6 @@ int editorclass::getenemycol(int t)
|
|||
return 6;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int editorclass::getwarpbackground(int rx, int ry)
|
||||
|
@ -985,7 +984,6 @@ int editorclass::getenemyframe(int t)
|
|||
return 78;
|
||||
break;
|
||||
}
|
||||
return 78;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1430,7 +1428,6 @@ int editorclass::edgetile( int x, int y )
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int editorclass::warpzoneedgetile( int x, int y )
|
||||
|
@ -1481,7 +1478,6 @@ int editorclass::warpzoneedgetile( int x, int y )
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int editorclass::outsideedgetile( int x, int y )
|
||||
|
@ -1499,7 +1495,6 @@ int editorclass::outsideedgetile( int x, int y )
|
|||
return 2;
|
||||
break;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1551,7 +1546,6 @@ int editorclass::backedgetile( int x, int y )
|
|||
return 0;
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int editorclass::labspikedir( int x, int y, int t )
|
||||
|
@ -3348,10 +3342,10 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent
|
|||
FillRect(dwgfx.backBuffer, tx+6,ty+2,4,12,dwgfx.getRGB(255,255,255));
|
||||
//15:
|
||||
tx+=tg;
|
||||
dwgfx.drawsprite(tx,ty,186,75, 75, 255- help.glow/4 - (fRandom()*20));
|
||||
dwgfx.drawsprite(tx,ty,186,75, 75, static_cast<int>(255- help.glow/4 - (fRandom()*20)));
|
||||
//16:
|
||||
tx+=tg;
|
||||
dwgfx.drawsprite(tx,ty,184,160- help.glow/2 - (fRandom()*20), 200- help.glow/2, 220 - help.glow);
|
||||
dwgfx.drawsprite(tx,ty,184,static_cast<int>(160- help.glow/2 - (fRandom()*20)), static_cast<int>(200- help.glow/2), 220 - help.glow);
|
||||
|
||||
if(ed.drawmode==10)dwgfx.Print(22+((ed.drawmode-10)*tg)-4, 225-4,"R",255,255,255,false);
|
||||
if(ed.drawmode==11)dwgfx.Print(22+((ed.drawmode-10)*tg)-4, 225-4,"T",255,255,255,false);
|
||||
|
@ -3599,7 +3593,7 @@ void editorrender( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, ent
|
|||
//dwgfx.backbuffer.unlock();
|
||||
}
|
||||
|
||||
void editorlogic( KeyPoll& key, Graphics& dwgfx, Game& game, entityclass& obj, musicclass& music, mapclass& map, UtilityClass& help )
|
||||
void editorlogic( KeyPoll& /*key*/, Graphics& dwgfx, Game& game, entityclass& /*obj*/, musicclass& music, mapclass& map, UtilityClass& help )
|
||||
{
|
||||
//Misc
|
||||
help.updateglow();
|
||||
|
@ -3639,8 +3633,8 @@ void editorlogic( KeyPoll& key, Graphics& dwgfx, Game& game, entityclass& obj, m
|
|||
void editorinput( KeyPoll& key, Graphics& dwgfx, Game& game, mapclass& map, entityclass& obj, UtilityClass& help, musicclass& music )
|
||||
{
|
||||
//TODO Mouse Input!
|
||||
game.mx = (float) key.mx;
|
||||
game.my = (float) key.my;
|
||||
game.mx = (int) key.mx;
|
||||
game.my = (int) key.my;
|
||||
ed.tilex=(game.mx - (game.mx%8))/8;
|
||||
ed.tiley=(game.my - (game.my%8))/8;
|
||||
if (game.stretchMode == 1) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user