~nightshade-dev/nightshade/trunk

« back to all changes in this revision

Viewing changes to src/constellation_mgr.cpp

  • Committer: Trystan Larey-Williams
  • Date: 2011-06-01 23:25:13 UTC
  • mfrom: (128.15.20 trunk)
  • Revision ID: tlareywi@trystan.digitaliseducation-20110601232513-xpimcjm6immeonp0
local merge

Show diffs side-by-side

added added

removed removed

Lines of Context:
243
243
                        stringstream in(record);
244
244
                        in >> shortname >> texfile;
245
245
 
 
246
                        if(in.fail()) {
 
247
                                cerr << "Error parsing constellation art record:\n" << record << endl;
 
248
                                continue;
 
249
                        }
 
250
 
246
251
                        // TODO add better error checking
247
252
                        if(shortname!="" && shortname[0]!='#') {
248
253
                                in >> fx1 >> fy1 >> hp1;
249
254
                                in >> fx2 >> fy2 >> hp2;
250
255
                                in >> fx3 >> fy3 >> hp3;
 
256
                        } else {
 
257
                                continue;
251
258
                        }
252
259
 
253
260
                        cons = NULL;
254
261
                        cons = findFromAbbreviation(shortname);
255
262
                        if (!cons) {
256
263
                                // save on common error delay
257
 
                                // cerr << "ERROR : Can't find constellation called : " << shortname << endl;
 
264
                                cerr << "ERROR : Can't find constellation called : " << shortname << endl;
258
265
                        } else {
259
266
 
260
267
                                // Try local sky culture directory for texture images first
269
276
                                        cons->art_tex = new s_texture(true, localFile, TEX_LOAD_TYPE_PNG_BLEND1, true);  // use mipmaps
270
277
                                }
271
278
 
 
279
                                if(cons->art_tex->getID() == 0) continue;  // otherwise no texture
 
280
 
272
281
                                cons->art_tex->getDimensions(texW, texH);
273
282
 
274
283
                                // support absolute and proportional image coordinates