mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
dedicated server nulltexturemanager work
also supress warning for imageassets not loading a texture in nulldevice, and early out of _determineFeatures shadergen methods under the same conditions
This commit is contained in:
parent
02aee76fc9
commit
04f4a5fcf4
4 changed files with 17 additions and 3 deletions
|
|
@ -48,6 +48,8 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "assetMacroHelpers.h"
|
#include "assetMacroHelpers.h"
|
||||||
|
|
||||||
|
#include "gfx/gfxDevice.h"
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
class ImageAsset : public AssetBase
|
class ImageAsset : public AssetBase
|
||||||
{
|
{
|
||||||
|
|
@ -250,7 +252,8 @@ public: \
|
||||||
}\
|
}\
|
||||||
else if (!m##name)\
|
else if (!m##name)\
|
||||||
{\
|
{\
|
||||||
Con::errorf("%s(%s)::_set%s() - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), _in);\
|
if (GFX->getAdapterType() != NullDevice)\
|
||||||
|
Con::errorf("%s(%s)::_set%s() - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), _in);\
|
||||||
return false;\
|
return false;\
|
||||||
}\
|
}\
|
||||||
return true;\
|
return true;\
|
||||||
|
|
@ -392,7 +395,8 @@ public: \
|
||||||
}\
|
}\
|
||||||
else if (!m##name[index])\
|
else if (!m##name[index])\
|
||||||
{\
|
{\
|
||||||
Con::errorf("%s(%s)::_set%s(%i) - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), index, _in);\
|
if (GFX->getAdapterType() != NullDevice)\
|
||||||
|
Con::errorf("%s(%s)::_set%s(%i) - Couldn't load image \"%s\"", macroText(className), getName(), macroText(name), index, _in);\
|
||||||
return false; \
|
return false; \
|
||||||
}\
|
}\
|
||||||
return true;\
|
return true;\
|
||||||
|
|
|
||||||
|
|
@ -87,8 +87,16 @@ GFXNullTextureObject::GFXNullTextureObject(GFXDevice * aDevice, GFXTextureProfil
|
||||||
|
|
||||||
class GFXNullTextureManager : public GFXTextureManager
|
class GFXNullTextureManager : public GFXTextureManager
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
GFXTextureObject* createTexture(GBitmap* bmp, const String& resourceName, GFXTextureProfile* profile, bool deleteBmp) { return nullptr; } // _createNullTextureObject();}
|
||||||
|
GFXTextureObject* createTexture(DDSFile* dds, GFXTextureProfile* profile, bool deleteDDS) { return nullptr; }
|
||||||
|
GFXTextureObject* createTexture(const Torque::Path& path, GFXTextureProfile* profile) { return nullptr; }
|
||||||
|
GFXTextureObject* createTexture(U32 width, U32 height, void* pixels, GFXFormat format, GFXTextureProfile* profile) { return nullptr; }
|
||||||
|
GFXTextureObject* createTexture(U32 width, U32 height, U32 depth, GFXFormat format, GFXTextureProfile* profile, U32 numMipLevels = 1) { return nullptr; }
|
||||||
|
GFXTextureObject* createTexture(U32 width, U32 height, GFXFormat format, GFXTextureProfile* profile, U32 numMipLevels, S32 antialiasLevel) { return nullptr; }
|
||||||
|
GFXTextureObject* createCompositeTexture(GBitmap* bmp[4], U32 inputKey[4], const String& resourceName, GFXTextureProfile* profile, bool deleteBmp) { return nullptr; }
|
||||||
protected:
|
protected:
|
||||||
virtual GFXTextureObject *_createTextureObject( U32 height,
|
GFXTextureObject *_createTextureObject( U32 height,
|
||||||
U32 width,
|
U32 width,
|
||||||
U32 depth,
|
U32 depth,
|
||||||
GFXFormat format,
|
GFXFormat format,
|
||||||
|
|
|
||||||
|
|
@ -295,6 +295,7 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum,
|
||||||
MaterialFeatureData &fd,
|
MaterialFeatureData &fd,
|
||||||
const FeatureSet &features )
|
const FeatureSet &features )
|
||||||
{
|
{
|
||||||
|
if (GFX->getAdapterType() == NullDevice) return;
|
||||||
PROFILE_SCOPE( ProcessedShaderMaterial_DetermineFeatures );
|
PROFILE_SCOPE( ProcessedShaderMaterial_DetermineFeatures );
|
||||||
|
|
||||||
const F32 shaderVersion = GFX->getPixelShaderVersion();
|
const F32 shaderVersion = GFX->getPixelShaderVersion();
|
||||||
|
|
|
||||||
|
|
@ -593,6 +593,7 @@ void ProcessedDeferredMaterial::_determineFeatures( U32 stageNum,
|
||||||
MaterialFeatureData &fd,
|
MaterialFeatureData &fd,
|
||||||
const FeatureSet &features )
|
const FeatureSet &features )
|
||||||
{
|
{
|
||||||
|
if (GFX->getAdapterType() == NullDevice) return;
|
||||||
Parent::_determineFeatures( stageNum, fd, features );
|
Parent::_determineFeatures( stageNum, fd, features );
|
||||||
if (fd.features.hasFeature(MFT_ForwardShading))
|
if (fd.features.hasFeature(MFT_ForwardShading))
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue