mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix asteroids compile warnings.
This commit is contained in:
parent
0b1c515790
commit
5209258de0
1 changed files with 11 additions and 7 deletions
|
@ -89,7 +89,7 @@ void FetchKeyboardInput()
|
||||||
{
|
{
|
||||||
int kbkey = KBKEY_DECODE(codepoint);
|
int kbkey = KBKEY_DECODE(codepoint);
|
||||||
int abskbkey = (kbkey < 0) ? -kbkey : kbkey;
|
int abskbkey = (kbkey < 0) ? -kbkey : kbkey;
|
||||||
if ( MAXKEYNUM <= abskbkey ) { continue; }
|
if ( MAXKEYNUM <= (size_t) abskbkey ) { continue; }
|
||||||
keysdown[abskbkey] = 0 < kbkey;
|
keysdown[abskbkey] = 0 < kbkey;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ void DrawLine(uint32_t color, long x0, long y0, long x1, long y1)
|
||||||
long e2;
|
long e2;
|
||||||
while ( true )
|
while ( true )
|
||||||
{
|
{
|
||||||
if ( 0 <= x0 && x0 < xres && 0 <= y0 & y0 < yres )
|
if ( 0 <= x0 && (size_t) x0 < xres && 0 <= y0 && y0 < (size_t) yres )
|
||||||
{
|
{
|
||||||
size_t index = y0 * linesize + x0;
|
size_t index = y0 * linesize + x0;
|
||||||
buf[index] = color;
|
buf[index] = color;
|
||||||
|
@ -145,24 +145,28 @@ public:
|
||||||
{
|
{
|
||||||
x += rhs.x;
|
x += rhs.x;
|
||||||
y += rhs.y;
|
y += rhs.y;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector& operator-=(const Vector& rhs)
|
Vector& operator-=(const Vector& rhs)
|
||||||
{
|
{
|
||||||
x -= rhs.x;
|
x -= rhs.x;
|
||||||
y -= rhs.y;
|
y -= rhs.y;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector& operator*=(float scalar)
|
Vector& operator*=(float scalar)
|
||||||
{
|
{
|
||||||
x *= scalar;
|
x *= scalar;
|
||||||
y *= scalar;
|
y *= scalar;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector& operator/=(float scalar)
|
Vector& operator/=(float scalar)
|
||||||
{
|
{
|
||||||
x /= scalar;
|
x /= scalar;
|
||||||
y /= scalar;
|
y /= scalar;
|
||||||
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Vector operator+(const Vector& other) const
|
const Vector operator+(const Vector& other) const
|
||||||
|
@ -296,8 +300,8 @@ public:
|
||||||
return !strcmp(classname, "Object");
|
return !strcmp(classname, "Object");
|
||||||
}
|
}
|
||||||
virtual void PreFrame() { }
|
virtual void PreFrame() { }
|
||||||
virtual void OnFrame(float deltatime) { }
|
virtual void OnFrame(float /*deltatime*/) { }
|
||||||
virtual void PostFrame(float deltatime) { }
|
virtual void PostFrame(float /*deltatime*/) { }
|
||||||
virtual void Render() { }
|
virtual void Render() { }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -344,7 +348,7 @@ public:
|
||||||
return !strcmp(classname, "Actor") || Object::IsA(classname);
|
return !strcmp(classname, "Actor") || Object::IsA(classname);
|
||||||
}
|
}
|
||||||
virtual void Move(float deltatime);
|
virtual void Move(float deltatime);
|
||||||
virtual void Think(float deltatime) { }
|
virtual void Think(float /*deltatime*/) { }
|
||||||
virtual void Render() { }
|
virtual void Render() { }
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
@ -506,7 +510,7 @@ public:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void AsteroidField::Think(float deltatime)
|
void AsteroidField::Think(float /*deltatime*/)
|
||||||
{
|
{
|
||||||
float spawndist = 1500.0f;
|
float spawndist = 1500.0f;
|
||||||
float maxdist = 1.5 * spawndist;
|
float maxdist = 1.5 * spawndist;
|
||||||
|
@ -1137,7 +1141,7 @@ void InitGame()
|
||||||
new AsteroidField;
|
new AsteroidField;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char* argv[])
|
int main(int /*argc*/, char* argv[])
|
||||||
{
|
{
|
||||||
#ifndef HACK_DONT_CHECK_FB
|
#ifndef HACK_DONT_CHECK_FB
|
||||||
char* vidmode = GetCurrentVideoMode();
|
char* vidmode = GetCurrentVideoMode();
|
||||||
|
|
Loading…
Add table
Reference in a new issue