Jump to content

  • Log In with Google      Sign In   
  • Create Account


Smacker_626

Member Since 26 Aug 2002
Offline Last Active Mar 20 2012 02:24 PM
-----

Posts I've Made

In Topic: SDL Help

12 March 2012 - 08:41 PM

gameEvents::screen() is returning an SDL_Surface, are you sure you don't want to return a pointer to an SDL_Surface instead? If you do, that should solve your problem since the code you posted doesn't actually make use of the SDL_Surface.

Any code that actually works with an SDL_Surface will need "SDL.h" included to bring in the definition.

In Topic: Problem with script (no errors but no output?)

04 March 2012 - 01:51 AM

  • At the beginning of the file, include "cstdlib" so that you can access rand() and srand().
  • You have a name conflict in cDungeon. The constructor uses a local variable named aaMaze but there's a data member called aaMaze as well. Fix the name conflict.
Do these 2 things and your code works fine.

Hope that helps Posted Image.


You've lost me on number 2... can't see where you're referring to =/

EDIT: Ah i see - it works now Posted Image

Sorry I wasn't very clear, I've edited my post to be a bit clearer.

Glad to help.

In Topic: Problem with script (no errors but no output?)

03 March 2012 - 01:19 AM

  • At the beginning of the file, include "cstdlib" so that you can access rand() and srand().
  • You have a name conflict in class cDungeon. At line 52 in the constructor you define a variable named aaMaze even though at line 73 you define a data member with the same name. This wouldn't normally be a problem but in this case you try to use both in the constructor and so you're really only using the one you defined at line 52. Fix the name conflict.
Do these 2 things and your code works fine.

Hope that helps Posted Image.

In Topic: simple problem with assigning a value

14 December 2011 - 04:30 PM

Glad to see you fixed your problem.

Just an FYI, I've always read that float comparisons such as the ones you're using are very fragile at best, see C++ FAQ Lite.

In Topic: Works on 98 but not on XP?

11 June 2006 - 05:24 PM

This may not help but you could try calling "fflush(FILE *);" after every write to the file, i'm not sure if the buffer would be flushed when your program crashes.

Sorry I don't have anything else to offer.

PARTNERS