Jump to content
  • Advertisement


  • Content Count

  • Joined

  • Last visited

Community Reputation

127 Neutral

About epicar

  • Rank
  1. Is it possible that you're using the wrong dll? I just checked the project I'm using it with, and the file is called CSharpZipLib.dll. I also checked the latest version available at http://www.icsharpcode.net/OpenSource/SharpZipLib/Download.aspx, and their files are called ICSharpCode.SharpZipLib.dll.
  2. epicar

    Policy based Particle System

    Is your game.hpp including all of the template classes necessary for instantiation? Make sure you're including a full definition for ParticleGroup, CompletePolicy and NullPolicy before declaring the particleGroup member.
  3. If you're running your mod in debug mode from visual studio, you should be able to get call stack when that exception is thrown. Valve's developer wiki explains how to set up debugging in visual studio here: http://developer.valvesoftware.com/wiki/Installing_and_Debugging_the_Source_Code I'd be more than happy to help, if you can post some more information.
  4. Here is a listing of an event system I've become rather fond of. EventSender.h #include "EventListener.h" template<typename EventType> class EventListener; template<typename EventType> class EventSender { public: typedef EventListener<EventType> ListenerType; private: typedef std::vector<ListenerType*> EventListenerVector; EventListenerVector mListeners; static EventSender<EventType>& GetInstance() { static EventSender<EventType> sender; return sender; } void AddListener( ListenerType* theListener ) { mListeners.push_back( theListener ); } void RemoveListener( const ListenerType* theListener ) { EventListenerVector::iterator l = std::remove( mListeners.begin(), mListeners.end(), theListener ); if ( l != mListeners.end() ) mListeners.erase( l ); } void SendEvent( const EventType& theEvent ) { EventListenerVector::iterator l; for ( l = mListeners.begin(); l != mListeners.end(); ++l ) (*l)->HandleEvent( theEvent ); } public: virtual ~EventSender() {} static void Add( ListenerType* theListener ) { GetInstance().AddListener( theListener ); } static void Remove( const ListenerType* theListener ) { GetInstance().RemoveListener( theListener ); } static void Send( const EventType& theEvent ) { GetInstance().SendEvent( theEvent ); } }; EventListener.h #include "EventSender.h" template<class EventType> class EventListener { public: EventListener() { EventSender<EventType>::Add( this ); } virtual ~EventListener() { EventSender<EventType>::Remove( this ); } virtual void HandleEvent( const EventType& theEvent ) = 0; }; Usage class ResetScoreEvent {}; class LevelChangedEvent { public: LevelChangedEvent( const std::string& filename ) : mFilename( filename ) {} std::string mFilename; }; class Scoreboard : public EventListener<LevelChangedEvent>, public EventListener<ResetScoreEvent> { void HandleEvent( const LevelChangedEvent& event ) { SetLevelName( event.mFilename ); } void HandleEvent( const ResetScoreEvent& event ) { SetScore( 0 ); } //... } void ChangeLevel( const std::string& filename ) { //... EventSender<ResetScoreEvent>::Send( ResetScoreEvent() ); EventSender<LevelChangedEvent>::Send( LevelChangedEvent( filename ) ); } Pros: Events are passed to listeners by reference with no need for dynamic_cast. Event listeners use RAII to handle their own registration. Doesn't require a base event class, or any centralized location for event definitions. Arguments are passed with the event itself. Cons: Singleton design of EventSender. Listeners must inherit from EventListener for each event.
  5. Can you describe how you have your stats set up now? The approach will involve adding a layer of abstraction on top of what you already have, so that's where we should start. In C#, you can use properties to provide this abstraction, for example: private int m_strength; private int m_strength_spell_bonus; private int m_strength_armor_bonus; public int Strength { get { return m_strength + m_strength_spell_bonus + m_strength_armor_bonus; } }
  6. epicar

    Can't have extern static bool?

    When applied to global variables, the static modifier behaves as it does in C, in that its scope is limited to the file in which it's declared. That's why it doesn't appear to exist in your other files. Simply declaring it as 'bool localMode = false;' in Utils.cpp should work fine.
  7. epicar

    More Rubberband problems..

    You're calling glutSwapBuffers() in 2 different places, so your rectangle is never drawn in the same frame as display(). Try putting your call to drawRectangle() inside of display(), and remove the extra call to glutSwapBuffers() at the end of drawRectangle(). You'll also probably want to add an if statement to make sure drawRectangle() isn't called if the mouse button isn't down.
  8. epicar

    XNA Tutorial 2D?

    http://creators.xna.com/en-US/education/gettingstarted This links to their 2d and 3d tutorials, which are both quite comprehensive.
  9. epicar

    DirectX bone animation software

    You may try blender, which is free and open source. Their features page indicates support for rigging and animation, and lists 'DirectX' under 3d file formats.
  10. #ifdef _WIN32 struct ptw32_handle_t; typedef ptw32_handle_t pthread_t; #else struct pthread_t; #endif
  11. A great resource for TDD and its application to game development: Stepping Through the Looking Glass: Test-Driven Game Development (Part 1) (Part 2) (Part 3)
  12. Vsync would be the logical solution, but I've also found this Gaffer on Games article to be enlightening: http://gafferongames.com/game-physics/fix-your-timestep/
  13. epicar

    [C++ & OpenGL] Cubes messed up

    Maybe try glDepthFunc( GL_LESS )? That's what is set by default.
  14. Instead of disabling the depth test, you could clear the depth buffer before drawing view models.
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!