[ZoneBuilder] Add sndcurve interface
This commit is contained in:
parent
3d159d3112
commit
1b12886229
@ -388,6 +388,7 @@ namespace Components
|
|||||||
AssetHandler::RegisterInterface(new Assets::IMapEnts());
|
AssetHandler::RegisterInterface(new Assets::IMapEnts());
|
||||||
AssetHandler::RegisterInterface(new Assets::IRawFile());
|
AssetHandler::RegisterInterface(new Assets::IRawFile());
|
||||||
AssetHandler::RegisterInterface(new Assets::IGfxImage());
|
AssetHandler::RegisterInterface(new Assets::IGfxImage());
|
||||||
|
AssetHandler::RegisterInterface(new Assets::ISndCurve());
|
||||||
AssetHandler::RegisterInterface(new Assets::IMaterial());
|
AssetHandler::RegisterInterface(new Assets::IMaterial());
|
||||||
AssetHandler::RegisterInterface(new Assets::IPhysPreset());
|
AssetHandler::RegisterInterface(new Assets::IPhysPreset());
|
||||||
AssetHandler::RegisterInterface(new Assets::IXAnimParts());
|
AssetHandler::RegisterInterface(new Assets::IXAnimParts());
|
||||||
|
@ -73,6 +73,7 @@ namespace Components
|
|||||||
#include "AssetInterfaces\IRawFile.hpp"
|
#include "AssetInterfaces\IRawFile.hpp"
|
||||||
#include "AssetInterfaces\IGfxImage.hpp"
|
#include "AssetInterfaces\IGfxImage.hpp"
|
||||||
#include "AssetInterfaces\IMaterial.hpp"
|
#include "AssetInterfaces\IMaterial.hpp"
|
||||||
|
#include "AssetInterfaces\ISndCurve.hpp"
|
||||||
#include "AssetInterfaces\IPhysPreset.hpp"
|
#include "AssetInterfaces\IPhysPreset.hpp"
|
||||||
#include "AssetInterfaces\IXAnimParts.hpp"
|
#include "AssetInterfaces\IXAnimParts.hpp"
|
||||||
#include "AssetInterfaces\IFxEffectDef.hpp"
|
#include "AssetInterfaces\IFxEffectDef.hpp"
|
||||||
|
24
src/Components/Modules/AssetInterfaces/ISndCurve.cpp
Normal file
24
src/Components/Modules/AssetInterfaces/ISndCurve.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include <STDInclude.hpp>
|
||||||
|
|
||||||
|
namespace Assets
|
||||||
|
{
|
||||||
|
void ISndCurve::save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder)
|
||||||
|
{
|
||||||
|
AssertSize(Game::SndCurve, 136);
|
||||||
|
|
||||||
|
Utils::Stream* buffer = builder->getBuffer();
|
||||||
|
Game::SndCurve* asset = header.sndCurve;
|
||||||
|
Game::SndCurve* dest = buffer->dest<Game::SndCurve>();
|
||||||
|
buffer->save(asset);
|
||||||
|
|
||||||
|
buffer->pushBlock(Game::XFILE_BLOCK_VIRTUAL);
|
||||||
|
|
||||||
|
if (asset->filename)
|
||||||
|
{
|
||||||
|
buffer->saveString(builder->getAssetName(this->getType(), asset->filename));
|
||||||
|
Utils::Stream::ClearPointer(&dest->filename);
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer->popBlock();
|
||||||
|
}
|
||||||
|
}
|
10
src/Components/Modules/AssetInterfaces/ISndCurve.hpp
Normal file
10
src/Components/Modules/AssetInterfaces/ISndCurve.hpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
namespace Assets
|
||||||
|
{
|
||||||
|
class ISndCurve : public Components::AssetHandler::IAsset
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual Game::XAssetType getType() override { return Game::XAssetType::ASSET_TYPE_SNDCURVE; };
|
||||||
|
|
||||||
|
virtual void save(Game::XAssetHeader header, Components::ZoneBuilder::Zone* builder) override;
|
||||||
|
};
|
||||||
|
}
|
@ -1215,6 +1215,15 @@ namespace Game
|
|||||||
char * compressedData;
|
char * compressedData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#pragma pack(push, 4)
|
||||||
|
struct SndCurve
|
||||||
|
{
|
||||||
|
const char *filename;
|
||||||
|
unsigned __int16 knotCount;
|
||||||
|
vec2_t knots[16];
|
||||||
|
};
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
struct FontEntry
|
struct FontEntry
|
||||||
{
|
{
|
||||||
unsigned short character;
|
unsigned short character;
|
||||||
@ -2888,6 +2897,7 @@ namespace Game
|
|||||||
TracerDef* tracer;
|
TracerDef* tracer;
|
||||||
VehicleDef* vehicle;
|
VehicleDef* vehicle;
|
||||||
GfxWorld* gfxMap;
|
GfxWorld* gfxMap;
|
||||||
|
SndCurve* sndCurve;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct XAsset
|
struct XAsset
|
||||||
|
Loading…
Reference in New Issue
Block a user