Help for a noob

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
TheMan
Posts: 10
Joined: Tue Jan 03, 2006 9:29 am

Help for a noob

Post by TheMan »

Hi, I'm quite new to this and im having some problems with the screen not clearing the cursor im blitting to it. Can someone please guide me in the right direction?

Code: Select all

int main() {
		SceCtrlData pad;
		
		pspDebugScreenInit();
		SetupCallbacks();
		initGraphics();
		
		int cursorx = 480/2;
		int cursory = 272/2;
		int cursorxstep = 3;
		int cursorystep = 3;
		
		char buffer[200];
		char buffer2[200];
        Image* cursor;
		Image* bg; 
		sprintf(buffer, "cursor.png");
		sprintf(buffer2, "bg.png");
        cursor = loadImage(buffer);
		bg = loadImage(buffer2); 
			while(1) {
				blitAlphaImageToScreen(0 ,0 ,480 , 272, bg, 0, 0);

				sceCtrlReadBufferPositive(&pad, 1);
				if (pad.Buttons & PSP_CTRL_UP){
					cursory = cursory - cursorystep;
				} 
				if (pad.Buttons & PSP_CTRL_DOWN){
					cursory = cursory + cursorystep;
				} 
				if (pad.Buttons & PSP_CTRL_LEFT){
					cursorx = cursorx - cursorxstep;
				} 
				if (pad.Buttons & PSP_CTRL_RIGHT){
					cursorx = cursorx + cursorxstep;
				}
				if (pad.Buttons & PSP_CTRL_CROSS){
					sceKernelExitGame();
				}

				if &#40;cursorx < 0&#41; cursorx=0;
				if &#40;cursorx > 480&#41; cursorx=480;
				if &#40;cursory < 0&#41; cursory=0;
				if &#40;cursory > 272&#41; cursory=272;

				blitImageToImage&#40;0 ,0 ,9 , 12, cursor, cursorx, cursory, bg&#41;;
				sceDisplayWaitVblankStart&#40;&#41;;
				flipScreen&#40;&#41;; 
			&#125;
		pspDebugScreenClear&#40;&#41;;
		sceKernelSleepThread&#40;&#41;;
		return 0;
&#125;
TheMan
Posts: 10
Joined: Tue Jan 03, 2006 9:29 am

Post by TheMan »

NVM figured it out
ronniebeck
Posts: 4
Joined: Wed Jan 04, 2006 2:40 pm

Post by ronniebeck »

On the topic of helping a noob, can some one tell me what I am doing wrong here?

Code: Select all

&#91;rony@kehlstein fileio&#93;$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall  -L. -L/usr/local/pspdev/psp/sdk/lib   main.o -lpspumd -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o fileio.elf
main.o&#58; In function `fileSize'&#58;
main.c&#58;&#40;.text+0x16c&#41;&#58; undefined reference to `sceIoGetStat'
collect2&#58; ld returned 1 exit status
make&#58; *** &#91;fileio.elf&#93; Error 1
&#91;rony@kehlstein fileio&#93;$
User avatar
JoshDB
Posts: 87
Joined: Wed Oct 05, 2005 3:54 am

Post by JoshDB »

Try looking at your makefile for missing libraries
MikeDX
Posts: 30
Joined: Wed Oct 19, 2005 9:24 am

Post by MikeDX »

A more sensible option would just be to replace sceIoGetStat with sceIoGetstat

check the makefiles indeed... tsk.
User avatar
JoshDB
Posts: 87
Joined: Wed Oct 05, 2005 3:54 am

Post by JoshDB »

Hey, I'm a n00b here too... My problem is usually in the Makefile, so I just try to help ( :
TheMan
Posts: 10
Joined: Tue Jan 03, 2006 9:29 am

Post by TheMan »

Another question that somebody might be able to help me with; I remember hearing from someone that you can warp images or do things to images, for example like fading or shrinking/expanding it.
Does anybody know how I would be able to fade an image, with just code?
Post Reply