Rev 2163 | Rev 2236 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2163 | Rev 2188 | ||
---|---|---|---|
Line 76... | Line 76... | ||
76 | mov eax,[img_high] |
76 | mov eax,[img_high] |
77 | imul eax,dword [screen_width] |
77 | imul eax,dword [screen_width] |
78 | mov ebx,[screen_high] |
78 | mov ebx,[screen_high] |
79 | call integer_division |
79 | call integer_division |
80 | mov [stretch_img_width],eax |
80 | mov [stretch_img_width],eax |
81 | mov ebx,[img_width] |
- | |
82 | sub ebx,eax |
- | |
83 | shr ebx,1 |
- | |
84 | mov [stretch_start_coordinates.x],bx |
- | |
85 | jmp .continue |
81 | jmp .continue |
86 | @@: |
82 | @@: |
87 | ; X = Ximg |
83 | ; X = Ximg |
88 | ; Y = Ximg*Yscreen/Xscreen |
84 | ; Y = Ximg*Yscreen/Xscreen |
89 | mov eax,[img_width] |
85 | mov eax,[img_width] |
Line 91... | Line 87... | ||
91 | mov eax,[img_width] |
87 | mov eax,[img_width] |
92 | imul eax,dword [screen_high] |
88 | imul eax,dword [screen_high] |
93 | mov ebx,[screen_width] |
89 | mov ebx,[screen_width] |
94 | call integer_division |
90 | call integer_division |
95 | mov [stretch_img_high],eax |
91 | mov [stretch_img_high],eax |
96 | mov ebx,[img_high] |
- | |
97 | sub ebx,eax |
- | |
98 | shr ebx,1 |
- | |
99 | mov [stretch_start_coordinates.y],bx |
- | |
100 | .continue: |
92 | .continue: |
- | 93 | mov eax,[Stretch_Crop_Corner] |
|
- | 94 | mov ebx,eax |
|
- | 95 | shr eax,16 |
|
- | 96 | shl eax,2 |
|
- | 97 | mov eax,[eax+call_to_calculate_stretch_start_coordinates_Y] |
|
- | 98 | call eax |
|
- | 99 | and ebx,0xffff |
|
- | 100 | shl ebx,2 |
|
- | 101 | mov ebx,[ebx+call_to_calculate_stretch_start_coordinates_X] |
|
- | 102 | call ebx |
|
- | 103 | ||
101 | mov ebx,[screen_width] |
104 | mov ebx,[screen_width] |
102 | shl ebx,16 |
105 | shl ebx,16 |
103 | add ebx,[screen_high] |
106 | add ebx,[screen_high] |
Line 104... | Line 107... | ||
104 | 107 | ||
Line 117... | Line 120... | ||
117 | call [Scaling_Start] |
120 | call [Scaling_Start] |
118 | call background_1 |
121 | call background_1 |
119 | ret |
122 | ret |
Line 120... | Line 123... | ||
120 | 123 | ||
- | 124 | ;--------------------------------------------------------------------- |
|
- | 125 | call_to_calculate_stretch_start_coordinates_X: |
|
- | 126 | dd calculate_stretch_start_coordinates_XL |
|
- | 127 | dd calculate_stretch_start_coordinates_XC |
|
- | 128 | dd calculate_stretch_start_coordinates_XR |
|
- | 129 | ;--------------------------------------------------------------------- |
|
- | 130 | call_to_calculate_stretch_start_coordinates_Y: |
|
- | 131 | dd calculate_stretch_start_coordinates_YU |
|
- | 132 | dd calculate_stretch_start_coordinates_YC |
|
- | 133 | dd calculate_stretch_start_coordinates_YD |
|
- | 134 | ;--------------------------------------------------------------------- |
|
- | 135 | calculate_stretch_start_coordinates_XC: |
|
- | 136 | xor ecx,ecx |
|
- | 137 | .1: |
|
- | 138 | mov eax,[img_width] |
|
- | 139 | sub eax,[stretch_img_width] |
|
- | 140 | test ecx,ecx |
|
- | 141 | jnz @f |
|
- | 142 | shr eax,1 |
|
- | 143 | @@: |
|
- | 144 | mov [stretch_start_coordinates.x],ax |
|
- | 145 | calculate_stretch_start_coordinates_XL: |
|
- | 146 | ret |
|
- | 147 | ;--------------------------------------------------------------------- |
|
- | 148 | calculate_stretch_start_coordinates_XR: |
|
- | 149 | xor ecx,ecx |
|
- | 150 | inc ecx |
|
- | 151 | jmp calculate_stretch_start_coordinates_XC.1 |
|
- | 152 | ;--------------------------------------------------------------------- |
|
- | 153 | calculate_stretch_start_coordinates_YC: |
|
- | 154 | xor ecx,ecx |
|
- | 155 | .1: |
|
- | 156 | mov eax,[img_high] |
|
- | 157 | sub eax,[stretch_img_high] |
|
- | 158 | test ecx,ecx |
|
- | 159 | jnz @f |
|
- | 160 | shr eax,1 |
|
- | 161 | @@: |
|
- | 162 | mov [stretch_start_coordinates.y],ax |
|
- | 163 | calculate_stretch_start_coordinates_YU: |
|
- | 164 | ret |
|
- | 165 | ;--------------------------------------------------------------------- |
|
- | 166 | calculate_stretch_start_coordinates_YD: |
|
- | 167 | xor ecx,ecx |
|
- | 168 | inc ecx |
|
- | 169 | jmp calculate_stretch_start_coordinates_YC.1 |
|
121 | ;--------------------------------------------------------------------- |
170 | ;--------------------------------------------------------------------- |
122 | ;.stretch_inscribe: |
171 | ;.stretch_inscribe: |
123 | ; ret |
172 | ; ret |
124 | ;--------------------------------------------------------------------- |
173 | ;--------------------------------------------------------------------- |
125 | background_1: |
174 | background_1: |