NNS_G2dCalcRequiredOBJ* Calculation Results Table

Overview

Internally, NNS_G2dCalcRequiredOBJ1D and NNS_G2dCalcRequiredOBJ2DRect are the same function. They return the same values when specified with the same arguments. The two tables below show the relationship between the arguments and the returned values for these NNS_G2dCalcRequiredOBJ*() functions. The values in the two tables are the same; only the conditions applied to divide up the colors are different. In both tables, the areaWidth argument defines the horizontal direction and the areaHeight argument defines the vertical direction.

The OBJ size is always a power of 2, so when either areaWidth or areaHeight has a remainder of 3 when divided by 4, the required number of OBJ will increase significantly. Conversely, when both are divisible by 4, the number of required OBJ will decline significantly. Thus, if either areaWidth or areaHeight has a remainder of 3 when divided by 4, you can reduce the number of required OBJ by simply incrementing the argument by 1. Consider that a 19x19 CharCanvas requires 24 OBJ, whereas a 20x20 CharCanvas needs only 9.

Table 1

This table shows return values classified and assigned a color according to range.

0-9 returned 10-19 returned 20-29 returned 30-39 returned 40-49 returned
h\w 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
1 1 1 2 1 2 2 3 2 3 3 4 3 4 4 5 4 5 5 6 5 6 6 7 6 7 7 8 7 8 8 9 8
2 1 1 2 1 2 2 3 2 3 3 4 3 4 4 5 4 5 5 6 5 6 6 7 6 7 7 8 7 8 8 9 8
3 2 2 4 2 4 4 6 4 6 6 8 6 8 8 10 8 10 10 12 10 12 12 14 12 14 14 16 14 16 16 18 16
4 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 4
5 2 2 4 2 4 4 6 3 5 5 7 5 7 7 9 6 8 8 10 8 10 10 12 9 11 11 13 11 13 13 15 12
6 2 2 4 2 4 4 6 3 5 5 7 5 7 7 9 6 8 8 10 8 10 10 12 9 11 11 13 11 13 13 15 12
7 3 3 6 3 6 6 9 5 8 8 11 8 11 11 14 10 13 13 16 13 16 16 19 15 18 18 21 18 21 21 24 20
8 2 2 4 1 3 3 5 1 3 3 5 2 4 4 6 2 4 4 6 3 5 5 7 3 5 5 7 4 6 6 8 4
9 3 3 6 2 5 5 8 3 6 6 9 5 8 8 11 6 9 9 12 8 11 11 14 9 12 12 15 11 14 14 17 12
10 3 3 6 2 5 5 8 3 6 6 9 5 8 8 11 6 9 9 12 8 11 11 14 9 12 12 15 11 14 14 17 12
11 4 4 8 3 7 7 11 5 9 9 13 8 12 12 16 10 14 14 18 13 17 17 21 15 19 19 23 18 22 22 26 20
12 3 3 6 2 5 5 8 2 5 5 8 4 7 7 10 4 7 7 10 6 9 9 12 6 9 9 12 8 11 11 14 8
13 4 4 8 3 7 7 11 4 8 8 12 7 11 11 15 8 12 12 16 11 15 15 19 12 16 16 20 15 19 19 23 16
14 4 4 8 3 7 7 11 4 8 8 12 7 11 11 15 8 12 12 16 11 15 15 19 12 16 16 20 15 19 19 23 16
15 5 5 10 4 9 9 14 6 11 11 16 10 15 15 20 12 17 17 22 16 21 21 26 18 23 23 28 22 27 27 32 24
16 4 4 8 2 6 6 10 2 6 6 10 4 8 8 12 4 8 8 12 6 10 10 14 6 10 10 14 8 12 12 16 8
17 5 5 10 3 8 8 13 4 9 9 14 7 12 12 17 8 13 13 18 11 16 16 21 12 17 17 22 15 20 20 25 16
18 5 5 10 3 8 8 13 4 9 9 14 7 12 12 17 8 13 13 18 11 16 16 21 12 17 17 22 15 20 20 25 16
19 6 6 12 4 10 10 16 6 12 12 18 10 16 16 22 12 18 18 24 16 22 22 28 18 24 24 30 22 28 28 34 24
20 5 5 10 3 8 8 13 3 8 8 13 6 11 11 16 6 11 11 16 9 14 14 19 9 14 14 19 12 17 17 22 12
21 6 6 12 4 10 10 16 5 11 11 17 9 15 15 21 10 16 16 22 14 20 20 26 15 21 21 27 19 25 25 31 20
22 6 6 12 4 10 10 16 5 11 11 17 9 15 15 21 10 16 16 22 14 20 20 26 15 21 21 27 19 25 25 31 20
23 7 7 14 5 12 12 19 7 14 14 21 12 19 19 26 14 21 21 28 19 26 26 33 21 28 28 35 26 33 33 40 28
24 6 6 12 3 9 9 15 3 9 9 15 6 12 12 18 6 12 12 18 9 15 15 21 9 15 15 21 12 18 18 24 12
25 7 7 14 4 11 11 18 5 12 12 19 9 16 16 23 10 17 17 24 14 21 21 28 15 22 22 29 19 26 26 33 20
26 7 7 14 4 11 11 18 5 12 12 19 9 16 16 23 10 17 17 24 14 21 21 28 15 22 22 29 19 26 26 33 20
27 8 8 16 5 13 13 21 7 15 15 23 12 20 20 28 14 22 22 30 19 27 27 35 21 29 29 37 26 34 34 42 28
28 7 7 14 4 11 11 18 4 11 11 18 8 15 15 22 8 15 15 22 12 19 19 26 12 19 19 26 16 23 23 30 16
29 8 8 16 5 13 13 21 6 14 14 22 11 19 19 27 12 20 20 28 17 25 25 33 18 26 26 34 23 31 31 39 24
30 8 8 16 5 13 13 21 6 14 14 22 11 19 19 27 12 20 20 28 17 25 25 33 18 26 26 34 23 31 31 39 24
31 9 9 18 6 15 15 24 8 17 17 26 14 23 23 32 16 25 25 34 22 31 31 40 24 33 33 42 30 39 39 48 32
32 8 8 16 4 12 12 20 4 12 12 20 8 16 16 24 8 16 16 24 12 20 20 28 12 20 20 28 16 24 24 32 16

Table 2

This table shows argument values classified by color.

 Arguments with remainder of 0 when divided by 4   Arguments with remainder of 3 when divided by 4 
h\w 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
1 1 1 2 1 2 2 3 2 3 3 4 3 4 4 5 4 5 5 6 5 6 6 7 6 7 7 8 7 8 8 9 8
2 1 1 2 1 2 2 3 2 3 3 4 3 4 4 5 4 5 5 6 5 6 6 7 6 7 7 8 7 8 8 9 8
3 2 2 4 2 4 4 6 4 6 6 8 6 8 8 10 8 10 10 12 10 12 12 14 12 14 14 16 14 16 16 18 16
4 1 1 2 1 2 2 3 1 2 2 3 2 3 3 4 2 3 3 4 3 4 4 5 3 4 4 5 4 5 5 6 4
5 2 2 4 2 4 4 6 3 5 5 7 5 7 7 9 6 8 8 10 8 10 10 12 9 11 11 13 11 13 13 15 12
6 2 2 4 2 4 4 6 3 5 5 7 5 7 7 9 6 8 8 10 8 10 10 12 9 11 11 13 11 13 13 15 12
7 3 3 6 3 6 6 9 5 8 8 11 8 11 11 14 10 13 13 16 13 16 16 19 15 18 18 21 18 21 21 24 20
8 2 2 4 1 3 3 5 1 3 3 5 2 4 4 6 2 4 4 6 3 5 5 7 3 5 5 7 4 6 6 8 4
9 3 3 6 2 5 5 8 3 6 6 9 5 8 8 11 6 9 9 12 8 11 11 14 9 12 12 15 11 14 14 17 12
10 3 3 6 2 5 5 8 3 6 6 9 5 8 8 11 6 9 9 12 8 11 11 14 9 12 12 15 11 14 14 17 12
11 4 4 8 3 7 7 11 5 9 9 13 8 12 12 16 10 14 14 18 13 17 17 21 15 19 19 23 18 22 22 26 20
12 3 3 6 2 5 5 8 2 5 5 8 4 7 7 10 4 7 7 10 6 9 9 12 6 9 9 12 8 11 11 14 8
13 4 4 8 3 7 7 11 4 8 8 12 7 11 11 15 8 12 12 16 11 15 15 19 12 16 16 20 15 19 19 23 16
14 4 4 8 3 7 7 11 4 8 8 12 7 11 11 15 8 12 12 16 11 15 15 19 12 16 16 20 15 19 19 23 16
15 5 5 10 4 9 9 14 6 11 11 16 10 15 15 20 12 17 17 22 16 21 21 26 18 23 23 28 22 27 27 32 24
16 4 4 8 2 6 6 10 2 6 6 10 4 8 8 12 4 8 8 12 6 10 10 14 6 10 10 14 8 12 12 16 8
17 5 5 10 3 8 8 13 4 9 9 14 7 12 12 17 8 13 13 18 11 16 16 21 12 17 17 22 15 20 20 25 16
18 5 5 10 3 8 8 13 4 9 9 14 7 12 12 17 8 13 13 18 11 16 16 21 12 17 17 22 15 20 20 25 16
19 6 6 12 4 10 10 16 6 12 12 18 10 16 16 22 12 18 18 24 16 22 22 28 18 24 24 30 22 28 28 34 24
20 5 5 10 3 8 8 13 3 8 8 13 6 11 11 16 6 11 11 16 9 14 14 19 9 14 14 19 12 17 17 22 12
21 6 6 12 4 10 10 16 5 11 11 17 9 15 15 21 10 16 16 22 14 20 20 26 15 21 21 27 19 25 25 31 20
22 6 6 12 4 10 10 16 5 11 11 17 9 15 15 21 10 16 16 22 14 20 20 26 15 21 21 27 19 25 25 31 20
23 7 7 14 5 12 12 19 7 14 14 21 12 19 19 26 14 21 21 28 19 26 26 33 21 28 28 35 26 33 33 40 28
24 6 6 12 3 9 9 15 3 9 9 15 6 12 12 18 6 12 12 18 9 15 15 21 9 15 15 21 12 18 18 24 12
25 7 7 14 4 11 11 18 5 12 12 19 9 16 16 23 10 17 17 24 14 21 21 28 15 22 22 29 19 26 26 33 20
26 7 7 14 4 11 11 18 5 12 12 19 9 16 16 23 10 17 17 24 14 21 21 28 15 22 22 29 19 26 26 33 20
27 8 8 16 5 13 13 21 7 15 15 23 12 20 20 28 14 22 22 30 19 27 27 35 21 29 29 37 26 34 34 42 28
28 7 7 14 4 11 11 18 4 11 11 18 8 15 15 22 8 15 15 22 12 19 19 26 12 19 19 26 16 23 23 30 16
29 8 8 16 5 13 13 21 6 14 14 22 11 19 19 27 12 20 20 28 17 25 25 33 18 26 26 34 23 31 31 39 24
30 8 8 16 5 13 13 21 6 14 14 22 11 19 19 27 12 20 20 28 17 25 25 33 18 26 26 34 23 31 31 39 24
31 9 9 18 6 15 15 24 8 17 17 26 14 23 23 32 16 25 25 34 22 31 31 40 24 33 33 42 30 39 39 48 32
32 8 8 16 4 12 12 20 4 12 12 20 8 16 16 24 8 16 16 24 12 20 20 28 12 20 20 28 16 24 24 32 16

See Also

NNS_G2dCalcRequiredOBJ1D, NNS_G2dCalcRequiredOBJ2DRect

Revision History

2005/05/25 Initial version.


CONFIDENTIAL