12 |
// |
// |
13 |
// $Id$ |
// $Id$ |
14 |
// $Log$ |
// $Log$ |
15 |
|
// Revision 1.4 2004/12/26 09:35:23 skunix |
16 |
|
// use logging functionality |
17 |
|
// |
18 |
// Revision 1.3 2004/12/26 08:03:34 skunix |
// Revision 1.3 2004/12/26 08:03:34 skunix |
19 |
// changed lambda::bind's to boost::binds |
// changed lambda::bind's to boost::binds |
20 |
// |
// |
122 |
{ |
{ |
123 |
impl->meta.insert(TextureManagerImpl::MetaMap::value_type(m->alias, *m)); |
impl->meta.insert(TextureManagerImpl::MetaMap::value_type(m->alias, *m)); |
124 |
} |
} |
125 |
|
/* |
126 |
void |
void |
127 |
adjust_add_meta(boost::filesystem::path p, TextureManager*tm, const TextureMeta*m) |
adjust_add_meta(boost::filesystem::path p, TextureManager*tm, const TextureMeta*m) |
128 |
{ |
{ |
130 |
|
|
131 |
boost::filesystem::path fullpath = p / m->filename; |
boost::filesystem::path fullpath = p / m->filename; |
132 |
|
|
133 |
std::cout << m->filename << " becomes " << fullpath.native_file_string() << std::endl; |
// std::cout << m->filename << " becomes " << fullpath.native_file_string() << std::endl; |
134 |
TextureMeta adjusted(*m); |
TextureMeta adjusted(*m); |
135 |
|
|
136 |
adjusted.filename=fullpath.native_file_string(); |
adjusted.filename=fullpath.native_file_string(); |
137 |
tm->add_meta(&adjusted); |
tm->add_meta(&adjusted); |
138 |
return; |
return; |
139 |
} |
} |
140 |
|
*/ |
141 |
|
|
142 |
Texture_sp |
Texture_sp |
143 |
TextureManager::get(const std::string& texAlias) |
TextureManager::get(const std::string& texAlias) |
158 |
TextureManager::load_path(const boost::filesystem::path& p) |
TextureManager::load_path(const boost::filesystem::path& p) |
159 |
{ |
{ |
160 |
using boost::filesystem::path; |
using boost::filesystem::path; |
161 |
log::Stream logstream(&log::server, log::Level::INFO); |
log::Stream2 logstream; //(&log::server, log::Level::INFO); |
162 |
path mf = p / "textures" / "meta"; |
path mf = p / "textures" / "meta"; |
163 |
logstream << (boost::format("Loading texture metadata from '%1%'\n")%mf.native_file_string()).str();// << std::endl; |
logstream << (boost::format("Loading texture metadata from '%1%'")%mf.native_file_string()).str() << log::Commit; |
164 |
|
|
165 |
|
|
166 |
texture_meta_parse(mf, |
texture_meta_parse(mf, |
167 |
boost::bind(&TextureManager::add_meta,this,_1) |
boost::bind(&TextureManager::add_meta,this,_1) |
168 |
); |
); |
169 |
|
|
|
std::cout << mf.string() << std::endl; |
|
170 |
} |
} |
171 |
|
|
172 |
|
|