Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only pad images in create texture (#2008)
- Loading branch information
Showing
41 changed files
with
598 additions
and
553 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include "CommonTest.hpp" | ||
|
||
TEST(Regression, image_load_save_test) { | ||
if (!TestHarness::windowing_supported()) return; | ||
// Iterate only platforms and graphics systems | ||
for (TestConfig tc : GetValidConfigs(true, true, false, false, false, false)) { | ||
tc.extensions = "Paths,libpng"; | ||
auto test_harness = LAUNCH_HARNESS_FOR_SOG(tc); | ||
test_common(test_harness.get(), "image_load_save_test" + tc.stringify()); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
CommandLine/testing/Tests/image_load_save_test.sog/create.edl
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,49 @@ | ||
// Sprites | ||
|
||
// Non power of 2 | ||
npow2_spr_gif = sprite_add("CommandLine/testing/data/npow2.gif", -1, false, false, 0, 0); | ||
// Save frames as bmp/png | ||
sprite_save(npow2_spr_gif, 0, "/tmp/img.bmp"); | ||
sprite_save(npow2_spr_gif, 1, "/tmp/img.png"); | ||
npow2_spr_bmp = sprite_add("/tmp/img.bmp", 1, false, false, 0, 0); | ||
npow2_spr_png = sprite_add("/tmp/img.png", 1, false, false, 0, 0); | ||
|
||
file_delete("/tmp/img.bmp") | ||
file_delete("/tmp/img.png") | ||
|
||
// Power of 2 | ||
pow2_spr_gif = sprite_add("CommandLine/testing/data/pow2.gif", -1, true, false, 0, 0); | ||
// Save frames as bmp/png | ||
sprite_save(pow2_spr_gif, 0, "/tmp/img.bmp"); | ||
sprite_save(pow2_spr_gif, 1, "/tmp/img.png"); | ||
pow2_spr_bmp = sprite_add("/tmp/img.bmp", 1, false, false, 0, 0); | ||
pow2_spr_png = sprite_add("/tmp/img.png", 1, false, false, 0, 0); | ||
|
||
// Strip | ||
spr_strip = sprite_add("CommandLine/testing/data/sprite.png", 4, true, false, 0, 0); | ||
|
||
file_delete("/tmp/img.bmp") | ||
file_delete("/tmp/img.png") | ||
|
||
// Backgrounds | ||
|
||
// Non power of 2 | ||
npow2_bkg_gif = background_add("CommandLine/testing/data/npow2.gif", false, false); | ||
// Save frames as bmp/png | ||
background_save(npow2_bkg_gif, "/tmp/img.bmp"); | ||
background_save(npow2_bkg_gif, "/tmp/img.png"); | ||
npow2_bkg_bmp = background_add("/tmp/img.bmp", 1, false, false); | ||
npow2_bkg_png = background_add("/tmp/img.png", 1, false, false); | ||
|
||
file_delete("/tmp/img.bmp") | ||
file_delete("/tmp/img.png") | ||
|
||
// Power of 2 | ||
pow2_bkg_gif = background_add("CommandLine/testing/data/pow2.gif", true, false); | ||
background_save(pow2_bkg_gif, "/tmp/img.bmp"); | ||
background_save(pow2_bkg_gif, "/tmp/img.png"); | ||
pow2_bkg_bmp = background_add("/tmp/img.bmp", 1, false, false); | ||
pow2_bkg_png = background_add("/tmp/img.png", 1, false, false); | ||
|
||
file_delete("/tmp/img.bmp") | ||
file_delete("/tmp/img.png") |
24 changes: 24 additions & 0 deletions
24
CommandLine/testing/Tests/image_load_save_test.sog/draw.edl
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,24 @@ | ||
// Draw sprites | ||
draw_sprite(npow2_spr_gif, 0, 0, 0); | ||
draw_sprite(npow2_spr_gif, 1, 70, 0); | ||
|
||
draw_sprite(npow2_spr_bmp, 0, 0, 35); | ||
draw_sprite(npow2_spr_png, 1, 70, 35); | ||
|
||
draw_sprite(pow2_spr_gif, 0, 0, 70); | ||
draw_sprite(pow2_spr_gif, 1, 64, 70); | ||
|
||
draw_sprite(pow2_spr_bmp, 0, 0, 134); | ||
draw_sprite(pow2_spr_png, 1, 64, 134); | ||
|
||
for (int i = 0 i < 4; ++i) | ||
draw_sprite(spr_strip, i, i*64, 198); | ||
|
||
// Draw backgrounds | ||
draw_background(npow2_bkg_gif, 0, 262); | ||
draw_background(npow2_bkg_bmp, 70, 262); | ||
draw_background(npow2_bkg_png, 140, 262); | ||
|
||
draw_background(pow2_bkg_gif, 0, 297); | ||
draw_background(pow2_bkg_bmp, 64, 297); | ||
draw_background(pow2_bkg_png, 128, 297); |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
Oops, something went wrong.