aboutsummaryrefslogtreecommitdiff
path: root/sources/TZR_DrawLine.c
blob: 78c218f5a0a20ad212e2b284ed8f8ad3ec4c384e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "TZR_render.h"
#include "TZR_globals.h"
#include "sdl_error.h"
#include <SDL2/SDL_render.h>

int
TZR_DrawLine(int x0, int y0, int x1, int y1)
{
	x0 += TZR_GetCameraX();
	y0 += TZR_GetCameraY();
	x1 += TZR_GetCameraX();
	y1 += TZR_GetCameraY();
	if (SDL_RenderDrawLine(___tzr_renderer, x0, y0, x1, y1) < 0)
		return sdl_error(-1);
	return 0;
}