alpha blending - PLEASE HELP
After working and researching for a few days now, I am posting another message in hopes of getting an answer. This is a small part of my project but it's stopping me. I've looked at every example and thread message I can find but nothing seems quite the same as mine (most use RAW files). Please help if you can.
I am trying to blend a 32 x 32 png image (game character) in with my 480 x 272 background image.
Here's my source:
dispBufferNumber = 0;
sceGuDispBuffer(SCR_WIDTH ,SCR_HEIGHT,(void*)(512 * 272 * 4),BUF_WIDTH);
sceGuClear(GU_COLOR_BUFFE R_BIT | GU_DEPTH_BUFFER_BIT);
sceGuOffset(2048 - (SCREEN_WIDTH / 2), 2048 - (SCREEN_HEIGHT / 2));
sceGuViewport(2048, 2048, SCREEN_WIDTH, SCREEN_HEIGHT);
sceGuScissor(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
sceGuAlphaFunc(GU_GREATER , 0, 0xff);
sceGuTexMode(GU_PSM_8888, 0, 0, 0);
sceGuTexFunc(GU_TFX_MODUL ATE, GU_TCC_RGBA);
//sceGuTexMode(GU_PSM_8888, 0, 0, 0);
//sceGuTexFunc(GU_TFX_REPLA CE, GU_TCC_RGBA);
//sceGuTexFilter(GU_NEAREST , GU_NEAREST);
//sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0, 0);
sceGuBlendFunc(GU_ADD, GU_SRC_ALPHA, GU_ONE_MINUS_SRC_ALPHA, 0xffffffff, 0xffffffff);
initialized = 1;
image = loadPngImage("ms0:/PSP/GAME/splash.png"); // 480 x 272 no alpha
position = loadPngImage("ms0:/PSP/GAME/character.png"); // 32 x 32 with transparent background
blitImageToScreen(0, 0, 480, 272, image, 0, 0);
blitAlphaImageToScreen(0, 0, 32, 32, position, 0, 0);
I changed my previous 24 x 32 to be 32 x 32 to meet the power of 2 requirement.
There are WAY too many variables for me to work with here trying to figure out what the problem is. The blitted 32 x 32 image shows up 100% transparent (nothing shows). The background is fine.
I am learning (quickly) more about this stuff but I am still too new to it. I have tried MANY different combinations trying to figure this out.
*** I will be happy to send my png file to someone too if they could make sure it's saved in a format compatible with this code if the code looks ok. ***
Your help is GREATLY appreciated. This is stopping me in my project and it's the only place i'll use this type of coding.