Quote:Original post by Prototype You need to post more code I guess. On a side note, returning 0 for failure is kinda non-standard and will confuse you when you are to use 3rd party libraries and such. Better get off that habit. |
Okay, thanks, mind telling me what to return? :)
This is all the code in my main.cpp that has something to do with the sprite class:
#include <SDL.h>
#include <stdio.h>
#include <sstream>
#include "logging.h"
#include "sprite.h"
int main(int argc, char *argv[])
{
Sprite *tile[4];
alpha_r = 255;
alpha_g = 0;
alpha_b = 255;
for (int n = 0; n <= 4; n++)
{
std::stringstream temp;
temp << "data\\tiles\\" << n << ".bmp";
tile[n]->Load(temp.str().c_str());
SDL_SetColorKey(tile[n]->img, SDL_SRCCOLORKEY, SDL_MapRGB(tile[n]->img->format, alpha_r, alpha_g, alpha_b));
}
}
Tell me if you need more :)
Thanks for all the help!