Previous 15994 Revisions Next

r14299 Wednesday 1st February, 2012 at 10:05:17 UTC by Robbbert
rendlay: fixed error messages so they have a newline at the end. Someone please commit to MAME.
[src/emu]rendlay.c

src/emu/rendlay.c
r14298r14299
362362      bounds.y1 = bounds.y0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "height", 1.0f);
363363   }
364364   else
365      throw emu_fatalerror("Illegal bounds value in XML");
365      throw emu_fatalerror("Illegal bounds value in XML\n");
366366
367367   // check for errors
368368   if (bounds.x0 > bounds.x1 || bounds.y0 > bounds.y1)
369      throw emu_fatalerror("Illegal bounds value in XML: (%f-%f)-(%f-%f)", bounds.x0, bounds.x1, bounds.y0, bounds.y1);
369      throw emu_fatalerror("Illegal bounds value in XML: (%f-%f)-(%f-%f)\n", bounds.x0, bounds.x1, bounds.y0, bounds.y1);
370370}
371371
372372
r14298r14299
392392   // check for errors
393393   if (color.r < 0.0 || color.r > 1.0 || color.g < 0.0 || color.g > 1.0 ||
394394      color.b < 0.0 || color.b > 1.0 || color.a < 0.0 || color.a > 1.0)
395      throw emu_fatalerror("Illegal ARGB color value in XML: %f,%f,%f,%f", color.r, color.g, color.b, color.a);
395      throw emu_fatalerror("Illegal ARGB color value in XML: %f,%f,%f,%f\n", color.r, color.g, color.b, color.a);
396396}
397397
398398
r14298r14299
418418      case 90:   orientation = ROT90;   break;
419419      case 180:   orientation = ROT180;   break;
420420      case 270:   orientation = ROT270;   break;
421      default:   throw emu_fatalerror("Invalid rotation in XML orientation node: %d", rotate); break;
421      default:   throw emu_fatalerror("Invalid rotation in XML orientation node: %d\n", rotate); break;
422422   }
423423   if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "swapxy", "no")) == 0)
424424      orientation ^= ORIENTATION_SWAP_XY;
r14298r14299
662662
663663   // error otherwise
664664   else
665      throw emu_fatalerror("Unknown element component: %s", compnode.name);
665      throw emu_fatalerror("Unknown element component: %s\n", compnode.name);
666666}
667667
668668
r14298r14299
730730         break;
731731
732732      default:
733         throw emu_fatalerror("Unknown component type requested draw()");
733         throw emu_fatalerror("Unknown component type requested draw()\n");
734734   }
735735}
736736
r14298r14299
18571857
18581858      // error if not found
18591859      if (m_element == NULL)
1860         throw emu_fatalerror("Unable to find layout element %s", name);
1860         throw emu_fatalerror("Unable to find layout element %s\n", name);
18611861   }
18621862
18631863   // fetch common data
r14298r14299
18781878   if (strcmp(itemnode.name, "screen") == 0)
18791879   {
18801880      if (m_screen == NULL)
1881         throw emu_fatalerror("Layout references invalid screen index %d", index);
1881         throw emu_fatalerror("Layout references invalid screen index %d\n", index);
18821882   }
18831883   else
18841884   {
18851885      if (m_element == NULL)
1886         throw emu_fatalerror("Layout item of type %s require an element tag", itemnode.name);
1886         throw emu_fatalerror("Layout item of type %s require an element tag\n", itemnode.name);
18871887   }
18881888}
18891889
r14298r14299
19391939   // find the layout node
19401940   xml_data_node *mamelayoutnode = xml_get_sibling(rootnode.child, "mamelayout");
19411941   if (mamelayoutnode == NULL)
1942      throw emu_fatalerror("Invalid XML file: missing mamelayout node");
1942      throw emu_fatalerror("Invalid XML file: missing mamelayout node\n");
19431943
19441944   // validate the config data version
19451945   int version = xml_get_attribute_int(mamelayoutnode, "version", 0);
19461946   if (version != LAYOUT_VERSION)
1947      throw emu_fatalerror("Invalid XML file: unsupported version");
1947      throw emu_fatalerror("Invalid XML file: unsupported version\n");
19481948
19491949   // parse all the elements
19501950   for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element"))

Previous 15994 Revisions Next


© 1998-2018 The MESS Team