forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Load PNG !?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
ShUr1k3n



Joined: 16 Oct 2005
Posts: 42

PostPosted: Thu Nov 03, 2005 8:46 am    Post subject: Load PNG !? Reply with quote

Guys, how can i display a PNG image to the screen !?

I convert the PNG file to C ( using png2c.C )...
I tried with a BitMap ( BMP ) file and it works fine, but with the PNG i just get some "mixed" pixels... =S

Can u plz tell me how can i make this work fine ?!

This is the code i use:

Code:


 void pgBitBlt(unsigned long x,unsigned long y,unsigned long w,unsigned long h,unsigned long mag,const unsigned short *d)
 {
    unsigned char *vptr0;      //pointer to vram
    unsigned char *vptr;      //pointer to vram
    unsigned long xx,yy,mx,my;
    const unsigned short *dd;
    
    vptr0=pgGetVramAddr(x,y);
    for (yy=0; yy < h; yy ++) {
       for (my=0; my < mag; my ++) {
          vptr=vptr0;
          dd=d;
          for (xx=0; xx < w; xx ++) {
             for (mx=0; mx < mag; mx ++) {
                 if(*dd != 0xFFFF){ *(unsigned short *)vptr=*dd;}
                vptr += PIXELSIZE*2;
             }
             dd ++;
          }
          vptr0 += LINESIZE*2;
       }
       d += w;
    }
    
 }


and can i plz tell me too whats the meaning of this "unsigned long mag"...

Thks,

ShUr1k3n.
Back to top
View user's profile Send private message Send e-mail
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Thu Nov 03, 2005 9:27 am    Post subject: Reply with quote

Please search the forums, someone asks how to load a PNG at least once a week. Locked for redundancy.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   This topic is locked: you cannot edit posts or make replies.    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group