mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-27 00:52:43 +00:00
TextureManager: stopped memory leaks
wsdl: create window at expected size, and retrieve correct mouse coords CStr: not ISerializable (=> not virtual) Game: less excessive complaining, since the original problem seems to be fixed Entity: fixed evaluation order Others: minor comments/etc This was SVN commit r2591.
This commit is contained in:
@@ -96,6 +96,8 @@ void ScriptingHost::RunMemScript(const char* script, size_t size, const char* fi
|
||||
if(!globalObject)
|
||||
globalObject = m_GlobalObject;
|
||||
|
||||
// Maybe TODO: support Unicode input formats?
|
||||
|
||||
jsval rval;
|
||||
JSBool ok = JS_EvaluateScript(m_Context, globalObject, script,
|
||||
(uint)size, filename, line, &rval);
|
||||
@@ -303,6 +305,8 @@ jsval ScriptingHost::GetGlobal(const std::string &globalName)
|
||||
// conversions
|
||||
//----------------------------------------------------------------------------
|
||||
/*
|
||||
// These have been removed in favour of ToPrimitive<int>(value)
|
||||
|
||||
int ScriptingHost::ValueToInt(const jsval value)
|
||||
{
|
||||
int32 i = 0;
|
||||
@@ -330,14 +334,14 @@ bool ScriptingHost::ValueToBool(const jsval value)
|
||||
|
||||
double ScriptingHost::ValueToDouble(const jsval value)
|
||||
{
|
||||
jsdouble d;
|
||||
jsdouble d;
|
||||
|
||||
JSBool ok = JS_ValueToNumber(m_Context, value, &d);
|
||||
JSBool ok = JS_ValueToNumber(m_Context, value, &d);
|
||||
|
||||
if (ok == JS_FALSE || !finite( d ) )
|
||||
throw PSERROR_Scripting_ConversionFailed();
|
||||
if (ok == JS_FALSE || !finite(d))
|
||||
throw PSERROR_Scripting_ConversionFailed();
|
||||
|
||||
return d;
|
||||
return d;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user