source: GTP/trunk/App/Demos/Geom/OgreStuff/include/opt/OgreHeightmapTerrainPageSource.h @ 1812

Revision 1812, 2.9 KB checked in by gumbau, 18 years ago (diff)
Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4(Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __HeightmapTerrainPageSource_H__
26#define __HeightmapTerrainPageSource_H__
27
28#include "OgreTerrainPrerequisites.h"
29#include "OgreTerrainPageSource.h"
30#include "OgreImage.h"
31
32namespace Ogre {
33
34    /** Specialisation of the TerrainPageSource class to provide tiles loaded
35        from a 2D greyscale image.
36    @remarks
37        This is a simple tile provider that does not support paging; it is
38        assumed that the entire heightmap is loaded as one page.
39    */
40    class _OgreTerrainExport HeightmapTerrainPageSource : public TerrainPageSource
41    {
42    protected:
43        /// Is this input RAW?
44        bool mIsRaw;
45        /// Should we flip terrain vertically?
46        bool mFlipTerrain;
47        /// Image containing the source heightmap if loaded from non-RAW
48        Image mImage;
49        /// Arbitrary data loaded from RAW
50        MemoryDataStreamPtr mRawData;
51        /// The (single) terrain page this source will provide
52        TerrainPage* mPage;
53        /// Source file name
54        String mSource;
55        /// Manual size if source is RAW
56        size_t mRawSize;
57        /// Manual bpp if source is RAW
58        uchar mRawBpp;
59       
60        /// Load a heightmap
61        void loadHeightmap(void);
62    public:
63        HeightmapTerrainPageSource();
64        ~HeightmapTerrainPageSource();
65        /// @see TerrainPageSource
66        void shutdown(void);
67        /// @see TerrainPageSource
68        void requestPage(ushort x, ushort y);
69        /// @see TerrainPageSource
70        void expirePage(ushort x, ushort y);
71        /// @see TerrainPageSource
72        void initialise(TerrainSceneManager* tsm,
73            ushort tileSize, ushort pageSize, bool asyncLoading,
74            TerrainPageSourceOptionList& optionList);
75    };
76}
77
78#endif
Note: See TracBrowser for help on using the repository browser.