summaryrefslogtreecommitdiff
path: root/src/transform.c
blob: 7c50a5e1fd82724f39354fcf7229d2629a96f123 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <stdlib.h>
#include <string.h>

#include <kalmia.h>
#include <ezxml.h>
#include "transform.h"


int kai_parse_matrix(ka_matrix_t *m, ezxml_t tag)
{
	if (strcmp("matrix", ezxml_name(tag)) != 0)
		return -1;
	
	char *str = ezxml_txt(tag);
	char *end;
	int i;
	for (i=0; i<16; i++) {
		(*m)[i] = strtod(str, &end);
		str = end;
	}
	
	return 0;
}