CubemapAsset.h
Engine/source/T3D/assets/CubemapAsset.h
Classes:
Public Defines
define
Public Functions
DefineConsoleType(TypeCubemapAssetPtr , CubemapAsset )
Detailed Description
Public Defines
CUBEMAP_ASSET_H()
Public Functions
DefineConsoleType(TypeCubemapAssetPtr , CubemapAsset )
1 2#pragma once 3//----------------------------------------------------------------------------- 4// Copyright (c) 2013 GarageGames, LLC 5// 6// Permission is hereby granted, free of charge, to any person obtaining a copy 7// of this software and associated documentation files (the "Software"), to 8// deal in the Software without restriction, including without limitation the 9// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 10// sell copies of the Software, and to permit persons to whom the Software is 11// furnished to do so, subject to the following conditions: 12// 13// The above copyright notice and this permission notice shall be included in 14// all copies or substantial portions of the Software. 15// 16// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 22// IN THE SOFTWARE. 23//----------------------------------------------------------------------------- 24#ifndef CUBEMAP_ASSET_H 25#define CUBEMAP_ASSET_H 26 27#ifndef _ASSET_BASE_H_ 28#include "assets/assetBase.h" 29#endif 30 31#ifndef _ASSET_DEFINITION_H_ 32#include "assets/assetDefinition.h" 33#endif 34 35#ifndef _STRINGUNIT_H_ 36#include "string/stringUnit.h" 37#endif 38 39#ifndef _ASSET_FIELD_TYPES_H_ 40#include "assets/assetFieldTypes.h" 41#endif 42 43#include "gui/editor/guiInspectorTypes.h" 44 45//----------------------------------------------------------------------------- 46class CubemapAsset : public AssetBase 47{ 48 typedef AssetBase Parent; 49 50 StringTableEntry mComponentName; 51 StringTableEntry mComponentClass; 52 StringTableEntry mFriendlyName; 53 StringTableEntry mComponentType; 54 StringTableEntry mDescription; 55 56 StringTableEntry mScriptFile; 57 58public: 59 CubemapAsset(); 60 virtual ~CubemapAsset(); 61 62 /// Engine. 63 static void initPersistFields(); 64 virtual void copyTo(SimObject* object); 65 66 /// Declare Console Object. 67 DECLARE_CONOBJECT(CubemapAsset); 68 69 StringTableEntry getComponentName() { return mComponentName; } 70 StringTableEntry getComponentClass() { return mComponentClass; } 71 StringTableEntry getFriendlyName() { return mFriendlyName; } 72 StringTableEntry getComponentType() { return mComponentType; } 73 StringTableEntry getDescription() { return mDescription; } 74 75 void setComponentName(StringTableEntry name) { mComponentName = name; } 76 void setComponentClass(StringTableEntry name) { mComponentClass = name; } 77 void setFriendlyName(StringTableEntry name) { mFriendlyName = name; } 78 void setComponentType(StringTableEntry typeName) { mComponentType = typeName; } 79 void setDescription(StringTableEntry description) { mDescription = description; } 80 81 AssetDefinition* getAssetDefinition() { return mpAssetDefinition; } 82 83 void setScriptFile(const char* pScriptFile); 84 inline StringTableEntry getScriptFile(void) const { return mScriptFile; }; 85 86protected: 87 virtual void initializeAsset(void); 88 virtual void onAssetRefresh(void); 89 90 static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast<CubemapAsset*>(obj)->setScriptFile(data); return false; } 91 static const char* getScriptFile(void* obj, const char* data) { return static_cast<CubemapAsset*>(obj)->getScriptFile(); } 92}; 93 94DefineConsoleType(TypeCubemapAssetPtr, CubemapAsset) 95 96//----------------------------------------------------------------------------- 97// TypeAssetId GuiInspectorField Class 98//----------------------------------------------------------------------------- 99class GuiInspectorTypeCubemapAssetPtr : public GuiInspectorTypeFileName 100{ 101 typedef GuiInspectorTypeFileName Parent; 102public: 103 104 GuiBitmapButtonCtrl* mShapeEdButton; 105 106 DECLARE_CONOBJECT(GuiInspectorTypeCubemapAssetPtr); 107 static void consoleInit(); 108 109 virtual GuiControl* constructEditControl(); 110 virtual bool updateRects(); 111}; 112 113#endif // _ASSET_BASE_H_ 114 115