COMMAND cd ${SUPERTUX_SOURCE_DIR} && ${CMAKE_CXX_COMPILER}
ARGS -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o ${SUPERTUX_BINARY_DIR}/miniswig.tmp -I${SUPERTUX_SOURCE_DIR}/src
COMMAND tools/miniswig/miniswig
- ARGS --input miniswig.tmp --output-cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp --output-hpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp --module supertux --select-namespace Scripting
+ ARGS --input miniswig.tmp --output-cpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.cpp --output-hpp ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.hpp --module supertux --select-namespace scripting
DEPENDS tools/miniswig/miniswig
IMPLICIT_DEPENDS CXX ${SUPERTUX_SOURCE_DIR}/src/scripting/wrapper.interface.hpp
)
self.build_tinygettext()
self.build_binreloc()
self.build_findlocale()
+ self.build_miniswig()
self.build_supertux()
self.build_tests()
-
+
def build_tinygettext(self):
env = Environment(CPPPATH=[".", "src"])
env.ParseConfig("sdl-config --libs --cflags")
Glob("external/squirrel/sqstdlib/*.cpp") +
Glob("external/squirrel/sqstdlib/*.c"))
+ def build_miniswig(self):
+ env = Environment(CPPPATH=[".", "tools/miniswig/"])
+ miniswig_bin = env.Program('miniswig',
+ ['tools/miniswig/parser.yy',
+ 'tools/miniswig/lexer.ll',
+ 'tools/miniswig/create_docu.cpp',
+ 'tools/miniswig/xmlwriter.cpp',
+ 'tools/miniswig/create_wrapper.cpp',
+ 'tools/miniswig/main.cpp',
+ 'tools/miniswig/tree.cpp'])
+
+ # env = self.env.Clone()
+ # env.Append(MINISWIG=miniswig_bin)
+
+ # env.Depends(env.Command('src/scripting/miniswig.tmp', 'src/scripting/wrapper.interface.hpp',
+ # ["$CXX -E -Isrc/ -x c -CC $SOURCE -o $TARGET -DSCRIPTING_API"]),
+ # ['src/scripting/interface.hpp',
+ # 'src/scripting/game_objects.hpp'])
+
+ # env.Depends(env.Command(['src/scripting/wrapper.cpp', 'src/scripting/wrapper.hpp'], 'src/scripting/miniswig.tmp',
+ # ["$MINISWIG --input $SOURCE --output-cpp ${TARGETS[0]} --output-hpp ${TARGETS[1]} "+
+ # "--module windstille --select-namespace Scripting"]),
+ # miniswig_bin)
+
+ # g++ -x "c++" -E -CC -DSCRIPTING_API src/scripting/wrapper.interface.hpp -o miniswig.tmp -Isrc
+ # tools/miniswig/miniswig --input miniswig.tmp \
+ # --output-cpp src/scripting/wrapper.cpp \
+ # --output-hpp src/scripting/wrapper.hpp \
+ # --module supertux \
+ # --select-namespace scripting
+
def build_supertux(self):
self.env = Environment(CPPPATH=["external/squirrel/include/",
"external/findlocale/",
"src/",
"/usr/include/AL/", # yuck
"."],
- CXXFLAGS=["-O0", "-g3",
+ CXXFLAGS=["-O2", "-g3",
"-ansi",
"-pedantic",
"-Wall",
"-Wextra",
"-Wnon-virtual-dtor",
- # "-Weffc++",
+ "-Weffc++",
# "-Wconversion",
"-Werror",
# "-Wshadow",
* implement PNG screenshot
+* GL_ARB_texture_non_power_of_two returns 1 on MatroxG450, while it
+ returns "Missing" in glew info, something wrong
+
+SuperTux Editor
+===============
+
+* +/- zoom buttons do not zoom to the center of the screen
+
+* Object Tool should behave more like Inkscape:
+
+ - LMB on an object to select
+ - LMB on the background to start a select-rectangle
+ - LMB+move to drag objects it around
+ - Shift+LMB to add an object to the selection
+ - RMB for context menu
+
+* Select Tool should be removed (identical to Object Tool)
+
+* replace tool crashes:
+
+ Note: Applications can use GLib.ExceptionManager.UnhandledException to handle the exception.
+System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
+ at System.Collections.Generic.Dictionary`2[System.Object,System.Single].get_Item (System.Object key) [0x00000]
+ at LayerListWidget.VisibilityDataFunc (Gtk.TreeViewColumn Column, Gtk.CellRenderer Renderer, TreeModel Model, TreeIter Iter) [0x00000]
+ at GtkSharp.TreeCellDataFuncWrapper.NativeCallback (IntPtr tree_column, IntPtr cell, IntPtr tree_model, IntPtr iter, IntPtr data) [0x00000]
+ at GLib.ExceptionManager.RaiseUnhandledException(System.Exception e, Boolean is_terminal)
+ at GtkSharp.TreeCellDataFuncWrapper.NativeCallback(IntPtr tree_column, IntPtr cell, IntPtr tree_model, IntPtr iter, IntPtr data)
+ at Gtk.Application.gtk_main()
+ at Gtk.Application.Run()
+ at Application.Main(System.String[] args)
+
+* Replace Tool should document its functions in a status bar message
+
+* Path Tool doesn't seem to do anything
+
+* Tiles Tool doesn't display the current tile
+
# EOF #
return;
std::cout << "Expose me '" << name << "'\n";
- Scripting::WillOWisp* interface = static_cast<Scripting::WillOWisp*> (this);
+ scripting::WillOWisp* interface = static_cast<scripting::WillOWisp*> (this);
expose_object(vm, table_idx, interface, name);
}
return;
std::cout << "UnExpose me '" << name << "'\n";
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
IMPLEMENT_FACTORY(WillOWisp, "willowisp");
#include "supertux/script_interface.hpp"
class WillOWisp : public BadGuy,
- public Scripting::WillOWisp,
+ public scripting::WillOWisp,
public ScriptInterface
{
public:
void
AmbientSound::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
- Scripting::AmbientSound* interface = static_cast<Scripting::AmbientSound*> (this);
+ scripting::AmbientSound* interface = static_cast<scripting::AmbientSound*> (this);
expose_object(vm, table_idx, interface, name, false);
}
void
AmbientSound::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
class AmbientSound : public GameObject,
public ScriptInterface,
- public Scripting::AmbientSound
+ public scripting::AmbientSound
{
public:
AmbientSound(const Reader& lisp);
Camera::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if(name.empty()) return;
- Scripting::Camera* interface = new Scripting::Camera(this);
+ scripting::Camera* interface = new scripting::Camera(this);
expose_object(vm, table_idx, interface, name, true);
}
Camera::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if(name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
Candle::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::Candle* interface = new Scripting::Candle(this);
+ scripting::Candle* interface = new scripting::Candle(this);
expose_object(vm, table_idx, interface, name, true);
}
Candle::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
DisplayEffect::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- expose_object(vm, table_idx, dynamic_cast<Scripting::DisplayEffect *>(this), name, false);
+ expose_object(vm, table_idx, dynamic_cast<scripting::DisplayEffect *>(this), name, false);
}
void
DisplayEffect::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
#include "supertux/script_interface.hpp"
class DisplayEffect : public GameObject,
- public Scripting::DisplayEffect,
+ public scripting::DisplayEffect,
public ScriptInterface
{
public:
LevelTime::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::LevelTime* interface = new Scripting::LevelTime(this);
+ scripting::LevelTime* interface = new scripting::LevelTime(this);
expose_object(vm, table_idx, interface, name, true);
}
LevelTime::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
Platform::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::Platform* interface = new Scripting::Platform(this);
+ scripting::Platform* interface = new scripting::Platform(this);
expose_object(vm, table_idx, interface, name, true);
}
Platform::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
IMPLEMENT_FACTORY(Platform, "platform");
if (name.empty())
return;
- Scripting::expose_object(vm, table_idx, dynamic_cast<Scripting::Player *>(this), name, false);
+ scripting::expose_object(vm, table_idx, dynamic_cast<scripting::Player *>(this), name, false);
}
void
if (name.empty())
return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
float
physic.set_velocity_y(-300);
}
-//Scripting Functions Below
+//scripting Functions Below
void
Player::deactivate()
class PlayerStatus;
class Player : public MovingObject,
- public Scripting::Player,
+ public scripting::Player,
public ScriptInterface
{
public:
ScriptedObject::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- expose_object(vm, table_idx, dynamic_cast<Scripting::ScriptedObject *>(this), name, false);
+ expose_object(vm, table_idx, dynamic_cast<scripting::ScriptedObject *>(this), name, false);
}
void
ScriptedObject::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
#include "supertux/script_interface.hpp"
class ScriptedObject : public MovingSprite,
- public Scripting::ScriptedObject,
+ public scripting::ScriptedObject,
public ScriptInterface
{
public:
void collision_solid(const CollisionHit& hit);
HitResponse collision(GameObject& other, const CollisionHit& hit);
- // --- Scripting Interface stuff ---
+ // --- scripting Interface stuff ---
void set_action(const std::string& animation);
std::string get_action();
if (name.empty())
return;
- Scripting::expose_object(vm, table_idx, dynamic_cast<Scripting::Text *>(this), name, false);
+ scripting::expose_object(vm, table_idx, dynamic_cast<scripting::Text *>(this), name, false);
}
void
if (name.empty())
return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
/** A text object intended for scripts that want to tell a story */
class TextObject : public GameObject,
- public Scripting::Text,
+ public scripting::Text,
public ScriptInterface
{
static Color default_color;
Thunderstorm::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name == "") return;
- Scripting::Thunderstorm* interface = new Scripting::Thunderstorm(this);
+ scripting::Thunderstorm* interface = new scripting::Thunderstorm(this);
expose_object(vm, table_idx, interface, name, true);
}
Thunderstorm::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name == "") return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
TileMap::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::TileMap* interface = new Scripting::TileMap(this);
+ scripting::TileMap* interface = new scripting::TileMap(this);
expose_object(vm, table_idx, interface, name, true);
}
TileMap::unexpose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name.empty()) return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
if (name == "")
return;
- Scripting::Wind* interface = new Scripting::Wind(this);
+ scripting::Wind* interface = new scripting::Wind(this);
expose_object(vm, table_idx, interface, name, true);
}
if (name == "")
return;
- Scripting::unexpose_object(vm, table_idx, name);
+ scripting::unexpose_object(vm, table_idx, name);
}
void
#ifndef HEADER_SUPERTUX_SCRIPTING_AMBIENT_SOUND_HPP
#define HEADER_SUPERTUX_SCRIPTING_AMBIENT_SOUND_HPP
-namespace Scripting {
+namespace scripting {
class AmbientSound
{
#ifndef HEADER_SUPERTUX_SCRIPTING_ANCHOR_POINTS_HPP
#define HEADER_SUPERTUX_SCRIPTING_ANCHOR_POINTS_HPP
-namespace Scripting {
+namespace scripting {
// TODO get these from the definitions in anchor.h (needs miniswig update)
static const int ANCHOR_TOP = 0x0010;
#define NOIMPL log_fatal << __FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
Camera::Camera(::Camera* camera)
: camera(camera)
{ }
typedef Camera _Camera;
#endif
-namespace Scripting {
+namespace scripting {
class Camera
{
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
Candle::Candle(::Candle* candle)
: candle(candle)
typedef Candle _Candle;
#endif
-namespace Scripting {
+namespace scripting {
class Candle
{
#ifndef HEADER_SUPERTUX_SCRIPTING_DISPLAY_EFFECT_HPP
#define HEADER_SUPERTUX_SCRIPTING_DISPLAY_EFFECT_HPP
-namespace Scripting {
+namespace scripting {
class DisplayEffect
{
#include "supertux/sector.hpp"
#include "worldmap/worldmap.hpp"
-namespace Scripting {
+namespace scripting {
FloatingImage::FloatingImage(const std::string& spritefile) :
floating_image()
{
- using namespace WorldMapNS;
+ using namespace worldmap;
floating_image = new _FloatingImage(spritefile);
if(Sector::current() != NULL) {
typedef FloatingImage _FloatingImage;
#endif
-namespace Scripting {
+namespace scripting {
class FloatingImage
{
#include "scripting/squirrel_util.hpp"
#include "scripting/time_scheduler.hpp"
-namespace Scripting {
+namespace scripting {
SQInteger display(HSQUIRRELVM vm)
{
void load_worldmap(const std::string& filename)
{
- using namespace WorldMapNS;
+ using namespace worldmap;
g_screen_manager->push_screen(new WorldMap(filename));
}
void debug_worldmap_ghost(bool enable)
{
- using namespace WorldMapNS;
+ using namespace worldmap;
if(WorldMap::current() == NULL)
throw std::runtime_error("Can't change ghost mode without active WorldMap");
void save_state()
{
- using namespace WorldMapNS;
+ using namespace worldmap;
if(World::current() == NULL || WorldMap::current() == NULL)
throw std::runtime_error("Can't save state without active World");
void update_worldmap()
{
- using namespace WorldMapNS;
+ using namespace worldmap;
if(WorldMap::current() == NULL)
throw std::runtime_error("Can't update Worldmap: none active");
void grease()
{
if (!validate_sector_player()) return;
- ::Player* tux = Sector::current()->player; // Scripting::Player != ::Player
+ ::Player* tux = Sector::current()->player; // scripting::Player != ::Player
tux->get_physic().set_velocity_x(tux->get_physic().get_velocity_x()*3);
}
#define __custom(x)
#endif
-namespace Scripting {
+namespace scripting {
/**
* Display the value of the argument. This is useful for inspecting tables.
*/
void play_demo(const std::string& filename);
-} // namespace Scripting
+} // namespace scripting
#endif
#include "supertux/flip_level_transformer.hpp"
#include "supertux/game_session.hpp"
-namespace Scripting {
+namespace scripting {
void
Level_finish(bool win)
{
#ifndef HEADER_SUPERTUX_SCRIPTING_LEVEL_HPP
#define HEADER_SUPERTUX_SCRIPTING_LEVEL_HPP
-namespace Scripting {
+namespace scripting {
/** Instantly finish the currently played level */
void Level_finish(bool win);
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
LevelTime::LevelTime(::LevelTime* level_time)
: level_time(level_time)
typedef LevelTime _LevelTime;
#endif
-namespace Scripting {
+namespace scripting {
class LevelTime
{
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
Platform::Platform(::Platform* platform)
: platform(platform)
typedef Platform _Platform;
#endif
-namespace Scripting {
+namespace scripting {
class Platform
{
#include <string>
#endif
-namespace Scripting {
+namespace scripting {
class Player
{
#ifndef HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP
#define HEADER_SUPERTUX_SCRIPTING_SCRIPTED_OBJECT_HPP
-namespace Scripting {
+namespace scripting {
class ScriptedObject
{
#include "lisp/list_iterator.hpp"
#include "scripting/squirrel_error.hpp"
-namespace Scripting {
+namespace scripting {
void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const Reader& lisp)
{
}
if(SQ_FAILED(sq_createslot(vm, table_idx)))
- throw Scripting::SquirrelError(vm, "Couldn't create new index");
+ throw scripting::SquirrelError(vm, "Couldn't create new index");
}
}
sq_pop(vm, 1);
}
-} // namespace Scripting
+} // namespace scripting
/* EOF */
#include "util/writer_fwd.hpp"
#include "util/reader_fwd.hpp"
-namespace Scripting {
+namespace scripting {
void save_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, Writer& writer);
void load_squirrel_table(HSQUIRRELVM vm, SQInteger table_idx, const Reader& lisp);
-} // namespace Scripting
+} // namespace scripting
#endif
#include "scripting/squirrel_error.hpp"
#include <sstream>
-namespace Scripting {
+namespace scripting {
SquirrelError::SquirrelError(HSQUIRRELVM v, const std::string& message) throw() :
message()
#include <squirrel.h>
#include <stdexcept>
-namespace Scripting {
+namespace scripting {
/** Exception class for squirrel errors, it takes a squirrelvm and uses
* sq_geterror() to retrieve additional information about the last error that
static HSQREMOTEDBG debugger = NULL;
#endif
-namespace Scripting {
+namespace scripting {
HSQUIRRELVM global_vm = NULL;
try {
std::string filename = "scripts/default.nut";
IFileStream stream(filename);
- Scripting::compile_and_run(global_vm, stream, filename);
+ scripting::compile_and_run(global_vm, stream, filename);
} catch(std::exception& e) {
log_warning << "Couldn't load default.nut: " << e.what() << std::endl;
}
sq_pushstring(vm, name, -1);
sq_pushfloat(vm, val);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't add float value to table");
+ throw scripting::SquirrelError(vm, "Couldn't add float value to table");
}
void store_int(HSQUIRRELVM vm, const char* name, int val)
sq_pushstring(vm, name, -1);
sq_pushinteger(vm, val);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't add int value to table");
+ throw scripting::SquirrelError(vm, "Couldn't add int value to table");
}
void store_string(HSQUIRRELVM vm, const char* name, const std::string& val)
sq_pushstring(vm, name, -1);
sq_pushstring(vm, val.c_str(), val.length());
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't add float value to table");
+ throw scripting::SquirrelError(vm, "Couldn't add float value to table");
}
void store_bool(HSQUIRRELVM vm, const char* name, bool val)
sq_pushstring(vm, name, -1);
sq_pushbool(vm, val ? SQTrue : SQFalse);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't add float value to table");
+ throw scripting::SquirrelError(vm, "Couldn't add float value to table");
}
bool has_float(HSQUIRRELVM vm, const char* name)
if(SQ_FAILED(sq_get(vm, -2))) {
std::ostringstream msg;
msg << "Couldn't get float value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
float result;
if(SQ_FAILED(sq_getfloat(vm, -1, &result))) {
std::ostringstream msg;
msg << "Couldn't get float value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
sq_pop(vm, 1);
if(SQ_FAILED(sq_get(vm, -2))) {
std::ostringstream msg;
msg << "Couldn't get int value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
SQInteger result;
if(SQ_FAILED(sq_getinteger(vm, -1, &result))) {
std::ostringstream msg;
msg << "Couldn't get int value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
sq_pop(vm, 1);
if(SQ_FAILED(sq_get(vm, -2))) {
std::ostringstream msg;
msg << "Couldn't get string value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
const char* result;
if(SQ_FAILED(sq_getstring(vm, -1, &result))) {
std::ostringstream msg;
msg << "Couldn't get string value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
sq_pop(vm, 1);
if(SQ_FAILED(sq_get(vm, -2))) {
std::ostringstream msg;
msg << "Couldn't get bool value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
SQBool result;
if(SQ_FAILED(sq_getbool(vm, -1, &result))) {
std::ostringstream msg;
msg << "Couldn't get bool value for '" << name << "' from table";
- throw Scripting::SquirrelError(vm, msg.str());
+ throw scripting::SquirrelError(vm, msg.str());
}
sq_pop(vm, 1);
#include "scripting/squirrel_error.hpp"
#include "scripting/wrapper.hpp"
-namespace Scripting {
+namespace scripting {
extern HSQUIRRELVM global_vm;
const std::string& name, bool free = false)
{
sq_pushstring(v, name.c_str(), -1);
- Scripting::create_squirrel_instance(v, object, free);
+ scripting::create_squirrel_instance(v, object, free);
if(table_idx < 0)
table_idx -= 2;
if(SQ_FAILED(sq_createslot(v, table_idx))) {
std::ostringstream msg;
msg << "Couldn't register object '" << name << "' in squirrel table";
- throw Scripting::SquirrelError(v, msg.str());
+ throw scripting::SquirrelError(v, msg.str());
}
}
if(SQ_FAILED(sq_deleteslot(v, table_idx, SQFalse))) {
std::ostringstream msg;
msg << "Couldn't unregister object '" << name << "' in squirrel root table";
- throw Scripting::SquirrelError(v, msg.str());
+ throw scripting::SquirrelError(v, msg.str());
}
}
-// SuperTux - Sector Scripting
+// SuperTux - Sector scripting
// Copyright (C) 2006 Wolfgang Becker <uafr@gmx.de>
//
// This program is free software: you can redistribute it and/or modify
#ifndef HEADER_SUPERTUX_SCRIPTING_SSECTOR_HPP
#define HEADER_SUPERTUX_SCRIPTING_SSECTOR_HPP
-namespace Scripting {
+namespace scripting {
class SSector
{
#ifndef HEADER_SUPERTUX_SCRIPTING_TEXT_HPP
#define HEADER_SUPERTUX_SCRIPTING_TEXT_HPP
-namespace Scripting {
+namespace scripting {
class Text
{
#include "scripting/squirrel_util.hpp"
#include "util/log.hpp"
-namespace Scripting
+namespace scripting
{
ThreadQueue::ThreadQueue() :
#include <squirrel.h>
#include <vector>
-namespace Scripting {
+namespace scripting {
/**
* Keeps a list of SquirrelThreads that wait for a wakeup event
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
Thunderstorm::Thunderstorm(::Thunderstorm* thunderstorm)
: thunderstorm(thunderstorm)
typedef Thunderstorm _Thunderstorm;
#endif
-namespace Scripting {
+namespace scripting {
class Thunderstorm
{
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
TileMap::TileMap(::TileMap* tilemap)
: tilemap(tilemap)
typedef TileMap _TileMap;
#endif
-namespace Scripting {
+namespace scripting {
class TileMap
{
#include "scripting/time_scheduler.hpp"
#include "util/log.hpp"
-namespace Scripting {
+namespace scripting {
TimeScheduler* TimeScheduler::instance = NULL;
#include <vector>
-namespace Scripting {
+namespace scripting {
/**
* This class keeps a list of squirrel threads that are scheduled for a certain
#ifndef HEADER_SUPERTUX_SCRIPTING_WILLOWISP_HPP
#define HEADER_SUPERTUX_SCRIPTING_WILLOWISP_HPP
-namespace Scripting {
+namespace scripting {
class WillOWisp
{
#define NOIMPL log_fatal << __PRETTY_FUNCTION__ << " not implemented."
-namespace Scripting {
+namespace scripting {
Wind::Wind(::Wind* wind)
: wind(wind)
typedef Wind _Wind;
#endif
-namespace Scripting {
+namespace scripting {
class Wind
{
#endif
};
-} // namespace Scripting
+} // namespace scripting
#endif
#include "scripting/squirrel_error.hpp"
#include "scripting/wrapper.interface.hpp"
-namespace Scripting {
-namespace Wrapper {
+namespace scripting {
+namespace wrapper {
static SQInteger AmbientSound_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (ptr);
+ scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'set_pos' called without instance"));
return SQ_ERROR;
}
- Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
+ scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
return SQ_ERROR;
}
- Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
+ scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
try {
float return_value = _this->get_pos_x();
sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
return SQ_ERROR;
}
- Scripting::AmbientSound* _this = reinterpret_cast<Scripting::AmbientSound*> (data);
+ scripting::AmbientSound* _this = reinterpret_cast<scripting::AmbientSound*> (data);
try {
float return_value = _this->get_pos_y();
static SQInteger Camera_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (ptr);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'reload_config' called without instance"));
return SQ_ERROR;
}
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
try {
_this->reload_config();
sq_throwerror(vm, _SC("'shake' called without instance"));
return SQ_ERROR;
}
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_pos' called without instance"));
return SQ_ERROR;
}
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_mode' called without instance"));
return SQ_ERROR;
}
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'scroll_to' called without instance"));
return SQ_ERROR;
}
- Scripting::Camera* _this = reinterpret_cast<Scripting::Camera*> (data);
+ scripting::Camera* _this = reinterpret_cast<scripting::Camera*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
static SQInteger Candle_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (ptr);
+ scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'get_burning' called without instance"));
return SQ_ERROR;
}
- Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
+ scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
try {
bool return_value = _this->get_burning();
sq_throwerror(vm, _SC("'set_burning' called without instance"));
return SQ_ERROR;
}
- Scripting::Candle* _this = reinterpret_cast<Scripting::Candle*> (data);
+ scripting::Candle* _this = reinterpret_cast<scripting::Candle*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
static SQInteger DisplayEffect_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (ptr);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'fade_out' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'fade_in' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_black' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'is_black' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
try {
bool return_value = _this->is_black();
sq_throwerror(vm, _SC("'sixteen_to_nine' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'four_to_three' called without instance"));
return SQ_ERROR;
}
- Scripting::DisplayEffect* _this = reinterpret_cast<Scripting::DisplayEffect*> (data);
+ scripting::DisplayEffect* _this = reinterpret_cast<scripting::DisplayEffect*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
static SQInteger FloatingImage_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (ptr);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (ptr);
delete _this;
return 0;
}
}
try {
- Scripting::FloatingImage* _this = new Scripting::FloatingImage(arg0);
+ scripting::FloatingImage* _this = new scripting::FloatingImage(arg0);
if(SQ_FAILED(sq_setinstanceup(vm, 1, _this))) {
sq_throwerror(vm, _SC("Couldn't setup instance of 'FloatingImage' class"));
return SQ_ERROR;
sq_throwerror(vm, _SC("'set_layer' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'get_layer' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
int return_value = _this->get_layer();
sq_throwerror(vm, _SC("'set_pos' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
float return_value = _this->get_pos_x();
sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
float return_value = _this->get_pos_y();
sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
int return_value = _this->get_anchor_point();
sq_throwerror(vm, _SC("'set_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'get_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
bool return_value = _this->get_visible();
sq_throwerror(vm, _SC("'set_action' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'get_action' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
try {
std::string return_value = _this->get_action();
sq_throwerror(vm, _SC("'fade_in' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'fade_out' called without instance"));
return SQ_ERROR;
}
- Scripting::FloatingImage* _this = reinterpret_cast<Scripting::FloatingImage*> (data);
+ scripting::FloatingImage* _this = reinterpret_cast<scripting::FloatingImage*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
static SQInteger LevelTime_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (ptr);
+ scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'start' called without instance"));
return SQ_ERROR;
}
- Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+ scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
try {
_this->start();
sq_throwerror(vm, _SC("'stop' called without instance"));
return SQ_ERROR;
}
- Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+ scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
try {
_this->stop();
sq_throwerror(vm, _SC("'get_time' called without instance"));
return SQ_ERROR;
}
- Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+ scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
try {
float return_value = _this->get_time();
sq_throwerror(vm, _SC("'set_time' called without instance"));
return SQ_ERROR;
}
- Scripting::LevelTime* _this = reinterpret_cast<Scripting::LevelTime*> (data);
+ scripting::LevelTime* _this = reinterpret_cast<scripting::LevelTime*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
static SQInteger Platform_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (ptr);
+ scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'goto_node' called without instance"));
return SQ_ERROR;
}
- Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
+ scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'start_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
+ scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
try {
_this->start_moving();
sq_throwerror(vm, _SC("'stop_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::Platform* _this = reinterpret_cast<Scripting::Platform*> (data);
+ scripting::Platform* _this = reinterpret_cast<scripting::Platform*> (data);
try {
_this->stop_moving();
static SQInteger Player_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (ptr);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'add_bonus' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'add_coins' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'make_invincible' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->make_invincible();
sq_throwerror(vm, _SC("'deactivate' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->deactivate();
sq_throwerror(vm, _SC("'activate' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->activate();
sq_throwerror(vm, _SC("'walk' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'get_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
bool return_value = _this->get_visible();
sq_throwerror(vm, _SC("'kill' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'set_ghost_mode' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'get_ghost_mode' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
bool return_value = _this->get_ghost_mode();
sq_throwerror(vm, _SC("'do_cheer' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->do_cheer();
sq_throwerror(vm, _SC("'do_duck' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->do_duck();
sq_throwerror(vm, _SC("'do_standup' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->do_standup();
sq_throwerror(vm, _SC("'do_backflip' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
try {
_this->do_backflip();
sq_throwerror(vm, _SC("'do_jump' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'trigger_sequence' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'use_scripting_controller' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'do_scripting_controller' called without instance"));
return SQ_ERROR;
}
- Scripting::Player* _this = reinterpret_cast<Scripting::Player*> (data);
+ scripting::Player* _this = reinterpret_cast<scripting::Player*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
static SQInteger ScriptedObject_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (ptr);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'set_action' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'get_action' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
std::string return_value = _this->get_action();
sq_throwerror(vm, _SC("'move' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_pos' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
float return_value = _this->get_pos_x();
sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
float return_value = _this->get_pos_y();
sq_throwerror(vm, _SC("'set_velocity' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_velocity_x' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
float return_value = _this->get_velocity_x();
sq_throwerror(vm, _SC("'get_velocity_y' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
float return_value = _this->get_velocity_y();
sq_throwerror(vm, _SC("'set_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'is_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
bool return_value = _this->is_visible();
sq_throwerror(vm, _SC("'set_solid' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'is_solid' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
bool return_value = _this->is_solid();
sq_throwerror(vm, _SC("'get_name' called without instance"));
return SQ_ERROR;
}
- Scripting::ScriptedObject* _this = reinterpret_cast<Scripting::ScriptedObject*> (data);
+ scripting::ScriptedObject* _this = reinterpret_cast<scripting::ScriptedObject*> (data);
try {
std::string return_value = _this->get_name();
static SQInteger SSector_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (ptr);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'set_ambient_light' called without instance"));
return SQ_ERROR;
}
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_ambient_red' called without instance"));
return SQ_ERROR;
}
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
try {
float return_value = _this->get_ambient_red();
sq_throwerror(vm, _SC("'get_ambient_green' called without instance"));
return SQ_ERROR;
}
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
try {
float return_value = _this->get_ambient_green();
sq_throwerror(vm, _SC("'get_ambient_blue' called without instance"));
return SQ_ERROR;
}
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
try {
float return_value = _this->get_ambient_blue();
sq_throwerror(vm, _SC("'set_gravity' called without instance"));
return SQ_ERROR;
}
- Scripting::SSector* _this = reinterpret_cast<Scripting::SSector*> (data);
+ scripting::SSector* _this = reinterpret_cast<scripting::SSector*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
static SQInteger Text_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (ptr);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'set_text' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'set_font' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'fade_in' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'fade_out' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_visible' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'set_centered' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQBool arg0;
if(SQ_FAILED(sq_getbool(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a bool"));
sq_throwerror(vm, _SC("'set_pos' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_pos_x' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
try {
float return_value = _this->get_pos_x();
sq_throwerror(vm, _SC("'get_pos_y' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
try {
float return_value = _this->get_pos_y();
sq_throwerror(vm, _SC("'set_anchor_point' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'get_anchor_point' called without instance"));
return SQ_ERROR;
}
- Scripting::Text* _this = reinterpret_cast<Scripting::Text*> (data);
+ scripting::Text* _this = reinterpret_cast<scripting::Text*> (data);
try {
int return_value = _this->get_anchor_point();
static SQInteger Thunderstorm_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (ptr);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'start' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->start();
sq_throwerror(vm, _SC("'stop' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->stop();
sq_throwerror(vm, _SC("'thunder' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->thunder();
sq_throwerror(vm, _SC("'lightning' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->lightning();
sq_throwerror(vm, _SC("'flash' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->flash();
sq_throwerror(vm, _SC("'electrify' called without instance"));
return SQ_ERROR;
}
- Scripting::Thunderstorm* _this = reinterpret_cast<Scripting::Thunderstorm*> (data);
+ scripting::Thunderstorm* _this = reinterpret_cast<scripting::Thunderstorm*> (data);
try {
_this->electrify();
static SQInteger TileMap_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (ptr);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'goto_node' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'start_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
try {
_this->start_moving();
sq_throwerror(vm, _SC("'stop_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
try {
_this->stop_moving();
sq_throwerror(vm, _SC("'fade' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'set_alpha' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
SQFloat arg0;
if(SQ_FAILED(sq_getfloat(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a float"));
sq_throwerror(vm, _SC("'get_alpha' called without instance"));
return SQ_ERROR;
}
- Scripting::TileMap* _this = reinterpret_cast<Scripting::TileMap*> (data);
+ scripting::TileMap* _this = reinterpret_cast<scripting::TileMap*> (data);
try {
float return_value = _this->get_alpha();
static SQInteger WillOWisp_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (ptr);
+ scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'goto_node' called without instance"));
return SQ_ERROR;
}
- Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+ scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
SQInteger arg0;
if(SQ_FAILED(sq_getinteger(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not an integer"));
sq_throwerror(vm, _SC("'set_state' called without instance"));
return SQ_ERROR;
}
- Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+ scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
const SQChar* arg0;
if(SQ_FAILED(sq_getstring(vm, 2, &arg0))) {
sq_throwerror(vm, _SC("Argument 1 not a string"));
sq_throwerror(vm, _SC("'start_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+ scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
try {
_this->start_moving();
sq_throwerror(vm, _SC("'stop_moving' called without instance"));
return SQ_ERROR;
}
- Scripting::WillOWisp* _this = reinterpret_cast<Scripting::WillOWisp*> (data);
+ scripting::WillOWisp* _this = reinterpret_cast<scripting::WillOWisp*> (data);
try {
_this->stop_moving();
static SQInteger Wind_release_hook(SQUserPointer ptr, SQInteger )
{
- Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (ptr);
+ scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (ptr);
delete _this;
return 0;
}
sq_throwerror(vm, _SC("'start' called without instance"));
return SQ_ERROR;
}
- Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
+ scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
try {
_this->start();
sq_throwerror(vm, _SC("'stop' called without instance"));
return SQ_ERROR;
}
- Scripting::Wind* _this = reinterpret_cast<Scripting::Wind*> (data);
+ scripting::Wind* _this = reinterpret_cast<scripting::Wind*> (data);
try {
_this->stop();
static SQInteger display_wrapper(HSQUIRRELVM vm)
{
- return Scripting::display(vm);
+ return scripting::display(vm);
}
static SQInteger print_stacktrace_wrapper(HSQUIRRELVM vm)
HSQUIRRELVM arg0 = vm;
try {
- Scripting::print_stacktrace(arg0);
+ scripting::print_stacktrace(arg0);
return 0;
static SQInteger get_current_thread_wrapper(HSQUIRRELVM vm)
{
- return Scripting::get_current_thread(vm);
+ return scripting::get_current_thread(vm);
}
static SQInteger display_text_file_wrapper(HSQUIRRELVM vm)
}
try {
- Scripting::display_text_file(arg0);
+ scripting::display_text_file(arg0);
return 0;
}
try {
- Scripting::load_worldmap(arg0);
+ scripting::load_worldmap(arg0);
return 0;
}
try {
- Scripting::load_level(arg0);
+ scripting::load_level(arg0);
return 0;
}
try {
- Scripting::wait(arg0, static_cast<float> (arg1));
+ scripting::wait(arg0, static_cast<float> (arg1));
return sq_suspendvm(vm);
HSQUIRRELVM arg0 = vm;
try {
- Scripting::wait_for_screenswitch(arg0);
+ scripting::wait_for_screenswitch(arg0);
return sq_suspendvm(vm);
(void) vm;
try {
- Scripting::exit_screen();
+ scripting::exit_screen();
return 0;
}
try {
- Scripting::fadeout_screen(static_cast<float> (arg0));
+ scripting::fadeout_screen(static_cast<float> (arg0));
return 0;
}
try {
- Scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
+ scripting::shrink_screen(static_cast<float> (arg0), static_cast<float> (arg1), static_cast<float> (arg2));
return 0;
(void) vm;
try {
- Scripting::abort_screenfade();
+ scripting::abort_screenfade();
return 0;
}
try {
- std::string return_value = Scripting::translate(arg0);
+ std::string return_value = scripting::translate(arg0);
sq_pushstring(vm, return_value.c_str(), return_value.size());
return 1;
}
try {
- Scripting::import(arg0, arg1);
+ scripting::import(arg0, arg1);
return 0;
(void) vm;
try {
- Scripting::save_state();
+ scripting::save_state();
return 0;
(void) vm;
try {
- Scripting::update_worldmap();
+ scripting::update_worldmap();
return 0;
}
try {
- Scripting::debug_collrects(arg0 == SQTrue);
+ scripting::debug_collrects(arg0 == SQTrue);
return 0;
}
try {
- Scripting::debug_show_fps(arg0 == SQTrue);
+ scripting::debug_show_fps(arg0 == SQTrue);
return 0;
}
try {
- Scripting::debug_draw_solids_only(arg0 == SQTrue);
+ scripting::debug_draw_solids_only(arg0 == SQTrue);
return 0;
}
try {
- Scripting::debug_worldmap_ghost(arg0 == SQTrue);
+ scripting::debug_worldmap_ghost(arg0 == SQTrue);
return 0;
}
try {
- Scripting::play_music(arg0);
+ scripting::play_music(arg0);
return 0;
}
try {
- Scripting::play_sound(arg0);
+ scripting::play_sound(arg0);
return 0;
}
try {
- Scripting::set_game_speed(static_cast<float> (arg0));
+ scripting::set_game_speed(static_cast<float> (arg0));
return 0;
(void) vm;
try {
- Scripting::grease();
+ scripting::grease();
return 0;
(void) vm;
try {
- Scripting::invincible();
+ scripting::invincible();
return 0;
(void) vm;
try {
- Scripting::ghost();
+ scripting::ghost();
return 0;
(void) vm;
try {
- Scripting::mortal();
+ scripting::mortal();
return 0;
(void) vm;
try {
- Scripting::restart();
+ scripting::restart();
return 0;
(void) vm;
try {
- Scripting::whereami();
+ scripting::whereami();
return 0;
(void) vm;
try {
- Scripting::gotoend();
+ scripting::gotoend();
return 0;
(void) vm;
try {
- Scripting::camera();
+ scripting::camera();
return 0;
}
try {
- Scripting::set_gamma(static_cast<float> (arg0));
+ scripting::set_gamma(static_cast<float> (arg0));
return 0;
(void) vm;
try {
- Scripting::quit();
+ scripting::quit();
return 0;
{
try {
- int return_value = Scripting::rand();
+ int return_value = scripting::rand();
sq_pushinteger(vm, return_value);
return 1;
}
try {
- Scripting::record_demo(arg0);
+ scripting::record_demo(arg0);
return 0;
}
try {
- Scripting::play_demo(arg0);
+ scripting::play_demo(arg0);
return 0;
}
try {
- Scripting::Level_finish(arg0 == SQTrue);
+ scripting::Level_finish(arg0 == SQTrue);
return 0;
}
try {
- Scripting::Level_spawn(arg0, arg1);
+ scripting::Level_spawn(arg0, arg1);
return 0;
(void) vm;
try {
- Scripting::Level_flip_vertically();
+ scripting::Level_flip_vertically();
return 0;
(void) vm;
try {
- Scripting::Level_toggle_pause();
+ scripting::Level_toggle_pause();
return 0;
}
try {
- Scripting::Level_edit(arg0 == SQTrue);
+ scripting::Level_edit(arg0 == SQTrue);
return 0;
}
-} // end of namespace Wrapper
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook)
+} // namespace wrapper
+void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "AmbientSound", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Camera", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Candle", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "DisplayEffect", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "FloatingImage", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "LevelTime", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Platform", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Player", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "ScriptedObject", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "SSector", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Text", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Thunderstorm", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "TileMap", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "WillOWisp", -1);
sq_remove(v, -2); // remove root table
}
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook)
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushroottable(v);
sq_pushstring(v, "Wind", -1);
void register_supertux_wrapper(HSQUIRRELVM v)
{
- using namespace Wrapper;
+ using namespace wrapper;
sq_pushstring(v, "ANCHOR_TOP", -1);
sq_pushinteger(v, 16);
}
-} // end of namespace Scripting
+} // namespace scripting
/* EOF */
#ifndef HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP
#define HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP
-namespace Scripting {
+namespace scripting {
void register_supertux_wrapper(HSQUIRRELVM v);
class AmbientSound;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::AmbientSound* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::AmbientSound* object, bool setup_releasehook = false);
class Camera;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Camera* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Camera* object, bool setup_releasehook = false);
class Candle;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Candle* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Candle* object, bool setup_releasehook = false);
class DisplayEffect;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::DisplayEffect* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::DisplayEffect* object, bool setup_releasehook = false);
class FloatingImage;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::FloatingImage* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::FloatingImage* object, bool setup_releasehook = false);
class LevelTime;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::LevelTime* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::LevelTime* object, bool setup_releasehook = false);
class Platform;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Platform* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Platform* object, bool setup_releasehook = false);
class Player;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Player* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Player* object, bool setup_releasehook = false);
class ScriptedObject;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::ScriptedObject* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::ScriptedObject* object, bool setup_releasehook = false);
class SSector;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::SSector* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::SSector* object, bool setup_releasehook = false);
class Text;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Text* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Text* object, bool setup_releasehook = false);
class Thunderstorm;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Thunderstorm* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Thunderstorm* object, bool setup_releasehook = false);
class TileMap;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::TileMap* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::TileMap* object, bool setup_releasehook = false);
class WillOWisp;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::WillOWisp* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::WillOWisp* object, bool setup_releasehook = false);
class Wind;
-void create_squirrel_instance(HSQUIRRELVM v, Scripting::Wind* object, bool setup_releasehook = false);
+void create_squirrel_instance(HSQUIRRELVM v, scripting::Wind* object, bool setup_releasehook = false);
}
Color text_color(1.0,1.0,0.6);
}
-namespace WorldMapNS {
+namespace worldmap {
namespace WorldMap {
Color level_title_color(1.0,1.0,1.0);
Color message_color(1.0,1.0,0.6);
Console::~Console()
{
if(vm != NULL) {
- sq_release(Scripting::global_vm, &vm_object);
+ sq_release(scripting::global_vm, &vm_object);
}
}
Console::ready_vm()
{
if(vm == NULL) {
- vm = Scripting::global_vm;
+ vm = scripting::global_vm;
HSQUIRRELVM new_vm = sq_newthread(vm, 16);
if(new_vm == NULL)
- throw Scripting::SquirrelError(vm, "Couldn't create new VM thread for console");
+ throw scripting::SquirrelError(vm, "Couldn't create new VM thread for console");
// store reference to thread
sq_resetobject(&vm_object);
if(SQ_FAILED(sq_getstackobj(vm, -1, &vm_object)))
- throw Scripting::SquirrelError(vm, "Couldn't get vm object for console");
+ throw scripting::SquirrelError(vm, "Couldn't get vm object for console");
sq_addref(vm, &vm_object);
sq_pop(vm, 1);
sq_newtable(new_vm);
sq_pushroottable(new_vm);
if(SQ_FAILED(sq_setdelegate(new_vm, -2)))
- throw Scripting::SquirrelError(new_vm, "Couldn't set console_table delegate");
+ throw scripting::SquirrelError(new_vm, "Couldn't set console_table delegate");
sq_setroottable(new_vm);
try {
std::string filename = "scripts/console.nut";
IFileStream stream(filename);
- Scripting::compile_and_run(vm, stream, filename);
+ scripting::compile_and_run(vm, stream, filename);
} catch(std::exception& e) {
log_warning << "Couldn't load console.nut: " << e.what() << std::endl;
}
void
Console::execute_script(const std::string& command)
{
- using namespace Scripting;
+ using namespace scripting;
ready_vm();
HSQUIRRELVM
GameSession::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();
void
GameSession::finish(bool win)
{
- using namespace WorldMapNS;
+ using namespace worldmap;
if (edit_mode) {
force_ghost_mode();
Console::instance->init_graphics();
timelog("scripting");
- Scripting::init_squirrel(g_config->enable_script_debugger);
+ scripting::init_squirrel(g_config->enable_script_debugger);
timelog("resources");
Resources::load_shared();
if(g_config->start_level.size() > 4 &&
g_config->start_level.compare(g_config->start_level.size() - 5, 5, ".stwm") == 0) {
init_rand();
- g_screen_manager->push_screen(new WorldMapNS::WorldMap(
+ g_screen_manager->push_screen(new worldmap::WorldMap(
FileSystem::basename(g_config->start_level)));
} else {
init_rand();//If level uses random eg. for
g_main_controller = NULL;
delete Console::instance;
Console::instance = NULL;
- Scripting::exit_squirrel();
+ scripting::exit_squirrel();
delete texture_manager;
texture_manager = NULL;
SDL_Quit();
} // namespace
-AddonMenu::AddonMenu()
+AddonMenu::AddonMenu() :
+ m_addons()
{
refresh();
}
#include "supertux/world.hpp"
#include "util/gettext.hpp"
-ContribMenu::ContribMenu()
+ContribMenu::ContribMenu() :
+ m_contrib_world_menu(),
+ m_contrib_worlds()
{
/** Generating contrib levels list by making use of Level Subset */
std::vector<std::string> level_worlds;
}
PHYSFS_freeList(files);
-
add_label(_("Contrib Levels"));
add_hl();
MainMenu::MainMenu() :
m_addon_menu(),
- m_contrib_menu()
+ m_contrib_menu(),
+ m_main_world()
{
set_pos(SCREEN_WIDTH/2, SCREEN_HEIGHT/2 + 35);
add_entry(MNID_STARTGAME, _("Start Game"));
screen_stack(),
screenshot_requested(false)
{
- using namespace Scripting;
+ using namespace scripting;
TimeScheduler::instance = new TimeScheduler();
}
ScreenManager::~ScreenManager()
{
- using namespace Scripting;
+ using namespace scripting;
delete TimeScheduler::instance;
TimeScheduler::instance = NULL;
void
ScreenManager::update_gamelogic(float elapsed_time)
{
- Scripting::update_debugger();
- Scripting::TimeScheduler::instance->update(game_time);
+ scripting::update_debugger();
+ scripting::TimeScheduler::instance->update(game_time);
current_screen->update(elapsed_time);
if (MenuManager::current() != NULL)
MenuManager::current()->update();
void set_screen_fade(ScreenFade* fade);
/// threads that wait for a screenswitch
- Scripting::ThreadQueue waiting_threads;
+ scripting::ThreadQueue waiting_threads;
private:
void draw_fps(DrawingContext& context, float fps);
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;
}
*
* Sectors contain GameObjects, e.g. Badguys and Players.
*/
-class Sector : public Scripting::SSector,
+class Sector : public scripting::SSector,
public Currenton<Sector>
{
public:
typedef std::vector<SpawnPoint*> SpawnPoints;
typedef std::vector<Portable*> Portables;
- // --- Scripting ---
+ // --- scripting ---
/**
* get/set color of ambient light
*/
sq_pushstring(vm, "statistics", -1);
sq_newtable(vm);
- if (coins != nv_coins) Scripting::store_int(vm, "coins-collected", coins);
- if (total_coins != nv_coins) Scripting::store_int(vm, "coins-collected-total", total_coins);
- if (badguys != nv_badguys) Scripting::store_int(vm, "badguys-killed", badguys);
- if (total_badguys != nv_badguys) Scripting::store_int(vm, "badguys-killed-total", total_badguys);
- if (time != nv_time) Scripting::store_float(vm, "time-needed", time);
- if (secrets != nv_secrets) Scripting::store_int(vm, "secrets-found", secrets);
- if (total_secrets != nv_secrets) Scripting::store_int(vm, "secrets-found-total", total_secrets);
+ if (coins != nv_coins) scripting::store_int(vm, "coins-collected", coins);
+ if (total_coins != nv_coins) scripting::store_int(vm, "coins-collected-total", total_coins);
+ if (badguys != nv_badguys) scripting::store_int(vm, "badguys-killed", badguys);
+ if (total_badguys != nv_badguys) scripting::store_int(vm, "badguys-killed-total", total_badguys);
+ if (time != nv_time) scripting::store_float(vm, "time-needed", time);
+ if (secrets != nv_secrets) scripting::store_int(vm, "secrets-found", secrets);
+ if (total_secrets != nv_secrets) scripting::store_int(vm, "secrets-found-total", total_secrets);
sq_createslot(vm, -3);
}
if(SQ_FAILED(sq_get(vm, -2))) {
return;
}
- Scripting::get_int(vm, "coins-collected", coins);
- Scripting::get_int(vm, "coins-collected-total", total_coins);
- Scripting::get_int(vm, "badguys-killed", badguys);
- Scripting::get_int(vm, "badguys-killed-total", total_badguys);
- Scripting::get_float(vm, "time-needed", time);
- Scripting::get_int(vm, "secrets-found", secrets);
- Scripting::get_int(vm, "secrets-found-total", total_secrets);
+ scripting::get_int(vm, "coins-collected", coins);
+ scripting::get_int(vm, "coins-collected-total", total_coins);
+ scripting::get_int(vm, "badguys-killed", badguys);
+ scripting::get_int(vm, "badguys-killed-total", total_badguys);
+ scripting::get_float(vm, "time-needed", time);
+ scripting::get_int(vm, "secrets-found", secrets);
+ scripting::get_int(vm, "secrets-found-total", total_secrets);
sq_pop(vm, 1);
}
World::~World()
{
- sq_release(Scripting::global_vm, &world_thread);
+ sq_release(scripting::global_vm, &world_thread);
if(current_ == this)
current_ = NULL;
}
void
World::run()
{
- using namespace Scripting;
+ using namespace scripting;
current_ = this;
// create new squirrel table for persistent game state
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushroottable(vm);
sq_pushstring(vm, "state", -1);
sq_newtable(vm);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't create state table");
+ throw scripting::SquirrelError(vm, "Couldn't create state table");
sq_pop(vm, 1);
load_state();
compile_and_run(object_to_vm(world_thread), in, filename);
} catch(std::exception& ) {
// fallback: try to load worldmap worldmap.stwm
- using namespace WorldMapNS;
+ using namespace worldmap;
g_screen_manager->push_screen(new WorldMap(basedir + "worldmap.stwm"));
}
}
void
World::save_state()
{
- using namespace Scripting;
+ using namespace scripting;
lisp::Writer writer(savegame_filename);
writer.start_list("supertux-savegame");
writer.write("version", 1);
- using namespace WorldMapNS;
+ using namespace worldmap;
if(WorldMap::current() != NULL) {
std::ostringstream title;
title << WorldMap::current()->get_title();
sq_pushroottable(global_vm);
sq_pushstring(global_vm, "state", -1);
if(SQ_SUCCEEDED(sq_get(global_vm, -2))) {
- Scripting::save_squirrel_table(global_vm, -1, writer);
+ scripting::save_squirrel_table(global_vm, -1, writer);
sq_pop(global_vm, 1);
}
sq_pop(global_vm, 1);
void
World::load_state()
{
- using namespace Scripting;
+ using namespace scripting;
try {
lisp::Parser parser;
throw std::runtime_error(out.str());
}
log_info << "Using GLEW " << glewGetString(GLEW_VERSION) << std::endl;
+ log_info << "GL_ARB_texture_non_power_of_two: " << GL_ARB_texture_non_power_of_two << std::endl;
#endif
}
#include "util/log.hpp"
-namespace WorldMapNS {
+namespace worldmap {
Direction reverse_dir(Direction direction)
{
}
}
-} // namespace WorldMapNS
+} // namespace worldmap
/* EOF */
#include <string>
-namespace WorldMapNS {
+namespace worldmap {
enum Direction { D_NONE, D_WEST, D_EAST, D_NORTH, D_SOUTH };
Direction string_to_direction(const std::string& directory);
std::string direction_to_string(Direction direction);
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
#include "video/drawing_context.hpp"
#include "worldmap/level.hpp"
-namespace WorldMapNS {
+namespace worldmap {
LevelTile::LevelTile(const std::string& basedir, const Reader& lisp) :
pos(),
class Sprite;
-namespace WorldMapNS {
+namespace worldmap {
class LevelTile : public GameObject
{
LevelTile& operator=(const LevelTile&);
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
#include "util/reader.hpp"
#include "worldmap/spawn_point.hpp"
-namespace WorldMapNS {
+namespace worldmap {
// from worldmap.cpp
Direction string_to_direction(const std::string& directory);
#include "supertux/game_object.hpp"
#include "worldmap/direction.hpp"
-namespace WorldMapNS {
+namespace worldmap {
class SpawnPoint
{
#include "video/drawing_context.hpp"
#include "worldmap/special_tile.hpp"
-namespace WorldMapNS {
+namespace worldmap {
SpecialTile::SpecialTile(const Reader& lisp) :
pos(),
class Sprite;
-namespace WorldMapNS {
+namespace worldmap {
class SpecialTile : public GameObject
{
bool apply_action_west;
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
#include "video/drawing_context.hpp"
#include "worldmap/sprite_change.hpp"
-namespace WorldMapNS {
+namespace worldmap {
SpriteChange::SpriteChange(const Reader& lisp) :
pos(),
class Sprite;
-namespace WorldMapNS {
+namespace worldmap {
class SpriteChange : public GameObject
{
static std::list<SpriteChange*> all_sprite_changes;
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
#include "video/drawing_context.hpp"
#include "worldmap/teleporter.hpp"
-namespace WorldMapNS {
+namespace worldmap {
Teleporter::Teleporter(const Reader& lisp) :
pos(),
{
}
-} // namespace WorldMapNS
+} // namespace worldmap
/* EOF */
class Sprite;
-namespace WorldMapNS {
+namespace worldmap {
class Teleporter : public GameObject
{
std::string message;
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
#include "worldmap/level.hpp"
#include "worldmap/tux.hpp"
-namespace WorldMapNS {
+namespace worldmap {
static const float TUXSPEED = 200;
static const float map_message_TIME = 2.8f;
class Sprite;
-namespace WorldMapNS {
+namespace worldmap {
class WorldMap;
Tux& operator=(const Tux&);
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
static const float CAMERA_PAN_SPEED = 5.0;
-namespace WorldMapNS {
+namespace worldmap {
WorldMap* WorldMap::current_ = NULL;
worldmap_menu.reset(new WorldmapMenu());
// create a new squirrel table for the worldmap
- 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 worldmap_table delegate");
+ throw scripting::SquirrelError(global_vm, "Couldn't set worldmap_table delegate");
sq_resetobject(&worldmap_table);
if(SQ_FAILED(sq_getstackobj(global_vm, -1, &worldmap_table)))
- throw Scripting::SquirrelError(global_vm, "Couldn't get table from stack");
+ throw scripting::SquirrelError(global_vm, "Couldn't get table from stack");
sq_addref(global_vm, &worldmap_table);
sq_pop(global_vm, 1);
WorldMap::~WorldMap()
{
- using namespace Scripting;
+ using namespace scripting;
if(free_tileset)
delete tileset;
{
ScriptInterface* interface = dynamic_cast<ScriptInterface*> (object);
if(interface != NULL) {
- HSQUIRRELVM vm = Scripting::global_vm;
+ HSQUIRRELVM vm = scripting::global_vm;
sq_pushobject(vm, worldmap_table);
interface->expose(vm, -1);
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, worldmap_table);
try {
tux->setup();
// register worldmap_table as worldmap in scripting
- using namespace Scripting;
+ using namespace scripting;
sq_pushroottable(global_vm);
sq_pushstring(global_vm, "worldmap", -1);
void
WorldMap::leave()
{
- using namespace Scripting;
+ using namespace scripting;
// save state of world and player
save_state();
void
WorldMap::save_state()
{
- using namespace Scripting;
+ using namespace scripting;
HSQUIRRELVM vm = global_vm;
int oldtop = sq_gettop(vm);
sq_pushroottable(vm);
sq_pushstring(vm, "state", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get state table");
+ throw scripting::SquirrelError(vm, "Couldn't get state table");
// get or create worlds table
sq_pushstring(vm, "worlds", -1);
sq_pushstring(vm, "worlds", -1);
sq_newtable(vm);
if(SQ_FAILED(sq_createslot(vm, -3)))
- throw Scripting::SquirrelError(vm, "Couldn't create state.worlds");
+ throw scripting::SquirrelError(vm, "Couldn't create state.worlds");
sq_pushstring(vm, "worlds", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't create.get state.worlds");
+ throw scripting::SquirrelError(vm, "Couldn't create.get state.worlds");
}
sq_pushstring(vm, map_filename.c_str(), map_filename.length());
void
WorldMap::load_state()
{
- using namespace Scripting;
+ using namespace scripting;
HSQUIRRELVM vm = global_vm;
int oldtop = sq_gettop(vm);
sq_pushroottable(vm);
sq_pushstring(vm, "state", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get state table");
+ throw scripting::SquirrelError(vm, "Couldn't get state table");
// get worlds table
sq_pushstring(vm, "worlds", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get state.worlds");
+ throw scripting::SquirrelError(vm, "Couldn't get state.worlds");
// get table for our world
sq_pushstring(vm, map_filename.c_str(), map_filename.length());
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get state.worlds.mapfilename");
+ throw scripting::SquirrelError(vm, "Couldn't get state.worlds.mapfilename");
// load tux
sq_pushstring(vm, "tux", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get tux");
+ throw scripting::SquirrelError(vm, "Couldn't get tux");
Vector p;
p.x = read_float(vm, "x");
// load levels
sq_pushstring(vm, "levels", -1);
if(SQ_FAILED(sq_get(vm, -2)))
- throw Scripting::SquirrelError(vm, "Couldn't get levels");
+ throw scripting::SquirrelError(vm, "Couldn't get levels");
for(LevelTiles::iterator i = levels.begin(); i != levels.end(); ++i) {
LevelTile* level = *i;
HSQUIRRELVM
WorldMap::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();
return height;
}
-} // namespace WorldMapNS
+} // namespace worldmap
/* EOF */
class GameObject;
class TileMap;
-namespace WorldMapNS {
+namespace worldmap {
class Tux;
class LevelTile;
WEST_EAST_WAY
};
-std::string direction_to_string(Direction d);
-Direction string_to_direction(const std::string& d);
-Direction reverse_dir(Direction d);
-
/**
* Screen that runs a WorldMap, which lets the player choose a Level.
*/
WorldMap& operator=(const WorldMap&);
};
-} // namespace WorldMapNS
+} // namespace worldmap
#endif
<< "#ifndef HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP\n" //TODO avoid hardcoding
<< "#define HEADER_SUPERTUX_SCRIPTING_WRAPPER_HPP\n"
<< "\n"
- << "namespace Scripting {\n"
+ << "namespace scripting {\n"
<< "\n";
hppout << "void register_" << modulename << "_wrapper(HSQUIRRELVM v);\n"
<< "#include \"scripting/squirrel_error.hpp\"\n"
<< "#include \"scripting/wrapper.interface.hpp\"\n"
<< "\n"
- << "namespace Scripting {\n"
- << "namespace Wrapper {\n"
+ << "namespace scripting {\n"
+ << "namespace wrapper {\n"
<< "\n";
for(std::vector<AtomicType*>::iterator i = ns->types.begin();
create_function_wrapper(0, *i);
}
- out << "} // end of namespace Wrapper\n";
+ out << "} // namespace wrapper\n";
for(std::vector<AtomicType*>::iterator i = ns->types.begin();
i != ns->types.end(); ++i) {
out << "void register_" << modulename << "_wrapper(HSQUIRRELVM v)\n"
<< "{\n"
- << ind << "using namespace Wrapper;\n"
+ << ind << "using namespace wrapper;\n"
<< "\n";
create_register_constants_code(ns);
out << "}\n"
<< "\n"
- << "} // end of namespace Scripting\n"
+ << "} // namespace scripting\n"
<< "\n"
<< "/* EOF */\n";
}
<< ns_prefix << _class->name
<< "* object, bool setup_releasehook)\n"
<< "{\n"
- << ind << "using namespace Wrapper;\n"
+ << ind << "using namespace wrapper;\n"
<< "\n"
<< ind << "sq_pushroottable(v);\n"
<< ind << "sq_pushstring(v, \"" << _class->name << "\", -1);\n"