[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Wesnoth-cvs-commits] wesnoth/src image.cpp
From: |
Yann Dirson |
Subject: |
[Wesnoth-cvs-commits] wesnoth/src image.cpp |
Date: |
Sat, 08 Jan 2005 16:51:43 -0500 |
CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Yann Dirson <address@hidden> 05/01/08 21:18:27
Modified files:
src : image.cpp
Log message:
duplicate less code in zipios mode
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/image.cpp.diff?tr1=1.71&tr2=1.72&r1=text&r2=text
Patches:
Index: wesnoth/src/image.cpp
diff -u wesnoth/src/image.cpp:1.71 wesnoth/src/image.cpp:1.72
--- wesnoth/src/image.cpp:1.71 Sat Jan 8 13:57:23 2005
+++ wesnoth/src/image.cpp Sat Jan 8 21:18:27 2005
@@ -204,32 +204,24 @@
{
#ifdef USE_ZIPIOS
std::string s = read_file("images/" + val_.filename_);
- if (s.empty()) {
+ if (s.empty())
return surface(NULL);
- } else {
- SDL_RWops* ops = SDL_RWFromMem((void*)s.c_str(), s.size());
- const surface res(IMG_Load_RW(ops, 0));
- if(res == NULL) {
- ERR_DP << "could not open image '" << val_.filename_ <<
"'\n";
- }
- SDL_FreeRW(ops);
- return res;
- }
+ SDL_RWops* ops = SDL_RWFromMem((void*)s.c_str(), s.size());
+ const surface res(IMG_Load_RW(ops, 0));
+ SDL_FreeRW(ops);
#else
const std::string& location = get_binary_file_location("images",
val_.filename_);
-
- if(location.empty()) {
+ if(location.empty())
return surface(NULL);
- } else {
- const surface res(IMG_Load(location.c_str()));
- if(res == NULL) {
- ERR_DP << "could not open image '" << val_.filename_ <<
"'\n";
- }
- return res;
- }
+ const surface res(IMG_Load(location.c_str()));
#endif
+ if(res == NULL) {
+ ERR_DP << "could not open image '" << val_.filename_ << "'\n";
+ }
+
+ return res;
}
surface locator::load_image_sub_file() const
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Wesnoth-cvs-commits] wesnoth/src image.cpp,
Yann Dirson <=