From c23c7d03522456ac580cb7acd93fbfd95d5b846d Mon Sep 17 00:00:00 2001 From: heavydemon21 Date: Wed, 20 Nov 2024 19:27:30 +0100 Subject: fixed compile warning and tested the prerequisite that user needs to set explicity and reference --- src/crepe/facade/SDLContext.cpp | 4 ++-- src/example/rendering_particle.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/crepe/facade/SDLContext.cpp b/src/crepe/facade/SDLContext.cpp index daf0050..f78ec8f 100644 --- a/src/crepe/facade/SDLContext.cpp +++ b/src/crepe/facade/SDLContext.cpp @@ -122,7 +122,7 @@ SDL_Rect SDLContext::get_dst_rect(const Sprite & sprite, const Vector2 & pos, void SDLContext::draw_particle(const Sprite & sprite, const Vector2 & pos, const double & angle, const double & scale, - const Camera & camera) const { + const Camera & camera) { SDL_RendererFlip render_flip = (SDL_RendererFlip) ((SDL_FLIP_HORIZONTAL * sprite.flip.flip_x) @@ -136,7 +136,7 @@ void SDLContext::draw_particle(const Sprite & sprite, const Vector2 & pos, } void SDLContext::draw(const Sprite & sprite, const Transform & transform, - const Camera & cam) const { + const Camera & cam) { SDL_RendererFlip render_flip = (SDL_RendererFlip) ((SDL_FLIP_HORIZONTAL * sprite.flip.flip_x) diff --git a/src/example/rendering_particle.cpp b/src/example/rendering_particle.cpp index 5030bc6..4571afb 100644 --- a/src/example/rendering_particle.cpp +++ b/src/example/rendering_particle.cpp @@ -32,7 +32,8 @@ int main(int argc, char * argv[]) { Sprite & test_sprite = game_object.add_component( make_shared("../asset/texture/img.png"), color, FlipSettings{false, false}); test_sprite.order_in_layer = 5; - auto test = game_object.add_component(ParticleEmitter::Data{ + + auto & test = game_object.add_component(ParticleEmitter::Data{ .position = {0, 0}, .max_particles = 10, .emission_rate = 0.1, -- cgit v1.2.3