00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #include "std3d.h"
00027
00028
00029
00030
00031
00032
00033 #include "3d/driver_user.h"
00034 #include "3d/scene_user.h"
00035 #include "3d/text_context_user.h"
00036 #include "nel/3d/u_driver.h"
00037 #include "3d/dru.h"
00038 #include "3d/scene.h"
00039 #include "3d/texture_user.h"
00040 #include "3d/material_user.h"
00041 #include "nel/3d/u_camera.h"
00042 #include "nel/misc/file.h"
00043 #include "nel/misc/path.h"
00044
00045
00046 using namespace std;
00047 using namespace NLMISC;
00048
00049
00050 namespace NL3D
00051 {
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 UScene *CDriverUser::createScene()
00064 {
00065 NL3D_MEM_DRIVER
00066
00067 CSceneUser *pSU = new CSceneUser(this);
00068
00069 pSU->getScene().setShapeBank( &_ShapeBank._ShapeBank );
00070
00071 pSU->getScene().getRenderTrav()->setMeshSkinManager(&_MeshSkinManager);
00072
00073 pSU->getScene().setAsyncTextureManager(&_AsyncTextureManager);
00074
00075 pSU->getScene().setLodCharacterManager(&_LodCharacterManager);
00076 return _Scenes.insert(pSU);
00077 }
00078
00079 void CDriverUser::deleteScene(UScene *scene)
00080 {
00081 NL3D_MEM_DRIVER
00082
00083 _Scenes.erase((CSceneUser*)scene, "deleteScene(): Bad scene ptr");
00084 }
00085
00086
00087
00088
00089
00090
00091
00092 UTextContext *CDriverUser::createTextContext(const std::string fontFileName, const std::string fontExFileName)
00093 {
00094 NL3D_MEM_DRIVER
00095
00096 return _TextContexts.insert(new CTextContextUser(fontFileName, fontExFileName, this, &_FontManager));
00097 }
00098
00099 void CDriverUser::deleteTextContext(UTextContext *textContext)
00100 {
00101 NL3D_MEM_DRIVER
00102
00103 _TextContexts.erase((CTextContextUser*)textContext, "deleteTextContext: Bad TextContext");
00104 }
00105
00106 void CDriverUser::setFontManagerMaxMemory(uint maxMem)
00107 {
00108 NL3D_MEM_DRIVER
00109
00110 _FontManager.setMaxMemory(maxMem);
00111 }
00112
00113 std::string CDriverUser::getFontManagerCacheInformation() const
00114 {
00115 NL3D_MEM_DRIVER
00116
00117 return _FontManager.getCacheInformation();
00118 }
00119
00120
00121
00122
00123 UTextureFile *CDriverUser::createTextureFile(const std::string &file)
00124 {
00125 NL3D_MEM_DRIVER
00126
00127 CTextureFileUser *text= new CTextureFileUser(file);
00128 _Textures.insert(text);
00129 return text;
00130 }
00131
00132 void CDriverUser::deleteTextureFile(UTextureFile *textfile)
00133 {
00134 NL3D_MEM_DRIVER
00135
00136 _Textures.erase(dynamic_cast<CTextureFileUser*>(textfile), "deleteTextureFile: Bad textfile");
00137 }
00138
00139 UTextureRaw *CDriverUser::createTextureRaw()
00140 {
00141 NL3D_MEM_DRIVER
00142 nlstop;
00143
00144 return NULL;
00145 }
00146
00147 void CDriverUser::deleteTextureRaw(UTextureRaw *textraw)
00148 {
00149 NL3D_MEM_DRIVER
00150 nlstop;
00151
00152 delete textraw;
00153 }
00154
00155 UMaterial *CDriverUser::createMaterial()
00156 {
00157 NL3D_MEM_DRIVER
00158
00159 return _Materials.insert(new CMaterialUser);
00160 }
00161
00162 void CDriverUser::deleteMaterial(UMaterial *umat)
00163 {
00164 NL3D_MEM_DRIVER
00165
00166 _Materials.erase( (CMaterialUser*)umat, "deleteMaterial: Bad material");
00167 }
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 void CDriverUser::profileRenderedPrimitives(CPrimitiveProfile &pIn, CPrimitiveProfile &pOut)
00180 {
00181 NL3D_MEM_DRIVER
00182
00183 _Driver->profileRenderedPrimitives(pIn, pOut);
00184 }
00185
00186
00187
00188 uint32 CDriverUser::profileAllocatedTextureMemory()
00189 {
00190 NL3D_MEM_DRIVER
00191
00192 return _Driver->profileAllocatedTextureMemory();
00193 }
00194
00195
00196
00197 uint32 CDriverUser::profileSetupedMaterials() const
00198 {
00199 NL3D_MEM_DRIVER
00200
00201 return _Driver->profileSetupedMaterials();
00202 }
00203
00204
00205
00206 uint32 CDriverUser::profileSetupedModelMatrix() const
00207 {
00208 NL3D_MEM_DRIVER
00209 return _Driver->profileSetupedModelMatrix();
00210 }
00211
00212
00213
00214 void CDriverUser::enableUsedTextureMemorySum (bool enable)
00215 {
00216 NL3D_MEM_DRIVER
00217 _Driver->enableUsedTextureMemorySum (enable);
00218 }
00219
00220
00221
00222 uint32 CDriverUser::getUsedTextureMemory () const
00223 {
00224 NL3D_MEM_DRIVER
00225 return _Driver->getUsedTextureMemory ();
00226 }
00227
00228
00229 }