Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Latest commit

 

History

History
7510 lines (7177 loc) · 271 KB

SDL_blit_auto.c

File metadata and controls

7510 lines (7177 loc) · 271 KB
 
1
2
3
/* DO NOT EDIT! This file is generated by sdlgenblit.pl */
/*
SDL - Simple DirectMedia Layer
Feb 1, 2011
Feb 1, 2011
4
Copyright (C) 1997-2011 Sam Lantinga
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/
#include "SDL_config.h"
/* *INDENT-OFF* */
#include "SDL_video.h"
Aug 17, 2007
Aug 17, 2007
28
29
30
#include "SDL_blit.h"
#include "SDL_blit_auto.h"
Aug 17, 2007
Aug 17, 2007
31
static void SDL_Blit_RGB888_RGB888_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
33
const int flags = info->flags;
34
35
36
37
38
39
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
40
41
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
43
while (info->dst_h--) {
44
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
45
46
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
47
48
49
50
51
52
53
54
55
56
57
58
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
59
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
60
61
62
63
64
65
}
*dst = *src;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
66
info->dst += info->dst_pitch;
67
68
69
}
}
Aug 17, 2007
Aug 17, 2007
70
static void SDL_Blit_RGB888_RGB888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
72
const int flags = info->flags;
73
74
75
76
77
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
78
79
80
81
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
82
83
84
85
86
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
87
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
88
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
89
90
91
92
93
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
95
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
96
case SDL_COPY_BLEND:
97
98
99
100
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
101
case SDL_COPY_ADD:
102
103
104
105
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
106
107
108
109
110
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
111
112
113
114
115
116
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
117
118
info->src += info->src_pitch;
info->dst += info->dst_pitch;
119
120
121
}
}
Aug 17, 2007
Aug 17, 2007
122
static void SDL_Blit_RGB888_RGB888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
124
const int flags = info->flags;
125
126
127
128
129
130
131
132
133
134
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
135
136
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
138
while (info->dst_h--) {
139
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
140
141
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
142
143
144
145
146
147
148
149
150
151
152
153
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
154
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
155
156
157
158
159
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
160
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
161
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
162
163
164
165
166
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
168
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
169
case SDL_COPY_BLEND:
170
171
172
173
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
174
case SDL_COPY_ADD:
175
176
177
178
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
179
180
181
182
183
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
184
185
186
187
188
189
190
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
191
info->dst += info->dst_pitch;
192
193
194
}
}
Aug 17, 2007
Aug 17, 2007
195
static void SDL_Blit_RGB888_RGB888_Modulate(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
197
198
199
200
201
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
202
203
204
Uint32 pixel;
Uint32 R, G, B, A;
Aug 17, 2007
Aug 17, 2007
205
206
207
208
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
209
210
211
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
212
if (flags & SDL_COPY_MODULATE_COLOR) {
213
214
215
216
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
217
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
218
219
A = (A * modulateA) / 255;
}
220
221
222
223
224
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
225
226
info->src += info->src_pitch;
info->dst += info->dst_pitch;
227
228
229
}
}
Aug 17, 2007
Aug 17, 2007
230
static void SDL_Blit_RGB888_RGB888_Modulate_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
232
233
234
235
236
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
237
238
239
240
241
242
243
244
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
245
246
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
248
while (info->dst_h--) {
249
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
250
251
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
252
253
254
255
256
257
258
259
260
261
262
263
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
264
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
265
266
267
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
268
if (flags & SDL_COPY_MODULATE_COLOR) {
269
270
271
272
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
273
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
274
275
A = (A * modulateA) / 255;
}
276
277
278
279
280
281
pixel = ((Uint32)R << 16) | ((Uint32)G << 8) | B;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
282
info->dst += info->dst_pitch;
283
284
285
}
}
Aug 17, 2007
Aug 17, 2007
286
static void SDL_Blit_RGB888_RGB888_Modulate_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
288
289
290
291
292
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
293
294
295
296
297
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
298
299
300
301
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
302
303
304
305
306
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
307
if (flags & SDL_COPY_MODULATE_COLOR) {
308
309
310
311
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
312
if (flags & SDL_COPY_MODULATE_ALPHA) {
313
314
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
315
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
316
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
317
318
319
320
321
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
323
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
324
case SDL_COPY_BLEND:
325
326
327
328
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
329
case SDL_COPY_ADD:
330
331
332
333
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
334
335
336
337
338
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
339
340
341
342
343
344
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
345
346
info->src += info->src_pitch;
info->dst += info->dst_pitch;
347
348
349
}
}
Aug 17, 2007
Aug 17, 2007
350
static void SDL_Blit_RGB888_RGB888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
352
353
354
355
356
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
357
358
359
360
361
362
363
364
365
366
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
367
368
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
370
while (info->dst_h--) {
371
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
372
373
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
374
375
376
377
378
379
380
381
382
383
384
385
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
386
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
387
388
389
390
391
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
392
if (flags & SDL_COPY_MODULATE_COLOR) {
393
394
395
396
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
397
if (flags & SDL_COPY_MODULATE_ALPHA) {
398
399
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
400
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
401
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
402
403
404
405
406
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
408
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
409
case SDL_COPY_BLEND:
410
411
412
413
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
414
case SDL_COPY_ADD:
415
416
417
418
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
419
420
421
422
423
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
424
425
426
427
428
429
430
}
dstpixel = ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
431
info->dst += info->dst_pitch;
432
433
434
}
}
Aug 17, 2007
Aug 17, 2007
435
static void SDL_Blit_RGB888_BGR888_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
437
const int flags = info->flags;
438
439
440
441
442
443
444
445
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
446
447
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
449
while (info->dst_h--) {
450
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
451
452
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
453
454
455
456
457
458
459
460
461
462
463
464
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
465
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
466
467
468
469
470
471
472
473
474
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
475
info->dst += info->dst_pitch;
476
477
478
}
}
Aug 17, 2007
Aug 17, 2007
479
static void SDL_Blit_RGB888_BGR888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
481
const int flags = info->flags;
482
483
484
485
486
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
487
488
489
490
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
491
492
493
494
495
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
496
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
497
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
498
499
500
501
502
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
504
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
505
case SDL_COPY_BLEND:
506
507
508
509
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
510
case SDL_COPY_ADD:
511
512
513
514
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
515
516
517
518
519
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
520
521
522
523
524
525
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
526
527
info->src += info->src_pitch;
info->dst += info->dst_pitch;
528
529
530
}
}
Aug 17, 2007
Aug 17, 2007
531
static void SDL_Blit_RGB888_BGR888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
533
const int flags = info->flags;
534
535
536
537
538
539
540
541
542
543
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
544
545
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
547
while (info->dst_h--) {
548
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
549
550
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
551
552
553
554
555
556
557
558
559
560
561
562
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
563
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
564
565
566
567
568
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
569
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
570
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
571
572
573
574
575
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
577
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
578
case SDL_COPY_BLEND:
579
580
581
582
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
583
case SDL_COPY_ADD:
584
585
586
587
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
588
589
590
591
592
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
593
594
595
596
597
598
599
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
600
info->dst += info->dst_pitch;
601
602
603
}
}
Aug 17, 2007
Aug 17, 2007
604
static void SDL_Blit_RGB888_BGR888_Modulate(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
606
607
608
609
610
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
611
612
613
Uint32 pixel;
Uint32 R, G, B, A;
Aug 17, 2007
Aug 17, 2007
614
615
616
617
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
618
619
620
while (n--) {
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
621
if (flags & SDL_COPY_MODULATE_COLOR) {
622
623
624
625
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
626
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
627
628
A = (A * modulateA) / 255;
}
629
630
631
632
633
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
634
635
info->src += info->src_pitch;
info->dst += info->dst_pitch;
636
637
638
}
}
Aug 17, 2007
Aug 17, 2007
639
static void SDL_Blit_RGB888_BGR888_Modulate_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
641
642
643
644
645
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
646
647
648
649
650
651
652
653
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
654
655
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
657
while (info->dst_h--) {
658
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
659
660
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
661
662
663
664
665
666
667
668
669
670
671
672
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
673
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
674
675
676
}
pixel = *src;
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
Aug 17, 2007
Aug 17, 2007
677
if (flags & SDL_COPY_MODULATE_COLOR) {
678
679
680
681
R = (R * modulateR) / 255;
G = (G * modulateG) / 255;
B = (B * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
682
if (flags & SDL_COPY_MODULATE_ALPHA) {
Aug 28, 2006
Aug 28, 2006
683
684
A = (A * modulateA) / 255;
}
685
686
687
688
689
690
pixel = ((Uint32)B << 16) | ((Uint32)G << 8) | R;
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
691
info->dst += info->dst_pitch;
692
693
694
}
}
Aug 17, 2007
Aug 17, 2007
695
static void SDL_Blit_RGB888_BGR888_Modulate_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
697
698
699
700
701
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
702
703
704
705
706
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
707
708
709
710
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
711
712
713
714
715
while (n--) {
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
716
if (flags & SDL_COPY_MODULATE_COLOR) {
717
718
719
720
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
721
if (flags & SDL_COPY_MODULATE_ALPHA) {
722
723
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
724
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
725
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
726
727
728
729
730
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
732
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
733
case SDL_COPY_BLEND:
734
735
736
737
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
738
case SDL_COPY_ADD:
739
740
741
742
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
743
744
745
746
747
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
748
749
750
751
752
753
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
754
755
info->src += info->src_pitch;
info->dst += info->dst_pitch;
756
757
758
}
}
Aug 17, 2007
Aug 17, 2007
759
static void SDL_Blit_RGB888_BGR888_Modulate_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
761
762
763
764
765
const int flags = info->flags;
const Uint32 modulateR = info->r;
const Uint32 modulateG = info->g;
const Uint32 modulateB = info->b;
const Uint32 modulateA = info->a;
766
767
768
769
770
771
772
773
774
775
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
776
777
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
779
while (info->dst_h--) {
780
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
781
782
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
783
784
785
786
787
788
789
790
791
792
793
794
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
795
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
796
797
798
799
800
}
srcpixel = *src;
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
dstpixel = *dst;
dstB = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstR = (Uint8)dstpixel; dstA = 0xFF;
Aug 17, 2007
Aug 17, 2007
801
if (flags & SDL_COPY_MODULATE_COLOR) {
802
803
804
805
srcR = (srcR * modulateR) / 255;
srcG = (srcG * modulateG) / 255;
srcB = (srcB * modulateB) / 255;
}
Aug 17, 2007
Aug 17, 2007
806
if (flags & SDL_COPY_MODULATE_ALPHA) {
807
808
srcA = (srcA * modulateA) / 255;
}
Aug 17, 2007
Aug 17, 2007
809
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
810
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
811
812
813
814
815
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
817
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
818
case SDL_COPY_BLEND:
819
820
821
822
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
823
case SDL_COPY_ADD:
824
825
826
827
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
828
829
830
831
832
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
833
834
835
836
837
838
839
}
dstpixel = ((Uint32)dstB << 16) | ((Uint32)dstG << 8) | dstR;
*dst = dstpixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
840
info->dst += info->dst_pitch;
841
842
843
}
}
Nov 29, 2008
Nov 29, 2008
844
static void SDL_Blit_RGB888_ARGB8888_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
846
const int flags = info->flags;
847
848
849
850
851
852
853
854
Uint32 pixel;
Uint32 R, G, B, A;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
855
856
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
858
while (info->dst_h--) {
859
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
860
861
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
862
863
864
865
866
867
868
869
870
871
872
873
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
874
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
875
876
}
pixel = *src;
Nov 29, 2008
Nov 29, 2008
877
878
R = (Uint8)(pixel >> 16); G = (Uint8)(pixel >> 8); B = (Uint8)pixel; A = 0xFF;
pixel = ((Uint32)A << 24) | ((Uint32)R << 16) | ((Uint32)G << 8) | B;
879
880
881
882
883
*dst = pixel;
posx += incx;
++dst;
}
posy += incy;
Aug 17, 2007
Aug 17, 2007
884
info->dst += info->dst_pitch;
885
886
887
}
}
Nov 29, 2008
Nov 29, 2008
888
static void SDL_Blit_RGB888_ARGB8888_Blend(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
890
const int flags = info->flags;
891
892
893
894
895
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
Aug 17, 2007
Aug 17, 2007
896
897
898
899
while (info->dst_h--) {
Uint32 *src = (Uint32 *)info->src;
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
900
901
while (n--) {
srcpixel = *src;
Nov 29, 2008
Nov 29, 2008
902
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
903
dstpixel = *dst;
Nov 29, 2008
Nov 29, 2008
904
dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
Aug 17, 2007
Aug 17, 2007
905
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
906
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
907
908
909
910
911
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
913
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
914
case SDL_COPY_BLEND:
915
916
917
918
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
919
case SDL_COPY_ADD:
920
921
922
923
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
924
925
926
927
928
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;
break;
Nov 29, 2008
Nov 29, 2008
930
dstpixel = ((Uint32)dstA << 24) | ((Uint32)dstR << 16) | ((Uint32)dstG << 8) | dstB;
931
932
933
934
*dst = dstpixel;
++src;
++dst;
}
Aug 17, 2007
Aug 17, 2007
935
936
info->src += info->src_pitch;
info->dst += info->dst_pitch;
937
938
939
}
}
Nov 29, 2008
Nov 29, 2008
940
static void SDL_Blit_RGB888_ARGB8888_Blend_Scale(SDL_BlitInfo *info)
Aug 17, 2007
Aug 17, 2007
942
const int flags = info->flags;
943
944
945
946
947
948
949
950
951
952
Uint32 srcpixel;
Uint32 srcR, srcG, srcB, srcA;
Uint32 dstpixel;
Uint32 dstR, dstG, dstB, dstA;
int srcy, srcx;
int posy, posx;
int incy, incx;
srcy = 0;
posy = 0;
Aug 17, 2007
Aug 17, 2007
953
954
incy = (info->src_h << 16) / info->dst_h;
incx = (info->src_w << 16) / info->dst_w;
Aug 17, 2007
Aug 17, 2007
956
while (info->dst_h--) {
957
Uint32 *src;
Aug 17, 2007
Aug 17, 2007
958
959
Uint32 *dst = (Uint32 *)info->dst;
int n = info->dst_w;
960
961
962
963
964
965
966
967
968
969
970
971
srcx = -1;
posx = 0x10000L;
while (posy >= 0x10000L) {
++srcy;
posy -= 0x10000L;
}
while (n--) {
if (posx >= 0x10000L) {
while (posx >= 0x10000L) {
++srcx;
posx -= 0x10000L;
}
Aug 17, 2007
Aug 17, 2007
972
src = (Uint32 *)(info->src + (srcy * info->src_pitch) + (srcx * 4));
973
974
}
srcpixel = *src;
Nov 29, 2008
Nov 29, 2008
975
srcR = (Uint8)(srcpixel >> 16); srcG = (Uint8)(srcpixel >> 8); srcB = (Uint8)srcpixel; srcA = 0xFF;
976
dstpixel = *dst;
Nov 29, 2008
Nov 29, 2008
977
dstA = (Uint8)(dstpixel >> 24); dstR = (Uint8)(dstpixel >> 16); dstG = (Uint8)(dstpixel >> 8); dstB = (Uint8)dstpixel;
Aug 17, 2007
Aug 17, 2007
978
if (flags & (SDL_COPY_BLEND|SDL_COPY_ADD)) {
979
/* This goes away if we ever use premultiplied alpha */
Aug 28, 2006
Aug 28, 2006
980
981
982
983
984
if (srcA < 255) {
srcR = (srcR * srcA) / 255;
srcG = (srcG * srcA) / 255;
srcB = (srcB * srcA) / 255;
}
Feb 5, 2011
Feb 5, 2011
986
switch (flags & (SDL_COPY_BLEND|SDL_COPY_ADD|SDL_COPY_MOD)) {
Aug 17, 2007
Aug 17, 2007
987
case SDL_COPY_BLEND:
988
989
990
991
dstR = srcR + ((255 - srcA) * dstR) / 255;
dstG = srcG + ((255 - srcA) * dstG) / 255;
dstB = srcB + ((255 - srcA) * dstB) / 255;
break;
Aug 17, 2007
Aug 17, 2007
992
case SDL_COPY_ADD:
993
994
995
996
dstR = srcR + dstR; if (dstR > 255) dstR = 255;
dstG = srcG + dstG; if (dstG > 255) dstG = 255;
dstB = srcB + dstB; if (dstB > 255) dstB = 255;
break;
Feb 5, 2011
Feb 5, 2011
997
998
999
1000
case SDL_COPY_MOD:
dstR = (srcR * dstR) / 255;
dstG = (srcG * dstG) / 255;
dstB = (srcB * dstB) / 255;