Search found 61 matches

by bugmenot
Wed Jan 07, 2009 5:03 am
Forum: Game Development
Topic: Strike a blow for the indie scene!
Replies: 84
Views: 9790

Re: Strike a blow for the indie scene!

I have changed my mind: Nintendo, you cannot continue ignoring me. There is nobody like me. I have created the entire game, start to finish. I am far better than Miyamoto, Itoi, Kojima, Carmack, and Wright COMBINED. NONE of these "designers" could create the entire thing if their lives dep...
by bugmenot
Sun Dec 28, 2008 2:08 pm
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

That's what I figured you had meant, it shouldn't hurt to leave it both places, correct? Or should it only be in Image?
Should only be in Image.
by bugmenot
Sun Dec 28, 2008 10:41 am
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

Yeah, it does free it. However, since Image class allocates the memory for the SDL_Surface in the first place and takes ownership of the pointer to it, it should also be responsible to free it as well. tileSheet->Load( file_tilesheet, TILE_WIDTH, TILE_HEIGHT, TILE_SPRITES ); tileSheet is a member va...
by bugmenot
Sun Dec 28, 2008 2:05 am
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

You also have memory leaks: #ifndef IMAGE_H_INCLUDED #define IMAGE_H_INCLUDED #include <string> #include "SDL/SDL.h" class Image{ private: SDL_Surface *image; public: int Load( std::string filename ); SDL_Surface *GetSurface() { return image; } }; #endif // IMAGE_H_INCLUDED How does the SD...
by bugmenot
Sun Dec 28, 2008 2:04 am
Forum: Programming Discussion
Topic: A probably stupid SDL problem
Replies: 18
Views: 2139

Re: A probably stupid SDL problem

To stop this from happening in the future, get into the habit of putting your constants/literals on the left of equality tests:

Code: Select all

if( NULL == screen )
So when you make the mistake of:

Code: Select all

if( NULL = screen )
Your compiler will spit out an actual error.
by bugmenot
Sun Dec 28, 2008 1:58 am
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

From a very quick glance: Level *test; test->Load( mapname, tilesheet ); test->Draw(); Doesn't need to be a pointer: Level test; test.Load( mapname, tilesheet ); test.Draw(); In int Level::Load( std::string file_map, std::string file_tilesheet ): Always pass objects as references and const whenever ...
by bugmenot
Tue Dec 23, 2008 5:43 pm
Forum: Programming Discussion
Topic: Using Pointers and Vectors Together
Replies: 14
Views: 1373

Re: Using Pointers and Vectors Together

:) But good job in putting .size() in the initialization statement instead of as the stop condition, lots of new folks put it in the stop condition and then their for loop runs slower than necessary. Arguably by a very tiny amount especially for a loop that small and assuming the compiler doesn't o...
by bugmenot
Tue Dec 23, 2008 12:28 pm
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

GyroVorbis wrote:Didn't you say that this happened when you rewrote string code to use character arrays? That would fit the array out-of-bounds theory...
C++ strings FTW.
by bugmenot
Mon Dec 22, 2008 5:35 pm
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

dandymcgee wrote:I'm not sure what you mean by source control? Do you have an example?
SVN, git, CVS, Perforce.
dandymcgee wrote: Well as I've said I can't even figure out what file the error is starting in, and the whole project is somewhere around 700 lines.
That is small enough. Post the whole project.
by bugmenot
Mon Dec 22, 2008 12:47 pm
Forum: Programming Discussion
Topic: Project broken beyond repair
Replies: 20
Views: 2164

Re: Project broken beyond repair

Without code, it is a little difficult to help. My guess is that it is due to a memory stump. Going beyond the bounds of an array, deleting something off the stack, uninitialised variables, double deleting, etc. Are you building and running in Debug mode? Are you running the project with the debugge...
by bugmenot
Fri Dec 19, 2008 5:26 pm
Forum: Programming Discussion
Topic: Using Pointers and Vectors Together
Replies: 14
Views: 1373

Re: Using Pointers and Vectors Together

Level::~Level() { for( int i = mapData.size(); i >= 0; i-- ) { delete mapData[i]; } mapData.clear(); writeLog("Map Unloaded from memory\n"); } Should be: Level::~Level() { for( int i = mapData.size()-1; i >= 0; i-- ) { delete mapData[i]; } mapData.clear(); writeLog("Map Unloaded from...
by bugmenot
Mon Dec 15, 2008 5:35 am
Forum: Game Development
Topic: I need some advice
Replies: 9
Views: 1845

Re: I need some advice

SFML and Allegro are both higher level libraries then SDL which may be more suitable for a 2D game.
by bugmenot
Fri Dec 12, 2008 10:20 am
Forum: Programming Discussion
Topic: a little challange.
Replies: 52
Views: 4671

Re: a little challange.

I am not really a sports spectator person but I do find cricket extremely boring.

Back on your code, a co-worker pointed out interestingly that it can be extended to run as parallel processes which is a huge advantage as you have multiple sentinels/messages going through the network.
by bugmenot
Fri Dec 12, 2008 9:34 am
Forum: Programming Discussion
Topic: a little challange.
Replies: 52
Views: 4671

Re: a little challange.

http://en.wikipedia.org/wiki/Social-cir ... work_model

This looks similar to your model.

What warning level is your compiler set to?
by bugmenot
Fri Dec 12, 2008 6:11 am
Forum: Programming Discussion
Topic: a little challange.
Replies: 52
Views: 4671

Re: a little challange.

I had a proper look at the algorithm so let's see if I get this right in regards to the diagram I made above: 1) Initiate a message from A. A has a message 2) First iteration, go through all the nodes, if a node has a message, then iterate through all the nodes it is connected to and give them the m...