Go to the source code of this file.
|
s32 | draw_image_with_clipping (IMG_PTR raster, u32 width, u32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipX, u16 clipY, u16 clipWidth, u16 clipHeight) |
|
s32 | draw_ci_image_with_clipping (IMG_PTR raster, s32 width, s32 height, s32 fmt, s32 bitDepth, PAL_PTR palette, s16 posX, s16 posY, u16 clipULx, u16 clipULy, u16 clipLRx, u16 clipRLy, u8 opacity) |
|
s32 | draw_tiled_image (IMG_PTR raster, u32 width, u32 height, u8 fmt, u8 bitDepth, s16 posX, s16 posY, u16 clipX, u16 clipY, u16 clipWidth, u16 clipHeight, f32 scaleX, f32 scaleY) |
|
s32 | integer_log (s32 number, u32 base) |
|
s32 | draw_adjustable_tiled_image (IMG_PTR raster, u32 width, u32 height, u8 fmt, u8 bitDepth, s16 posX, s16 posY, u16 clipX, u16 clipY, u16 clipWidth, u16 clipHeight, f32 scaleX, f32 scaleY) |
|
◆ Rect2b
◆ draw_image_with_clipping()
s32 draw_image_with_clipping |
( |
IMG_PTR | raster, |
|
|
u32 | width, |
|
|
u32 | height, |
|
|
s32 | fmt, |
|
|
s32 | bitDepth, |
|
|
s16 | posX, |
|
|
s16 | posY, |
|
|
u16 | clipX, |
|
|
u16 | clipY, |
|
|
u16 | clipWidth, |
|
|
u16 | clipHeight ) |
Definition at line 48 of file draw_img_util.c.
51 {
57
58 u16 texOffsetX, texOffsetY;
59
62 }
63 if (clipX >= (
s16)(posX + width)) {
65 }
66 if (clipY >= (
s16)(posY + height)) {
68 }
69
73
77 texOffsetY = 0;
79 do {
85 }
86
88 texOffsetY =
abs(posY - clipY);
90 }
91
96 }
97
98 if (
texRect.lry + 1 >= height) {
102 }
103
107
111 texOffsetX = 0;
112
114 do {
120 }
121
123 texOffsetX =
abs(posX - clipX);
125 }
126
131 }
132
133 if (
texRect.lrx + 1 >= width) {
137 }
138
151 }
152
154 0, texOffsetX * 32, texOffsetY * 32, 1024, 1024);
155
157 break;
158 }
161 }
162
164 break;
165 }
168 }
169
171}
BSS s32 PopupMenu_SelectedIndex
Referenced by draw_ci_image_with_clipping().
◆ draw_ci_image_with_clipping()
s32 draw_ci_image_with_clipping |
( |
IMG_PTR | raster, |
|
|
s32 | width, |
|
|
s32 | height, |
|
|
s32 | fmt, |
|
|
s32 | bitDepth, |
|
|
PAL_PTR | palette, |
|
|
s16 | posX, |
|
|
s16 | posY, |
|
|
u16 | clipULx, |
|
|
u16 | clipULy, |
|
|
u16 | clipLRx, |
|
|
u16 | clipRLy, |
|
|
u8 | opacity ) |
Definition at line 6 of file draw_img_util.c.
7 {
9
14
15 if (opacity == 255) {
18 } else if (opacity == 0) {
20 } else {
24 }
25
30 } else {
32 }
33 } else {
35 }
36 ret =
draw_image_with_clipping(raster, width, height, fmt, bitDepth, posX, posY,
clipULx,
clipULy,
clipLRx,
clipRLy);
39}
s32 draw_image_with_clipping(IMG_PTR raster, u32 width, u32 height, s32 fmt, s32 bitDepth, s16 posX, s16 posY, u16 clipX, u16 clipY, u16 clipWidth, u16 clipHeight)
◆ draw_tiled_image()
s32 draw_tiled_image |
( |
IMG_PTR | raster, |
|
|
u32 | width, |
|
|
u32 | height, |
|
|
u8 | fmt, |
|
|
u8 | bitDepth, |
|
|
s16 | posX, |
|
|
s16 | posY, |
|
|
u16 | clipX, |
|
|
u16 | clipY, |
|
|
u16 | clipWidth, |
|
|
u16 | clipHeight, |
|
|
f32 | scaleX, |
|
|
f32 | scaleY ) |
Definition at line 173 of file draw_img_util.c.
176 {
180 s32 texOffsetX, texOffsetY;
183
184 if (scaleX < 0.01 || scaleY < 0.01) {
185 return 0;
186 }
187
189 return 0;
190 }
191
192 if (clipX >= (
s16)(posX + width * scaleX)) {
193 return 0;
194 }
195
196 if (clipY >= (
s16)(posY + height * scaleY)) {
197 return 0;
198 }
199
203 dsdx = 1.0f / scaleX * 1024.0f;
204 dtdy = 1.0f / scaleY * 1024.0f;
208 texOffsetY = 0;
210 do {
216 }
217
220 texOffsetY =
abs(posY - clipY) / scaleY * 32.0f;
221 }
222
228 }
229
235 }
236 }
237
244 texOffsetX = 0;
245
247 do {
253 }
254
257 texOffsetX =
abs(posX - clipX) / scaleX * 32.0f;
258 }
259
265 }
266
270 }
271
280 }
281
283 0, texOffsetX, texOffsetY,
dsdx,
dtdy);
284
286 break;
287 }
290 };
291
293 break;
294 }
297 };
298
299 return 1;
300}
◆ integer_log()
s32 integer_log |
( |
s32 | number, |
|
|
u32 | base ) |
◆ draw_adjustable_tiled_image()
s32 draw_adjustable_tiled_image |
( |
IMG_PTR | raster, |
|
|
u32 | width, |
|
|
u32 | height, |
|
|
u8 | fmt, |
|
|
u8 | bitDepth, |
|
|
s16 | posX, |
|
|
s16 | posY, |
|
|
u16 | clipX, |
|
|
u16 | clipY, |
|
|
u16 | clipWidth, |
|
|
u16 | clipHeight, |
|
|
f32 | scaleX, |
|
|
f32 | scaleY ) |
Definition at line 316 of file draw_img_util.c.
319 {
324 s32 texOffsetX, texOffsetY;
326
328
331
333
334 if (scaleX < 0.01 || scaleY < 0.01) {
335 return 0;
336 }
337
339 return 0;
340 }
341
342 if (clipX >= (
s16)(posX + width * scaleX)) {
343 return 0;
344 }
345
346 if (clipY >= (
s16)(posY + height * scaleY)) {
347 return 0;
348 }
354 } else {
355 return 0;
356 }
362 } else {
363 return 0;
364 }
370 } else {
371 return 0;
372 }
376 } else {
377 return 0;
378 }
379 } else {
380 return 0;
381 }
382
383 dsdx = 1.0f / scaleX * 1024.0f;
384 dtdy = 1.0f / scaleY * 1024.0f;
389 return 0;
390 }
391 if (scaleY <= 1.0) {
393 } else {
395 }
396
399
401
406
412
413 texOffsetX = texOffsetY = 0;
414
416 do {
422 }
423
428 texOffsetY =
temp * 32.0f;
429 }
430 if (
texRect.lry + 1 == height){
432 }
else if (height <
texRect.lry + 1) {
435 temp = height * scaleY;
438 }
439
446 }
447 }
452 texOffsetX =
temp * 32.0f;
453 }
456 }
457
474 }
476 0, texOffsetX, texOffsetY,
dsdx,
dtdy);
477
479 break;
480 }
481
484 };
485
486 return 1;
487}
s32 integer_log(s32 number, u32 base)