On 2/13/07, Keith Gable <[EMAIL PROTECTED]> wrote:
> On 2/12/07, Ralph Versteegen <[EMAIL PROTECTED]> wrote:
> > On 2/13/07, Keith Gable <[EMAIL PROTECTED]> wrote:
> > > Hey guys,
> > >
> > > I'm in a class where we're learning C++ data structures. I've been 
> > > thinking
> > > of some useful dataset I can work on to help make sure I know what I'm
> > > doing. Then it hit me -- you guys are still loading .RPG files from
> > > FreeBasic! :) So, I'm wondering....
> >
> > Huh?
>
> It's my understanding that FreeBasic is like VB in that it's compiled
> to "fake" code and is then executed by an interpreter. So, using a C
> library to do this will be faster. If it's not, then it's really the
> same either way... :)
>

Oh, no, it's compiled! It's slower than C, but only because the
compiler is no where near as advanced at optimisation as compilers
like GCC - something which will hopefully change in the future.

Sure, unlumping speed could be improved, especially by not unlumping
at all (instead keep offsets to each lump) - which has been suggested
and was rejected at the time because of memory constraints - we were
still using QB.

>
> >
> > >
> > > 1) How useful would a native code lump/unlump library be to OHRRPGCE?
> > > Preferably, I don't want to mess with underlying implementation of stuff
> > > right now (so -- basically, just extract lumps into memory and such). So,
> > > you could call it liblump.so/lump.dll or something like that. Later, if 
> > > it's
> > > useful, I could try for a librpgfile.so/rpgfile.dll that does all of that
> > > underlying parsing.
> > >
> >
> > What do you mean by native code?
>
> Again, I understand that FreeBasic is interpreted. If not, nevermind :)
>
> >
> > Well, that sort of library would be useful to programs which access
> > RPG files. I tried to make a lump.dll for Fyre for VB, but I don't
> > think he got it working - VB seems to require special activex dlls or
> > something.
>
> DLLs work fine. You have to use Declare Function. Something like this:
>
> In C:
> int function_name(int &var1, int var2);
>
> In VB:
> Declare Function function_name Lib "dllname.dll" (ByRef var1 As
> Integer, ByVal var2 As Integer) As Integer
>
> If you actually want to associate the DLL with the project, it has to
> be an ActiveX DLL. It's easier to do it using Declare Function. Or,
> option #2 is to write a .ocx (ActiveX Control) in VB that executes
> stuff in the DLL and then have VB users use the VB OCX. Slower, but
> hey, it's VB6. :)

Maybe. But I don't have a copy of VB.NET to try it out with, I only
tested my dll with FB.

>
> >
> > Have a look at OHR++, it includes unlumping to memory and a (nearly
> > finished?) RPG file loader.
>
> Ahh.... If there's already a project, nevermind! :)
>
> >
> > > 2) Does FreeBasic support C++'s ABI, or does it only support C?
> > >
> >
> > Only C. See Mike's wrapper for the audiere library.
>
> Ouch. Nobody supports the C++ ABI except those coding in C++ -_-.
>
> --
> Keith Gable
> Lead Programmer / Project Leader
> The Ignition Project <http://www.ignition-project.com/>
>
> [Ask me how you can get a free Gmail account - Now with Google Chat!]
> _______________________________________________
> ohrrpgce mailing list
> [email protected]
> http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org
>
_______________________________________________
ohrrpgce mailing list
[email protected]
http://lists.motherhamster.org/listinfo.cgi/ohrrpgce-motherhamster.org

Reply via email to