PostEffectAsset.h
Engine/source/T3D/assets/PostEffectAsset.h
Classes:
class
Public Defines
define
Public Functions
DefineConsoleType(TypePostEffectAssetPtr , PostEffectAsset )
Detailed Description
Public Defines
POSTEFFECT_ASSET_H()
Public Functions
DefineConsoleType(TypePostEffectAssetPtr , PostEffectAsset )
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 POSTEFFECT_ASSET_H 25#define POSTEFFECT_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 "postFx/postEffect.h" 44 45//----------------------------------------------------------------------------- 46class PostEffectAsset : public AssetBase 47{ 48 typedef AssetBase Parent; 49 50 StringTableEntry mScriptFile; 51 StringTableEntry mHLSLShaderFile; 52 StringTableEntry mGLSLShaderFile; 53 54 StringTableEntry mScriptPath; 55 StringTableEntry mHLSLShaderPath; 56 StringTableEntry mGLSLShaderPath; 57 58public: 59 PostEffectAsset(); 60 virtual ~PostEffectAsset(); 61 62 /// Engine. 63 static void initPersistFields(); 64 virtual void copyTo(SimObject* object); 65 66 void setScriptFile(const char* pScriptFile); 67 inline StringTableEntry getScriptFile(void) const { return mScriptFile; }; 68 69 void setHLSLShaderFile(const char* pShaderFile); 70 inline StringTableEntry getHLSLShaderFile(void) const { return mHLSLShaderFile; }; 71 void setGLSLShaderFile(const char* pShaderFile); 72 inline StringTableEntry getGLSLShaderFile(void) const { return mGLSLShaderFile; }; 73 74 inline StringTableEntry getScriptPath(void) const { return mScriptPath; }; 75 inline StringTableEntry getHLSLShaderPath(void) const { return mHLSLShaderPath; }; 76 inline StringTableEntry getGLSLShaderPath(void) const { return mGLSLShaderPath; }; 77 78 /// Declare Console Object. 79 DECLARE_CONOBJECT(PostEffectAsset); 80 81protected: 82 virtual void initializeAsset(); 83 virtual void onAssetRefresh(void); 84 85 static bool setScriptFile(void *obj, const char *index, const char *data) { static_cast<PostEffectAsset*>(obj)->setScriptFile(data); return false; } 86 static const char* getScriptFile(void* obj, const char* data) { return static_cast<PostEffectAsset*>(obj)->getScriptFile(); } 87 88 static bool setHLSLShaderFile(void* obj, const char* index, const char* data) { static_cast<PostEffectAsset*>(obj)->setHLSLShaderFile(data); return false; } 89 static const char* getHLSLShaderFile(void* obj, const char* data) { return static_cast<PostEffectAsset*>(obj)->getHLSLShaderFile(); } 90 static bool setGLSLShaderFile(void* obj, const char* index, const char* data) { static_cast<PostEffectAsset*>(obj)->setGLSLShaderFile(data); return false; } 91 static const char* getGLSLShaderFile(void* obj, const char* data) { return static_cast<PostEffectAsset*>(obj)->getGLSLShaderFile(); } 92}; 93 94DefineConsoleType(TypePostEffectAssetPtr, PostEffectAsset) 95 96#endif // _ASSET_BASE_H_ 97 98