Пример #1
0
void LOADERDECL Pos_ReadDirect()
{
	static_assert(N <= 3, "N > 3 is not sane!");
	auto const scale = posScale;
	DataWriter dst;
	DataReader src;

	for (int i = 0; i < 3; ++i)
		dst.Write(i<N ? PosScale(src.Read<T>(), scale) : 0.f);

	LOG_VTX();
}
Пример #2
0
void LOADERDECL Pos_ReadDirect(VertexLoader* loader)
{
	static_assert(N <= 3, "N > 3 is not sane!");
	auto const scale = loader->m_posScale;
	DataReader dst(g_vertex_manager_write_ptr, nullptr);
	DataReader src(g_video_buffer_read_ptr, nullptr);

	for (int i = 0; i < 3; ++i)
		dst.Write(i < N ? PosScale(src.Read<T>(), scale) : 0.f);

	g_vertex_manager_write_ptr = dst.GetPointer();
	g_video_buffer_read_ptr = src.GetPointer();
	LOG_VTX();
}
Пример #3
0
void LOADERDECL Pos_ReadIndex()
{
	static_assert(!std::numeric_limits<I>::is_signed, "Only unsigned I is sane!");
	static_assert(N <= 3, "N > 3 is not sane!");

	auto const index = DataRead<I>();
	auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * arraystrides[ARRAY_POSITION]));
	auto const scale = posScale;
	DataWriter dst;

	for (int i = 0; i < 3; ++i)
		dst.Write(i<N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);

	LOG_VTX();
}
Пример #4
0
void LOADERDECL Pos_ReadIndex(VertexLoader* loader)
{
	static_assert(std::is_unsigned<I>::value, "Only unsigned I is sane!");
	static_assert(N <= 3, "N > 3 is not sane!");

	auto const index = DataRead<I>();
	loader->m_vertexSkip = index == std::numeric_limits<I>::max();
	auto const data = reinterpret_cast<const T*>(cached_arraybases[ARRAY_POSITION] + (index * g_main_cp_state.array_strides[ARRAY_POSITION]));
	auto const scale = loader->m_posScale;
	DataReader dst(g_vertex_manager_write_ptr, nullptr);

	for (int i = 0; i < 3; ++i)
		dst.Write(i < N ? PosScale(Common::FromBigEndian(data[i]), scale) : 0.f);

	g_vertex_manager_write_ptr = dst.GetPointer();
	LOG_VTX();
}