Search found 198 matches

by RandomDever
Tue Aug 17, 2010 6:23 pm
Forum: Art, Music, and Design
Topic: Good Sprite Application
Replies: 13
Views: 4026

Good Sprite Application

I'm on windows 7 and have been using paint .NET so far.
However recently I've needed to scale some sprites up by 200% and paint .NET makes my sprite all
blurry :( so i have to go in and re color everything. So I'm wondering if there is a better way.
by RandomDever
Sun Feb 21, 2010 10:38 pm
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 892

Re: TTF memory vacuum

dani93 wrote: Because you use the same pointer for several surfaces you will need to free each of them, not only the last!
:shock:




How?
by RandomDever
Sun Feb 21, 2010 3:38 pm
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 892

Re: TTF memory vacuum

dani93 wrote:You render surfaces but you don't free the memory.
http://jcatki.no-ip.org:8080/SDL_ttf/SD ... html#SEC43
Quote of the most important part:
The caller (you!) is responsible for freeing any returned surface.
So I'm supposed to free the surfaces before the program quits?
by RandomDever
Sun Feb 21, 2010 3:07 pm
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 892

Re: TTF memory vacuum

I had a problem like this once because every frame I was opening the font I was using and then not closing it. Can't say much else without seeing some code. void StateManager::DrawState() { if( state == MAIN_MENU ) { SDL_FillRect( screen, &screen->clip_rect, SDL_MapRGB( screen->format, 0, 0, 0 ...
by RandomDever
Sun Feb 21, 2010 9:35 am
Forum: Programming Discussion
Topic: TTF memory vacuum
Replies: 13
Views: 892

TTF memory vacuum

So my game has hit a stand still because when you run the program for like 5 seconds the memory goes to 100,000k of usage. it fluctuates alot but it's not a memory leak. A memory leak would only go up in a linear fashion right? Anyways I've heard that some people have this problem when rendering cha...
by RandomDever
Mon Feb 01, 2010 7:17 am
Forum: Game Development
Topic: TTF High Scores Dilema
Replies: 6
Views: 546

Re: TTF High Scores Dilema

EDIT: Well I tried it and it works now..... For some reason. :| :)
But how do I check whether a text file is empty or not?
And how do you add two strings together with a space added to separate them?
by RandomDever
Mon Feb 01, 2010 5:40 am
Forum: Game Development
Topic: TTF High Scores Dilema
Replies: 6
Views: 546

Re: TTF High Scores Dilema

Tried that already.
by RandomDever
Mon Feb 01, 2010 2:18 am
Forum: Game Development
Topic: TTF High Scores Dilema
Replies: 6
Views: 546

TTF High Scores Dilema

I'm currently working on a new project that I want to have a list of the top 5 high scores but ifstream objects seem to only be able to convert each line into a string. However to print it to the screen I need it to be a char * so I don't know what to do. And another more minor problem is that every...
by RandomDever
Sun Jan 10, 2010 2:23 pm
Forum: Programming Discussion
Topic: Button Class Not Drawing
Replies: 7
Views: 555

Re: Button Class Not Drawing

class Button { public: Button( int x, int y, int w, int h, bool fOver, bool fDown ); bool Check( SDL_Event event ); void Load( SDL_Surface *image ); SDL_Rect nextClip; private: bool overImage; bool downImage; bool isToggled; SDL_Surface *buttonImage; SDL_Surface *currentImage; int mouseX; int mouse...
by RandomDever
Sat Jan 09, 2010 6:17 pm
Forum: Programming Discussion
Topic: Button Class Not Drawing
Replies: 7
Views: 555

Re: Button Class Not Drawing

Do you mind posting your ApplySurface() function? Nope void ApplySurface( int x, int y, SDL_Surface* source, SDL_Surface* destination ) { //Make a temporary rectangle to hold the offsets SDL_Rect offset; //Give the offsets to the rectangle offset.x = x; offset.y = y; //Blit the surface SDL_BlitSurf...
by RandomDever
Sat Jan 09, 2010 5:33 pm
Forum: Programming Discussion
Topic: Button Class Not Drawing
Replies: 7
Views: 555

Button Class Not Drawing

class Button { public: Button( int x, int y, int w, int h, bool fOver, bool fDown ); bool Check( SDL_Event event, SDL_Surface *buffer ); void Load( SDL_Surface *image ); private: void Draw( int x, int y, SDL_Surface *screen, SDL_Rect clip ); bool overImage; bool downImage; SDL_Surface *buttonImage;...
by RandomDever
Sat Jan 02, 2010 7:51 pm
Forum: Programming Discussion
Topic: Collision Detection Problems
Replies: 5
Views: 929

Re: Collision Detection Problems

Well Actually the getting stuck on top thing was just me being a dumbass.
But I think I found an SDL library for collision so I'll see how that works. :)
by RandomDever
Sat Dec 26, 2009 12:50 pm
Forum: Programming Discussion
Topic: Collision Detection Problems
Replies: 5
Views: 929

Collision Detection Problems

bool checkCollision( SDL_Rect A, SDL_Rect B ) { //The sides of the rectangles int leftA, leftB; int rightA, rightB; int topA, topB; int bottomA, bottomB; //Calculate the sides of rect A leftA = A.x; rightA = A.x + A.w; topA = A.y; bottomA = A.y + A.h; //Calculate the sides of rect B leftB = B.x; ri...
by RandomDever
Sat Dec 26, 2009 12:33 pm
Forum: Game Development
Topic: What projects are you currently working on?
Replies: 500
Views: 164200

Re: What projects are you currently working on?

Currently I'm working on a base engine for all projects to come. It's almost done, I just have to implement collision detection. But for some reason it goes all fluky.
by RandomDever
Thu Oct 15, 2009 12:05 pm
Forum: Programming Discussion
Topic: My library
Replies: 12
Views: 1040

Re: My library

The framelimiter calculates how much time each frame has to its disposal, if it doesn't utilize all that time the rest is put in a delay. Here you're just dividing the start time with the amount of frames that's been drawn, which makes no sense. You need to take the current ticks and subtract the t...