예제 #1
0
		void GLRadiosityRenderer::UpdateChunk(int cx, int cy, int cz) {
			Chunk &c = GetChunk(cx, cy, cz);
			if (!c.dirty)
				return;

			int originX = cx * ChunkSize;
			int originY = cy * ChunkSize;
			int originZ = cz * ChunkSize;

			for (int z = c.dirtyMinZ; z <= c.dirtyMaxZ; z++)
				for (int y = c.dirtyMinY; y <= c.dirtyMaxY; y++)
					for (int x = c.dirtyMinX; x <= c.dirtyMaxX; x++) {
						IntVector3 pos;
						pos.x = (x + originX);
						pos.y = (y + originY);
						pos.z = (z + originZ);

						Result res = Evaluate(pos);
						c.dataFlat[z][y][x] = EncodeValue(res.base);
						c.dataX[z][y][x] = EncodeValue(res.x);
						c.dataY[z][y][x] = EncodeValue(res.y);
						c.dataZ[z][y][x] = EncodeValue(res.z);
					}

			c.dirty = false;
			c.transferDone = false;
		}
예제 #2
0
파일: Field.cpp 프로젝트: stievie/bibedt
void CField::GetSource(xString *src)
{
	if (!m_Value.IsEmpty()) {
		DWORD MaxLine = ((CBibedtApp*)AfxGetApp())->m_Options->m_LineLength - 1;
		_TUCHAR c;

		xString* val = xsNewInitS(EncodeValue(m_Value));
		xsTerminate(val);
		xsCatS(src, _T("  "));
		xsCatS(src, m_Name);
		xsCatS(src, _T("={"));
		DWORD pos = 4 + m_Name.GetLength();
		int length = xsLen(val);
		xsGrow(src, length);
		for (int i = 0; i < length; i++) {
			c = xsChar(val, i);
			pos++;
			if (pos >= MaxLine && c == ' ' && i < length) {
				xsCatS(src, _T("\r\n    "));
				pos = 4;
			} else
				xsPut(src, c);
		}
		xsDelete(val);
		xsPut(src, _T('}'));
		xsTerminate(src);
	}
}