Discuss the development of new homebrew software, tools and libraries.
Moderators: cheriff , TyRaNiD
TheMan
Posts: 10 Joined: Tue Jan 03, 2006 9:29 am
Post
by TheMan » Tue Jan 03, 2006 9:33 am
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 (cursorx < 0) cursorx=0;
if (cursorx > 480) cursorx=480;
if (cursory < 0) cursory=0;
if (cursory > 272) cursory=272;
blitImageToImage(0 ,0 ,9 , 12, cursor, cursorx, cursory, bg);
sceDisplayWaitVblankStart();
flipScreen();
}
pspDebugScreenClear();
sceKernelSleepThread();
return 0;
}
TheMan
Posts: 10 Joined: Tue Jan 03, 2006 9:29 am
Post
by TheMan » Wed Jan 04, 2006 5:42 am
NVM figured it out
ronniebeck
Posts: 4 Joined: Wed Jan 04, 2006 2:40 pm
Post
by ronniebeck » Wed Jan 04, 2006 2:50 pm
On the topic of helping a noob, can some one tell me what I am doing wrong here?
Code: Select all
[rony@kehlstein fileio]$ 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: In function `fileSize':
main.c:(.text+0x16c): undefined reference to `sceIoGetStat'
collect2: ld returned 1 exit status
make: *** [fileio.elf] Error 1
[rony@kehlstein fileio]$
JoshDB
Posts: 87 Joined: Wed Oct 05, 2005 3:54 am
Post
by JoshDB » Thu Jan 05, 2006 2:16 am
Try looking at your makefile for missing libraries
MikeDX
Posts: 30 Joined: Wed Oct 19, 2005 9:24 am
Post
by MikeDX » Thu Jan 05, 2006 4:07 am
A more sensible option would just be to replace sceIoGetStat with sceIoGetstat
check the makefiles indeed... tsk.
JoshDB
Posts: 87 Joined: Wed Oct 05, 2005 3:54 am
Post
by JoshDB » Thu Jan 05, 2006 9:48 am
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 » Fri Jan 06, 2006 1:54 am
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?