src/emu/rendlay.c
| r14298 | r14299 | |
| 362 | 362 | bounds.y1 = bounds.y0 + xml_get_attribute_float_with_subst(machine, *boundsnode, "height", 1.0f); |
| 363 | 363 | } |
| 364 | 364 | else |
| 365 | | throw emu_fatalerror("Illegal bounds value in XML"); |
| 365 | throw emu_fatalerror("Illegal bounds value in XML\n"); |
| 366 | 366 | |
| 367 | 367 | // check for errors |
| 368 | 368 | 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); |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
| r14298 | r14299 | |
| 392 | 392 | // check for errors |
| 393 | 393 | if (color.r < 0.0 || color.r > 1.0 || color.g < 0.0 || color.g > 1.0 || |
| 394 | 394 | 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); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | |
| r14298 | r14299 | |
| 418 | 418 | case 90: orientation = ROT90; break; |
| 419 | 419 | case 180: orientation = ROT180; break; |
| 420 | 420 | 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; |
| 422 | 422 | } |
| 423 | 423 | if (strcmp("yes", xml_get_attribute_string_with_subst(machine, *orientnode, "swapxy", "no")) == 0) |
| 424 | 424 | orientation ^= ORIENTATION_SWAP_XY; |
| r14298 | r14299 | |
| 662 | 662 | |
| 663 | 663 | // error otherwise |
| 664 | 664 | else |
| 665 | | throw emu_fatalerror("Unknown element component: %s", compnode.name); |
| 665 | throw emu_fatalerror("Unknown element component: %s\n", compnode.name); |
| 666 | 666 | } |
| 667 | 667 | |
| 668 | 668 | |
| r14298 | r14299 | |
| 730 | 730 | break; |
| 731 | 731 | |
| 732 | 732 | default: |
| 733 | | throw emu_fatalerror("Unknown component type requested draw()"); |
| 733 | throw emu_fatalerror("Unknown component type requested draw()\n"); |
| 734 | 734 | } |
| 735 | 735 | } |
| 736 | 736 | |
| r14298 | r14299 | |
| 1857 | 1857 | |
| 1858 | 1858 | // error if not found |
| 1859 | 1859 | 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); |
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | 1863 | // fetch common data |
| r14298 | r14299 | |
| 1878 | 1878 | if (strcmp(itemnode.name, "screen") == 0) |
| 1879 | 1879 | { |
| 1880 | 1880 | 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); |
| 1882 | 1882 | } |
| 1883 | 1883 | else |
| 1884 | 1884 | { |
| 1885 | 1885 | 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); |
| 1887 | 1887 | } |
| 1888 | 1888 | } |
| 1889 | 1889 | |
| r14298 | r14299 | |
| 1939 | 1939 | // find the layout node |
| 1940 | 1940 | xml_data_node *mamelayoutnode = xml_get_sibling(rootnode.child, "mamelayout"); |
| 1941 | 1941 | if (mamelayoutnode == NULL) |
| 1942 | | throw emu_fatalerror("Invalid XML file: missing mamelayout node"); |
| 1942 | throw emu_fatalerror("Invalid XML file: missing mamelayout node\n"); |
| 1943 | 1943 | |
| 1944 | 1944 | // validate the config data version |
| 1945 | 1945 | int version = xml_get_attribute_int(mamelayoutnode, "version", 0); |
| 1946 | 1946 | if (version != LAYOUT_VERSION) |
| 1947 | | throw emu_fatalerror("Invalid XML file: unsupported version"); |
| 1947 | throw emu_fatalerror("Invalid XML file: unsupported version\n"); |
| 1948 | 1948 | |
| 1949 | 1949 | // parse all the elements |
| 1950 | 1950 | for (xml_data_node *elemnode = xml_get_sibling(mamelayoutnode->child, "element"); elemnode != NULL; elemnode = xml_get_sibling(elemnode->next, "element")) |