Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add default arguments to add_object function call #3172

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/supertux/game_object_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,8 @@ GameObjectManager::register_class(ssq::VM& vm)
cls.addFunc("get_ambient_blue", &GameObjectManager::get_ambient_blue);
cls.addFunc("set_music", &GameObjectManager::set_music);
cls.addFunc<void, GameObjectManager, const std::string&, const std::string&,
float, float, const std::string&, const std::string&>("add_object", &GameObjectManager::add_object);
float, float, const std::string&, const std::string&>("add_object",
&GameObjectManager::add_object, ssq::DefaultArguments<const std::string&, const std::string&>("auto", ""));
}

/* EOF */
4 changes: 2 additions & 2 deletions src/supertux/game_object_manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ class GameObjectManager : public ExposableClass
* @param string $data Additional data in S-Expression format (check object definitions in level files).
*/
void add_object(const std::string& class_name, const std::string& name,
float pos_x, float pos_y, const std::string& direction,
const std::string& data);
float pos_x, float pos_y, const std::string& direction = "auto",
const std::string& data = "");

float get_width() const;
float get_height() const;
Expand Down
Loading