Jump to content

labsin

Members
  • Posts

    13
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by labsin

  1. 6 hours ago, superolelli said:

    Hi,

    i downloaded the sourcecode from github and I wanted to try the example, but got a compilation error. The problem is, that the method newImageFile in examplefilefactory.h does not override the method in filefactory.h properly. Obviously the code of the "core-engine" has been changed, but the example hasn't been updated. I tried to fix it myself, but it didn't work out, because I've never used this code before. I just wanted to get used to it and how it is working.

    Can someone fix the example? Would be very nice :)

    Greetings

    superolelli

    I'm updating the examples right now. I've already done a pull request with the fix and an scon loader.

    I'll also add atlas data to the example.

  2. I opened the GreyGuy scml file and saved it as scon. Now when I try the file in my scon parser, I have no sprites. I only have bones. There are no sprite objects in the obj_info property of the player entity.

    In the scon file there is:

    			"name": "Player",
    			"obj_info": [
    				{
    					"h": 10,
    					"name": "pelvis",
    					"type": "bone",
    					"w": 200
    				},
                  ...,
    				{
    					"h": 10,
    					"name": "back_foot",
    					"type": "bone",
    					"w": 200
    				}
    			]

     but the scml file has:

    
            <obj_info name="p_torso_idle" type="sprite">
                <frames>
                    <i folder="0" file="0"/>
                    <i folder="0" file="1"/>
                    <i folder="0" file="2"/>
                </frames>
            </obj_info>
    		...
            <obj_info name="p_foot_walk_a" type="sprite">
                <frames>
                    <i folder="5" file="1"/>
                    <i folder="5" file="5"/>
                </frames>
            </obj_info>
            <obj_info name="pelvis" type="bone" w="200" h="10"/>
    		...
            <obj_info name="back_foot" type="bone" w="200" h="10"/>

    Is this normal?

  3. 1 hour ago, Banbury said:

    When I'm using the library, I only need the compiled and linked lib file and the header files. Currently the header files are mixed with the source files. So if I want to use them, I have to collect them from a dozen different folders. That's why in C/C++ one usually has a src folder with all the .c/.cpp files and an inc folder with all the .h/.hpp files. (The src and inc folders can have subfolders.)

    Why do you need to collect the header files? You only need to set the include directory so the compiler finds them.

  4. 1 hour ago, conceptgame said:

    ...

    In settings.cpp, I have set the following:

        bool Settings::reverseYOnLoad = true;
        bool Settings::reversePivotYOnLoad = true;
        bool Settings::reverseAngleOnLoad = false;

    ...

     

    Instead of changing the values in the engine, you can overwrite them in your implementation with calling the following somewhere:

    SpriterEngine::Settings::reverseYOnLoad = true;
  5. 5 hours ago, jeremyjh said:

    I've started an integration of SpriterPlusPlus into Cocos2d-X, a new library called Spriter2dX. It does not yet have much platform support (only tested with CMake for Linux) but I will be adding that as I finish integrating this into the game I am developing. I expect to have Android done very soon, other platforms may follow and of course I'll take pull requests for them.

    I found this pretty easy to do, I think SpriterPlusPlus has a pretty good design for extension points. Cocos2d-X has a very different rendering system than for example SFML - so the ImageFile override had to work considerably differently. In Cocos2dX we don't just render a sprite to the screen, instead each object on the screen has a persistent object in a scene graph which will get rendered in a batch. So to work in the SpriterPlusPlus model I have each CCImageFile manage a pool of cocos2d::Sprite objects that it will position for a single tick. I have an example where I ported shamelessly robbed SpriterPlusPlus's example and its able to run 100 Grey Guy animations at about 50 fps on my laptop, haven't tried it with a real GPU.

    Great to see the CMake changes getting used by someone.

    I had the same problem with the qt 5 screne graph port. With the added problem that the nodes need to be created from a separate thread when asked to by the renderer. I solved it by relying on the zOrder returned by the sprite entity. This seems to be reliable. And the vectors aren't removed when they change so it's safe to keep the pointer to it.

  6. My SpriterPlusPlusQt is now in a working state. You should now be able to build and run it.

    Using it from QML is very easy.
    I created an example that's more or less the same as the SFML one (creating 100 random entities). Each frame is 10ms, so performance is good.

    Now I need to add more features (sound, ...) and optimize a bit.

    Still a question, are there some dimensions on the animation as a whole I could use? A bounding box.

  7. I'm writing a Qt implementation. I also include a documentwrapper using QtDom (a xml library).
    It seems this library doesn't provide access to xml attributes in a specific order (this is according to xml spec).
    So I've made a pull request to not expect the attributes to be in the right order.

    I've also used Valgrind to check for memory leaks and found a bunch of issues.
    I've added commits for that in the same pull request. Feel free to cherry-pick what you want.

    I also noticed something strange. In EntityInstanceData::setObjectInstance and other methods of the class, the id's already exist. So if you do ...map.insert(...) it basically does nothing, yet a new object is created in the method that's never deleted. I've added a check and a error message. I didn't check where the double id's came from.

  8. I don't like the layout of the repo. I think the spriterengine should be in it's own repository, so I can add it as a git submodule to my project. You could then add another repo with the example.

    Adding binary files to the repo is a bit strange. You could add a download link in the README or add them to the Release tab. And this repo is meant for developers that want to build their own implementation, so they'll need to build it anyway.

    Only using Visual studio as build option is a bit cumbersome for Unix/Linux devs. CMake would be a great option. It's cross platform and extendable. You could add it to the example and the engine and let them work together. SFML is also using it.

×
×
  • Create New...