parent
							
								
									59aed37d3e
								
							
						
					
					
						commit
						151a1f0d1b
					
				
					 3 changed files with 12 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -36,6 +36,14 @@ Table::Table(int x, int y /*= 1*/, int z /*= 1*/)
 | 
			
		|||
	data = static_cast<int16_t*>(calloc(x * y * z, sizeof(int16_t)));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Table::Table(const Table &other)
 | 
			
		||||
    :m_x(other.m_x), m_y(other.m_y), m_z(other.m_z)
 | 
			
		||||
{
 | 
			
		||||
	const size_t size = m_x * m_y * m_z * sizeof(int16_t);;
 | 
			
		||||
	data = static_cast<int16_t*>(malloc(size));
 | 
			
		||||
	memcpy(data, other.data, size);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Table::~Table()
 | 
			
		||||
{
 | 
			
		||||
	free(data);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,6 +31,8 @@ class Table : public Serializable
 | 
			
		|||
{
 | 
			
		||||
public:
 | 
			
		||||
	Table(int x, int y = 1, int z = 1);
 | 
			
		||||
	/* Clone constructor */
 | 
			
		||||
	Table(const Table &other);
 | 
			
		||||
	virtual ~Table();
 | 
			
		||||
 | 
			
		||||
	int xSize() const { return m_x; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue