LIBGL := -lGL -lGLU
LIBSDL := `sdl-config --libs`
endif
-LIBS := ${LIBSDL} ${LIBGL}
-
+LIBMY := -lpg
+LIBS := ${LIBSDL} ${LIBGL} ${LIBMY}
OPTFLAGS := -O2
DBGFLAGS := -ggdb
PRFFLAGS := ${DBGFLAGS} -pg
MYFLAGS := -Wall -pedantic -ansi
+RPATH := libs/
+
VALFLAGS := --leak-check=full
+LNKFLAGS := -Wl,-rpath,${RPATH}
+
ifeq (${WIN32},1)
CXXFLAGS := ${OPTFLAGS}
else ifeq (${FINAL},1)
CXX := g++
endif
-DIRS := # := start
+DIRS := # := start
SRCSDIR := src/
SRCS := # := start
CFGS += keys.cfg
CFGS := $(addprefix ${DSTCFGDIR},${CFGS})
-SRCLIBSDIR := libs/
-DSTLIBSDIR := ${WORKINGDIR}
+LIBSDIRNAME := libs/
+SRCLIBSDIR := ${LIBSDIRNAME}
+DSTLIBSDIR := ${WORKINGDIR}${LIBSDIRNAME}
LIBSTXT := # := start
LIBSTXT += COPYING-SDL
ifeq (${WIN32},1)
LIBSCPY += SDL.dll
else
- LIBSCPY += libSDL.so
+ LIBSCPY += libSDL-1.2.so.0
+ LIBSCPY += libpg.so.0
endif
LIBSCPY := $(addprefix ${DSTLIBSDIR},${LIBSCPY})
DEPSBLDDIRS := ${DEPSDIR} $(addprefix ${DEPSDIR},${DIRS})
OBJSBLDDIRS := ${OBJSDIR} $(addprefix ${OBJSDIR},${DIRS})
-BLDDIRS := ${OBJSBLDDIRS} ${DEPSBLDDIRS} ${WORKINGDIR} ${DSTCFGDIR}
+
+BLDDIRS := # := start
+BLDDIRS += ${OBJSBLDDIRS}
+BLDDIRS += ${DEPSBLDDIRS}
+BLDDIRS += ${WORKINGDIR}
+BLDDIRS += ${DSTCFGDIR}
+BLDDIRS += ${DSTLIBSDIR}
INCDIRS := ${SRCSDIR}
+INCFLAGS := $(addprefix -I, ${INCDIRS})
PRNTFMT := printf "%-5s: %s\n"
# how to link the main target
${TARGETTMP}: ${OBJS}
${Q1}${PRNTFMT} "${CXX}" "$@"
- ${Q2}${CXX} ${CXXFLAGS} -o $@ $^ ${LIBS}
+ ${Q2}${CXX} ${CXXFLAGS} ${LNKFLAGS} -o $@ $^ ${LIBS}
# rule to copy tmp target to working directory
${TARGET}: ${TARGETTMP} | ${WORKINGDIR}
# rule to make an object file from a .cpp
${OBJSDIR}%.o: ${SRCSDIR}%.cpp | $$(dir $$@)
${Q1}${PRNTFMT} "${CXX}" "$@"
- ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $< -I "${INCDIRS}"
+ ${Q2}${CXX} ${CXXFLAGS} -c -o $@ $< ${INCFLAGS}
# rule to make a depend file from a .cpp
# be clever and escape the / chars in file paths
# DON'T simply use another sed delimiter or it can't appear in the file paths
${DEPSDIR}%.d: ${SRCSDIR}%.cpp | $$(dir $$@)
${Q1}${PRNTFMT} "DEP" "$@"
- ${Q2}${CXX} -MM ${CXXFLAGS} $< -I "${INCDIRS}" | \
+ ${Q2}${CXX} -MM ${CXXFLAGS} $< ${INCFLAGS} | \
sed 's/\(^.*\):/$(subst /,\/,${OBJSDIR}\1 $@):/' > $@
CLEANCMDS := cleanbin cleanobjs cleandeps clean cleanall
--- /dev/null
+/usr/lib/libpg.so.0
\ No newline at end of file
#ifndef COLLISIONINFO_H
#define COLLISIONINFO_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Header Class *****
#ifndef EFFECT_H
#define EFFECT_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
// Mutual headers ...
#ifndef GRAVITY_H
#define GRAVITY_H
+#include <pg/Vector2.h>
+
#include "Effect.h"
-#include "Vector2.h"
/// ***** Header Class *****
#ifndef GRAVITYWELL_H
#define GRAVITYWELL_H
+#include <pg/Vector2.h>
+
#include "Effect.h"
-#include "Vector2.h"
/// ***** Header Class *****
#ifndef SCREEN_H
#define SCREEN_H
+#include <pg/Vector2.h>
+
#include "Effect.h"
-#include "Vector2.h"
/// ***** Header Class *****
*/
#include "Ball.h"
-#include "debug.h"
-#include "Vector2.h"
+#include <pg/debug.h>
+#include <pg/Vector2.h>
+
#include "graphics/graphics.h"
#ifndef BALL_H
#define BALL_H
+#include <pg/Vector2.h>
+
#include "PhysicsEntity.h"
-#include "Vector2.h"
/// ***** Header Class *****
#include "Entity.h"
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Constructors/Destructors *****
#ifndef ENTITY_H
#define ENTITY_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Header Class *****
#include "Line.h"
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Constructors/Destructors *****
#ifndef LINE_H
#define LINE_H
+#include <pg/Vector2.h>
+
#include "Particle.h"
-#include "Vector2.h"
/// ***** Header Class *****
#include "Particle.h"
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Constructors/Destructors *****
#ifndef PARTICLE_H
#define PARTICLE_H
+#include <pg/Vector2.h>
+
#include "Entity.h"
-#include "Vector2.h"
/// NOTE to SELF
*/
#include "PhysicsEntity.h"
-#include "debug.h"
+
+#include <pg/debug.h>
+#include <pg/Vector2.h>
#include "effectManager.h"
-#include "Vector2.h"
/// ***** Constructors/Destructors *****
#ifndef PHYSICS_H
#define PHYSICS_H
+#include <pg/Vector2.h>
+
#include "Entity.h"
-#include "Vector2.h"
/// ***** Header Class *****
#include "Point.h"
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Constructors/Destructors *****
#ifndef POINT_H
#define POINT_H
+#include <pg/Vector2.h>
+
#include "Particle.h"
-#include "Vector2.h"
/// ***** Header Class *****
*/
#include "Polygon.h"
-#include "debug.h"
-#include "Vector2.h"
+#include <pg/debug.h>
+#include <pg/Vector2.h>
#include "graphics/graphics.h"
#ifndef POLYGON_H
#define POLYGON_H
+#include <pg/Vector2.h>
+
#include "PhysicsEntity.h"
-#include "Vector2.h"
#include <vector>
using std::vector;
#include "WindParticle.h"
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Constructors/Destructors *****
#ifndef WINDPARTICLE_H
#define WINDPARTICLE_H
+#include <pg/Vector2.h>
+
#include "Point.h"
-#include "Vector2.h"
/// ***** Header Class *****
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Vector2.h"
-#include "debug.h"
-
-#include "mathw.h"
-
-/// ***** Constructors/Destructors *****
-
-Vector2::Vector2()
- : m_fX(0), m_fY(0)
-{
-
-}
-Vector2::Vector2(float fX, float fY)
- : m_fX(fX), m_fY(fY)
-{
-
-}
-
-/// ***** Public Class Methods *****
-
-void Vector2::zero()
-{
- m_fX = 0;
- m_fY = 0;
-}
-void Vector2::unit()
-{
- float fLen = length();
-
- m_fX /= fLen;
- m_fY /= fLen;
-}
-
-float Vector2::angle() const
-{
- //TODO
- DASSERT(false);
- //return atan2A(m_fY,m_fX);
- return 0;
-}
-float Vector2::length() const
-{
- return sqrt(sqrLength());
-}
-float Vector2::sqrLength() const
-{
- return this->dot(*this);
-}
-
-float Vector2::dot(const Vector2& vec) const
-{
- return m_fX * vec.m_fX + m_fY * vec.m_fY;
-}
-
-
-string Vector2::toString() const
-{
- // long just to be safe
- char rgchars[100];
-
- sprintf(rgchars, "Vector2 X: %f, Y: %f", m_fX, m_fY);
-
- return rgchars;
-}
-void Vector2::print() const
-{
- printf("%s\n", toString().c_str());
-}
-
-
-Vector2 Vector2::add(const Vector2& vec) const
-{
- return Vector2(m_fX + vec.m_fX, m_fY + vec.m_fY);
-}
-Vector2 Vector2::subtract(const Vector2& vec) const
-{
- return Vector2(m_fX - vec.m_fX, m_fY - vec.m_fY);
-}
-Vector2 Vector2::multiply(float f) const
-{
- return Vector2(m_fX * f, m_fY * f);
-}
-Vector2 Vector2::divide(float f) const
-{
- return Vector2(m_fX / f, m_fY / f);
-}
-
-/// ***** Public Methods *****
-
-Vector2 operator+(const Vector2& vec1, const Vector2& vec2)
-{
- return vec1.add(vec2);
-}
-Vector2 operator-(const Vector2& vec1, const Vector2& vec2)
-{
- return vec1.subtract(vec2);
-}
-Vector2 operator*(float f, const Vector2& vec)
-{
- return vec.multiply(f);
-}
-Vector2 operator*(const Vector2& vec, float f)
-{
- return vec.multiply(f);
-}
-Vector2 operator/(const Vector2& vec, float f)
-{
- return vec.divide(f);
-}
-
-
-void operator+=(Vector2& vec1, const Vector2& vec2)
-{
- vec1.m_fX += vec2.m_fX;
- vec1.m_fY += vec2.m_fY;
-}
-void operator-=(Vector2& vec1, const Vector2& vec2)
-{
- vec1.m_fX -= vec2.m_fX;
- vec1.m_fY -= vec2.m_fY;
-}
-void operator*=(Vector2& vec, float f)
-{
- vec.m_fX *= f;
- vec.m_fY *= f;
-}
-void operator/=(Vector2& vec, float f)
-{
- vec.m_fX /= f;
- vec.m_fY /= f;
-}
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef VECTOR2_H
-#define VECTOR2_H
-
-#include <string>
-
-using std::string;
-
-/// ***** Header Class *****
-class Vector2
-{
- public:
- float m_fX;
- float m_fY;
-
- Vector2();
- Vector2(float, float);
-
- void zero();
- void unit();
-
- float angle() const;
- float length() const;
- float sqrLength() const;
-
- float dot(const Vector2&) const;
-
- Vector2 add(const Vector2&) const;
- Vector2 subtract(const Vector2&) const;
- Vector2 divide(float) const;
- Vector2 multiply(float) const;
-
- string toString() const;
- void print() const;
-};
-
-/// ***** Header Methods *****
-
-// definitions of the operators are external because (float, Vector2) would
-// fail inside the class
-
-Vector2 operator+(const Vector2&, const Vector2&);
-Vector2 operator-(const Vector2&, const Vector2&);
-Vector2 operator*(float, const Vector2&);
-Vector2 operator*(const Vector2&, float);
-Vector2 operator/(const Vector2&, float);
-
-void operator+=(Vector2&, const Vector2&);
-void operator-=(Vector2&, const Vector2&);
-void operator*=(Vector2&, float);
-void operator/=(Vector2&, float);
-
-#endif // VECTOR2_H
*/
#include "collisionManager.h"
-#include "debug.h"
-#include "Vector2.h"
+#include <pg/debug.h>
+#include <pg/Vector2.h>
+#include <pg/mathw.h>
#include "Entities/Ball.h"
#include "Entities/Polygon.h"
#include "CollisionInfo.h"
-#include "mathw.h"
-
/// ***** Private Method Headers *****
static void clearEntities();
*/
#include "config.h"
-#include "debug.h"
+
+#include <pg/debug.h>
#include <SDL/SDL.h>
#include "keys.h"
*/
#include "keys.h"
-#include "debug.h"
+
+#include <pg/debug.h>
#include <SDL/SDL.h>
#ifndef KEYS_H
#define KEYS_H
+#include <pg/debug.h>
+
#include <SDL/SDL.h>
#include <map>
#include <string>
-#include "debug.h"
-
/// ***** Header Methods *****
namespace key
{
*/
#include "reader.h"
-#include "debug.h"
+
+#include <pg/debug.h>
#include <iostream>
using std::cerr;
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "debug.h"
-
-#include <iostream>
-using std::cerr;
-using std::cout;
-using std::endl;
-
-#include <assert.h>
-
-#include "locks/Mutex.h"
-#include "locks/Autolock.h"
-
-/// ***** Public Methods *****
-
-Mutex muDPF;
-
-void DPF(int level, const char* pstr)
-{
- Autolock lock(muDPF);
-
- cout << pstr << endl;
-}
-
-void debug::init()
-{
- muDPF.init();
-}
-
-void debug::clean()
-{
- muDPF.clean();
-}
-
-void DASSERT(bool fBreak)
-{
- assert(fBreak);
-}
-
-/// ***** Private Methods *****
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef DEBUG_H
-#define DEBUG_H
-
-#include <iostream>
-using std::cout;
-using std::cerr;
-using std::endl;
-
-void DPF(int level, const char* pstr);
-
-namespace debug
-{
- void init();
- void clean();
-}
-
-void DASSERT(bool fBreak);
-
-// comment out when not debugging
-#define DEBUGGING
-
-
-#endif // DEBUG_H
NEWSRCS += game.cpp
NEWSRCS += main.cpp
-NEWSRCS += mathw.cpp
NEWSRCS += ticks.cpp
-NEWSRCS += Vector2.cpp
NEWSRCS += handleSignal.cpp
NEWSRCS += entityCreator.cpp
NEWSRCS += collisionManager.cpp
NEWSRCS += CollisionInfo.cpp
-NEWSRCS += debug.cpp
-
NEWDIRS := # insure blank
NEWDIRS += config/
NEWDIRS += input/
NEWDIRS += graphics/
-NEWDIRS += locks/
# Post dir setup
#include "effectManager.h"
+#include <pg/Vector2.h>
+
#include <set>
#include "Effects/Effect.h"
#include "Effects/GravityWell.h"
#include "Effects/Screen.h"
-#include "Vector2.h"
#include "input/inputManager.h"
#include "config/config.h"
#ifndef EFFECTMANAGER_H
#define EFFECTMANAGER_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
+
#include "Entities/PhysicsEntity.h"
/// ***** Header Methods *****
#ifndef ENTITYCREATOR_H
#define ENTITYCREATOR_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
/// ***** Header Methods *****
namespace creator
*/
#include "entityManager.h"
-#include "debug.h"
+
+#include <pg/debug.h>
+#include <pg/Mutex.h>
+#include <pg/Autolock.h>
#include <set>
#include <SDL/SDL.h>
-#include "locks/Mutex.h"
-#include "locks/Autolock.h"
-
#include "Entities/Entity.h"
#include "Entities/Particle.h"
#include "Entities/PhysicsEntity.h"
*/
#include "game.h"
-#include "debug.h"
+
+#include <pg/debug.h>
#include <vector>
using std::vector;
*/
#include "graphics.h"
-#include "debug.h"
+
+#include <pg/debug.h>
+#include <pg/mathw.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL/SDL.h>
#include <cmath>
-#include "mathw.h"
-
#include <iostream>
using std::cerr;
using std::cout;
#ifndef GRAPHICS_H
#define GRAPHICS_H
-#include "Vector2.h"
+#include <pg/Vector2.h>
+
#include <vector>
*/
#include "inputManager.h"
-#include "debug.h"
+
+#include <pg/debug.h>
#include <SDL/SDL.h>
#ifndef INPUT_H
#define INPUT_H
+#include <pg/Vector2.h>
+
#include <SDL/SDL.h>
-#include "Vector2.h"
/// ***** Header Methods *****
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Autolock.h"
-
-#include "Mutex.h"
-
-/// ***** Constructors/Destructors *****
-Autolock::Autolock(Mutex& mu)
- : m_mu(mu)
-{
- Lock();
-}
-
-Autolock::~Autolock()
-{
- Unlock();
-}
-
-void Autolock::Lock()
-{
- m_mu.Lock();
-}
-
-void Autolock::Unlock()
-{
- m_mu.Unlock();
-}
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef AUTOLOCK_H
-#define AUTOLOCK_H
-
-class Mutex;
-
-/// ***** Header Class *****
-class Autolock
-{
-public:
- Autolock(Mutex& mu);
- ~Autolock();
-
- void Lock();
- void Unlock();
-
-// hide copying methods!
-private:
- Autolock(const Autolock&);
- const Autolock& operator ==(const Autolock&);
-
-private:
- Mutex& m_mu;
-};
-
-/// ***** Header Methods *****
-
-#endif // AUTOLOCK_H
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "Mutex.h"
-#include "debug.h"
-
-#include <SDL/SDL.h>
-
-Mutex::Mutex()
- : m_pSDL_mutex(NULL)
-{
-
-}
-Mutex::~Mutex()
-{
-
-}
-
-void Mutex::init()
-{
- m_pSDL_mutex = SDL_CreateMutex();
-}
-void Mutex::clean()
-{
- SDL_DestroyMutex(m_pSDL_mutex);
- m_pSDL_mutex = NULL;
-}
-
-bool Mutex::IsValid()
-{
- return NULL != m_pSDL_mutex;
-}
-
-void Mutex::Lock()
-{
- DASSERT(IsValid());
-
- SDL_mutexP(m_pSDL_mutex);
- m_uiThreadID = SDL_ThreadID();
-}
-void Mutex::Unlock()
-{
- DASSERT(IsValid());
-
- DASSERT(m_uiThreadID == SDL_ThreadID());
- SDL_mutexV(m_pSDL_mutex);
-}
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef MUTEX_H
-#define MUTEX_H
-
-/// ***** Header Class *****
-
-class SDL_mutex;
-
-class Mutex
-{
-public:
- Mutex();
- ~Mutex();
-
- void init();
- void clean();
-
- bool IsValid();
-
- void Lock();
- void Unlock();
-
-// hide copying methods!
-private:
- Mutex(const Mutex&);
- const Mutex& operator ==(const Mutex&);
-
-private:
- SDL_mutex* m_pSDL_mutex;
- unsigned int m_uiThreadID;
-};
-
-#endif // MUTEX_H
+++ /dev/null
-NEWSRCS := # insure blank
-
-NEWSRCS += Autolock.cpp
-NEWSRCS += Mutex.cpp
-
-
-# Post dir setup
-
-CURDIR := locks/
-
-NEWSRCS := $(addprefix ${CURDIR},${NEWSRCS})
-NEWOBJS := ${NEWSRCS:.cpp=.o}
-NEWDEPS := ${NEWSRCS:.cpp=.d}
-
-# Append to lists
-
-SRCS += ${NEWSRCS}
-OBJS += $(addprefix ${OBJSDIR},${NEWOBJS})
-DEPS += $(addprefix ${DEPSDIR},${NEWDEPS})
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <pg/debug.h>
+
#include <GL/gl.h>
#include <GL/glu.h>
#include <SDL/SDL.h>
-#include "debug.h"
#include "handleSignal.h"
#include "game.h"
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "mathw.h"
-
-
-/// ***** Public Methods *****
-
-int mod(int x, int y)
-{
- return x % y + (x < 0 ? y : 0);
-}
-
-// Vector2 Math
-
-Vector2 vectorToLine
-(
- const Vector2& vec,
- float x1,
- float y1,
- float x2,
- float y2
-)
-{
- float lineSize = (float) sqrt((x1 - x2) * (x1 - x2)
- + (y1 - y2) * (y1 - y2));
- if (lineSize == 0)
- return Vector2(x1 - vec.m_fX, y1 - vec.m_fY);
-
- float u = ((vec.m_fX - x1) * (x2 - x1)
- + (vec.m_fY - y1) * (y2 - y1)) / (lineSize * lineSize);
-
- if (u < 0)
- return Vector2(x1 - vec.m_fX, y1 - vec.m_fY);
- else if (u > 1)
- return Vector2(x2 - vec.m_fX, y2 - vec.m_fY);
- else
- {
- float ix = x1 + u * (x2 - x1);
- float iy = y1 + u * (y2 - y1);
- return Vector2(ix - vec.m_fX, iy - vec.m_fY);
- }
-}
-
-Vector2 perp(const Vector2& vec)
-{
- return Vector2(-vec.m_fY, vec.m_fX);
-}
-
-float dot(const Vector2& vec1, const Vector2& vec2)
-{
- return vec1.m_fX * vec2.m_fX + vec1.m_fY * vec2.m_fY;
-}
-
-//TODO float Vector2::projectionCoeff(const Vector2* vec) const;
-//TODO Vector2* Vector2::projection(const Vector2* vec) const;
-
+++ /dev/null
-/*
- * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef MATHW_H
-#define MATHW_H
-
-#include <math.h>
-#include "Vector2.h"
-
-
-/// ***** Public Variables *****
-
-static const float PI = 3.1415926535897;
-
-/// ***** Header Methods *****
-
-int mod(int, int);
-
-/// Vector2 Math
-
-Vector2 vectorToLine
-(
- const Vector2& vec,
- float x1,
- float y1,
- float x2,
- float y2
-);
-
-//Vector2 lineIntersection(Vector2&, Vector2&, Vector2&, Vector2&) const;
-
-//void Rotate(float rads);
-
-float dot(const Vector2&, const Vector2&);
-Vector2 perp(const Vector2&);
-
-//TODO float projectionCoeff(const Vector2&, const Vector2&) const;
-//TODO void projection(const Vector2&, const Vector2&);
-
-#endif // MATHW_H