sound_manager->preload("sounds/shoot.wav");
// create a new squirrel table for the sector
- using namespace Scripting;
+ using namespace scripting;
sq_collectgarbage(global_vm);
sq_newtable(global_vm);
sq_pushroottable(global_vm);
if(SQ_FAILED(sq_setdelegate(global_vm, -2)))
- throw Scripting::SquirrelError(global_vm, "Couldn't set sector_table delegate");
+ throw scripting::SquirrelError(global_vm, "Couldn't set sector_table delegate");
sq_resetobject(§or_table);
if(SQ_FAILED(sq_getstackobj(global_vm, -1, §or_table)))
- throw Scripting::SquirrelError(global_vm, "Couldn't get sector table");
+ throw scripting::SquirrelError(global_vm, "Couldn't get sector table");
sq_addref(global_vm, §or_table);
sq_pop(global_vm, 1);
}
Sector::~Sector()
{
- using namespace Scripting;
+ using namespace scripting;
deactivate();
HSQUIRRELVM
Sector::run_script(std::istream& in, const std::string& sourcename)
{
- using namespace Scripting;
+ using namespace scripting;
// garbage collect thread list
for(ScriptList::iterator i = scripts.begin();
_current = this;
// register sectortable as sector in scripting
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushroottable(vm);
sq_pushstring(vm, "sector", -1);
sq_pushobject(vm, sector_table);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't set sector in roottable");
+ throw scripting::SquirrelError(vm, "Couldn't set sector in roottable");
sq_pop(vm, 1);
for(GameObjects::iterator i = gameobjects.begin();
return;
// remove sector entry from global vm
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushroottable(vm);
sq_pushstring(vm, "sector", -1);
if(SQ_FAILED(sq_deleteslot(vm, -2, SQFalse)))
- throw Scripting::SquirrelError(vm, "Couldn't unset sector in roottable");
+ throw scripting::SquirrelError(vm, "Couldn't unset sector in roottable");
sq_pop(vm, 1);
for(GameObjects::iterator i = gameobjects.begin();
{
ScriptInterface* interface = dynamic_cast<ScriptInterface*> (object);
if(interface != NULL) {
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushobject(vm, sector_table);
interface->expose(vm, -1);
sq_pop(vm, 1);
void
Sector::try_expose_me()
{
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushobject(vm, sector_table);
- Scripting::SSector* interface = static_cast<Scripting::SSector*> (this);
+ scripting::SSector* interface = static_cast<scripting::SSector*> (this);
expose_object(vm, -1, interface, "settings", false);
sq_pop(vm, 1);
}
{
ScriptInterface* interface = dynamic_cast<ScriptInterface*> (object);
if(interface != NULL) {
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
SQInteger oldtop = sq_gettop(vm);
sq_pushobject(vm, sector_table);
try {
void
Sector::try_unexpose_me()
{
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
SQInteger oldtop = sq_gettop(vm);
sq_pushobject(vm, sector_table);
try {
- Scripting::unexpose_object(vm, -1, "settings");
+ scripting::unexpose_object(vm, -1, "settings");
} catch(std::exception& e) {
log_warning << "Couldn't unregister object: " << e.what() << std::endl;
}