Welcome! Log In Create A New Profile

Advanced

Libwiisprite help

Posted by WiiPhlex 
Libwiisprite help
September 01, 2008 01:48PM
As I don't have a wii I cannot test this, but someone who tested for me says this doesn't work, and I honestly don't see why, I have the image at the given directory, it compiles under GCC with no warnings and obviously no errors, I have checked and double checked again, I had to make it so simple just to see if I could even get an image on screen, but this simply won't work, and it should so I'm being rather annoyed by it. code as follows

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

#include "menu.h"

using namespace wsp;

GameWindow gameWindow;
Sprite sprite;
Image image;

//---------------------------------------------------------------------------------
int main(int argc, char **argv) {
//---------------------------------------------------------------------------------

	fatInitDefault();
	gameWindow.InitVideo();
	LayerManager manager(1);
	
	if(image.LoadImage("data/menu_screen.png") != IMG_LOAD_ERROR_NONE)exit(0);
	sprite.SetImage(&image);
	
	sprite.SetPosition(0, 0);
	
	manager.Append(&sprite);
	
	PAD_Init();
	WPAD_Init();
	
	while (1) {
		
		WPAD_ScanPads();
		u32 pressed = WPAD_ButtonsHeld(WPAD_CHAN_0);
		
		if ( pressed & WPAD_BUTTON_HOME ) exit(0);
		
		manager.Draw(0, 0); 
		gameWindow.Flush();
	}
	
	// flush WPAD and video systems then exist to HBC
	WPAD_Flush(WPAD_CHAN_ALL);
	WPAD_Disconnect(WPAD_CHAN_ALL);
	WPAD_Shutdown();
	
	if (gameWindow.IsInitialized())
		gameWindow.StopVideo();
	gameWindow.Flush();
	
	exit(0);
	return 0;
	
}
Re: Libwiisprite help
September 05, 2008 07:18PM
Just compiled this, and it seems to work. Did your tester forget to copy over the png file maybe? Is the png file the right color depth?
Re: Libwiisprite help
September 06, 2008 01:46AM
Sorted out a while ago thanks :p tester didn't have the images at the correct directory.
Sorry, only registered users may post in this forum.

Click here to login