Diff of /trunk/ModularRex/RexParts/ModrexObjects.cs
Parent Directory
|
Revision Log
|
Patch
| revision 75, Mon Feb 23 07:21:19 2009 UTC | revision 80, Mon Mar 2 11:28:24 2009 UTC | |
|---|---|---|
| # | Line 36 | Line 36 |
| 36 | scene.SceneContents.OnObjectDuplicate += SceneGraph_OnObjectDuplicate; | scene.SceneContents.OnObjectDuplicate += SceneGraph_OnObjectDuplicate; |
| 37 | scene.SceneContents.OnObjectRemove += SceneGraph_OnObjectRemove; | scene.SceneContents.OnObjectRemove += SceneGraph_OnObjectRemove; |
| 38 | ||
| 39 | scene.AddCommand(this, "modreximport", "load 0.4 rex database <connstring>", "conn string example: SQLiteDialect;SQLite20Driver;Data Source=beneath_the_waves.db;Version=3", HandleLoadRexLegacyData); | |
| 40 | ||
| 41 | if (m_db == null) | if (m_db == null) |
| 42 | { | { |
| # | Line 378 | Line 379 |
| 379 | ||
| 380 | #endregion | #endregion |
| 381 | ||
| 382 | ||
| 383 | public void HandleLoadRexLegacyData(string module, string[] args) | |
| 384 | { | |
| 385 | NHibernateRexLegacyData legacydata = new NHibernateRexLegacyData(); | |
| 386 | ||
| 387 | legacydata.Initialise(args[1]); | |
| 388 | if(!legacydata.Inizialized) | |
| 389 | { | |
| 390 | m_log.Info("[MODREXOBJECTS]: Legacy database failed to initialize."); | |
| 391 | return; | |
| 392 | } | |
| 393 | ||
| 394 | List<RexLegacyPrimData> rexprimdata = legacydata.LoadAllRexPrimData(); | |
| 395 | m_log.Info("[MODREXOBJECTS]: Legacy rexprimdata objects loaded:" + rexprimdata.Count.ToString()); | |
| 396 | ||
| 397 | List<RexLegacyPrimMaterialData> rexprimmaterialdata = legacydata.LoadAllRexPrimMaterialData(); | |
| 398 | m_log.Info("[MODREXOBJECTS]: Legacy rexprimmaterialdata objects loaded:" + rexprimmaterialdata.Count.ToString()); | |
| 399 | ||
| 400 | foreach (RexLegacyPrimData prim in rexprimdata) | |
| 401 | { | |
| 402 | RexObjectProperties p = GetObject(prim.UUID); | |
| 403 | p.SetRexPrimDataFromLegacyData(prim); | |
| 404 | } | |
| 405 | ||
| 406 | foreach (RexLegacyPrimMaterialData primmat in rexprimmaterialdata) | |
| 407 | { | |
| 408 | RexObjectProperties p = GetObject(primmat.UUID); | |
| 409 | p.RexMaterials.AddMaterial((uint)primmat.MaterialIndex,primmat.MaterialUUID); | |
| 410 | } | |
| 411 | } | |
| 412 | ||
| 413 | } | } |
| 414 | } | } |
|
||||||||
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

