mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Added D3D error code interpreter
Added sanity check for findMatch Finished most of asset importer logic to utilize settings system Cleaned up code for finding associated files Added General importer settings category and integrated logic for those settings fields Updated logic in variableGroup to support callbacks in custom fields Updated logic in variableInspector to better handle callbacks, as well as being able to manually update when manipulating fields Updated scripts to utilize project settings values for playGUI and mainMenuGUI names Improved module-oriented loading of materials Added util function for populating custom fonts
This commit is contained in:
parent
02262b014a
commit
ab9fc302fc
19 changed files with 620 additions and 598 deletions
|
|
@ -100,6 +100,9 @@ inline bool IsCharMatch( char e, char s, bool caseSensitive )
|
|||
|
||||
bool FindMatch::isMatch( const char *exp, const char *str, bool caseSensitive )
|
||||
{
|
||||
if (str == NULL || exp == NULL)
|
||||
return false;
|
||||
|
||||
while ( *str && ( *exp != '*' ) )
|
||||
{
|
||||
if ( !IsCharMatch( *exp++, *str++, caseSensitive ) )
|
||||
|
|
|
|||
|
|
@ -1764,3 +1764,76 @@ void GFXD3D11Device::setDebugMarker(ColorI color, const char *name)
|
|||
D3DPERF_SetMarker(D3DCOLOR_ARGB(color.alpha, color.red, color.green, color.blue),
|
||||
(LPCWSTR)&eventName);
|
||||
}
|
||||
|
||||
const char* GFXD3D11Device::interpretDebugResult(long result)
|
||||
{
|
||||
const char* error;
|
||||
|
||||
switch (result) {
|
||||
case S_OK:
|
||||
error = "S_OK";
|
||||
break;
|
||||
case S_FALSE:
|
||||
error = "S_FALSE";
|
||||
break;
|
||||
//generics
|
||||
case E_UNEXPECTED:
|
||||
error = "E_UNEXPECTED";
|
||||
break;
|
||||
case E_NOTIMPL:
|
||||
error = "E_NOTIMPL";
|
||||
break;
|
||||
case E_OUTOFMEMORY:
|
||||
error = "E_OUTOFMEMORY";
|
||||
break;
|
||||
case E_INVALIDARG:
|
||||
error = "E_INVALIDARG";
|
||||
break;
|
||||
case E_NOINTERFACE:
|
||||
error = "E_NOINTERFACE";
|
||||
break;
|
||||
case E_POINTER:
|
||||
error = "E_POINTER";
|
||||
break;
|
||||
case E_HANDLE:
|
||||
error = "E_HANDLE";
|
||||
break;
|
||||
case E_ABORT:
|
||||
error = "E_ABORT";
|
||||
break;
|
||||
case E_FAIL:
|
||||
error = "E_FAIL";
|
||||
break;
|
||||
case E_ACCESSDENIED:
|
||||
error = "E_ACCESSDENIED";
|
||||
break;
|
||||
|
||||
//graphics specific
|
||||
case DXGI_ERROR_INVALID_CALL:
|
||||
error = "DXGI_ERROR_INVALID_CALL";
|
||||
break;
|
||||
case DXGI_ERROR_WAS_STILL_DRAWING:
|
||||
error = "DXGI_ERROR_WAS_STILL_DRAWING";
|
||||
break;
|
||||
|
||||
//dx11 specific
|
||||
case D3D11_ERROR_FILE_NOT_FOUND:
|
||||
error = "D3D11_ERROR_FILE_NOT_FOUND";
|
||||
break;
|
||||
case D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS:
|
||||
error = "D3D11_ERROR_TOO_MANY_UNIQUE_STATE_OBJECTS";
|
||||
break;
|
||||
case D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS:
|
||||
error = "D3D11_ERROR_TOO_MANY_UNIQUE_VIEW_OBJECTS";
|
||||
break;
|
||||
case D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD:
|
||||
error = "D3D11_ERROR_DEFERRED_CONTEXT_MAP_WITHOUT_INITIAL_DISCARD";
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
error = "UNKNOWN";
|
||||
break;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -325,6 +325,7 @@ public:
|
|||
// grab the sampler map
|
||||
const SamplerMap &getSamplersMap() const { return mSamplersMap; }
|
||||
SamplerMap &getSamplersMap(){ return mSamplersMap; }
|
||||
const char* interpretDebugResult(long result);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ GFXD3D11StateBlock::GFXD3D11StateBlock(const GFXStateBlockDesc& desc)
|
|||
|
||||
if (FAILED(hr))
|
||||
{
|
||||
AssertFatal(false, "GFXD3D11StateBlock::GFXD3D11StateBlock - CreateBlendState call failure.");
|
||||
AssertFatal(false, avar("GFXD3D11StateBlock::GFXD3D11StateBlock - CreateBlendState call failure: %s.", GFX->interpretDebugResult(hr)));
|
||||
}
|
||||
|
||||
ZeroMemory(&mDepthStencilDesc, sizeof(D3D11_DEPTH_STENCIL_DESC));
|
||||
|
|
|
|||
|
|
@ -428,7 +428,7 @@ public:
|
|||
virtual void enterDebugEvent(ColorI color, const char *name) = 0;
|
||||
virtual void leaveDebugEvent() = 0;
|
||||
virtual void setDebugMarker(ColorI color, const char *name) = 0;
|
||||
|
||||
virtual const char* interpretDebugResult(long result) { return "Not Implemented"; };
|
||||
/// @}
|
||||
|
||||
/// @name Resource debug methods
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ public:
|
|||
const U32 getNumVertexStreams() const { return mNumVertexStream; }
|
||||
|
||||
bool glUseMap() const { return mUseGlMap; }
|
||||
|
||||
const char* interpretDebugResult(long result) { return "Not Implemented"; };
|
||||
protected:
|
||||
/// Called by GFXDevice to create a device specific stateblock
|
||||
virtual GFXStateBlockRef createStateBlockInternal(const GFXStateBlockDesc& desc);
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ bool GuiInspectorVariableGroup::inspectGroup()
|
|||
|
||||
Con::executef(this, "onConstructField", mFields[i]->mFieldName,
|
||||
mFields[i]->mFieldLabel, mFields[i]->mFieldTypeName, mFields[i]->mFieldDescription,
|
||||
mFields[i]->mDefaultValue, mFields[i]->mDataValues, mFields[i]->mOwnerObject);
|
||||
mFields[i]->mDefaultValue, mFields[i]->mDataValues, mFields[i]->mSetCallbackName, mFields[i]->mOwnerObject);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
#include "gui/editor/inspector/variableInspector.h"
|
||||
#include "console/engineAPI.h"
|
||||
|
||||
GuiVariableInspector::GuiVariableInspector()
|
||||
GuiVariableInspector::GuiVariableInspector() : mAutoUpdate(true)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -117,7 +117,7 @@ void GuiVariableInspector::endGroup()
|
|||
}
|
||||
|
||||
void GuiVariableInspector::addField(const char* name, const char* label, const char* typeName, const char* description,
|
||||
const char* defaultValue, const char* dataValues, SimObject* ownerObj)
|
||||
const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj)
|
||||
{
|
||||
VariableField newField;
|
||||
newField.mFieldName = StringTable->insert(name);
|
||||
|
|
@ -127,7 +127,7 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
|
|||
newField.mDefaultValue = StringTable->insert(defaultValue);
|
||||
newField.mDataValues = String(dataValues);
|
||||
newField.mGroup = mCurrentGroup;
|
||||
newField.mSetCallbackName = StringTable->EmptyString();
|
||||
newField.mSetCallbackName = StringTable->insert(callbackName);
|
||||
newField.mEnabled = true;
|
||||
|
||||
newField.mOwnerObject = ownerObj;
|
||||
|
|
@ -184,18 +184,14 @@ void GuiVariableInspector::addField(const char* name, const char* label, const c
|
|||
|
||||
mFields.push_back(newField);
|
||||
|
||||
update();
|
||||
if(mAutoUpdate)
|
||||
update();
|
||||
}
|
||||
|
||||
void GuiVariableInspector::addCallbackField(const char* name, const char* label, const char* typeName, const char* description,
|
||||
const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj)
|
||||
{
|
||||
addField(name, label, typeName, description, defaultValue, dataValues, ownerObj);
|
||||
|
||||
//Add the callback name
|
||||
mFields.last().mSetCallbackName = StringTable->insert(callbackName);
|
||||
|
||||
update();
|
||||
addField(name, label, typeName, description, defaultValue, dataValues, callbackName, ownerObj);
|
||||
}
|
||||
|
||||
void GuiVariableInspector::clearFields()
|
||||
|
|
@ -238,7 +234,7 @@ DefineEngineMethod(GuiVariableInspector, addField, void, (const char* name, cons
|
|||
if (name == "" || typeName == "")
|
||||
return;
|
||||
|
||||
object->addField(name, label, typeName, description, defaultValue, dataValues, ownerObj);
|
||||
object->addField(name, label, typeName, description, defaultValue, dataValues, "", ownerObj);
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiVariableInspector, addCallbackField, void, (const char* name, const char* label, const char* typeName,
|
||||
|
|
@ -270,3 +266,8 @@ DefineEngineMethod( GuiVariableInspector, loadVars, void, ( const char * searchS
|
|||
{
|
||||
object->loadVars( searchString );
|
||||
}
|
||||
|
||||
DefineEngineMethod(GuiVariableInspector, setAutoUpdate, void, (bool doAutoUpdate), (true), "setAutoUpdate( doAutoUpdate ) - Dictates if the inspector automatically updates when changes happen, or if it must be called manually")
|
||||
{
|
||||
object->setAutoUpdate(doAutoUpdate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,18 +53,22 @@ public:
|
|||
void endGroup();
|
||||
|
||||
void addField(const char* name, const char* label, const char* typeName, const char* description,
|
||||
const char* defaultValue, const char* dataValues, SimObject* ownerObj);
|
||||
const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj);
|
||||
void addCallbackField(const char* name, const char* label, const char* typeName, const char* description,
|
||||
const char* defaultValue, const char* dataValues, const char* callbackName, SimObject* ownerObj);
|
||||
void setFieldEnabled(const char* name, bool enabled);
|
||||
void clearFields();
|
||||
|
||||
void setAutoUpdate(bool doAutoUpdate) { mAutoUpdate = doAutoUpdate; }
|
||||
|
||||
protected:
|
||||
|
||||
Vector<VariableField> mFields;
|
||||
|
||||
String mCurrentGroup;
|
||||
|
||||
bool mAutoUpdate;
|
||||
|
||||
};
|
||||
|
||||
#endif // _GUI_VARIABLEINSPECTOR_H_
|
||||
Loading…
Add table
Add a link
Reference in a new issue