-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from YoYoGames/pkraif-shader-test-fixes-2
Fix shader uniform tests not passing + add sprite test suite
- Loading branch information
Showing
23 changed files
with
161 additions
and
66 deletions.
There are no files selected for viewing
Binary file modified
BIN
+778 Bytes
(910%)
projects/xUnit/datafiles/ShaderTests/SetUniformFArray/SetAlphaExpected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-16 KB
projects/xUnit/datafiles/ShaderTests/SetUniformFArray/SetAlphaExpectedBuffer
Binary file not shown.
Binary file modified
BIN
+778 Bytes
(910%)
projects/xUnit/datafiles/ShaderTests/SetUniformFBuffer/SetAlphaExpected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-16 KB
projects/xUnit/datafiles/ShaderTests/SetUniformFBuffer/SetAlphaExpectedBuffer
Binary file not shown.
Binary file modified
BIN
+778 Bytes
(910%)
projects/xUnit/datafiles/ShaderTests/SetUniformI/SetAlphaExpected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-16 KB
projects/xUnit/datafiles/ShaderTests/SetUniformI/SetAlphaExpectedBuffer
Binary file not shown.
Binary file modified
BIN
+778 Bytes
(910%)
projects/xUnit/datafiles/ShaderTests/SetUniformIArray/SetAlphaExpected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed
BIN
-16 KB
projects/xUnit/datafiles/ShaderTests/SetUniformIArray/SetAlphaExpectedBuffer
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
projects/xUnit/scripts/ResourceSpriteTestSuite/ResourceSpriteTestSuite.gml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
function ResourceSpriteTestSuite() : TestSuite() constructor { | ||
|
||
addFact("sprite_add", function() { | ||
|
||
var _sprite = sprite_add("spriteAdd.png", 1, false, false, 0, 0); | ||
assert_true(sprite_exists(_sprite), test_current().name + ", didn't return a valid sprite"); | ||
assert_true(sprite_get_number(_sprite) == 1, test_current().name + ", added sprite doesnt' have the correct number of subimages"); | ||
|
||
var _sprite_width = 64; | ||
var _sprite_height = 64; | ||
assert_true(sprite_get_width(_sprite) == _sprite_width, test_current().name + ", added sprite doesn't have the correct width"); | ||
assert_true(sprite_get_height(_sprite) == _sprite_height, test_current().name + ", added sprite doesn't have the correct height"); | ||
|
||
var _surface = surface_create(_sprite_width, _sprite_height); | ||
surface_set_target(_surface); | ||
gpu_push_state(); | ||
gpu_set_blendenable(false); | ||
draw_sprite(_sprite, 0, 0, 0); | ||
gpu_pop_state(); | ||
surface_reset_target(); | ||
|
||
var _buffer = buffer_create(buffer_sizeof(buffer_u32) * _sprite_width * _sprite_height, buffer_fixed, 1); | ||
buffer_get_surface(_buffer, _surface, 0); | ||
|
||
var _color = buffer_peek(_buffer, 0, buffer_u32); | ||
assert_equals(_color, 0x00_3F_7F_FF, test_current().name + ", added sprite doesn't preserve color when alpha is 0"); | ||
|
||
sprite_delete(_sprite); | ||
assert_false(sprite_exists(_sprite), test_current().name + ", failed to delete added sprite"); | ||
|
||
surface_free(_surface); | ||
buffer_delete(_buffer); | ||
}); | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
projects/xUnit/scripts/ResourceSpriteTestSuite/ResourceSpriteTestSuite.yy
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.