File: graph_draw_amap.c

package info (click to toggle)
xsystem35 1.7.3-pre5-8
  • links: PTS
  • area: main
  • in suites: bullseye
  • size: 7,372 kB
  • sloc: ansic: 51,007; sh: 12,049; asm: 863; makefile: 412; xml: 281; perl: 142
file content (24 lines) | stat: -rw-r--r-- 451 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// 8bit surface (or data) surface  alpha map إԡ

#include <string.h>
#include "portab.h"
#include "surface.h"
#include "ngraph.h"
#include "ags.h"

int gr_draw_amap(surface_t *dst, int dx, int dy, BYTE *src, int width, int height, int scanline) {
	int y;
	BYTE *sp, *dp;
	
	sp = src;
	dp = GETOFFSET_ALPHA(dst, dx, dy);
	
	for (y = 0; y < height; y++) {
		memcpy(dp, sp, width);
		sp += scanline;
		dp += dst->width;
	}
	
	return OK;
}