diff options
| author | JAROWMR <jarorutjes07@gmail.com> | 2025-01-08 14:59:18 +0100 | 
|---|---|---|
| committer | JAROWMR <jarorutjes07@gmail.com> | 2025-01-08 14:59:18 +0100 | 
| commit | 9ead13a796f188abb502f29b0efa136b9c73fda4 (patch) | |
| tree | c55726b8488092355738d33384ca893dff30a027 | |
| parent | 1dbf6855eb8fcafb411c92257cd10af13e3562f1 (diff) | |
| parent | 0b9574bdd6c5968c07bcf165d66032b75649b5da (diff) | |
Merge branch 'master' of github.com:lonkaars/crepe into jaro/game
| -rw-r--r-- | src/crepe/api/Sprite.cpp | 4 | ||||
| -rw-r--r-- | src/test/AudioTest.cpp | 9 | 
2 files changed, 10 insertions, 3 deletions
| diff --git a/src/crepe/api/Sprite.cpp b/src/crepe/api/Sprite.cpp index 2919857..3c77e2e 100644 --- a/src/crepe/api/Sprite.cpp +++ b/src/crepe/api/Sprite.cpp @@ -20,9 +20,7 @@ Sprite::Sprite(game_object_id_t id, const Asset & texture, const Sprite::Data &  Sprite::~Sprite() { dbg_trace(); } -unique_ptr<Component> Sprite::save() const { -	return unique_ptr<Component>(new Sprite(*this)); -} +unique_ptr<Component> Sprite::save() const { return unique_ptr<Component>(new Sprite(*this)); }  void Sprite::restore(const Component & snapshot) {  	*this = static_cast<const Sprite &>(snapshot); diff --git a/src/test/AudioTest.cpp b/src/test/AudioTest.cpp index 3844c73..e548221 100644 --- a/src/test/AudioTest.cpp +++ b/src/test/AudioTest.cpp @@ -60,6 +60,8 @@ TEST_F(AudioTest, Play) {  		InSequence seq;  		EXPECT_CALL(context, play(_)).Times(0); +		EXPECT_CALL(context, set_loop(_, _)).Times(0); +		EXPECT_CALL(context, set_volume(_, _)).Times(0);  		component.play();  	} @@ -67,6 +69,8 @@ TEST_F(AudioTest, Play) {  		InSequence seq;  		EXPECT_CALL(context, play(_)).Times(1); +		EXPECT_CALL(context, set_loop(_, _)).Times(1); +		EXPECT_CALL(context, set_volume(_, _)).Times(1);  		system.fixed_update();  	}  } @@ -146,6 +150,9 @@ TEST_F(AudioTest, PlayOnActive) {  		InSequence seq;  		EXPECT_CALL(context, play(_)).Times(1); +		EXPECT_CALL(context, set_loop(_, _)).Times(1); +		EXPECT_CALL(context, set_volume(_, _)).Times(1); +  		component.active = true;  		system.fixed_update();  	} @@ -156,6 +163,8 @@ TEST_F(AudioTest, PlayImmediately) {  	component.play();  	EXPECT_CALL(context, play(_)).Times(1); +	EXPECT_CALL(context, set_volume(_, _)).Times(1); +	EXPECT_CALL(context, set_loop(_, _)).Times(1);  	system.fixed_update();  } |