forked from 0ad/0ad
Fixed build on Windows
This was SVN commit r6938.
This commit is contained in:
parent
98fe150d1e
commit
9e3b4276f9
@ -27,7 +27,7 @@ fancywater = true
|
|||||||
; vertexshader Use vertex shaders for transform and lighting where possible
|
; vertexshader Use vertex shaders for transform and lighting where possible
|
||||||
; Using 'fixed' instead of 'default' may work around some graphics-related problems,
|
; Using 'fixed' instead of 'default' may work around some graphics-related problems,
|
||||||
; but will reduce performance when a modern graphics card is available.
|
; 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.
|
; 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.
|
; Lower values sharpen/extend, and higher values blur/decrease. Clamped at -3.0 to 3.0.
|
||||||
|
@ -276,6 +276,7 @@ function init(window, bottomWindow)
|
|||||||
}
|
}
|
||||||
|
|
||||||
function updateVariationControl() {
|
function updateVariationControl() {
|
||||||
|
variationControl.freeze();
|
||||||
variationControl.sizer.clear(true);
|
variationControl.sizer.clear(true);
|
||||||
var settings = Atlas.State.objectSettings;
|
var settings = Atlas.State.objectSettings;
|
||||||
var variation = settings.getActorVariation();
|
var variation = settings.getActorVariation();
|
||||||
@ -286,6 +287,9 @@ function init(window, bottomWindow)
|
|||||||
choice.stringSelection = variation[i];
|
choice.stringSelection = variation[i];
|
||||||
variationControl.sizer.add(choice, 0, wxStretch.EXPAND);
|
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();
|
variationControlBox.layout();
|
||||||
variationControl.sizer.layout();
|
variationControl.sizer.layout();
|
||||||
bottomWindow.sizer.layout();
|
bottomWindow.sizer.layout();
|
||||||
|
@ -102,7 +102,11 @@ void FColladaDocument::LoadFromText(const char *text)
|
|||||||
|
|
||||||
if (newText != 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);
|
REQUIRE_SUCCESS(status);
|
||||||
|
@ -48,7 +48,9 @@
|
|||||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||||
#include <boost/preprocessor/repetition/repeat.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)
|
#define FAIL(msg) do { JS_ReportError(cx, msg); return false; } while (false)
|
||||||
|
|
||||||
@ -511,7 +513,10 @@ namespace
|
|||||||
wxLogWarning(_T("%s"), logMessage.c_str());
|
wxLogWarning(_T("%s"), logMessage.c_str());
|
||||||
else
|
else
|
||||||
wxLogError(_T("%s"), logMessage.c_str());
|
wxLogError(_T("%s"), logMessage.c_str());
|
||||||
|
#ifndef _WIN32
|
||||||
|
// When running under Valgrind, print more information in the error message
|
||||||
VALGRIND_PRINTF_BACKTRACE("->");
|
VALGRIND_PRINTF_BACKTRACE("->");
|
||||||
|
#endif
|
||||||
wxPrintf(_T("wxJS %s: %s\n--------\n"), isWarning ? _T("warning") : _T("error"), logMessage.c_str());
|
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)
|
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)
|
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)
|
ScriptInterface::LocalRootScope::LocalRootScope(ScriptInterface& scriptInterface)
|
||||||
: m_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()
|
ScriptInterface::LocalRootScope::~LocalRootScope()
|
||||||
@ -688,7 +693,7 @@ bool ScriptInterface::SetValue_(const wxString& name, jsval val)
|
|||||||
jsval argv[argc] = { jsName, val };
|
jsval argv[argc] = { jsName, val };
|
||||||
jsval rval;
|
jsval rval;
|
||||||
JSBool ok = JS_CallFunctionName(m->m_cx, m->m_glob, "setValue", argc, argv, &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)
|
bool ScriptInterface::GetValue_(const wxString& name, jsval& ret)
|
||||||
@ -697,7 +702,8 @@ bool ScriptInterface::GetValue_(const wxString& name, jsval& ret)
|
|||||||
|
|
||||||
const uintN argc = 1;
|
const uintN argc = 1;
|
||||||
jsval argv[argc] = { jsName };
|
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)
|
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);
|
wxCHECK(JS_HasProperty(m->m_cx, JSVAL_TO_OBJECT(val), name, &found), false);
|
||||||
if (! found)
|
if (! found)
|
||||||
return false;
|
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)
|
bool ScriptInterface::Eval(const wxString& script)
|
||||||
{
|
{
|
||||||
jsval rval;
|
jsval rval;
|
||||||
JSBool ok = JS_EvaluateScript(m->m_cx, m->m_glob, script.mb_str(), script.length(), NULL, 0, &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)
|
bool ScriptInterface::Eval_(const wxString& script, jsval& rval)
|
||||||
{
|
{
|
||||||
JSBool ok = JS_EvaluateScript(m->m_cx, m->m_glob,
|
JSBool ok = JS_EvaluateScript(m->m_cx, m->m_glob,
|
||||||
script.mb_str(), script.length(), NULL, 0, &rval);
|
script.mb_str(), script.length(), NULL, 0, &rval);
|
||||||
return ok;
|
return ok ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ScriptInterface::LoadScript(const wxString& filename, const wxString& code)
|
void ScriptInterface::LoadScript(const wxString& filename, const wxString& code)
|
||||||
|
@ -94,6 +94,8 @@ public:
|
|||||||
bool OK();
|
bool OK();
|
||||||
// Leaves the local root scope
|
// Leaves the local root scope
|
||||||
~LocalRootScope();
|
~LocalRootScope();
|
||||||
|
private:
|
||||||
|
LocalRootScope& operator=(const LocalRootScope&);
|
||||||
};
|
};
|
||||||
#define LOCAL_ROOT_SCOPE LocalRootScope scope(*this); if (! scope.OK()) return false
|
#define LOCAL_ROOT_SCOPE LocalRootScope scope(*this); if (! scope.OK()) return false
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user