예제 #1
0
inline unsigned process_linei(const string& format, BufferReader& in, BufferWriter& out) {
	int face[12]; 

	auto ret = sscanf(in.read_raw(), format.data(),
		face + 0, face + 1, face + 2,
		face + 3, face + 4, face + 5,
		face + 6, face + 7, face + 8,
		face + 9, face + 10, face + 11);
	for (unsigned char x = 0; x < ret; ++x)
		*(face + x) -= 1;

	out.write_elements<int>(face, ret); 
	return ret;
} 
예제 #2
0
inline unsigned process_linei(const string& format, BufferReader& in, BufferWriter& out, unsigned& face_count) {
	int face[12];
	// vertex/uv/normal 
	// TEST does atoi stop at the /
	auto ret = sscanf(in.read_raw(), format.data(),
		face + 0, face + 1, face + 2,
		face + 3, face + 4, face + 5,
		face + 6, face + 7, face + 8,
		face + 9, face + 10, face + 11);
	for (unsigned char x = 0; x < ret; ++x)
		*(face + x) -= 1;

	out.write_elements<int>(face, ret);
	++face_count;
	return ret;
}