⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ogrepaginglandscapetexture.cpp

📁 使用stl技术,(还没看,是听说的)
💻 CPP
字号:
/***************************************************************************
OgrePagingLandScapeTexture.cpp  -  description
-------------------
begin                : Fri Apr 16 2004
copyright            : (C) 2003 by Jose A Milan
email                : spoke@supercable.es
***************************************************************************/

/***************************************************************************
*                                                                         *
*   This program is free software; you can redistribute it and/or modify  *
*   it under the terms of the GNU Lesser General Public License as published by  *
*   the Free Software Foundation; either version 2 of the License, or     *
*   (at your option) any later version.                                   *
*                                                                         *
***************************************************************************/

#include "OgreVector3.h"
#include "OgreColourValue.h"

#include "OgreStringConverter.h"
#include "OgreMaterialManager.h"
#include "OgreTextureManager.h"
#include "OgreTechnique.h"
#include "OgrePass.h"

#include "OgrePagingLandScapeTexture.h"

namespace Ogre
{

//-----------------------------------------------------------------------
PagingLandScapeTexture::PagingLandScapeTexture()
{
	mIsLoaded = false;
	mDataX = 0;
	mDataZ = 0;
	// get default material
	mMaterial = 0;//reinterpret_cast<Material *>(MaterialManager::getSingleton().getByName("BaseWhite"));
}

//-----------------------------------------------------------------------
PagingLandScapeTexture::~PagingLandScapeTexture()
{
	mIsLoaded = false;
	if ( mMaterial != 0 )
	{
		//TODO: Check this
/*
		if ( mMaterial->isLoaded() )
		{
			mMaterial->unload();
		}
*/
		mMaterial = 0;
	}
}

//-----------------------------------------------------------------------
void PagingLandScapeTexture::load(uint mX, uint mZ)
{
	mDataX = mX;
	mDataZ = mZ;
	_loadMaterial();
	mIsLoaded = true;
}

//-----------------------------------------------------------------------
void PagingLandScapeTexture::unload()
{
	mIsLoaded = false;
	_unloadMaterial();
}

//-----------------------------------------------------------------------
bool PagingLandScapeTexture::isLoaded()
{
	return mIsLoaded;
}

//-----------------------------------------------------------------------
Material* PagingLandScapeTexture::getMaterial()
{
	return mMaterial;
}

} //namespace

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -