Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/spe/viewer_types.cc @ 639:70c5c2d2eb24
fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 19 Nov 2009 18:45:24 +0900 |
parents | 735f76483bb2 |
children | 49b3c753e209 |
rev | line source |
---|---|
507 | 1 #include "viewer_types.h" |
2 | |
3 int | |
4 getLocalPosition(int d, int offset) | |
5 { | |
6 return d & (offset-1); | |
7 } | |
8 | |
9 /** | |
10 * ワールド座標における x の値を | |
11 * split_screen_w で分割した領域(1 〜 split_screen_w)での座標に変換する | |
12 * (ex. split_screen_w が 256 の場合、 | |
13 * x = 1 -> 1 | |
14 * x = 256 -> 256 | |
15 * x = 257 -> 1 | |
16 */ | |
17 int | |
18 getLocalX(int x) | |
19 { | |
20 return getLocalPosition(x, split_screen_w); | |
21 } | |
22 | |
23 /** | |
24 * getLocalX に同じ | |
25 */ | |
26 int | |
27 getLocalY(int y) | |
28 { | |
29 return getLocalPosition(y, split_screen_h); | |
30 } |