[657] | 1 | /*
|
---|
| 2 | -----------------------------------------------------------------------------
|
---|
| 3 | This source file is part of OGRE
|
---|
| 4 | (Object-oriented Graphics Rendering Engine)
|
---|
| 5 | For the latest info, see http://www.ogre3d.org/
|
---|
| 6 |
|
---|
| 7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
| 8 | Also see acknowledgements in Readme.html
|
---|
| 9 |
|
---|
| 10 | This program is free software; you can redistribute it and/or modify it under
|
---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
| 13 | version.
|
---|
| 14 |
|
---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
| 18 |
|
---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
| 22 | http://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 |
|
---|
| 32 | namespace 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
|
---|