My Project
ContentLoaderParaX.h
1 #pragma once
2 #include "IDataLoader.h"
3 
4 namespace ParaEngine
5 {
6  struct AssetFileEntry;
7 
13  class CParaXLoader : public IDataLoader
14  {
15  private:
16  friend struct ParaXEntity;
17 
19  asset_ptr<ParaXEntity> m_asset;
20  // if this is "", m_asset->GetLocalFileName() is used.
21  std::string m_sFileName;
22 
23  public:
27  CParaXLoader(asset_ptr<ParaXEntity>& pAsset, const char* sFileName = NULL);
28  ~CParaXLoader();
29 
31  HRESULT CleanUp();
32  // overrides
33  public:
35  const char* GetFileName();
37  HRESULT Decompress(void** ppData, int* pcBytes);
39  HRESULT Destroy();
41  HRESULT Load();
42  };
43 
48  {
49  public:
50  CParaXProcessor(asset_ptr<ParaXEntity>& pAsset);
51  ~CParaXProcessor();
52 
54  RenderDevicePtr GetRenderDevice();
55 
57  HRESULT CleanUp();
58  // overrides
59  public:
60  HRESULT LockDeviceObject();
61  HRESULT UnLockDeviceObject();
62  HRESULT Destroy();
63  HRESULT Process(void* pData, int cBytes);
64  HRESULT CopyToResource();
65  void SetResourceError();
66 
67  private:
68  bool CreateMeshLODLevel(float fromDepth, const std::string& sFilename);
69 
70  private:
71  friend struct ParaXEntity;
72 
74  asset_ptr<ParaXEntity> m_asset;
76  RenderDevicePtr m_pDevice;
77 
78  char* m_pData;
79  int m_cBytes;
80 
83  std::vector<MeshLOD> m_MeshLODs;
84 
86  AssetFileEntry* m_pAssetFileEntry;
87  int m_nTechniqueHandle;
88  };
89 }
HRESULT Load()
Load is called from the IO thread to load data.
Definition: ContentLoaderParaX.cpp:75
HRESULT Destroy()
Destroy is called by the graphics thread when it has consumed the data.
Definition: ContentLoaderParaX.cpp:69
CParaXLoader implementation of IDataLoader it will first search locally.
Definition: ContentLoaderParaX.h:13
light-weighted file record header in memory.
Definition: AssetManifest.h:10
different physics engine has different winding order.
Definition: EventBinding.h:32
CParaXLoader(asset_ptr< ParaXEntity > &pAsset, const char *sFileName=NULL)
Definition: ContentLoaderParaX.cpp:34
a very thin wrapper to DirectX device with a portable version of openGL implementation.
Definition: RenderDeviceDirectX.h:10
const char * GetFileName()
get file name
Definition: ContentLoaderParaX.cpp:46
Definition: ParaXEntity.h:9
IDataProcessor is an interface that the AsyncLoader class uses to process and copy data into locked r...
Definition: IDataLoader.h:76
IDataLoader is an interface that the AsyncLoader class uses to load data from disk.
Definition: IDataLoader.h:14
CParaXProcessor implementation of IDataProcessor.
Definition: ContentLoaderParaX.h:47
HRESULT CleanUp()
clean up everything
Definition: ContentLoaderParaX.cpp:63
HRESULT Decompress(void **ppData, int *pcBytes)
Decompress is called by one of the processing threads to decompress the data.
Definition: ContentLoaderParaX.cpp:59