Mercurial > hg > Game > Cerium
changeset 262:0697f31fbd7f draft
Add alpha blending
author | e065725@yutaka.st.ie.u-ryukyu.ac.jp |
---|---|
date | Wed, 03 Jun 2009 22:14:20 +0900 |
parents | 9fdad6dfde09 |
children | 6f2f877f62c3 ec6729fab209 |
files | TaskManager/Test/test_render/task/DrawSpan.cpp |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/TaskManager/Test/test_render/task/DrawSpan.cpp Wed Jun 03 21:30:01 2009 +0900 +++ b/TaskManager/Test/test_render/task/DrawSpan.cpp Wed Jun 03 22:14:20 2009 +0900 @@ -265,10 +265,17 @@ DrawSpan::updateBuffer(float zpos, int rangex, int x, int y, int tex_x, int tex_y, uint32 *tex_addr) { + + int rgb = get_rgb(tex_x, tex_y, tex_addr); - - zRow[x + (rangex*y)] = zpos; - linebuf[x + (rangex*y)] = rgb; + /*下位4bitを抽出*/ + int alpha = rgb & 0x000F; + /*完全に透けているか判断*/ + int flag = (alpha != 0); + + zRow[x + (rangex*y)] = zpos*flag + zRow[x + (rangex*y)]*(1-flag); + linebuf[x + (rangex*y)] = rgb*flag + linebuf[x + (rangex*y)]*(1-flag); + } /**