| 27 | #include "scale.h" |
| 28 | |
| 29 | void scaletexture(uchar *src, uint sw, uint sh, uint bpp, uchar *dst, uint dw, uint dh) |
| 30 | { |
| 31 | if(sw == dw*2 && sh == dh*2) |
| 32 | { |
| 33 | switch(bpp) |
| 34 | { |
| 35 | case 1: return halvetexture1(src, sw, sh, dst); |
| 36 | case 2: return halvetexture2(src, sw, sh, dst); |
| 37 | case 3: return halvetexture3(src, sw, sh, dst); |
| 38 | case 4: return halvetexture4(src, sw, sh, dst); |
| 39 | } |
| 40 | } |
| 41 | else if(sw < dw || sh < dh || sw&(sw-1) || sh&(sh-1)) |
| 42 | { |
| 43 | switch(bpp) |
| 44 | { |
| 45 | case 1: return scaletexture1(src, sw, sh, dst, dw, dh); |
| 46 | case 2: return scaletexture2(src, sw, sh, dst, dw, dh); |
| 47 | case 3: return scaletexture3(src, sw, sh, dst, dw, dh); |
| 48 | case 4: return scaletexture4(src, sw, sh, dst, dw, dh); |
| 49 | } |
| 50 | } |
| 51 | else |
| 52 | { |
| 53 | switch(bpp) |
| 54 | { |
| 55 | case 1: return shifttexture1(src, sw, sh, dst, dw, dh); |
| 56 | case 2: return shifttexture2(src, sw, sh, dst, dw, dh); |
| 57 | case 3: return shifttexture3(src, sw, sh, dst, dw, dh); |
| 58 | case 4: return shifttexture4(src, sw, sh, dst, dw, dh); |
| 59 | } |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | Texture *notexture = NULL, *noworldtexture = NULL; |
| 64 |
no outgoing calls
no test coverage detected