Fixed build on Windows

This was SVN commit r6938.
This commit is contained in:
Ykkrosh 2009-07-02 14:04:59 +00:00
parent 98fe150d1e
commit 9e3b4276f9
5 changed files with 28 additions and 11 deletions

View File

@ -27,7 +27,7 @@ fancywater = true
; vertexshader Use vertex shaders for transform and lighting where possible
; Using 'fixed' instead of 'default' may work around some graphics-related problems,
; but will reduce performance when a modern graphics card is available.
renderpath = vertexshader
renderpath = default
; Adjusts how OpenGL calculates mipmap level of detail. 0.0f is the default (blurry) value.
; Lower values sharpen/extend, and higher values blur/decrease. Clamped at -3.0 to 3.0.

View File

@ -276,6 +276,7 @@ function init(window, bottomWindow)
}
function updateVariationControl() {
variationControl.freeze();
variationControl.sizer.clear(true);
var settings = Atlas.State.objectSettings;
var variation = settings.getActorVariation();
@ -286,6 +287,9 @@ function init(window, bottomWindow)
choice.stringSelection = variation[i];
variationControl.sizer.add(choice, 0, wxStretch.EXPAND);
}
// TODO: this sizer stuff is a bit dodgy - it often doesn't quite
// update the sizes and scrollbars at the right points
variationControl.thaw();
variationControlBox.layout();
variationControl.sizer.layout();
bottomWindow.sizer.layout();

View File

@ -102,7 +102,11 @@ void FColladaDocument::LoadFromText(const char *text)
if (newText != text)
{
xmlFree((void*)newText);
// It'd be nice to use xmlFree, but for some reason (?) it causes
// linker errors in MSVC. So get access to it an ugly way:
xmlFreeFunc freeFunc;
xmlMemGet(&freeFunc, NULL, NULL, NULL);
freeFunc((void*)newText);
}
REQUIRE_SUCCESS(status);

View File

@ -48,7 +48,9 @@
#include <boost/preprocessor/punctuation/comma_if.hpp>
#include <boost/preprocessor/repetition/repeat.hpp>
#include <valgrind/valgrind.h>
#ifndef _WIN32
# include <valgrind/valgrind.h>
#endif
#define FAIL(msg) do { JS_ReportError(cx, msg); return false; } while (false)
@ -511,7 +513,10 @@ namespace
wxLogWarning(_T("%s"), logMessage.c_str());
else
wxLogError(_T("%s"), logMessage.c_str());
#ifndef _WIN32
// When running under Valgrind, print more information in the error message
VALGRIND_PRINTF_BACKTRACE("->");
#endif
wxPrintf(_T("wxJS %s: %s\n--------\n"), isWarning ? _T("warning") : _T("error"), logMessage.c_str());
}
@ -654,18 +659,18 @@ JSContext* ScriptInterface::GetContext()
bool ScriptInterface::AddRoot(void* ptr)
{
return JS_AddRoot(m->m_cx, ptr);
return JS_AddRoot(m->m_cx, ptr) ? true : false;
}
bool ScriptInterface::RemoveRoot(void* ptr)
{
return JS_RemoveRoot(m->m_cx, ptr);
return JS_RemoveRoot(m->m_cx, ptr) ? true : false;
}
ScriptInterface::LocalRootScope::LocalRootScope(ScriptInterface& scriptInterface)
: m_ScriptInterface(scriptInterface)
{
m_OK = JS_EnterLocalRootScope(m_ScriptInterface.m->m_cx);
m_OK = JS_EnterLocalRootScope(m_ScriptInterface.m->m_cx) ? true : false;
}
ScriptInterface::LocalRootScope::~LocalRootScope()
@ -688,7 +693,7 @@ bool ScriptInterface::SetValue_(const wxString& name, jsval val)
jsval argv[argc] = { jsName, val };
jsval rval;
JSBool ok = JS_CallFunctionName(m->m_cx, m->m_glob, "setValue", argc, argv, &rval);
return ok;
return ok ? true : false;
}
bool ScriptInterface::GetValue_(const wxString& name, jsval& ret)
@ -697,7 +702,8 @@ bool ScriptInterface::GetValue_(const wxString& name, jsval& ret)
const uintN argc = 1;
jsval argv[argc] = { jsName };
return JS_CallFunctionName(m->m_cx, m->m_glob, "getValue", argc, argv, &ret);
JSBool ok = JS_CallFunctionName(m->m_cx, m->m_glob, "getValue", argc, argv, &ret);
return ok ? true : false;
}
bool ScriptInterface::CallFunction(jsval val, const char* name)
@ -718,21 +724,22 @@ bool ScriptInterface::CallFunction_(jsval val, const char* name, std::vector<jsv
wxCHECK(JS_HasProperty(m->m_cx, JSVAL_TO_OBJECT(val), name, &found), false);
if (! found)
return false;
return JS_CallFunctionName(m->m_cx, JSVAL_TO_OBJECT(val), name, argc, argv, &ret);
JSBool ok = JS_CallFunctionName(m->m_cx, JSVAL_TO_OBJECT(val), name, argc, argv, &ret);
return ok ? true : false;
}
bool ScriptInterface::Eval(const wxString& script)
{
jsval rval;
JSBool ok = JS_EvaluateScript(m->m_cx, m->m_glob, script.mb_str(), script.length(), NULL, 0, &rval);
return ok;
return ok ? true : false;
}
bool ScriptInterface::Eval_(const wxString& script, jsval& rval)
{
JSBool ok = JS_EvaluateScript(m->m_cx, m->m_glob,
script.mb_str(), script.length(), NULL, 0, &rval);
return ok;
return ok ? true : false;
}
void ScriptInterface::LoadScript(const wxString& filename, const wxString& code)

View File

@ -94,6 +94,8 @@ public:
bool OK();
// Leaves the local root scope
~LocalRootScope();
private:
LocalRootScope& operator=(const LocalRootScope&);
};
#define LOCAL_ROOT_SCOPE LocalRootScope scope(*this); if (! scope.OK()) return false