~thumper/nux/properties

« back to all changes in this revision

Viewing changes to NuxMesh/NWorldArchiveManager.h

  • Committer: Tim Penhey
  • Date: 2011-06-30 13:45:32 UTC
  • mfrom: (373.1.2 remove-nux-mesh)
  • Revision ID: tim.penhey@canonical.com-20110630134532-7tda1y8mgjp10q4o
Remove old CMakeLists.txt files (no longer using CMake), and removing old NuxMesh code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright 2010 Inalogic® Inc.
3
 
 *
4
 
 * This program is free software: you can redistribute it and/or modify it
5
 
 * under the terms of the GNU Lesser General Public License, as
6
 
 * published by the  Free Software Foundation; either version 2.1 or 3.0
7
 
 * of the License.
8
 
 *
9
 
 * This program is distributed in the hope that it will be useful, but
10
 
 * WITHOUT ANY WARRANTY; without even the implied warranties of
11
 
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
12
 
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
13
 
 * License for more details.
14
 
 *
15
 
 * You should have received a copy of both the GNU Lesser General Public
16
 
 * License along with this program.  If not, see <http://www.gnu.org/licenses/>
17
 
 *
18
 
 * Authored by: Jay Taoko <jaytaoko@inalogic.com>
19
 
 *
20
 
 */
21
 
 
22
 
 
23
 
#ifndef NWORLDARCHIVEMANAGER_H
24
 
#define NWORLDARCHIVEMANAGER_H
25
 
 
26
 
#include "NuxCore/FileManager/NSerializer.h"
27
 
 
28
 
namespace nux
29
 
{
30
 
  class NMeshObject;
31
 
  class N3DWorld;
32
 
 
33
 
  typedef enum
34
 
  {
35
 
    OBJECTTYPE_UNKNOWN  = 0,
36
 
    OBJECTTYPE_MESH,
37
 
    OBJECTTYPE_LIGHT,
38
 
    FORCE_OBJECTTYPE = 0x7fffffff
39
 
  } ObjectType;
40
 
 
41
 
#define WORLDARCHIVE_TAG            NUX_MAKEFOURCHARTAG('i','w','l','d')       // .iwl
42
 
#define WORLDARCHIVE_VERSION        NUX_MAKEFOURCHARTAG('0','0','0','1')
43
 
#define WORLDARCHIVE_END_TAG        NUX_MAKEFOURCHARTAG(0,0,0,0)
44
 
 
45
 
 
46
 
#define STATICMESHARCHIVE_TAG       NUX_MAKEFOURCHARTAG('i','m','s','h')       // .ims
47
 
#define STATICMESHARCHIVE_VERSION   NUX_MAKEFOURCHARTAG('0','0','0','1')
48
 
#define STATICMESHARCHIVE_END_TAG   NUX_MAKEFOURCHARTAG(0,0,0,0)
49
 
 
50
 
 
51
 
  typedef struct
52
 
  {
53
 
    unsigned int ArchiveTag;
54
 
    unsigned int ArchiveFormatVersion;
55
 
// Creation date
56
 
    unsigned int Year;
57
 
    unsigned int Month;
58
 
    unsigned int Day;
59
 
    unsigned int Hour;
60
 
    unsigned int Min;
61
 
    unsigned int Sec;
62
 
    unsigned int MSec;
63
 
  } WorldAchiveHeader;
64
 
 
65
 
  const unsigned int WORLDACHIVEHEADER_SIZE     = 36;
66
 
 
67
 
  class NWorldArchiveManager
68
 
  {
69
 
  public:
70
 
    NWorldArchiveManager();
71
 
    ~NWorldArchiveManager();
72
 
 
73
 
    bool SaveWorldArchiveFile (const TCHAR *WorldArchiveFilename, N3DWorld *World);
74
 
    N3DWorld *LoadWorldArchiveFile (const TCHAR *WorldArchiveFilename);
75
 
 
76
 
    bool SaveStaticMeshFile (const TCHAR *MeshFilename, NMeshObject *Mesh, unsigned int Flags = 0);
77
 
    NMeshObject *LoadStaticMeshFile (const TCHAR *MeshFilename);
78
 
 
79
 
 
80
 
    bool m_isLoaded;
81
 
    nux::NSerializer *m_FileStream;
82
 
    unsigned int m_NumberOfObjects;
83
 
    NString m_CurrentWorldArchive;
84
 
  };
85
 
 
86
 
}
87
 
#endif // NWORLDARCHIVEMANAGER_H