Reindentation.

git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@1092 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
hybrid 2007-12-03 22:58:57 +00:00
parent 5ddb952b9a
commit 0528061a8c

View File

@ -26,7 +26,7 @@ using namespace video;
#include "irrString.h"
/** A structure representing some DeleD infos.
This structure contains data about DeleD level file like: version, ambient colour, number of objects etc...*/
This structure contains data about DeleD level file like: version, ambient colour, number of objects etc...*/
struct dmfHeader
{
//main file header
@ -107,7 +107,6 @@ This function converts an hex string (i.e. FF) to its int value (i.e. 255).
int axtoi(const char *hexStg)
{
unsigned int intValue = 0; // integer value of hex string
sscanf(hexStg, "%x", &intValue);
return (intValue);
}
@ -115,7 +114,6 @@ int axtoi(const char *hexStg)
/** A standard string.
A standard string created with standard template libraries.*/
typedef core::stringc stdstring;
typedef core::stringc String;
//Define a class StringList based on core::array and the defined class String
@ -153,7 +151,7 @@ public:
//Loads a stringlist from a file
//note that each String added to StringList
//is separed by a \\n character and it's present
//is separated by a \\n character and it's present
//at the end of line.
/** Loads a StringList from a file.
This function loads a StringList from a file where each string is divided by a \\n char.*/
@ -190,7 +188,7 @@ public:
}
};
//This function subdivides a string in a list of strings
//This function subdivides a string in a list of strings
/** This function subdivides strings divided by divider in a list of strings.
\return A StringList made of all strings divided by divider.*/
StringList SubdivideString(String str, String divider)
@ -210,7 +208,7 @@ StringList SubdivideString(String str, String divider)
while((str[c]!=divider[0]) && c<l)
{
resultstr += str[c];
c++;
++c;
}
//Remove spaces \t and \n from string in my implementation...
@ -218,7 +216,7 @@ StringList SubdivideString(String str, String divider)
//a particular char.
resultstr.trim();//trims string resultstr
strings.Add(resultstr);//add trimmed string
c++;
++c;
}
return strings;
@ -270,8 +268,8 @@ bool GetDMFHeader (StringList RawFile, dmfHeader & header)
//set Materials Number
header.numMaterials=atoi(RawFile[offs].c_str());
offs=offs + header.numMaterials;
offs++;
offs+=header.numMaterials;
++offs;
//set Object Number
header.numObjects=atoi(RawFile[offs].c_str());
@ -291,9 +289,9 @@ bool GetDMFHeader (StringList RawFile, dmfHeader & header)
StringList wat=SubdivideString(RawFile[offs],String(";"));
StringList wat1=SubdivideString(wat[0],String("_"));
offs++;
offs = offs + atoi(RawFile[offs].c_str());
offs++;
++offs;
offs += atoi(RawFile[offs].c_str());
++offs;
fac=atoi(RawFile[offs].c_str());
@ -305,10 +303,12 @@ bool GetDMFHeader (StringList RawFile, dmfHeader & header)
offs++;
for(int j=0; j<fac; j++)
{
if(!(wat1[0] == String("water") && wat[2] == String("0")))
header.numVertices=header.numVertices + atoi(RawFile[offs+j].c_str());
else
header.numWatVertices=header.numWatVertices + atoi(RawFile[offs + j].c_str());
}
offs = offs + fac;
}
@ -418,7 +418,9 @@ You must give in input a StringList representing a DMF file loaded with LoadFrom
\return true if function succeed or false on fail.*/
bool GetDMFWaterMaterials(StringList RawFile /**<StringList representing a DMF file.*/,
dmfMaterial materials[]/**<Materials returned.*/,
int num_material/**<Number of materials contained in DMF file.*/){
int num_material/**<Number of materials contained in DMF file.*/
)
{
int offs=4;
StringList temp;
StringList temp1;
@ -470,13 +472,16 @@ bool GetDMFWaterMaterials(StringList RawFile /**<StringList representing a DMF f
}
return true;
}
/**This function extract an array of dmfVert and dmfFace from a DMF file.
You must give in input a StringList representing a DMF file loaded with LoadFromFile and two arrays long enough.
Please use GetDMFHeader() before this function to know number of vertices and faces.
\return true if function succeed or false on fail.*/
bool GetDMFVerticesFaces(StringList RawFile/**<StringList representing a DMF file.*/,
dmfVert vertices[]/**<Vertices returned*/,
dmfFace faces[]/**Faces returned*/){
dmfFace faces[]/**Faces returned*/
)
{
int offs=3;
int offs1=0;
StringList temp,temp1;
@ -493,8 +498,8 @@ bool GetDMFVerticesFaces(StringList RawFile/**<StringList representing a DMF fil
if (atof(temp1[0].c_str()) < 0.91)
return false;//not correct version
//end checking
//end checking
temp.clear();
temp1.clear();
offs=offs + atoi(RawFile[offs].c_str());
@ -561,13 +566,14 @@ bool GetDMFVerticesFaces(StringList RawFile/**<StringList representing a DMF fil
}
/**This function extract an array of dmfLights from a DMF file.
You must give in input a StringList representing a DMF file loaded with LoadFromFile
and one array long enough.
Please use GetDMFHeader() before this function to know number of dynamic lights.
You must give in input a StringList representing a DMF file loaded with
LoadFromFile and one array long enough. Please use GetDMFHeader() before this
function to know number of dynamic lights.
\return true if function succeed or false on fail.*/
bool GetDMFLights(StringList RawFile/**<StringList representing a DMF file.*/,
dmfLight lights[]/**<Lights returned.*/){
dmfLight lights[]/**<Lights returned.*/
)
{
int offs=3;
StringList temp,temp1;
@ -615,7 +621,8 @@ bool GetDMFLights(StringList RawFile/**<StringList representing a DMF file.*/,
{
offs++;
temp=SubdivideString(RawFile[offs],String(";"));
if(atoi(temp[0].c_str())==1){
if(atoi(temp[0].c_str())==1)
{
temp1=SubdivideString(temp[18],String("_"));
if(temp1[0]==String("dynamic"))
{
@ -641,6 +648,7 @@ bool GetDMFLights(StringList RawFile/**<StringList representing a DMF file.*/,
return true;
}
/**This function extract an array of dmfWaterPlain,dmfVert and dmfFace from a DMF file.
You must give in input a StringList representing a DMF file loaded with LoadFromFile and three arrays long enough.
Please use GetDMFHeader() before this function to know number of water plains and water faces as well as water vertices.
@ -648,7 +656,9 @@ Please use GetDMFHeader() before this function to know number of water plains an
bool GetDMFWaterPlains(StringList RawFile/**<StringList representing a DMF file.*/,
dmfWaterPlain wat_planes[]/**<Water planes returned.*/,
dmfVert vertices[]/**<Vertices returned*/,
dmfFace faces[]/**Faces returned*/){
dmfFace faces[]/**Faces returned*/
)
{
int offs=3;
int offs1=0;
StringList temp,temp1;
@ -721,7 +731,6 @@ bool GetDMFWaterPlains(StringList RawFile/**<StringList representing a DMF file.
case 4:
if(atof(userinfo[4].c_str()))
wavelength = (float)atof(userinfo[4].c_str());
break;
}
}
@ -769,7 +778,7 @@ bool GetDMFWaterPlains(StringList RawFile/**<StringList representing a DMF file.
}
face_cnt++;
temp.clear();
};
}
}
offs=offs+fac;
}