Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-08-26 17:42:30 +0000
committerStijn Buys <ingar@osirion.org>2008-08-26 17:42:30 +0000
commitcc0a4412a4ac7f1f78ef7e644a0c06c6dd6dd129 (patch)
tree27271e45ca42c1039d149ab30637fe4fb08eb732 /src/render/textures.cc
parent02e623574c4c12c40a0757ed934a93353f34a653 (diff)
improved dust rendering
Diffstat (limited to 'src/render/textures.cc')
-rw-r--r--src/render/textures.cc30
1 files changed, 20 insertions, 10 deletions
diff --git a/src/render/textures.cc b/src/render/textures.cc
index 6ceb7cd..a041c32 100644
--- a/src/render/textures.cc
+++ b/src/render/textures.cc
@@ -10,6 +10,7 @@
#include "render/textures.h"
#include "render/tga.h"
#include "render/pngfile.h"
+#include "render/jpgfile.h"
#include "sys/sys.h"
#include "core/application.h"
@@ -76,23 +77,32 @@ size_t Textures::load(std::string name, bool filter)
std::string filename;
Image *image = 0;
- // try the png version
- filename.assign(name);
- filename.append(".png");
- image = PNG::load(filename.c_str());
+ if (!image) {
+ // try the png version
+ filename.assign(name);
+ filename.append(".png");
+ image = PNG::load(filename.c_str());
+ }
if (!image) {
// try the tga version
filename.assign(name);
filename.append(".tga");
image = TGA::load(filename.c_str());
+ }
+
+ if (!image) {
+ // try the jpg version
+ filename.assign(name);
+ filename.append(".jpg");
+ image = JPG::load(filename.c_str());
+ }
- if (!image) {
- // add to the registry with id 0 (texture not found)
- con_warn << "Could not open " << filename << std::endl;
- registry[name] = 0;
- return 0;
- }
+ if (!image) {
+ // add to the registry with id 0 (texture not found)
+ con_warn << "Could not open " << filename << std::endl;
+ registry[name] = 0;
+ return 0;
}
size_t id = index;