Mercurial > hg > Members > kono > Cerium
diff Renderer/test_render/spe/viewer_types.cpp @ 283:55ea4465b1a2
fix test_render
author | e065746@localhost.localdomain |
---|---|
date | Fri, 05 Jun 2009 16:49:12 +0900 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Renderer/test_render/spe/viewer_types.cpp Fri Jun 05 16:49:12 2009 +0900 @@ -0,0 +1,30 @@ +#include "viewer_types.h" + +int +getLocalPosition(int d, int offset) +{ + return d & (offset-1); +} + +/** + * ワールド座標における x の値を + * split_screen_w で分割した領域(1 〜 split_screen_w)での座標に変換する + * (ex. split_screen_w が 256 の場合、 + * x = 1 -> 1 + * x = 256 -> 256 + * x = 257 -> 1 + */ +int +getLocalX(int x) +{ + return getLocalPosition(x, split_screen_w); +} + +/** + * getLocalX に同じ + */ +int +getLocalY(int y) +{ + return getLocalPosition(y, split_screen_h); +}