Jump to content

thomcc

Members
  • Posts

    3
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

thomcc's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi! I'm working on a C++ library for parsing and rendering SCML files and I had a few questions about the format (specifically where it's going compared to what is described in the ScmlReference). I think this link to a SCMLFormatSpecification PDF is dated, but I have a few questions about how much of it is still planned to be used (or, how much the current plan for the spec has diverged from it). [*:189oq8sy] Are meta_data elements part of the B5 spec? If so, where can they appear? (or B6, though I haven't played with it yet as my primary computer doesn't run Windows) [*:189oq8sy] Are atlas elements implemented in Spriter? I thought not, but this post makes me doubt myself: http://www.brashmonkey.com/forum/viewtopic.php?f=10&t=12686. [*:189oq8sy] The hierarchy element is gone, along with non-ref bones and objects in mainline keys, right?
  2. Probably just providing (weak) exception safety without throwing exceptions would be best, IMO. It's usually someone who blames the STL because they chose the wrong datastructure or algorithm at one point. Also the std associative (set, map, ordered and unordered) containers tend to be slow, and require mallocs on every insertion, which is very unfortunate. Still, these people will almost always be more happy with their own implementations anyway, so I'm not sure those people are worth catering to. Regardless, I'm not sure how much of your code I'd be able to reuse if I took over your implementation. Well thats not really true, to be honest I have a fairly hard time understanding (huge single file, lots of nested classes many with same name) and am very uncomfortable when I make changes to it. But there's a lot I would change (you use heap the much more than I would, you use a map where I would use a vector, I rarely, if ever, use nested classes, etc). I've made some changes to make it work better with the most recent version of SCML files (nothing major, just fall back to the pivot_x and pivot_y values in a file when missing in an object), but after struggling with the code for a while (unable to get x-flipping to work, unable to understand what your code does to handle it (should rotate_point() be doing something about the flip parameter?)) I've more or less given up and started working on a separate implementation, which I'll try to release in the near future.
  3. Hey, thanks a ton for writing this library and releasing it under such a permissive license, I really appreciate it. I'm just starting to use it, and I've noticed that there are a few bugs in the SFML renderer. In SCML_SFML.cpp, in FileSystem::loadImageFile on lines 18-21: you do a null check after dereferencing the pointer. This obviously make no sense, as new throws on failure, not returns NULL anyway. If the check succeeded, then you would leak img. As it is, you never check if the filename is valid. I think what you meant to do is check if the loadFromFile call succeeded. The right way to do that would be something like: if (!img->loadFromFile(filename)) { delete img; return false; } ... Not to mention that img can be leaked several other ways. If images throws when inserting the img (e.g. because the map failed to allocate a new node), or if img->loadFromFile freakishly throws (It shouldn't but could if it allocates memory)... But I digress. (There's no way I could convince you to use smart pointers, is there? c++11's std::unique_ptr is exception safe and has no overhead, after all... probably not, as you won't even commit to using the standard library of all things!). Anyway, thought you might want to know. This is the only issue I see in the renderer. Eventually I'm sure I'll end up needing to peek in SFMLpp.{h,cpp}, and if I see anything in there I'll post about it here too. Thanks again for taking the time to write SFMLpp.
×
×
  • Create New...