Users browsing this thread: 2 Guest(s)
The Spriter's Toolkit
#18
OK, so I got some time to code this weekend, and decided to work on SNEStify a bit, since I think it'll be the easiest one to start with. And heeeere's my first debug log!

Code:
>:Initializing program...

>:8
Argument count: 2
>:F:\C++\CodeBlocks\SDL_SNEStify\Debug\SDL_SNEStify.exe
>:F:\C++\CodeBlocks\SDL_SNEStify\Debug\herdvsswarmderp.png

>:36
Loading image: F:\C++\CodeBlocks\SDL_SNEStify\Debug\SDL_SNEStify.exe...

>:37
Image failed. Retrying...

>:37
Loading image: F:\C++\CodeBlocks\SDL_SNEStify\Debug\herdvsswarmderp.png...

>:38
Image failed. Retrying...

>:38
Image failed to load. Surrendering without a fight.

Yeah, for some reason, IMG_Load() from SDL_Image can't understand a full path when an image is passed as an argument. The reason why it tries to load itself as an image is because, for some reason, when you drag an image onto an executable, the EXE path becomes the first argument, so I set it to go through all arguments and search for an image. It's obviously finding the image; just not loading it. So now I have to figure out how to get around this path issue. I considered just trimming the path off and only passing the file name, but what about files that aren't in the same folder as the EXE?

I need to figure this out, because this same method is going to be used in my tileset digester. Here's the actual image loading code:

Code:
//Create the work image
for(int i = 0; i < argc; i++){
    sFileName = args[i];
    fprintf(fLog, ">:%i\nLoading image: %s...\n\n", SDL_GetTicks(), args[i]);
    image = IMG_Load(sFileName.c_str());
    if(image != 0){
        fprintf(fLog, ">:%i\nImage loaded!\n\n", SDL_GetTicks());
        break;
    } else fprintf(fLog, ">:%i\nImage failed. Retrying...\n\n", SDL_GetTicks());
};

Any ideas anyone?
Reply
Thanked by:


Messages In This Thread
The Spriter's Toolkit - by Kelvin - 04-12-2015, 10:23 PM
RE: The Spriter's Toolkit - by SmithyGCN - 04-12-2015, 10:44 PM
RE: The Spriter's Toolkit - by Kelvin - 04-13-2015, 07:32 AM
RE: The Spriter's Toolkit - by daemoth - 04-13-2015, 01:45 PM
RE: The Spriter's Toolkit - by puggsoy - 04-13-2015, 08:39 PM
RE: The Spriter's Toolkit - by Sketchasaurus - 04-14-2015, 05:04 AM
RE: The Spriter's Toolkit - by Kelvin - 04-14-2015, 09:14 PM
RE: The Spriter's Toolkit - by daemoth - 04-14-2015, 09:40 PM
RE: The Spriter's Toolkit - by TheShyGuy - 04-14-2015, 09:41 PM
RE: The Spriter's Toolkit - by Sketchasaurus - 04-14-2015, 10:01 PM
RE: The Spriter's Toolkit - by Kelvin - 04-17-2015, 03:24 PM
RE: The Spriter's Toolkit - by puggsoy - 04-18-2015, 04:34 AM
RE: The Spriter's Toolkit - by Kelvin - 04-19-2015, 03:56 PM
RE: The Spriter's Toolkit - by puggsoy - 04-20-2015, 03:56 AM
RE: The Spriter's Toolkit - by TheShyGuy - 04-20-2015, 09:35 AM
RE: The Spriter's Toolkit - by Kelvin - 04-20-2015, 01:49 PM
RE: The Spriter's Toolkit - by puggsoy - 04-21-2015, 02:06 AM
RE: The Spriter's Toolkit - by Kelvin - 05-04-2015, 08:48 AM
RE: The Spriter's Toolkit - by puggsoy - 05-08-2015, 09:05 AM
RE: The Spriter's Toolkit - by Kelvin - 05-10-2015, 07:04 AM
RE: The Spriter's Toolkit - by puggsoy - 05-11-2015, 03:56 AM
RE: The Spriter's Toolkit - by Kelvin - 05-11-2015, 07:35 AM

Forum Jump: