diff --git a/addon/ColorBehavior.cpp b/addon/ColorBehavior.cpp index 9071181a..864be51a 100644 --- a/addon/ColorBehavior.cpp +++ b/addon/ColorBehavior.cpp @@ -1,10 +1,11 @@ +//#ident "$Id: ColorBehavior.cpp,v 1.4 2003/07/16 20:02:02 rzr Exp $" /*************************************************************************** ColorBehavior.cpp - description ------------------- begin : Tue Feb 15 2000 copyright : (C) 2000 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ #include "Private.h" #include "ColorBehavior.h" @@ -18,19 +19,18 @@ ColorBehavior::~ColorBehavior() { } void ColorBehavior::onCollision(const Vertex3D &, const Vertex3D &, Group *) { - EmAssert(this->getParent() != NULL, "ColorBehavior::onCollision parent NULL"); - EM_COUT("ColorBehavior::onCollision()" << endl, 0); - if (this->getParent() != NULL) { - for (int a=0; agetParent()->getShape3DSize(); a++) { - this->getParent()->getShape3D(a)->setColor(1.0, 1.0, 0.0, 0.0); - } - } + EmAssert(this->getParent() != NULL, "ColorBehavior::onCollision parent NULL"); + EM_COUT("ColorBehavior::onCollision()" << endl, 0); + if (this->getParent() != NULL) { + for (int a=0; agetParent()->getShape3DSize(); a++) { + this->getParent()->getShape3D(a)->setColor(1.f, 1.f, 0.f, 0.f); + } + } } void ColorBehavior::onTick() { - EmAssert(this->getParent() != NULL, "ColorBehavior::onTick parent NULL"); - for (int a=0; agetParent()->getShape3DSize(); a++) { - this->getParent()->getShape3D(a)->setColor(1.0, 0.0, 0.0, 1.0); - } + EmAssert(this->getParent() != NULL, "ColorBehavior::onTick parent NULL"); + for (int a=0; agetParent()->getShape3DSize(); a++) { + this->getParent()->getShape3D(a)->setColor(1.f, 0.f, 0.f, 1.f); + } } - diff --git a/base/Config.cpp b/base/Config.cpp index 228efbee..e3d20d26 100644 --- a/base/Config.cpp +++ b/base/Config.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Config.cpp,v 1.29 2003/06/13 13:39:44 rzr Exp $" +//#ident "$Id: Config.cpp,v 1.30 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Config.cpp - description ------------------- @@ -26,6 +26,7 @@ #endif #ifdef WIN32 +//#include //#include #include // mkdir @ msvc+mingw32 //#define mkdir(name, modes) mkdir(name) @@ -457,4 +458,4 @@ void Config::setPaths(char const * const argv0) { // EM_CERR("- Config::setPath"); // EM_CERR( m_sExeDir); EM_CERR( m_sDataDir); } //!-rzr -//EOF:$Id: Config.cpp,v 1.29 2003/06/13 13:39:44 rzr Exp $ +//EOF:$Id: Config.cpp,v 1.30 2003/07/16 20:02:04 rzr Exp $ diff --git a/base/Engine.cpp b/base/Engine.cpp index 3d1085c4..a98fadf1 100644 --- a/base/Engine.cpp +++ b/base/Engine.cpp @@ -82,7 +82,10 @@ Engine * Engine::p_Engine = NULL; Engine::Engine(int & argc, char *argv[]) { Config * config = Config::getInstance(); config->loadArgs(argc, argv); - +#ifdef RZR_PATHRELATIVE + Config::getInstance()->loadConfig(); +#endif + if (!config->useExternGL()) { #if EM_USE_SDL SDL_Init(SDL_INIT_TIMER); diff --git a/base/Group.cpp b/base/Group.cpp index bdcf3933..ba7689a9 100644 --- a/base/Group.cpp +++ b/base/Group.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Group.cpp,v 1.10 2003/06/13 13:39:45 rzr Exp $" +//#ident "$Id: Group.cpp,v 1.11 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Group.cpp - description ------------------- @@ -171,7 +171,7 @@ Shape3D * Group::getShape3D(int i) { return m_vShape3D[i]; } -int Group::getShape3DSize() { +int Group::getShape3DSize() const { return m_vShape3D.size(); } @@ -285,4 +285,4 @@ void Group::unsetPropertyRecursive(int p) { } } //TODO: Compute Bounds //!rzr -//EOF $Id: Group.cpp,v 1.10 2003/06/13 13:39:45 rzr Exp $ +//EOF $Id: Group.cpp,v 1.11 2003/07/16 20:02:04 rzr Exp $ diff --git a/base/Group.h b/base/Group.h index cfc9790f..aec8ed6f 100644 --- a/base/Group.h +++ b/base/Group.h @@ -1,10 +1,11 @@ +//#ident "$Id: Group.h,v 1.10 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Group.h - description ------------------- begin : Wed Jan 26 2000 copyright : (C) 2000 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ #ifndef GROUP_H #define GROUP_H @@ -68,7 +69,7 @@ class BillBoard; ** Animation -- lwGroup rwGroup -- Animation ** */ class Group : public Node { - public: +public: Group(); virtual ~Group(); void setName(const char * name); @@ -78,9 +79,9 @@ class Group : public Node { /** Removes the group from the tree. You must call 'delete group' after * this function if you wish to deallocate the group. */ void removeGroup(Group * g); - // void addBehavior(Behavior * b, bool signal=true); + // void addBehavior(Behavior * b, bool signal=true); void setBehavior(Behavior * b, bool signal = true); - // void removeBehavior(Behavior * b); + // void removeBehavior(Behavior * b); void addShape3D(Shape3D * s); /** Removes the shape from the tree. You must call 'delete shape' after * this function if you wish to deallocate the shape. */ @@ -90,9 +91,9 @@ class Group : public Node { void setLight(Light * l); void setCollisionBounds(CollisionBounds * cb); void setSound(Sound * s); - // int getBehaviorSize(); - int getShape3DSize(); - // Behavior * getBehavior(int i); + // int getBehaviorSize(); + int getShape3DSize() const; + // Behavior * getBehavior(int i); Behavior * getBehavior(); Group * getGroup(int i); Shape3D * getShape3D(int i); @@ -115,10 +116,10 @@ class Group : public Node { void unsetPropertyRecursive(int p); void unsetUserProperty(int p); - inline int getCollisionGroup() { return m_iCollisionGroup; }; - inline void setCollisionGroup(int c) { m_iCollisionGroup = c; }; + inline int getCollisionGroup() { return m_iCollisionGroup; }; + inline void setCollisionGroup(int c) { m_iCollisionGroup = c; }; - private: +private: friend class BehaviorVisitor; friend class AlignVisitor; friend class AllegroVisitor; @@ -144,16 +145,16 @@ class Group : public Node { Group* p_Parent; vector m_vChildren; vector m_vShape3D; - // vector m_vBehavior; + // vector m_vBehavior; Behavior * p_Behavior; - char m_Name[256]; + char m_Name[256]; //todo: replace with string int m_iProperties; int m_iUserProperties; - int m_iCollisionGroup; + int m_iCollisionGroup; - // void propagateSignal(int signal, Group* sender); + // void propagateSignal(int signal, Group* sender); void setParent(Group* g); }; diff --git a/base/Keyboard.cpp b/base/Keyboard.cpp index 46e643d1..794328c0 100644 --- a/base/Keyboard.cpp +++ b/base/Keyboard.cpp @@ -1,3 +1,4 @@ +//#ident "$Id: Keyboard.cpp,v 1.4 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Keyboard.cpp - description ------------------- diff --git a/base/Keyboard.h b/base/Keyboard.h index b202d849..6c6eaf44 100644 --- a/base/Keyboard.h +++ b/base/Keyboard.h @@ -1,10 +1,11 @@ +//#ident "$Id: Keyboard.h,v 1.9 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Keyboard.h - description ------------------- begin : Thu Feb 1 2001 copyright : (C) 2001 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ #ifndef KEYBOARD_H @@ -101,14 +102,14 @@ #define SDLK_RCTRL KEY_RCONTROL #define SDLK_COMPOSE KEY_ALTGR -#define SDLK_F1 KEY_F1 +#define SDLK_F1 KEY_F1 //!rzr+ bug fixed #define SDLK_F2 KEY_F2 #define SDLK_F3 KEY_F3 -#define SDLK_F3 KEY_F4 -#define SDLK_F1 KEY_F5 -#define SDLK_F2 KEY_F6 -#define SDLK_F3 KEY_F7 -#define SDLK_F3 KEY_F8 +#define SDLK_F4 KEY_F4 +#define SDLK_F5 KEY_F5 +#define SDLK_F6 KEY_F6 +#define SDLK_F7 KEY_F7 +#define SDLK_F8 KEY_F8 //!rzr- #endif // EM_USE_ALLEGRO @@ -119,7 +120,7 @@ /** @author Henrik Enqvist */ class Keyboard { - public: +public: Keyboard(); ~Keyboard(); static void clear(); @@ -127,7 +128,7 @@ class Keyboard { static bool isKeyDown(int piKey); static EMKey waitForKey(); #if EM_USE_SDL - private: +private: static bool m_abKey[KEY_MAX]; #endif }; diff --git a/base/Private.h b/base/Private.h index 09c87a10..09c02df5 100644 --- a/base/Private.h +++ b/base/Private.h @@ -1,4 +1,4 @@ -//#ident "$Id: Private.h,v 1.17 2003/06/11 13:25:49 rzr Exp $" +//#ident "$Id: Private.h,v 1.18 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Private.h - description ------------------- @@ -30,7 +30,7 @@ #define EM_USE_SDL 0 #endif -#ifndef EM_USE_ALLEGRO +#ifndef EM_USE_ALLEGRO //!rzr allegro may conflict when stdc++ headers #define EM_USE_ALLEGRO 0 #endif @@ -115,4 +115,4 @@ bool operator == (const PolygonEdge & peA, const PolygonEdge & peB) { #endif // PRIVATE_H -//EOF: $Id: Private.h,v 1.17 2003/06/11 13:25:49 rzr Exp $ +//EOF: $Id: Private.h,v 1.18 2003/07/16 20:02:04 rzr Exp $ diff --git a/base/Shape3D.h b/base/Shape3D.h index 6bbd93d7..31a1c6f1 100644 --- a/base/Shape3D.h +++ b/base/Shape3D.h @@ -1,11 +1,11 @@ -//#ident "$Id: Shape3D.h,v 1.14 2003/05/27 11:53:25 rzr Exp $" +//#ident "$Id: Shape3D.h,v 1.15 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Shape3D.h - description ------------------- begin : Wed Jan 26 2000 copyright : (C) 2000 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ #ifndef SHAPE3D_H #define SHAPE3D_H @@ -20,11 +20,13 @@ //#define EM_SHAPE3D_FLAT 16 //#define EM_SHAPE3D_DOUBLE 32 + #include #include #include "TextureUtil.h" #include "EMath.h" +using namespace std; class Group; class Polygon3D; @@ -35,23 +37,28 @@ class Polygon3D; * with the 'add(Polygon*)' method. The Shape3D is finished off by calling * countNormals(). * @see Polygon */ -class Shape3D { - public: +class Shape3D +{ +public: Shape3D(int v = 6, int p = 2); virtual ~Shape3D(); /** Creates a new vertex and returns the index. The index is used when * creating polygons. @see Polygon */ int add(float x, float y, float z); - int add(float x, float y, float z, float r, float g, float b, float a, float u, float v); + int add(float x, float y, float z, float r, float g, float b, float a=1, + float u=0, float v=0); int addAt(int index, float x, float y, float z, - float r, float g, float b, float a, float u, float v); + float r=1, float g=1, float b=1 , float a=1, + float u=0, float v=0); /** Adds a polygon. @see Polygon */ void add(Polygon3D*); /** Counts the polygon normals used for lightning. This must be called when * all vertices and polygons are added to the shape. */ void countNormals(); /** Sets the color of all polygons to rgba. */ - void setColor(float r, float g, float b, float a); + void setColor(float r, float g, float b, float a=1.); + void setColor(int index, float r, float g, float b, float a=1.); + Color * getColor(int index); /** Applies a a property to all polygons. See Polygon class for * properties. @see Polygon */ void setPolygonProperty(int property); @@ -82,11 +89,10 @@ class Shape3D { float getCollisionSize(); void setParent(Group*); Group * getParent() { return p_Parent; }; - Color * getColor(int index); - void setColor(int index, float r, float g, float b, float a); TexCoord * getTexCoord(int index); void setTexCoord(int index, float u, float v); - + +public: vector m_vPolygon; vector m_vVtxSrc; vector m_vVtxTrans; @@ -105,7 +111,8 @@ class Shape3D { int m_iProperties; /// used for importing 3ds files //!rzr string m_sMaterialName; + string m_sName; }; #endif // SHAPE3D_H -//EOF $Id: Shape3D.h,v 1.14 2003/05/27 11:53:25 rzr Exp $ +//EOF $Id: Shape3D.h,v 1.15 2003/07/16 20:02:04 rzr Exp $ diff --git a/base/TextureUtil.cpp b/base/TextureUtil.cpp index abbdc631..4ff8ed94 100644 --- a/base/TextureUtil.cpp +++ b/base/TextureUtil.cpp @@ -1,4 +1,4 @@ -//#Ident "$Id: TextureUtil.cpp,v 1.15 2003/06/18 10:43:45 henqvist Exp $" +//#Ident "$Id: TextureUtil.cpp,v 1.16 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** TextureUtil.cpp - description ------------------- @@ -333,7 +333,8 @@ int TextureUtil::genTexture( char const * const filename, EmTexture * const texture) { //cout<<"+ Texture::genTexture : "< -#endif #include // mkdir +#else +#include //@msvc +#endif //#include #define mkdir(dir,modes) mkdir(dir) // @direct.h // autoconf should do that #endif -#ifdef RZR_RANDOM_UNSUPPORTED +#ifdef RZR_RANDOM_UNSUPPORTED #define random rand // cstdlibs random is not definied @msvc + mingw32 #endif @@ -265,4 +267,4 @@ using namespace std; #endif #endif #endif //!-rzr ---------------------------------------------------------------- -//EOF: $Id: config-rzr.h,v 1.9 2003/06/13 13:39:46 rzr Exp $ +//EOF: $Id: config-rzr.h,v 1.10 2003/07/16 20:02:04 rzr Exp $ diff --git a/data/professor/ModuleProfessor.cpp b/data/professor/ModuleProfessor.cpp index 4f262701..cc683ecd 100644 --- a/data/professor/ModuleProfessor.cpp +++ b/data/professor/ModuleProfessor.cpp @@ -1,21 +1,22 @@ +//#ident "$Id: ModuleProfessor.cpp,v 1.8 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Score.cpp - description ------------------- begin : Fri Jan 26 2001 copyright : (C) 2001 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ #include "Private.h" +//#include "Keyboard.h" +#include "Config.h" #include "Behavior.h" #include "Group.h" #include "Pinball.h" #include "Loader.h" #include "StateMachine.h" #include "Table.h" -#include "Keyboard.h" #include "Score.h" -#include "Config.h" class ProfessorBehavior : public Behavior { public: @@ -33,44 +34,44 @@ class ProfessorBehavior : public Behavior { // launch ball string launch("launch"); if (table->active() == 0 && - table->getCurrentBall() < MAX_BALL) { + table->getCurrentBall() < MAX_BALL) { switch (table->getCurrentBall()) { case 0 : - if (table->isBallDead(0) ) { - SendSignal( loader->getSignal("game_start"), 0, this->getParent(), NULL ); - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(0, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(0) ) { + SendSignal( loader->getSignal("game_start"), 0, this->getParent(), NULL ); + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(0, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } case 1 : - if (table->isBallDead(1)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(1, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(1)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(1, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } case 2 : - if (table->isBallDead(2)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(2, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } - if (table->isBallDead(0)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(0, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } - if (table->isBallDead(1)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(1, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(2)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(2, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } + if (table->isBallDead(0)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(0, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } + if (table->isBallDead(1)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(1, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } default: - throw string("all balls busy"); + throw string("all balls busy"); } EM_COUT("Table::onTick() new ball", 1); } @@ -87,20 +88,20 @@ class ProfessorBehavior : public Behavior { OnSignal( PBL_SIG_RESET_ALL ) { this->clear(); } - // ball dead - ElseOnSignal( PBL_SIG_BALL_OFF ) { + // ball dead + ElseOnSignal( PBL_SIG_BALL_OFF ) { if (table->active() == 1) { - SendSignal( loader->getSignal("multiball_off"), 0, this->getParent(), NULL ); + SendSignal( loader->getSignal("multiball_off"), 0, this->getParent(), NULL ); } if (table->active() == 0) { - SendSignal( loader->getSignal("allballs_off"), 0, this->getParent(), NULL ); - if (table->getCurrentBall() < MAX_BALL) { - table->setCurrentBall(table->getCurrentBall()+1); - if (table->getCurrentBall() == MAX_BALL) { - SendSignal( PBL_SIG_GAME_OVER, 0, this->getParent(), NULL ); - EM_COUT("game over", 1); - } - } + SendSignal( loader->getSignal("allballs_off"), 0, this->getParent(), NULL ); + if (table->getCurrentBall() < MAX_BALL) { + table->setCurrentBall(table->getCurrentBall()+1); + if (table->getCurrentBall() == MAX_BALL) { + SendSignal( PBL_SIG_GAME_OVER, 0, this->getParent(), NULL ); + EM_COUT("game over", 1); + } + } } } ElseOnSignal(loader->getSignal("bump")) { diff --git a/data/tux/ModuleTux.cpp b/data/tux/ModuleTux.cpp index 8f5be359..a352580f 100644 --- a/data/tux/ModuleTux.cpp +++ b/data/tux/ModuleTux.cpp @@ -1,21 +1,24 @@ +//#ident "$Id: ModuleTux.cpp,v 1.18 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** ModuleTux.cpp - description ------------------- begin : Fri Jan 26 2001 copyright : (C) 2001 by Henrik Enqvist email : henqvist@excite.com - ***************************************************************************/ +***************************************************************************/ + #include "Private.h" +//#include "Keyboard.h" //!rzr : allegro : must be before +#include "Config.h" #include "Behavior.h" #include "Group.h" #include "Pinball.h" #include "Loader.h" #include "StateMachine.h" #include "Score.h" -#include "Keyboard.h" #include "Table.h" -#include "Config.h" + #define MISSION_TEXT_TIMEOUT 6000 #define INFO_TEXT_TIME 600 @@ -178,79 +181,79 @@ class TuxBehavior : public Behavior { // launch ball string launch("launch"); if (table->active() == 0 && - table->getCurrentBall() < MAX_BALL) { + table->getCurrentBall() < MAX_BALL) { switch (table->getCurrentBall()) { case 0 : - if (table->isBallDead(0) ) { - SendSignal( m_sigGameStart, 0, this->getParent(), NULL ); - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(0, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(0) ) { + SendSignal( m_sigGameStart, 0, this->getParent(), NULL ); + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(0, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } case 1 : - if (table->isBallDead(1)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(1, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(1)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(1, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } case 2 : - if (table->isBallDead(2)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(2, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } - if (table->isBallDead(0) ) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(0, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } - if (table->isBallDead(1)) { - SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); - table->activateBall(1, 19.5f, 0.0f, 30.0f); - //score->clearText(); - break; - } + if (table->isBallDead(2)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(2, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } + if (table->isBallDead(0) ) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(0, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } + if (table->isBallDead(1)) { + SendSignal( PBL_SIG_BALL_ON, 0, this->getParent(), NULL ); + table->activateBall(1, 19.5f, 0.0f, 30.0f); + //score->clearText(); + break; + } default: - throw string("TuxBehavior::onTick() all balls busy"); + throw string("TuxBehavior::onTick() all balls busy"); } EM_COUT("ModuleTux::onTick() new ball", 1); } EM_COUT("TuxBehavior::onTick done", 0); - + if (m_iMission == MISSION_RAMP_ARROWS) { ++m_iRampTick; if (m_iRampTick >= 2000) { - if (m_aArrow[3]) { - m_aArrow[3] = false; - SendSignal( m_sigArrowOff[4], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); - m_iRampTick = 0; - } else if (m_aArrow[2]) { - m_aArrow[2] = false; - SendSignal( m_sigArrowOff[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); - m_iRampTick = 0; - } + if (m_aArrow[3]) { + m_aArrow[3] = false; + SendSignal( m_sigArrowOff[4], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); + m_iRampTick = 0; + } else if (m_aArrow[2]) { + m_aArrow[2] = false; + SendSignal( m_sigArrowOff[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); + m_iRampTick = 0; + } } } if (m_iMission == MISSION_FOURTH_ARROWS) { ++m_iRampTick; if (m_iRampTick >= 2000) { - if (m_aArrow[6]) { - m_aArrow[6] = false; - SendSignal( m_sigArrowOff[7], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); - m_iRampTick = 0; - } else if (m_aArrow[5]) { - m_aArrow[5] = false; - SendSignal( m_sigArrowOff[6], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); - m_iRampTick = 0; - } + if (m_aArrow[6]) { + m_aArrow[6] = false; + SendSignal( m_sigArrowOff[7], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); + m_iRampTick = 0; + } else if (m_aArrow[5]) { + m_aArrow[5] = false; + SendSignal( m_sigArrowOff[6], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); + m_iRampTick = 0; + } } } @@ -263,22 +266,22 @@ class TuxBehavior : public Behavior { case MISSION_THIRD_BUMP: case MISSION_FOURTH_BUMP: case MISSION_FIFTH_BUMP: - score->setInfoText("hit bumpers", INFO_TEXT_TIME); break; + score->setInfoText("hit bumpers", INFO_TEXT_TIME); break; case MISSION_FIRST_CAVE: case MISSION_SECOND_CAVE: case MISSION_THIRD_CAVE: case MISSION_FOURTH_CAVE: case MISSION_FIFTH_CAVE: - score->setInfoText("shoot left cave to release tux", INFO_TEXT_TIME); break; + score->setInfoText("shoot left cave to release tux", INFO_TEXT_TIME); break; case MISSION_ARROWS: - score->setInfoText("follow blue arrows", INFO_TEXT_TIME); break; + score->setInfoText("follow blue arrows", INFO_TEXT_TIME); break; case MISSION_SIDETARGETS: - score->setInfoText("hit blue targets", INFO_TEXT_TIME); break; + score->setInfoText("hit blue targets", INFO_TEXT_TIME); break; case MISSION_RAMP_ARROWS: case MISSION_FOURTH_ARROWS: - score->setInfoText("follow blue arrows, hurry up", INFO_TEXT_TIME); break; + score->setInfoText("follow blue arrows, hurry up", INFO_TEXT_TIME); break; case MISSION_FIFTH_ALL: - score->setInfoText("hit all of them", INFO_TEXT_TIME); break; + score->setInfoText("hit all of them", INFO_TEXT_TIME); break; } } }; @@ -297,34 +300,34 @@ class TuxBehavior : public Behavior { // ball dead ElseOnSignal( PBL_SIG_BALL_OFF ) { if (table->active() == 1) { - // multiball is dead - SendSignal( m_sigMultiballOff, 0, this->getParent(), NULL ); - m_bMultiBallOn = false; + // multiball is dead + SendSignal( m_sigMultiballOff, 0, this->getParent(), NULL ); + m_bMultiBallOn = false; } if (table->active() == 0) { - // no active ball - SendSignal( m_sigAllBallsOff, 0, this->getParent(), NULL ); - if (m_bExtraBall) { - m_bExtraBall = false; - } else if (table->getCurrentBall() < MAX_BALL) { - table->setCurrentBall(table->getCurrentBall()+1); - if (table->getCurrentBall() == MAX_BALL) { - SendSignal( PBL_SIG_GAME_OVER, 0, this->getParent(), NULL ); - EM_COUT("game over", 1); - } - } + // no active ball + SendSignal( m_sigAllBallsOff, 0, this->getParent(), NULL ); + if (m_bExtraBall) { + m_bExtraBall = false; + } else if (table->getCurrentBall() < MAX_BALL) { + table->setCurrentBall(table->getCurrentBall()+1); + if (table->getCurrentBall() == MAX_BALL) { + SendSignal( PBL_SIG_GAME_OVER, 0, this->getParent(), NULL ); + EM_COUT("game over", 1); + } + } } } // multiball ElseOnSignal( m_sigHead ) { score->setInfoText("shoot head to lock ball", INFO_TEXT_TIME); - } + } ElseOnSignal( m_sigLock[0] ) { score->setInfoText("first ball locked", INFO_TEXT_TIME); - } + } ElseOnSignal( m_sigLock[1] ) { score->setInfoText("second ball locked", INFO_TEXT_TIME); - } + } ElseOnSignal( m_sigReleaseLock ) { score->setInfoText("multiball", INFO_TEXT_TIME); table->unLockBall(0); @@ -338,208 +341,208 @@ class TuxBehavior : public Behavior { score->addScore(350 * m_iMultiplier); // missions if (m_iMission == MISSION_FIRST_BUMP) { - ++m_iBumpCounter; - if (m_iBumpCounter == 10) { - m_iBumpCounter = 0; - m_iMission = MISSION_ARROWS; - SendSignal( m_sigArrowBlink[0], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[1], 0, this->getParent(), NULL ); - //cerr << "side arrows blink" << endl; - m_iMissionTick = MISSION_TEXT_TIMEOUT; - } + ++m_iBumpCounter; + if (m_iBumpCounter == 10) { + m_iBumpCounter = 0; + m_iMission = MISSION_ARROWS; + SendSignal( m_sigArrowBlink[0], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[1], 0, this->getParent(), NULL ); + //cerr << "side arrows blink" << endl; + m_iMissionTick = MISSION_TEXT_TIMEOUT; + } } if (m_iMission == MISSION_SECOND_BUMP) { - ++m_iBumpCounter; - if (m_iBumpCounter == 10) { - m_iBumpCounter = 0; - m_iMission = MISSION_SIDETARGETS; - SendSignal( m_sigSideTargetBlink[0], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[1], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[2], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[3], 0, this->getParent(), NULL ); - //cerr << "side targets blink" << endl; - m_iMissionTick = MISSION_TEXT_TIMEOUT; - } + ++m_iBumpCounter; + if (m_iBumpCounter == 10) { + m_iBumpCounter = 0; + m_iMission = MISSION_SIDETARGETS; + SendSignal( m_sigSideTargetBlink[0], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[1], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[2], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[3], 0, this->getParent(), NULL ); + //cerr << "side targets blink" << endl; + m_iMissionTick = MISSION_TEXT_TIMEOUT; + } } if (m_iMission == MISSION_THIRD_BUMP) { - ++m_iBumpCounter; - if (m_iBumpCounter == 10) { - m_iBumpCounter = 0; - m_iMission = MISSION_RAMP_ARROWS; - SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); - //cerr << "side ramp arrows blink" << endl; - m_iMissionTick = MISSION_TEXT_TIMEOUT; - } + ++m_iBumpCounter; + if (m_iBumpCounter == 10) { + m_iBumpCounter = 0; + m_iMission = MISSION_RAMP_ARROWS; + SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); + //cerr << "side ramp arrows blink" << endl; + m_iMissionTick = MISSION_TEXT_TIMEOUT; + } } if (m_iMission == MISSION_FOURTH_BUMP) { - ++m_iBumpCounter; - if (m_iBumpCounter == 10) { - m_iBumpCounter = 0; - m_iMission = MISSION_FOURTH_ARROWS; - SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); - //cerr << "right ramp arrows blink" << endl; - m_iMissionTick = MISSION_TEXT_TIMEOUT; - } + ++m_iBumpCounter; + if (m_iBumpCounter == 10) { + m_iBumpCounter = 0; + m_iMission = MISSION_FOURTH_ARROWS; + SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); + //cerr << "right ramp arrows blink" << endl; + m_iMissionTick = MISSION_TEXT_TIMEOUT; + } } if (m_iMission == MISSION_FIFTH_BUMP) { - ++m_iBumpCounter; - if (m_iBumpCounter == 10) { - m_iBumpCounter = 0; - m_iMission = MISSION_FIFTH_ALL; - SendSignal( m_sigSideTargetBlink[0], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[1], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[2], 0, this->getParent(), NULL ); - SendSignal( m_sigSideTargetBlink[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[0], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[1], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[4], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowBlink[7], 0, this->getParent(), NULL ); - //cerr << "right ramp arrows blink" << endl; - m_iMissionTick = MISSION_TEXT_TIMEOUT; - } + ++m_iBumpCounter; + if (m_iBumpCounter == 10) { + m_iBumpCounter = 0; + m_iMission = MISSION_FIFTH_ALL; + SendSignal( m_sigSideTargetBlink[0], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[1], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[2], 0, this->getParent(), NULL ); + SendSignal( m_sigSideTargetBlink[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[0], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[1], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[2], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[4], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[5], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowBlink[7], 0, this->getParent(), NULL ); + //cerr << "right ramp arrows blink" << endl; + m_iMissionTick = MISSION_TEXT_TIMEOUT; + } } } // cave ElseOnSignal(m_sigCave) { if (m_iMission == MISSION_FIRST_CAVE) { - SendSignal( m_sigBigTuxOn[0], 0, this->getParent(), NULL ); - score->setInfoText("first tux saved", INFO_TEXT_TIME); - score->addScore(40000); - m_iMission = MISSION_SECOND_BUMP; - m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; + SendSignal( m_sigBigTuxOn[0], 0, this->getParent(), NULL ); + score->setInfoText("first tux saved", INFO_TEXT_TIME); + score->addScore(40000); + m_iMission = MISSION_SECOND_BUMP; + m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; } if (m_iMission == MISSION_SECOND_CAVE) { - SendSignal( m_sigBigTuxOn[1], 0, this->getParent(), NULL ); - score->setInfoText("second tux saved", INFO_TEXT_TIME); - score->addScore(50000); - m_iMission = MISSION_THIRD_BUMP; - m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; + SendSignal( m_sigBigTuxOn[1], 0, this->getParent(), NULL ); + score->setInfoText("second tux saved", INFO_TEXT_TIME); + score->addScore(50000); + m_iMission = MISSION_THIRD_BUMP; + m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; } if (m_iMission == MISSION_THIRD_CAVE) { - SendSignal( m_sigBigTuxOn[2], 0, this->getParent(), NULL ); - score->setInfoText("third tux saved", INFO_TEXT_TIME); - score->addScore(60000); - m_iMission = MISSION_FOURTH_BUMP; - m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; + SendSignal( m_sigBigTuxOn[2], 0, this->getParent(), NULL ); + score->setInfoText("third tux saved", INFO_TEXT_TIME); + score->addScore(60000); + m_iMission = MISSION_FOURTH_BUMP; + m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; } if (m_iMission == MISSION_FOURTH_CAVE) { - SendSignal( m_sigBigTuxOn[3], 0, this->getParent(), NULL ); - score->setInfoText("fourth tux saved", INFO_TEXT_TIME); - score->addScore(70000); - m_iMission = MISSION_FIFTH_BUMP; - m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; + SendSignal( m_sigBigTuxOn[3], 0, this->getParent(), NULL ); + score->setInfoText("fourth tux saved", INFO_TEXT_TIME); + score->addScore(70000); + m_iMission = MISSION_FIFTH_BUMP; + m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; } if (m_iMission == MISSION_FIFTH_CAVE) { - SendSignal( m_sigMissionAll, 0, this->getParent(), NULL ); - SendSignal( m_sigStopBalls, 0, this->getParent(), NULL ); - SendSignal( m_sigResumeBalls, 1000, this->getParent(), NULL ); - score->setInfoText("all tuxes saved", INFO_TEXT_TIME); - score->addScore(500000); - m_iMission = MISSION_ALL; - m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; + SendSignal( m_sigMissionAll, 0, this->getParent(), NULL ); + SendSignal( m_sigStopBalls, 0, this->getParent(), NULL ); + SendSignal( m_sigResumeBalls, 1000, this->getParent(), NULL ); + score->setInfoText("all tuxes saved", INFO_TEXT_TIME); + score->addScore(500000); + m_iMission = MISSION_ALL; + m_iMissionTick = MISSION_TEXT_TIMEOUT - INFO_TEXT_TIME; } score->addScore(1750); } // LINUX ElseOnSignal(m_sigLinux[0]) { if (!m_aLinux[0]) { - SendSignal(m_sigLinuxOn[0], 0, this->getParent(), NULL); - m_aLinux[0] = true; + SendSignal(m_sigLinuxOn[0], 0, this->getParent(), NULL); + m_aLinux[0] = true; } score->addScore(50); } ElseOnSignal(m_sigLinux[1]) { if (!m_aLinux[1]) { - SendSignal(m_sigLinuxOn[1], 0, this->getParent(), NULL); - m_aLinux[1] = true; + SendSignal(m_sigLinuxOn[1], 0, this->getParent(), NULL); + m_aLinux[1] = true; } score->addScore(50); } ElseOnSignal(m_sigLinux[2]) { if (!m_aLinux[2]) { - SendSignal(m_sigLinuxOn[2], 0, this->getParent(), NULL); - m_aLinux[2] = true; + SendSignal(m_sigLinuxOn[2], 0, this->getParent(), NULL); + m_aLinux[2] = true; } score->addScore(50); } ElseOnSignal(m_sigLinux[3]) { if (!m_aLinux[3]) { - SendSignal(m_sigLinuxOn[3], 0, this->getParent(), NULL); - m_aLinux[3] = true; + SendSignal(m_sigLinuxOn[3], 0, this->getParent(), NULL); + m_aLinux[3] = true; } score->addScore(50); } ElseOnSignal(m_sigLinux[4]) { if (!m_aLinux[4]) { - SendSignal(m_sigLinuxOn[4], 0, this->getParent(), NULL); - m_aLinux[4] = true; + SendSignal(m_sigLinuxOn[4], 0, this->getParent(), NULL); + m_aLinux[4] = true; } score->addScore(50); } // TUX ElseOnSignal(m_sigTux[0]) { if (!m_aTux[0]) { - SendSignal(m_sigTuxOn[0], 0, this->getParent(), NULL); - m_aTux[0] = true; + SendSignal(m_sigTuxOn[0], 0, this->getParent(), NULL); + m_aTux[0] = true; } score->addScore(500); } ElseOnSignal(m_sigTux[1]) { if (!m_aTux[1]) { - SendSignal(m_sigTuxOn[1], 0, this->getParent(), NULL); - m_aTux[1] = true; + SendSignal(m_sigTuxOn[1], 0, this->getParent(), NULL); + m_aTux[1] = true; } score->addScore(500); } ElseOnSignal(m_sigTux[2]) { if (!m_aTux[2]) { - SendSignal(m_sigTuxOn[2], 0, this->getParent(), NULL); - m_aTux[2] = true; + SendSignal(m_sigTuxOn[2], 0, this->getParent(), NULL); + m_aTux[2] = true; } score->addScore(500); } // BOOT ElseOnSignal( m_sigBoot[0] ) { if (m_aBoot[0]) { - SendSignal(m_sigBootOff[0], 0, this->getParent(), NULL); - m_aBoot[0] = false; + SendSignal(m_sigBootOff[0], 0, this->getParent(), NULL); + m_aBoot[0] = false; } else { - SendSignal(m_sigBootOn[0], 0, this->getParent(), NULL); - m_aBoot[0] = true; + SendSignal(m_sigBootOn[0], 0, this->getParent(), NULL); + m_aBoot[0] = true; } score->addScore(50); } ElseOnSignal( m_sigBoot[1] ) { if (m_aBoot[1]) { - SendSignal(m_sigBootOff[1], 0, this->getParent(), NULL); - m_aBoot[1] = false; + SendSignal(m_sigBootOff[1], 0, this->getParent(), NULL); + m_aBoot[1] = false; } else { - SendSignal(m_sigBootOn[1], 0, this->getParent(), NULL); - m_aBoot[1] = true; + SendSignal(m_sigBootOn[1], 0, this->getParent(), NULL); + m_aBoot[1] = true; } score->addScore(50); } ElseOnSignal( m_sigBoot[2] ) { if (m_aBoot[2]) { - SendSignal(m_sigBootOff[2], 0, this->getParent(), NULL); - m_aBoot[2] = false; + SendSignal(m_sigBootOff[2], 0, this->getParent(), NULL); + m_aBoot[2] = false; } else { - SendSignal(m_sigBootOn[2], 0, this->getParent(), NULL); - m_aBoot[2] = true; + SendSignal(m_sigBootOn[2], 0, this->getParent(), NULL); + m_aBoot[2] = true; } score->addScore(50); } ElseOnSignal( m_sigBoot[3] ) { if (m_aBoot[3]) { - SendSignal(m_sigBootOff[3], 0, this->getParent(), NULL); - m_aBoot[3] = false; + SendSignal(m_sigBootOff[3], 0, this->getParent(), NULL); + m_aBoot[3] = false; } else { - SendSignal(m_sigBootOn[3], 0, this->getParent(), NULL); - m_aBoot[3] = true; + SendSignal(m_sigBootOn[3], 0, this->getParent(), NULL); + m_aBoot[3] = true; } score->addScore(50); } @@ -547,168 +550,168 @@ class TuxBehavior : public Behavior { // BOOT bool tmp = m_aBoot[0]; for (int a=0; a<3; ++a) { - if (m_aBoot[a] != m_aBoot[a+1]) { - m_aBoot[a] = m_aBoot[a+1]; - if (m_aBoot[a]) SendSignal(m_sigBootOn[a], 0, this->getParent(), NULL); - else SendSignal(m_sigBootOff[a], 0, this->getParent(), NULL); - } + if (m_aBoot[a] != m_aBoot[a+1]) { + m_aBoot[a] = m_aBoot[a+1]; + if (m_aBoot[a]) SendSignal(m_sigBootOn[a], 0, this->getParent(), NULL); + else SendSignal(m_sigBootOff[a], 0, this->getParent(), NULL); + } } if (m_aBoot[3] != tmp) { - m_aBoot[3] = tmp; - if (m_aBoot[3]) SendSignal(m_sigBootOn[3], 0, this->getParent(), NULL); - else SendSignal(m_sigBootOff[3], 0, this->getParent(), NULL); + m_aBoot[3] = tmp; + if (m_aBoot[3]) SendSignal(m_sigBootOn[3], 0, this->getParent(), NULL); + else SendSignal(m_sigBootOff[3], 0, this->getParent(), NULL); } // LINUX tmp = m_aLinux[0]; for (int aa=0; aa<4; ++aa) { - if (m_aLinux[aa] != m_aLinux[aa+1]) { - m_aLinux[aa] = m_aLinux[aa+1]; - if (m_aLinux[aa]) SendSignal(m_sigLinuxOn[aa], 0, this->getParent(), NULL); - else SendSignal(m_sigLinuxOff[aa], 0, this->getParent(), NULL); - } + if (m_aLinux[aa] != m_aLinux[aa+1]) { + m_aLinux[aa] = m_aLinux[aa+1]; + if (m_aLinux[aa]) SendSignal(m_sigLinuxOn[aa], 0, this->getParent(), NULL); + else SendSignal(m_sigLinuxOff[aa], 0, this->getParent(), NULL); + } } if (m_aLinux[4] != tmp) { - m_aLinux[4] = tmp; - if (m_aLinux[4]) SendSignal(m_sigLinuxOn[4], 0, this->getParent(), NULL); - else SendSignal(m_sigLinuxOff[4], 0, this->getParent(), NULL); + m_aLinux[4] = tmp; + if (m_aLinux[4]) SendSignal(m_sigLinuxOn[4], 0, this->getParent(), NULL); + else SendSignal(m_sigLinuxOff[4], 0, this->getParent(), NULL); } } ElseOnSignal( PBL_SIG_RIGHTARM_ON ) { // BOOT bool tmp = m_aBoot[3]; { for (int a=3; a>0; --a) { - if (m_aBoot[a] != m_aBoot[a-1]) { - m_aBoot[a] = m_aBoot[a-1]; - if (m_aBoot[a]) SendSignal(m_sigBootOn[a], 0, this->getParent(), NULL); - else SendSignal(m_sigBootOff[a], 0, this->getParent(), NULL); - } + if (m_aBoot[a] != m_aBoot[a-1]) { + m_aBoot[a] = m_aBoot[a-1]; + if (m_aBoot[a]) SendSignal(m_sigBootOn[a], 0, this->getParent(), NULL); + else SendSignal(m_sigBootOff[a], 0, this->getParent(), NULL); + } } } if (m_aBoot[0] != tmp) { - m_aBoot[0] = tmp; - if (m_aBoot[0]) SendSignal(m_sigBootOn[0], 0, this->getParent(), NULL); - else SendSignal(m_sigBootOff[0], 0, this->getParent(), NULL); + m_aBoot[0] = tmp; + if (m_aBoot[0]) SendSignal(m_sigBootOn[0], 0, this->getParent(), NULL); + else SendSignal(m_sigBootOff[0], 0, this->getParent(), NULL); } // LINUX tmp = m_aLinux[4]; { for (int a=4; a>0; --a) { - if (m_aLinux[a] != m_aLinux[a-1]) { - m_aLinux[a] = m_aLinux[a-1]; - if (m_aLinux[a]) SendSignal(m_sigLinuxOn[a], 0, this->getParent(), NULL); - else SendSignal(m_sigLinuxOff[a], 0, this->getParent(), NULL); - } + if (m_aLinux[a] != m_aLinux[a-1]) { + m_aLinux[a] = m_aLinux[a-1]; + if (m_aLinux[a]) SendSignal(m_sigLinuxOn[a], 0, this->getParent(), NULL); + else SendSignal(m_sigLinuxOff[a], 0, this->getParent(), NULL); + } } } if (m_aLinux[0] != tmp) { - m_aLinux[0] = tmp; - if (m_aLinux[0]) SendSignal(m_sigLinuxOn[0], 0, this->getParent(), NULL); - else SendSignal(m_sigLinuxOff[0], 0, this->getParent(), NULL); + m_aLinux[0] = tmp; + if (m_aLinux[0]) SendSignal(m_sigLinuxOn[0], 0, this->getParent(), NULL); + else SendSignal(m_sigLinuxOff[0], 0, this->getParent(), NULL); } } ElseOnSignal(m_sigRightLoop) { if (m_bExtraBallWaiting) { - SendSignal( m_sigExtraBall, 0, this->getParent(), NULL ); - m_bExtraBall = true; - m_bExtraBallWaiting = false; + SendSignal( m_sigExtraBall, 0, this->getParent(), NULL ); + m_bExtraBall = true; + m_bExtraBallWaiting = false; } score->addScore(2500); if (m_iMission == MISSION_FOURTH_ARROWS) { - m_iRampTick = 0; - if (m_aArrow[6]) { - SendSignal( m_sigArrowOff[5], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOff[6], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOff[7], 0, this->getParent(), NULL ); - SendSignal( m_sigBigTuxBlink[3], 0, this->getParent(), NULL ); - m_iMission = MISSION_FOURTH_CAVE; - SendSignal( m_sigMissionCave, 0, this->getParent(), NULL ); - m_iMissionTick = MISSION_TEXT_TIMEOUT; - m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = false; - } else if (m_aArrow[5]) { - m_aArrow[6] = true; - SendSignal( m_sigArrowBlink[7], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[6], 0, this->getParent(), NULL ); - } else { - m_aArrow[5] = true; - SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[5], 0, this->getParent(), NULL ); - } + m_iRampTick = 0; + if (m_aArrow[6]) { + SendSignal( m_sigArrowOff[5], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOff[6], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOff[7], 0, this->getParent(), NULL ); + SendSignal( m_sigBigTuxBlink[3], 0, this->getParent(), NULL ); + m_iMission = MISSION_FOURTH_CAVE; + SendSignal( m_sigMissionCave, 0, this->getParent(), NULL ); + m_iMissionTick = MISSION_TEXT_TIMEOUT; + m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = false; + } else if (m_aArrow[5]) { + m_aArrow[6] = true; + SendSignal( m_sigArrowBlink[7], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[6], 0, this->getParent(), NULL ); + } else { + m_aArrow[5] = true; + SendSignal( m_sigArrowBlink[6], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[5], 0, this->getParent(), NULL ); + } } if (m_iMission == MISSION_FIFTH_ALL) { - SendSignal( m_sigArrowOn[5], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[6], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[7], 0, this->getParent(), NULL ); - m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = true; + SendSignal( m_sigArrowOn[5], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[6], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[7], 0, this->getParent(), NULL ); + m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = true; } } ElseOnSignal(m_sigLeftLoop) { if (m_bMultiBallOn) { - SendSignal( m_sigJackpot, 0, this->getParent(), NULL ); - score->addScore(100000); + SendSignal( m_sigJackpot, 0, this->getParent(), NULL ); + score->addScore(100000); } score->addScore(2500); if (m_iMission == MISSION_RAMP_ARROWS) { - m_iRampTick = 0; - if (m_aArrow[3]) { - SendSignal( m_sigArrowOff[2], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOff[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOff[4], 0, this->getParent(), NULL ); - SendSignal( m_sigBigTuxBlink[2], 0, this->getParent(), NULL ); - m_iMission = MISSION_THIRD_CAVE; - SendSignal( m_sigMissionCave, 0, this->getParent(), NULL ); - m_iMissionTick = MISSION_TEXT_TIMEOUT; - m_aArrow[2] = m_aArrow[3] = m_aArrow[4] = false; - } else if (m_aArrow[2]) { - m_aArrow[3] = true; - SendSignal( m_sigArrowBlink[4], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[3], 0, this->getParent(), NULL ); - } else { - m_aArrow[2] = true; - SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[2], 0, this->getParent(), NULL ); - } + m_iRampTick = 0; + if (m_aArrow[3]) { + SendSignal( m_sigArrowOff[2], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOff[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOff[4], 0, this->getParent(), NULL ); + SendSignal( m_sigBigTuxBlink[2], 0, this->getParent(), NULL ); + m_iMission = MISSION_THIRD_CAVE; + SendSignal( m_sigMissionCave, 0, this->getParent(), NULL ); + m_iMissionTick = MISSION_TEXT_TIMEOUT; + m_aArrow[2] = m_aArrow[3] = m_aArrow[4] = false; + } else if (m_aArrow[2]) { + m_aArrow[3] = true; + SendSignal( m_sigArrowBlink[4], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[3], 0, this->getParent(), NULL ); + } else { + m_aArrow[2] = true; + SendSignal( m_sigArrowBlink[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[2], 0, this->getParent(), NULL ); + } } if (m_iMission == MISSION_FIFTH_ALL) { - SendSignal( m_sigArrowOn[2], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[3], 0, this->getParent(), NULL ); - SendSignal( m_sigArrowOn[4], 0, this->getParent(), NULL ); - m_aArrow[2] = m_aArrow[3] = m_aArrow[4] = true; + SendSignal( m_sigArrowOn[2], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[3], 0, this->getParent(), NULL ); + SendSignal( m_sigArrowOn[4], 0, this->getParent(), NULL ); + m_aArrow[2] = m_aArrow[3] = m_aArrow[4] = true; } } // Side Targets ElseOnSignal(m_sigSideTarget[0]) { if (m_iMission == MISSION_SIDETARGETS || m_iMission == MISSION_FIFTH_ALL) { - m_aSideTarget[0] = true; + m_aSideTarget[0] = true; } score->addScore(350*m_iMultiplier); } ElseOnSignal(m_sigSideTarget[1]) { if (m_iMission == MISSION_SIDETARGETS || m_iMission == MISSION_FIFTH_ALL) { - m_aSideTarget[1] = true; + m_aSideTarget[1] = true; } score->addScore(350*m_iMultiplier); } ElseOnSignal(m_sigSideTarget[2]) { if (m_iMission == MISSION_SIDETARGETS || m_iMission == MISSION_FIFTH_ALL) { - m_aSideTarget[2] = true; + m_aSideTarget[2] = true; } score->addScore(350*m_iMultiplier); } ElseOnSignal(m_sigSideTarget[3]) { if (m_iMission == MISSION_SIDETARGETS || m_iMission == MISSION_FIFTH_ALL) { - m_aSideTarget[3] = true; + m_aSideTarget[3] = true; } score->addScore(350*m_iMultiplier); } // Arrows ElseOnSignal(m_sigArrow[0]) { if (m_iMission == MISSION_ARROWS || m_iMission == MISSION_FIFTH_ALL) { - SendSignal( m_sigArrowOn[0], 0, this->getParent(), NULL ); - m_aArrow[0] = true; + SendSignal( m_sigArrowOn[0], 0, this->getParent(), NULL ); + m_aArrow[0] = true; } score->addScore(750); } ElseOnSignal(m_sigArrow[1]) { if (m_iMission == MISSION_ARROWS || m_iMission == MISSION_FIFTH_ALL) { - SendSignal( m_sigArrowOn[1], 0, this->getParent(), NULL ); - m_aArrow[1] = true; + SendSignal( m_sigArrowOn[1], 0, this->getParent(), NULL ); + m_aArrow[1] = true; } score->addScore(750); } @@ -726,7 +729,7 @@ class TuxBehavior : public Behavior { // Side targets all if (m_aSideTarget[0] && m_aSideTarget[1] && m_aSideTarget[2] && m_aSideTarget[3] && - m_iMission == MISSION_SIDETARGETS) { + m_iMission == MISSION_SIDETARGETS) { SendSignal( m_sigSideTargetOff[0], 0, this->getParent(), NULL ); SendSignal( m_sigSideTargetOff[1], 0, this->getParent(), NULL ); SendSignal( m_sigSideTargetOff[2], 0, this->getParent(), NULL ); @@ -740,9 +743,9 @@ class TuxBehavior : public Behavior { // last mission all if (m_iMission == MISSION_FIFTH_ALL && - m_aSideTarget[0] && m_aSideTarget[1] && m_aSideTarget[2] && m_aSideTarget[3] && - m_aArrow[0] && m_aArrow[1] && m_aArrow[2] && m_aArrow[3] && - m_aArrow[4] && m_aArrow[5] && m_aArrow[6] && m_aArrow[7]) { + m_aSideTarget[0] && m_aSideTarget[1] && m_aSideTarget[2] && m_aSideTarget[3] && + m_aArrow[0] && m_aArrow[1] && m_aArrow[2] && m_aArrow[3] && + m_aArrow[4] && m_aArrow[5] && m_aArrow[6] && m_aArrow[7]) { SendSignal( m_sigSideTargetOff[0], 0, this->getParent(), NULL ); SendSignal( m_sigSideTargetOff[1], 0, this->getParent(), NULL ); SendSignal( m_sigSideTargetOff[2], 0, this->getParent(), NULL ); @@ -757,7 +760,7 @@ class TuxBehavior : public Behavior { SendSignal( m_sigArrowOff[7], 0, this->getParent(), NULL ); m_aSideTarget[0] = m_aSideTarget[1] = m_aSideTarget[2] = m_aSideTarget[3] = false; m_aArrow[0] = m_aArrow[1] = m_aArrow[2] = m_aArrow[3] = - m_aArrow[4] = m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = false; + m_aArrow[4] = m_aArrow[5] = m_aArrow[6] = m_aArrow[7] = false; m_iMission = MISSION_FIFTH_CAVE; SendSignal( m_sigMissionCave, 0, this->getParent(), NULL ); } @@ -776,21 +779,21 @@ class TuxBehavior : public Behavior { m_aLinux[0] = m_aLinux[1] = m_aLinux[2] = m_aLinux[3] = m_aLinux[4] = false; switch (m_iMultiplier) { case 1: - m_iMultiplier = 2; - SendSignal(m_sigMultiplier[1], 0, this->getParent(), NULL); - break; + m_iMultiplier = 2; + SendSignal(m_sigMultiplier[1], 0, this->getParent(), NULL); + break; case 2: - m_iMultiplier = 3; - SendSignal(m_sigMultiplier[2], 0, this->getParent(), NULL); - break; + m_iMultiplier = 3; + SendSignal(m_sigMultiplier[2], 0, this->getParent(), NULL); + break; case 3: - m_iMultiplier = 4; - SendSignal(m_sigMultiplier[3], 0, this->getParent(), NULL); - break; + m_iMultiplier = 4; + SendSignal(m_sigMultiplier[3], 0, this->getParent(), NULL); + break; case 4: - m_iMultiplier = 5; - SendSignal(m_sigMultiplier[4], 0, this->getParent(), NULL); - break; + m_iMultiplier = 5; + SendSignal(m_sigMultiplier[4], 0, this->getParent(), NULL); + break; } score->addScore(5000); } diff --git a/src/Loader.cpp b/src/Loader.cpp index 753f4579..55f7211a 100644 --- a/src/Loader.cpp +++ b/src/Loader.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Loader.cpp,v 1.33 2003/06/16 13:06:12 rzr Exp $" +//#ident "$Id: Loader.cpp,v 1.34 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Loader.cpp - description ------------------- @@ -7,16 +7,20 @@ email : henqvist@excite.com ***************************************************************************/ -#include -#include -#include #include #include #include #include -#include #include "Private.h" +#include "Config.h" + +#include +#include +#include +#include +using namespace std; + #include "Loader.h" #include "Pinball.h" #include "Keyboard.h" @@ -39,7 +43,6 @@ #include "SoundUtil.h" #include "Score.h" #include "StdAnimation.h" -#include "Config.h" #include "StateBehavior.h" #include "Script.h" #include "FakeModuleBehavior.h" @@ -328,7 +331,7 @@ void Loader::loadArmBehavior(ifstream & file, istringstream & ist, Group * group EmReadCmp(file, ist, str, "}"); } -void Loader::loadAnimation(ifstream & file, istringstream & ist, Engine *, +void Loader::loadAnimation(ifstream & file, istringstream & ist, Engine * e, Group * group, Behavior * beh) { EM_COUT("Loader::loadAnimation", 0); @@ -717,7 +720,7 @@ void Loader::loadModule(ifstream & file, istringstream & ist, Engine *, Group * ** Top level loading ****************************************************************/ -int Loader::cmpVersion(const FileVersion & version, const int major, const int minor, const int micro) { +int Loader::cmpVersion(const FileVersion & version, const int major, const int minor, const int micro) const { if (version.major > major) return 1; else if (version.minor < major) return -1; else { @@ -1032,8 +1035,9 @@ int Loader::loadFile(const char* fn, Engine * engine) { /// load all scene in one shape void Loader::loadShape3dsAscii(ifstream & file, istringstream & ist, - Engine *, Group * group, Behavior *) + Engine *, Group * group, Behavior * b) { + EM_COUT("Loader::loadShape3dsAscii", 1); string str; EmReadCmp(file, ist, str, "{"); this->readNextToken(file, ist, str); @@ -1045,19 +1049,20 @@ void Loader::loadShape3dsAscii(ifstream & file, istringstream & ist, shape = new Shape3D; t = Obj3dsUtil::read( *shape , filename.c_str()); if ( t < 0 || shape == 0 ) { delete shape; return;} - - if ( shape->m_sMaterialName != "" ) { - //EM_COUT( shape->m_sMaterialName , 1); - filename = string(Config::getInstance()->getDataSubDir()) - + "/" + shape->m_sMaterialName; + + filename = shape->m_sMaterialName; //debug("assign textures"); + if ( ( filename != "" ) //&& ( filename.find(".",0) ) // name.ext = file ? + ) { + filename = string(Config::getInstance()->getDataSubDir() )+ "/" +filename ; EmTexture * tex = TextureUtil::getInstance()->loadTexture(filename.c_str()); if (tex != NULL) { shape->setTexture(tex); - shape->setColor(1,1,1,0); + shape->setColor(1,1,1,0); //TODO: check if nedded //EM_COUT("loaded and asssigned :"<countNormals(); group->addShape3D(shape); @@ -1070,9 +1075,9 @@ void Loader::loadShape3dsAscii(ifstream & file, istringstream & ist, void Loader::loadGroup3dsAscii(ifstream & file, istringstream & ist, - Engine *, Group * group, Behavior *) - { - EM_COUT("Loader::loadShape3dsAscii", 0); + Engine *, Group * group, Behavior * b) +{ + EM_COUT("+ Loader::loadGroup3dsAscii", 1); string str; EmReadCmp(file, ist, str, "{"); this->readNextToken(file, ist, str); @@ -1081,7 +1086,7 @@ void Loader::loadGroup3dsAscii(ifstream & file, istringstream & ist, string filename = string(Config::getInstance()->getDataSubDir()) + "/" + str; //EM_COUT( filename , 1); int t = 0; - + int i=0; t = Obj3dsUtil::read( *arg , filename.c_str()); if ( t < 0 ) { delete arg; return;} EmReadCmp(file, ist, str, "}"); @@ -1090,7 +1095,7 @@ void Loader::loadGroup3dsAscii(ifstream & file, istringstream & ist, #if 1 group->add(arg); #else - for(int i=0;igetShape3DSize(); i++) { + for(i=0;igetShape3DSize(); i++) { shape = arg->getShape3D(i); shape->countNormals(); group->addShape3D( shape); @@ -1121,19 +1126,23 @@ void Loader::loadGroup3dsAscii(ifstream & file, istringstream & ist, //this->readNextToken(file, ist, str); #endif - //debug("assign textures"); - for(int i=0; i < arg->getShape3DSize() ; i++) { + for(i=0;igetShape3DSize(); i++) { shape = arg->getShape3D(i); - if ( shape->m_sMaterialName != "" ) { - EM_COUT( shape->m_sMaterialName , 1); - filename = string(Config::getInstance()->getDataSubDir()) - + "/" + shape->m_sMaterialName; - EmTexture * tex = - TextureUtil::getInstance()->loadTexture(filename.c_str()); - if (tex != NULL) { shape->setTexture(tex); shape->setColor(1,1,1,0); } - } - } + + filename = shape->m_sMaterialName; //debug("assign textures"); + if ( ( filename != "" ) //&& ( filename.find('.',0) ) + ) { + filename = string(Config::getInstance()->getDataSubDir()) + "/" +filename ; + EmTexture * tex = + TextureUtil::getInstance()->loadTexture(filename.c_str()); + if (tex != NULL) { + shape->setTexture(tex); + shape->setColor(1,1,1,0); //TODO: check if nedded + //EM_COUT("loaded and asssigned :"<getCollisionSize(); @@ -1157,7 +1166,7 @@ void Loader::loadGroup3dsAscii(ifstream & file, istringstream & ist, //debugf(". group collision slow\n"); group->setCollisionBounds(bounds); #endif - EM_COUT("-Loader::loadShape3dsAscii", 0); + EM_COUT("- Loader::loadGroup3dsAscii", 1); } #endif //-------------------------------------------------------------------- -//EOF $Id: Loader.cpp,v 1.33 2003/06/16 13:06:12 rzr Exp $ +//EOF $Id: Loader.cpp,v 1.34 2003/07/16 20:02:04 rzr Exp $ diff --git a/src/Loader.h b/src/Loader.h index 6d4fe77d..219df25e 100644 --- a/src/Loader.h +++ b/src/Loader.h @@ -1,4 +1,4 @@ -// #ident "$Id: Loader.h,v 1.14 2003/06/11 13:25:50 rzr Exp $" +// #ident "$Id: Loader.h,v 1.15 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Loader.h - description ------------------- @@ -95,7 +95,7 @@ class Loader { void loadMisc(ifstream & file, istringstream & ist, Engine * engine, Group * group, Behavior * beh); // return -1 if ver < m.m.m, 0 if var == m.m.m and 1 if ver > m.m.m - int cmpVersion(const FileVersion & ver, const int major, const int minor, const int micro); + int cmpVersion(const FileVersion & ver, const int major, const int minor, const int micro) const; static Loader * p_Loader; @@ -114,10 +114,10 @@ class Loader { #ifdef RZR_PATCHES_3DS // #define RZR_PATCHES_3DS in pinconfig.h /// load and add shape (3DS tri mesh , color or single texture, and collision void loadShape3dsAscii(ifstream & file, istringstream & ist, - Engine * engine, Group * group, Behavior * beh); + Engine * engine, Group * group, Behavior * beh=0); /// multi textures no collisions void loadGroup3dsAscii(ifstream & file, istringstream & ist, - Engine *, Group * group, Behavior *); + Engine *, Group * group, Behavior * beh=0); Obj3dsUtil* m_Obj3dsUtil; #endif @@ -126,4 +126,4 @@ class Loader { #endif // LOADER_H -//EOF $Id: Loader.h,v 1.14 2003/06/11 13:25:50 rzr Exp $ +//EOF $Id: Loader.h,v 1.15 2003/07/16 20:02:04 rzr Exp $ diff --git a/src/LoaderModule.cpp b/src/LoaderModule.cpp index 5d4681cb..149df09d 100644 --- a/src/LoaderModule.cpp +++ b/src/LoaderModule.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: LoaderModule.cpp,v 1.2 2003/04/09 12:19:07 rzr Exp $" +//#ident "$Id: LoaderModule.cpp,v 1.3 2003/07/16 20:02:04 rzr Exp $" #ifndef LoaderModule_cpp_ #define LoaderModule_cpp_ /** @@ -12,10 +12,9 @@ * (and keyboard bug that goes along on win32) **/ #include "Private.h" - +#include "Config.h" #include "Behavior.h" #include "LoaderModule.h" - #include #include #include @@ -114,4 +113,4 @@ Behavior* LoaderModule::read(string & filename) EM_COUT("- LoaderModule::read",0); } #endif // inclusion -//$Id: LoaderModule.cpp,v 1.2 2003/04/09 12:19:07 rzr Exp $ +//$Id: LoaderModule.cpp,v 1.3 2003/07/16 20:02:04 rzr Exp $ diff --git a/src/Obj3dsUtil.cpp b/src/Obj3dsUtil.cpp index 4623840f..a0985870 100755 --- a/src/Obj3dsUtil.cpp +++ b/src/Obj3dsUtil.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" +//#ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" /** * @author: www.Philippe.COVAL.online.fr - rev: $Author: rzr $ * 3ds loader wrapper @@ -37,7 +37,7 @@ extern "C" { | grep -v "#include \"" >| /tmp/inl-3ds.c */ //#include "/tmp/inl-3ds.c" //C-x i - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ /** * @author: www.Philippe.COVAL.online.fr - Rev: $Author: rzr $ * Copyright: GPL @ http://rzr.online.fr/licence.htm @@ -176,7 +176,7 @@ extern "C" { #endif #endif //_h_ - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ /** * @author: www.Philippe.COVAL.online.fr - Rev: $Author: rzr $ * Copyright: GPL @ http://rzr.online.fr/licence.htm @@ -249,7 +249,7 @@ extern "C" { #endif // inclusion - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ /** * @author: www.Philippe.COVAL.online.fr - Rev: $Author: rzr $ * Copyright: GPL @ http://rzr.online.fr/licence.htm @@ -285,7 +285,7 @@ extern "C" { int fgets_tag(FILE* f, char* buf, char** strarg); #endif - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ /** * @author: www.Philippe.COVAL.online.fr - Rev: $Author: rzr $ * Copyright: GPL @ http://rzr.online.fr/licence.htm @@ -738,7 +738,7 @@ extern "C" { } #endif // inclusion - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ #ifndef color3ds_h_ #define color3ds_h_ /** @@ -796,8 +796,8 @@ extern "C" { int getColorTable(char const * const src, unsigned int * dest); #endif //_h_ inclusion - //$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $ - /* #ident "$Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $" */ + //$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $ + /* #ident "$Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $" */ /** * @author: www.Philippe.COVAL.online.fr - Rev: $Author: rzr $ * Copyright: GPL @ http://rzr.online.fr/licence.htm @@ -1044,7 +1044,7 @@ extern "C" { #endif #endif //_h_ - //EOF $Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $ + //EOF $Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $ //----------------------------------------------------------------------------- #endif // 3dsview include/inline @@ -1070,6 +1070,7 @@ static int convert( Shape3D const & shape, Object& dest); int convert(Scene const & s , Shape3D & shape) { //debugf("+ convert Scene2Shape (%d)\n",s.no); + //shape.m_sName = string("scene"); int off=0; Polygon3D* poly = 0; float r=1,g=1,b=1,a=0; //a=1//TODO @@ -1110,10 +1111,12 @@ int convert(Scene const & s , Shape3D & shape) int convert( Object const & o , Shape3D & shape) { - debugf("+ convert structures (%d)\n",o.nv); + //debugf("+ convert structures (%d)\n",o.nv); Polygon3D* poly = 0; float r=1,g=1,b=1,a=0; unsigned int ui32=0; + + //shape.m_sName = string(o.name); for(unsigned int i=0;i::const_iterator i = shape.m_vVtxSrc.begin(); @@ -1196,8 +1200,8 @@ int convert(Shape3D const & shape, Object& dest) int convert( Group const & in , Scene & dest) { - //int l = in.m_vShape3D.size(); - //in.m_vShape3D + dest.no = in.getShape3DSize(); + exit(0); //TODO: return 0; } @@ -1213,7 +1217,7 @@ Obj3dsUtil* Obj3dsUtil::getInstance() int Obj3dsUtil::read( Shape3D& shape, char const * const filename ) { - //EM_COUT("+ Obj3dsUtil::read",1); + //debug("+ Obj3dsUtil::read (Shape3d&"); char name[BSIZE]; strcpy(name, filename); //Object o; initObject(&object); @@ -1224,7 +1228,7 @@ int Obj3dsUtil::read( Shape3D& shape, char const * const filename ) if ( t <= 0 ) return t; t = convert( scene, shape); freeScene( &scene); - //EM_COUT("- Obj3dsUtil::read",1); + //debug("- Obj3dsUtil::read"); return t; } @@ -1258,7 +1262,7 @@ int Obj3dsUtil::write( Shape3D const & shape, FILE* file) int Obj3dsUtil::read( Group& in, char const * const filename ) { - //EM_COUT("+ Obj3dsUtil::read",1); + //debug("+ Obj3dsUtil::read (Group&"); char name[BSIZE]; Shape3D* shape = 0; strcpy(name, filename); @@ -1279,8 +1283,8 @@ int Obj3dsUtil::read( Group& in, char const * const filename ) } freeScene( &s); - //EM_COUT("- Obj3dsUtil::read",1); - return 0; + //debug("- Obj3dsUtil::read"); + return s.no; } int Obj3dsUtil::write( Group & in, FILE* file) @@ -1306,4 +1310,4 @@ int Obj3dsUtil::write( Group & in, char const* const filename ) #endif // RZR_PATCHES_3DS #endif // inclusion -//EOF $Id: Obj3dsUtil.cpp,v 1.5 2003/06/16 13:06:13 rzr Exp $ +//EOF $Id: Obj3dsUtil.cpp,v 1.6 2003/07/16 20:02:04 rzr Exp $ diff --git a/src/Pinball.cpp b/src/Pinball.cpp index 9d89fcc4..ded6ddc5 100644 --- a/src/Pinball.cpp +++ b/src/Pinball.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Pinball.cpp,v 1.44 2003/06/18 10:43:44 henqvist Exp $" +//#ident "$Id: Pinball.cpp,v 1.45 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Pinball.cpp - description ------------------- @@ -7,11 +7,6 @@ email : henqvist@excite.com ***************************************************************************/ -#include -#include -//#include -#include -#include #include #include @@ -31,7 +26,15 @@ #include // not in msvc (replaced by io.h) #endif //!-rzr +#include "Config.h" #include "Pinball.h" + +#include +#include +//#include +#include +#include + #include "Keyboard.h" #include "Menu.h" #include "Engine.h" @@ -50,7 +53,6 @@ #include "CollisionBounds.h" #include "StateMachine.h" //#include "EyeBehavior.h" -#include "Config.h" #include "EmFont.h" #include "Loader.h" #include "BallGroup.h" @@ -250,7 +252,7 @@ class MyMenuApply : public MenuFct { default: w = 640; h = 480; } if (config->getWidth() != w) { -#ifdef EM_USE_SDL +#if EM_USE_SDL SDL_SetVideoMode(w, h, config->getBpp(), SDL_OPENGL | (config->useFullScreen() ? SDL_FULLSCREEN : 0)); @@ -439,7 +441,7 @@ void get_config(void) { menusize->setCurrent(4); } else if (Config::getInstance()->getWidth() == 1024) { menusize->setCurrent(5); - } else if (Config::getInstance()->getWidth() == 1280) { + } else if (Config::getInstance()->getWidth() == 1280) { menusize->setCurrent(6); } else { menusize->setCurrent(3); @@ -705,7 +707,9 @@ int main(int argc, char *argv[]) { //cerr<<"+ Pinball::main"<loadConfig(); +#endif Engine * engine = new Engine(argc, argv); float direct = 0.0f; @@ -736,13 +740,16 @@ int main(int argc, char *argv[]) { // Add a score board and a menu. MenuItem* menu = createMenus(engine); - // Draw to the screen. + cerr<<"Draw to the screen"<resetTick(); - while (! ( SDL_QuitRequested() //cout<<"catch close win"< -#include #include + + #include "Private.h" #include "Score.h" +#include "Config.h" + +#include + #include "Group.h" #include "Pinball.h" #include "Keyboard.h" //#include "SoundUtil.h" //#include "TextureUtil.h" #include "EmFont.h" -#include "Config.h" #include "Table.h" #include "Loader.h" #include "Engine.h" diff --git a/src/Table.cpp b/src/Table.cpp index 3cd81444..3cc0a11b 100644 --- a/src/Table.cpp +++ b/src/Table.cpp @@ -1,4 +1,4 @@ -//#ident "$Id: Table.cpp,v 1.17 2003/06/13 13:39:48 rzr Exp $" +//#ident "$Id: Table.cpp,v 1.18 2003/07/16 20:02:04 rzr Exp $" /*************************************************************************** Table.cpp - description ------------------- @@ -14,9 +14,9 @@ ***************************************************************************/ #include "Private.h" +#include "Config.h" #include "Table.h" #include "Engine.h" -#include "Config.h" #include "Loader.h" #include "BallGroup.h" #include "Pinball.h" @@ -336,4 +336,4 @@ bool Table::writeHighScoresFile() { return true; } -//EOF: $Id: Table.cpp,v 1.17 2003/06/13 13:39:48 rzr Exp $ +//EOF: $Id: Table.cpp,v 1.18 2003/07/16 20:02:04 rzr Exp $