noXur/Smurf — Issue #10: Compatibility problem etc.
Author: HyDr0x
Created: 2011-12-03 12:55:31+00:00
State: open

Hi, if we want to make this project portable to Linux and Mac we can't use sscanf_s or fopen_s because those functions are added from MS and are only available with windows. You can use the standart fopen or sscanf functions instead. They are equivalent and portable. sscanf_s etc. provide only some security functionality which we don't really need.

I also had some problems to make it run cause it doesn't recognize the glm and so on in the amloader.hpp. So I cutted the includes from the amloader.cpp out and copied them into the amloader.hpp file. So it worked for me.

```C++
#ifndef AMLOADER_HPP_
#define AMLOADER_HPP_

#include
#include
#include
#include

class AmiraMesh
...
```

There are some small errors because you changed from floats to glm::vec:

```C++
m_pvBuffer = new float[NumToRead];

to

m_pvBuffer = new glm::vec3[NumToRead];
```

and

```C++
AmiraMesh::~AmiraMesh()
{
if(m_pfBuffer) delete[] m_pfBuffer;
}

class AmiraMesh
{
private:
int	m_iSizeX, m_iSizeY, m_iSizeZ;	// Resolution of the vector field in each direction
//	int	m_iVectorComponents;	// Number of dimensions in one vector (have to be 3 in this application)
glm::vec3	m_vBBMin, m_vBBMax;	// Bounding box ("Real"-World-Size of the vector field
float	m_fScaleX, m_fScaleY, m_fScaleZ;	// Factor m_iSize/(m_vBBMax-m_vBBMin) to translate positions to grid positions faster
glm::vec3*	m_pvBuffer;
```