Mercurial > hg > Game > Cerium
changeset 126:74d0a70f60e9 draft
fix RGBA mask (bgr -> rgba)
author | gongo@charles.cr.ie.u-ryukyu.ac.jp |
---|---|
date | Tue, 25 Nov 2008 11:37:57 +0900 |
parents | 7c6e30d43c2d |
children | c5db07490d52 |
files | TaskManager/Test/test_render/Makefile.def TaskManager/Test/test_render/SpanPack.h TaskManager/Test/test_render/spe/DrawSpan.cpp TaskManager/Test/test_render/spe/Set_Texture.h TaskManager/Test/test_render/task/DrawSpan.cpp TaskManager/Test/test_render/viewer.cpp TaskManager/Test/test_render/viewer_types.h |
diffstat | 7 files changed, 25 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/Makefile.def Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/Makefile.def Tue Nov 25 11:37:57 2008 +0900 @@ -3,10 +3,10 @@ # include/library path # ex: macosx #CERIUM = /Users/gongo/Source/Concurrency/Game_project/Cerium -CERIUM = /Users/gongo/Source/hg/Cerium +#CERIUM = /Users/gongo/Source/hg/Cerium # ex: linux/ps3 -#CERIUM = /home/gongo/Cerium +CERIUM = /home/gongo/Cerium #CERIUM = ../../..
--- a/TaskManager/Test/test_render/SpanPack.h Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/SpanPack.h Tue Nov 25 11:37:57 2008 +0900 @@ -22,6 +22,12 @@ int pad[3]; // 12 void init(int ytop) { + this->info.size = 0; + this->info.y_top = ytop; + this->next = NULL; + } + + void reinit(int ytop) { SpanPack* top = this; SpanPack* p; SpanPack* p1;
--- a/TaskManager/Test/test_render/spe/DrawSpan.cpp Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/spe/DrawSpan.cpp Tue Nov 25 11:37:57 2008 +0900 @@ -74,10 +74,10 @@ char *p = get_pixel(tx%8, ty%8, tex); #endif - blue = (Uint8) p[0]; + alpha = 255; + red = (Uint8) p[0]; green = (Uint8) p[1]; - red = (Uint8) p[2]; - alpha = 255; + blue = (Uint8) p[2]; return (red & 0xff) * 0x10000 + (green & 0xff) * 0x100 + (blue & 0xff) + (alpha << 24);
--- a/TaskManager/Test/test_render/spe/Set_Texture.h Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/spe/Set_Texture.h Tue Nov 25 11:37:57 2008 +0900 @@ -2,7 +2,7 @@ #define INCLUDED_TASK_LOAD_TEXTURE #ifndef INCLUDED_SCHED_TASK -#include "SchedTask.h" +# include "SchedTask.h" #endif class SetTexture : public SchedTask {
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/task/DrawSpan.cpp Tue Nov 25 11:37:57 2008 +0900 @@ -74,10 +74,10 @@ char *p = get_pixel(tx%8, ty%8, tex); #endif - blue = (Uint8) p[0]; + alpha = 255; + red = (Uint8) p[0]; green = (Uint8) p[1]; - red = (Uint8) p[2]; - alpha = 255; + blue = (Uint8) p[2]; return (red & 0xff) * 0x10000 + (green & 0xff) * 0x100 + (blue & 0xff) + (alpha << 24); @@ -196,6 +196,7 @@ free(free_sp); free(linebuf); free(zRow); + free(tex); return 0; }
--- a/TaskManager/Test/test_render/viewer.cpp Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/viewer.cpp Tue Nov 25 11:37:57 2008 +0900 @@ -107,6 +107,10 @@ spackList_ptr[i] = &spackList[i]; } + for (int i = 1; i <= spackList_length; i++) { + spackList[i-1].init(i*split_screen_h); + } + task_next = manager->create_task(TASK_DUMMY); task_next->set_post(&post2runLoop, NULL); @@ -180,7 +184,7 @@ clean_pixels(); for (int i = 1; i <= spackList_length; i++) { - spackList[i-1].init(i*split_screen_h); + spackList[i-1].reinit(i*split_screen_h); } task_next = manager->create_task(TASK_DUMMY);
--- a/TaskManager/Test/test_render/viewer_types.h Tue Nov 25 10:38:44 2008 +0900 +++ b/TaskManager/Test/test_render/viewer_types.h Tue Nov 25 11:37:57 2008 +0900 @@ -19,10 +19,10 @@ // OPENGL, }; -const int redMask = 0x00ff0000; -const int greenMask = 0x0000ff00; -const int blueMask = 0x000000ff; -const int alphaMask = 0; +const int redMask = 0xff000000; +const int greenMask = 0x00ff0000; +const int blueMask = 0x0000ff00; +const int alphaMask = 0x000000ff; extern int getLocalX(int x); extern int getLocalY(int y);