From: <ave...@us...> - 2008-01-19 20:59:48
|
Revision: 4995 http://gemrb.svn.sourceforge.net/gemrb/?rev=4995&view=rev Author: avenger_teambg Date: 2008-01-19 12:57:52 -0800 (Sat, 19 Jan 2008) Log Message: ----------- reimplemented default resource in SetButtonPicture Modified Paths: -------------- gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp Modified: gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp 2008-01-19 20:42:29 UTC (rev 4994) +++ gemrb/trunk/gemrb/plugins/GUIScript/GUIScript.cpp 2008-01-19 20:57:52 UTC (rev 4995) @@ -2727,6 +2727,17 @@ ImageFactory* fact = ( ImageFactory* ) rm->GetFactoryResource( ResRef, IE_BMP_CLASS_ID, IE_NORMAL ); + //if the resource doesn't exist, but we have a default resource + //use this resource + if (!fact && DefResRef) { + fact = ( ImageFactory* ) + rm->GetFactoryResource( DefResRef, IE_BMP_CLASS_ID, IE_NORMAL ); + } + + if (!fact) { + return NULL; + } + Sprite2D* Picture = fact->GetImage(); if (Picture == NULL) { return NULL; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |