29 |
|
UUtUns16 x; |
30 |
|
UUtUns16 y; |
31 |
|
|
32 |
+ |
UUtUns16 index; |
33 |
+ |
UUtUns16 remaining_width; |
34 |
+ |
UUtUns16 remaining_height; |
35 |
+ |
|
36 |
+ |
M3tPointScreen dest_point; |
37 |
+ |
dest_point.z = inDestPoint->z; |
38 |
+ |
dest_point.invW = inDestPoint->invW; |
39 |
+ |
|
40 |
+ |
index = 0; |
41 |
+ |
remaining_height = inHeight; |
42 |
+ |
dest_point.y = (UUtInt16)((UUtUns16)inDestPoint->y); |
43 |
|
for (y = 0; y < inBigBitmap->num_y; y++) |
44 |
|
{ |
45 |
+ |
remaining_width = inWidth; |
46 |
+ |
dest_point.x = (UUtInt16)((UUtUns16)inDestPoint->x); |
47 |
|
for (x = 0; x < inBigBitmap->num_x; x++) |
48 |
|
{ |
36 |
– |
UUtUns16 index; |
37 |
– |
void* texture; // M3tTextureMap |
38 |
– |
M3tPointScreen dest_point; |
49 |
|
UUtUns16 width; |
50 |
|
UUtUns16 height; |
41 |
– |
UUtInt16 temp; |
42 |
– |
UUtInt32 x_times_maxwidth; |
43 |
– |
UUtInt32 y_times_maxheight; |
44 |
– |
|
45 |
– |
index = x + (y * inBigBitmap->num_x); |
46 |
– |
texture = inBigBitmap->textures[index]; |
51 |
|
|
52 |
< |
x_times_maxwidth = x * 256; |
53 |
< |
y_times_maxheight = y * 256; |
50 |
< |
|
51 |
< |
// Cast to Unsigned to get the 16 bit int representation and then to signed to get the actual value. Doing it in one step gives wrong results (at least with gcc) |
52 |
< |
dest_point.x = (UUtInt16)((UUtUns16)inDestPoint->x) + x_times_maxwidth; |
53 |
< |
dest_point.y = (UUtInt16)((UUtUns16)inDestPoint->y) + y_times_maxheight; |
54 |
< |
dest_point.z = inDestPoint->z; |
55 |
< |
dest_point.invW = inDestPoint->invW; |
56 |
< |
|
57 |
< |
temp = (UUtInt16) ( ((UUtInt32)inWidth - x_times_maxwidth) > 0 ? ((UUtInt32)inWidth - x_times_maxwidth) : 0); |
58 |
< |
width = 256 < (UUtUns16)temp ? 256 : temp; |
59 |
< |
temp = (UUtInt16) ( ((UUtInt32)inHeight - y_times_maxheight) > 0 ? ((UUtInt32)inHeight - y_times_maxheight) : 0); |
60 |
< |
height = 256 < (UUtUns16)temp ? 256 : temp; |
52 |
> |
width = 256 < remaining_width ? 256 : remaining_width; |
53 |
> |
height = 256 < remaining_height ? 256 : remaining_height; |
54 |
|
|
55 |
< |
M3rDraw_Bitmap(texture, &dest_point, width, height, inShade, inAlpha); |
55 |
> |
M3rDraw_Bitmap(inBigBitmap->textures[index], &dest_point, width, height, inShade, inAlpha); |
56 |
> |
|
57 |
> |
dest_point.x += 256; |
58 |
> |
remaining_width -= 256; |
59 |
> |
index++; |
60 |
|
} |
61 |
+ |
dest_point.y += 256; |
62 |
+ |
remaining_height -= 256; |
63 |
|
} |
64 |
|
} |
65 |
|
|