comparison 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
comparison
equal deleted inserted replaced
282:ef061be0baff 283:55ea4465b1a2
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 }