[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx,1.24,1.25 res_des
From: |
grumbel |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx,1.24,1.25 res_descriptor.cxx,1.13,1.14 |
Date: |
2 Apr 2003 19:43:06 -0000 |
Update of /var/lib/cvs/Games/Pingus/src
In directory dark:/tmp/cvs-serv13697
Modified Files:
pingus_resource.cxx res_descriptor.cxx
Log Message:
some cleanup and debugging stuff
Index: pingus_resource.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/pingus_resource.cxx,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- pingus_resource.cxx 4 Mar 2003 10:26:18 -0000 1.24
+++ pingus_resource.cxx 2 Apr 2003 19:43:04 -0000 1.25
@@ -144,7 +144,16 @@
CL_Surface
PingusResource::load_from_cache (const ResDescriptor& res_desc)
{
- return surface_map[res_desc];
+ std::map<ResDescriptor, CL_Surface>::iterator i = surface_map.find(res_desc);
+ if (i == surface_map.end())
+ {
+ std::cout << "PingusResource::load_from_cache: no surface cached: " <<
res_desc << std::endl;
+ return CL_Surface();
+ }
+ else
+ {
+ return i->second;
+ }
}
CL_Surface
Index: res_descriptor.cxx
===================================================================
RCS file: /var/lib/cvs/Games/Pingus/src/res_descriptor.cxx,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- res_descriptor.cxx 10 Mar 2003 11:29:49 -0000 1.13
+++ res_descriptor.cxx 2 Apr 2003 19:43:04 -0000 1.14
@@ -96,33 +96,6 @@
}
}
-#if 0
-ResDescriptor::ResDescriptor(const std::string& c_cast, const std::string&
value)
-{
- modifier = ResourceModifierNS::ROT0;
- std::string cast;
-
- if (c_cast.find_first_of(":") == std::string::npos) {
- cast = c_cast;
- datafile = "global";
- } else {
- cast = c_cast.substr(0, c_cast.find_first_of(":"));
- datafile = c_cast.substr(c_cast.find_first_of(":") + 1);
- }
-
- if (cast == "file") {
- type = RD_FILE;
- } else if (cast == "resource") {
- type = RD_RESOURCE;
- } else if (cast == "auto") {
- type = RD_AUTO;
- } else {
- PingusError::raise("ResDescriptor: Wrong cast '"+cast+"' for value
'"+value+"'\n");
- }
- res_name = value;
-}
-#endif
-
bool
ResDescriptor::operator<(const ResDescriptor& res_desc) const
{
@@ -164,10 +137,11 @@
switch (desc.type)
{
case ResDescriptor::RD_RESOURCE:
- return s << "(datafile: " << desc.datafile << ", res_name: " <<
desc.res_name << ")";
+ return s << "(datafile: " << desc.datafile << ", res_name: " <<
desc.res_name
+ << ", modifier: " << rs_to_string(desc.modifier) << ")";
break;
case ResDescriptor::RD_FILE:
- return s << "(file:" << desc.res_name << ")";
+ return s << "(plainfile:" << desc.res_name << ")";
break;
case ResDescriptor::RD_AUTO:
return s << "(auto)";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src pingus_resource.cxx,1.24,1.25 res_descriptor.cxx,1.13,1.14,
grumbel <=