Flatbuffers schemas need to be open sourced

It seems the way cocos2d-x is structured right now I can not upgrade flatbuffers… (Or I’m just an idiot and can’t find the schemas anywhere).

All the generated headers are checked into cocos2d-x and none of the flatbuffers schema’s are available for re-generation… This pretty much makes it impossible for me to build cocos2d-x with the latest flatbuffers library instead of currently whats used (flatbuffers v1.0). This is obviously is not ideal for an open source project.

Am i missing something here? Is the a flag to disable ‘editor-support’? Where are the flatbuffer schemas so I can rebuild the generated files with an upgraded flatbuffers compiler? (CSParseBinary, CSTabControl, CSLanguageDataBinary, etc,).

Thoughts? @ricardo

@zhangxm do you know where are the schemas? in the Cocos Studio repository ?

Sorry, i don’t know it. I will ask other guys, but i am not sure if they know it or not because the team is canceled.

@zhangxm What do you mean by the team is cancelled?

Flatbuffer is added and used by Cocos Studio. As Cocos Studio is canceled, so the team is canceled too.

@zhangxm Ahh I understand.

I’m sure the schemas would be in the Cocos Studio repository… They typically have a .fbs file extension. Thanks for looking into this.

FBS_files.zip (5.1 KB)

@noodlecake i found the .fbs files, hope i can help you.

2 Likes

Maybe drop these in the repo under editors/cocos-studio folder?

@stevetranby sounds like a good idea, but i don’t know what .fbs files are needed and if these files work or not. @noodlecake will you please help to verify if these files work or not and are these files all needed.

@zhangxm Yes those are the correct files. These files do work, and I have used them to upgrade to flatbuffers 1.4. However, the schemas in these .fbs files you attached don’t seem to match the current schema in cocos2d-x… So I’m assuming there is a version mismatch somewhere. Seems related to a field called ‘WidgetOptions’ that doesn’t seem to be present in the current cocos2d-x project I have…

Anyways, these are the correct files and can be used. Thx.

@noodlecake yep, Cocos Studio has some branches. I can upload all versions, and could you please help to check which one can work?

@zhangxm Sure, if you upload all the versions I can certainly find the one that is current with the cocos2d-x v3 branch.

@noodlecake thanks, i updated all branches’ files. Please help to verify it.
fbs-files.zip (52.2 KB)

The one in Mono_3.6 seems like the one that is consistent with the latest version.

Thanks for testing. So i will update the files into editor/cocos-studio as @stevetranby’s suggestion.

I added the fbs files: https://github.com/cocos2d/cocos2d-x/pull/16808

1 Like

@noodlecake hi, can you share your generated flatbuffer file, I just try to generate but it show some error with cocos2dx 3.13.1 in ButtonReader, should I edit ButtonReader.cpp ?

You may have to edit some cocos2d-x source based on the version of flatbuffers you are using… ( and based on the what options you are providing to flatc )

@noodlecake are you sure that .fbs are correct? I tried to update flatbuffers to 1.5, and found there are many compiling errors.

flatc compile errors? Or c++ compile errors in cocos2d-x with the generated schemas?