aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/PS3/SPU_Tasks/PerlinNoise/PerlinNoiseJob.h
blob: b45763a5599eae786c4ac80255ba2ca58929326c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#pragma once
#include <vectormath\cpp\vectormath_aos.h>
#include "PerlinNoise_SPU.h"





class PerlinNoise_DataIn
{
public:
#ifndef SN_TARGET_PS3_SPU
	void set(PerlinNoise* pNoise, doubleArray& buffer, int x, int y, int z, int xSize, int ySize, int zSize, double xScale, double yScale, double zScale)
	{
		int arraySize = xSize * ySize * zSize;
		// make sure it's 16 byte aligned
		if(arraySize & 1)
			arraySize++;
		if (buffer.data == NULL) 
			buffer = doubleArray(arraySize);
		for (unsigned int i = 0; i < buffer.length; i++)
			buffer[i] = 0;

		m_perlinData.setup(pNoise);

		m_outputBuffer = buffer.data;
		this->x = x;
		this->y = y;
		this->z = z;
		this->xSize = xSize;
		this->ySize = ySize;
		this->zSize = zSize;
		this->xScale = xScale;
		this->yScale = yScale;
		this->zScale = zScale;
	}
	void set(PerlinNoise* pNoise, doubleArray& buffer, int x, int z, int xSize, int zSize, double xScale, double zScale, double pow)
	{
		set(pNoise, buffer, x, 10, z, xSize, 1, zSize, xScale, 1, zScale);
	}
#endif
	PerlinNoise_SPU	m_perlinData;
	double*			m_outputBuffer;

	int x, y, z;
	int xSize, ySize, zSize;
	double xScale, yScale, zScale;
};