Support new SpiderMonkey API.

wposix: Define int8_t compatibly with SpiderMonkey.
Remove unused camera, lightenv JS interfaces.
Remove most of vector JS interface.
Remove some of the redundant JS string conversion functions.
Remove unneeded vmem, _lodBias functions.
Clean up some formatting.

This was SVN commit r8629.
This commit is contained in:
Ykkrosh
2010-11-16 23:00:52 +00:00
parent 9c521ceb3b
commit bd3bd084c0
83 changed files with 1125 additions and 2149 deletions
+37 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2009 Wildfire Games.
/* Copyright (C) 2010 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -29,10 +29,10 @@
class CScriptVal
{
public:
CScriptVal() : m_Val(0) { }
CScriptVal() : m_Val(JSVAL_VOID) { }
CScriptVal(jsval val) : m_Val(val) { }
jsval get() const { return m_Val; }
const jsval& get() const { return m_Val; }
private:
jsval m_Val;
@@ -45,14 +45,48 @@ public:
CScriptValRooted(JSContext* cx, jsval val);
CScriptValRooted(JSContext* cx, CScriptVal val);
/**
* Returns the current value (or JSVAL_VOID if uninitialised).
*/
jsval get() const;
/**
* Returns reference to the current value.
* Fails if the value is not yet initialised.
*/
jsval& getRef() const;
/**
* Returns whether the value is uninitialised or is JSVAL_VOID.
*/
bool undefined() const;
/**
* Returns whether the value is uninitialised.
*/
bool uninitialised() const;
private:
boost::shared_ptr<jsval> m_Val;
};
/**
* RAII wrapper for JSIdArray*
*/
class AutoJSIdArray
{
NONCOPYABLE(AutoJSIdArray);
public:
AutoJSIdArray(JSContext* cx, JSIdArray* ida);
~AutoJSIdArray();
JSIdArray* get() const;
size_t length() const;
jsid operator[](size_t i) const;
private:
JSContext* m_Context;
JSIdArray* m_IdArray;
};
#endif // INCLUDED_SCRIPTVAL