Directory Structure [step 1]: moving files

working on #672

NOTE: This commit can't be compiled!!
This commit is contained in:
Yehonal
2017-10-12 20:00:52 +02:00
parent 4df28fd29c
commit f06f32849f
2508 changed files with 0 additions and 1325 deletions

View File

@@ -0,0 +1,69 @@
/*
* Copyright (C)
*
* Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*/
#ifndef DOOADHNDL_H
#define DOOADHNDL_H
#include "ObjectDataHandler.h"
#include "Utils.h"
#include "Chunk.h"
#include "Model.h"
#include <set>
#include <vector>
class DoodadDefinition : public IDefinition
{
public:
uint32 MmidIndex;
uint32 UniqueId;
uint16 DecimalScale;
uint16 Flags;
virtual float Scale() const { return DecimalScale / 1024.0f; }
Vector3 FixCoords(Vector3& vec)
{
return Vector3(vec.z, vec.x, vec.y);
}
void Read(FILE* stream)
{
int count = 0;
count += fread(&MmidIndex, sizeof(uint32), 1, stream);
count += fread(&UniqueId, sizeof(uint32), 1, stream);
Position = (Vector3::Read(stream));
Rotation = Vector3::Read(stream);
count += fread(&DecimalScale, sizeof(uint16), 1, stream);
count += fread(&Flags, sizeof(uint16), 1, stream);
if (count != 4)
printf("DoodadDefinition::Read: Failed to read some data expected 4, read %d\n", count);
}
};
class DoodadHandler : public ObjectDataHandler
{
public:
DoodadHandler(ADT* adt);
~DoodadHandler();
std::vector<Vector3> Vertices;
std::vector<Triangle<uint32> > Triangles;
bool IsSane() { return _definitions && _paths; }
protected:
void ProcessInternal(MapChunk* chunk);
private:
void ReadDoodadDefinitions(Chunk* chunk);
void ReadDoodadPaths(Chunk* id, Chunk* data);
void InsertModelGeometry(const DoodadDefinition& def, Model* model);
std::set<uint32> _drawn;
std::vector<DoodadDefinition>* _definitions;
std::vector<std::string>* _paths;
};
#endif