MiniB3D patch page thought

BlitzMax Forums/MiniB3D Module/MiniB3D patch page thought

gman(Posted 2006) [#1]
ive been thinking lately about MiniB3D and updating it. i really hate to break off the mainline development as moving in changes each release would start to be painful. i fully understand simon's position and his decision to keep it simple. at the same time, i think there is a lot of functionality out there that can benefit MiniB3D but is not in the mainline development. then hybrids patch page for Irrlicht came to mind. basically its a page of .patch files that fix or add functionality to Irrlicht but is not in the mainline development. i would be happy to host/maintain the site as well as provide a few patches if there is interest. it would mean others submitting your patches to me and maintaining them as well. while i would love to do that i simply dont have the time. to see an example, the Irrlicht patch page can be found at:

http://parsys.informatik.uni-oldenburg.de/~hybrid/irrlicht/

i can also write a quick tutorial on creating patches as well. thoughts?


Picklesworth(Posted 2006) [#2]
Good idea.
Excellent idea, in fact.

Such a site would need some pretty wisely set up versioning / dependency stuff, but it could be done and it would keep our wishes for more out of Simon's hair :)


(And on the topic of MiniB3d... it truly is a beautiful piece of work).


North(Posted 2006) [#3]
I certainly like the idea if it turns out to be maintainable.

If you initiate it gman i got faith it will work out ;)


simonh(Posted 2006) [#4]
Good idea gman! I guess I could host the patches on my own page, it would be easy to setup. No idea how patches work though, so that tutorial would be appreciated.


gman(Posted 2006) [#5]
very glad you like the concept simon :)

i will attempt to make an example of my factory modification for MiniB3D. this wraps all the new statements into factory so that a developer can extend the base types the engine uses. ie if the dev wanted to add something to TMesh, then they can extend TMesh, implement their new TMesh in the factory, and the engine will use the extended TMesh for everything.

first you will need a patch tool. this is pretty much stock on linux systems, but for windows its a different story. download the windows unix tools at:

http://unxutils.sourceforge.net/

after extraction, copy the UnixUtils\usr\local\wbin\patch.exe and diff.exe files to the MiniB3D root (same as where MiniB3D.bmx resides).

i have two batch files, one for creating a patch and one for applying a patch.

create.bat
diff -U 10 MiniB3D_orig.bmx MiniB3D.bmx > %1.patch

apply.bat
patch -p1 < %1.patch

both bat files take a parameter of the name of the patch.

make a copy of the original MiniB3D.bmx and call it MiniB3D_orig.bmx.

make all modifications for a certain patch to MiniB3D.bmx. in my case the MiniB3D factory. when you are ready to make the patch, from the command line in the MiniB3D directory call:


create patchname


where "patchname" is the name of the patch file you want to create. in my case i used:

create factory


the resulting file should be called "patchname.patch" or in my case "factory.patch". this file contains the differences between the original MiniB3D.bmx and my factory version.

now, to apply the patch, rename the current MiniB3D.bmx to MiniB3D_factory.bmx. copy MiniB3D_orig.bmx and call it MiniB3D.bmx. MiniB3D.bmx should now be the stock MiniB3D file.

call the apply bat file from the command line like:

apply "patchname"


in this case run:

apply factory


this will apply the patch file to the MiniB3D.bmx file. it does do a decent job with differences in the files so adding a patch to a file already patched by a different patch or one with modifications will work. if another patch modifies a line or a line has been edited that this one was supposed to patch it will generate a file of lines that could not be patched so the differences can be worked out by the dev.

this is quick and dirty so i expect questions :) for reference, my created patch file looks like:



simonh(Posted 2006) [#6]
Blimey, that's a lot of effort. Is anyone really going to go to that much trouble to update MiniB3D?

Maybe I can write a small app to automate the process. Thanks for going to the touble of writing the tutorial.


FlameDuck(Posted 2006) [#7]
What's wrong with just using Subversion?


Picklesworth(Posted 2006) [#8]
Subversion is right below this :)
Updates still should be done with patches, though. They're quite neat little things, and easy enough if you have a working SVN GUI or a decent text console.