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

Fixed snow particles scripting + menu Christmas level #1600

Merged
merged 1 commit into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
513 changes: 463 additions & 50 deletions data/levels/misc/menu.stl.in

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/object/cloud_particle_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ class CloudParticleSystem final :
static int constexpr const max_amount = 500;
static int constexpr const min_amount = 0;

virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<CloudParticleSystem, scripting::Clouds>::expose(vm, table_idx);
}

virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<CloudParticleSystem, scripting::Clouds>::unexpose(vm, table_idx);
}

private:
/** Returns the amount that got inserted (In case max_amount got hit) */
int add_clouds(int amount, float fade_time);
Expand Down
8 changes: 8 additions & 0 deletions src/object/custom_particle_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ class CustomParticleSystem :
return "images/engine/editor/sparkle.png";
}

virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<CustomParticleSystem, scripting::CustomParticles>::expose(vm, table_idx);
}

virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<CustomParticleSystem, scripting::CustomParticles>::unexpose(vm, table_idx);
}

//void fade_amount(int new_amount, float fade_time);
protected:
virtual int collision(Particle* particle, const Vector& movement) override;
Expand Down
4 changes: 2 additions & 2 deletions src/object/particlesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

ParticleSystem::ParticleSystem(const ReaderMapping& reader, float max_particle_size_) :
GameObject(reader),
//ExposedObject<ParticleSystem, scripting::ParticleSystem>(this),
ExposedObject<ParticleSystem, scripting::ParticleSystem>(this),
max_particle_size(max_particle_size_),
z_pos(LAYER_BACKGROUND1),
particles(),
Expand All @@ -44,7 +44,7 @@ ParticleSystem::ParticleSystem(const ReaderMapping& reader, float max_particle_s

ParticleSystem::ParticleSystem(float max_particle_size_) :
GameObject(),
//ExposedObject<ParticleSystem, scripting::ParticleSystem>(this),
ExposedObject<ParticleSystem, scripting::ParticleSystem>(this),
max_particle_size(max_particle_size_),
z_pos(LAYER_BACKGROUND1),
particles(),
Expand Down
4 changes: 2 additions & 2 deletions src/object/particlesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class ReaderMapping;
class, initialize particles in the constructor and move them in the
simulate function.
*/
class ParticleSystem : public GameObject//,
//public ExposedObject<ParticleSystem, scripting::ParticleSystem>
class ParticleSystem : public GameObject,
public ExposedObject<ParticleSystem, scripting::ParticleSystem>
{
public:
ParticleSystem(const ReaderMapping& reader, float max_particle_size = 60);
Expand Down
8 changes: 8 additions & 0 deletions src/object/rain_particle_system.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ class RainParticleSystem final :
// When m_current_amount == max_amount, fog is this value
static float constexpr const fog_max_value = 0.6f;

virtual void expose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<RainParticleSystem, scripting::Rain>::expose(vm, table_idx);
}

virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx) override {
ExposedObject<RainParticleSystem, scripting::Rain>::unexpose(vm, table_idx);
}

private:
void set_amount(float amount);
void set_angle(float angle);
Expand Down