My Project
CadContentLoader.h
1 
2 #pragma once
3 #include <string>
4 #include "ParaEngine.h"
5 #include "IDataLoader.h"
6 #include "AssetEntity.h"
7 #include "AssetManifest.h"
8 #include "ShapeAABB.h"
9 #include "CadModel.h"
10 #include "ICadModelImporter.h"
11 
12 namespace ParaEngine
13 {
14  class CadModel;
15  class CadModelPart;
16 
18  {
19  public:
20  CadModelLoader(asset_ptr<CadModel>& pAsset,const char* fileName = NULL);
21  ~CadModelLoader();
22 
23  const char* GetFileName();
24  HRESULT Decompress(void** ppData,int* pcBytes);
25  HRESULT CleanUp();
26  HRESULT Destroy();
27  HRESULT Load();
28 
29  private:
30  asset_ptr<CadModel> m_asset;
31  std::string m_fileName;
32  };
33 
35  {
36  public:
37  friend CadModel;
38  CadModelProcessor(asset_ptr<CadModel>& pAsset);
40 
41  IDirect3DDevice9* GetRenderDevice();
42  HRESULT CleanUp();
43 
44  HRESULT LockDeviceObject();
45  HRESULT UnLockDeviceObject();
46  HRESULT Destroy();
47  HRESULT Process(void* pData,int bytes);
48  HRESULT CopyToResource();
49  void SetResourceError();
50 
51  private:
52  asset_ptr<CadModel> m_asset;
53  IDirect3DDevice9* m_pDevice;
54  char* m_pData;
55  int m_bytes;
56  AssetFileEntry* m_pAssetFileEntry;
57  CadModelData* m_modelData;
58 
59  HRESULT CreateGridData();
60  };
61 }
light-weighted file record header in memory.
Definition: AssetManifest.h:10
HRESULT Destroy()
Destroy is called by the graphics thread when it has consumed the data, unless IsDeviceObject() is fa...
Definition: CadContentLoader.cpp:58
different physics engine has different winding order.
Definition: EventBinding.h:32
Definition: ICadModelImporter.h:41
Definition: CadContentLoader.h:34
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
HRESULT Decompress(void **ppData, int *pcBytes)
Decompress is called by one of the processing threads to decompress the data.
Definition: CadContentLoader.cpp:48
Definition: CadContentLoader.h:17
const char * GetFileName()
get the file name
Definition: CadContentLoader.cpp:35
Definition: CadModel.h:77
HRESULT Load()
Load is called from the IO thread to load data.
Definition: CadContentLoader.cpp:64