AGS.Native source code uploaded

Started by Pumaman, Wed 09/05/2012 20:14:08

Previous topic - Next topic

Pumaman

Sorry it's taken me so long to get round to this, but the final missing piece of the puzzle is now added to SVN!

https://svn.adventuregamestudio.co.uk:7743/svn/ags/trunk/Editor

As the Native assembly is a VC++ mixed mode assembly, you need the full version of Visual Studio to compile it.
Therefore, the editor code has two solution files -- AGS.Editor.NoNative.sln, which doens't include the Native DLL. This will work on the free VC# Express editions, but will reference the pre-compiled Native assembly; and AGS.Editor.Full.sln, which includes everything if you have the proper Visual Studio.

Let me know if it compiles for you or if anything is missing :)

Calin Leafshade

Excellent news! Standalone compiler incoming!

Alan v.Drake

* Dances in joy and delight *

- Alan

sonneveld

#3
Awesome.  Thanks for this!  Certainly a lot easier than what I was planning.  It seems to build fine on my machine.

A few notes/questions:
- Make sure NativeLibs and Common\libinclude are in visual studio's global lib and include paths respectively
- AGS.Native project has fixed paths for additional libs/includes in the Release build. Copying the same settings from the Debug build seems to work.
- Do you have the source for alfont?  It looks like you changed the font rendering to only change blenders when the alpha level changes (as an optimisation) and possibly you used an older/simpler version of the set_height function?
- Why was scintilla included in the static lib? Specific version or has something changed?
- Native solution still has sourcesafe references.  Seems to be safe to ignore. Any chance of using http://code.google.com/p/vss2git/ to port the whole repository to git?
- Updatecppversion crashes in debug build if Release build doesn't exist. (so build Release first :) )
- any special build instructions for the other native .libs?

edit: added extra question.

sonneveld

So who's going to work on what?  I'd like to work on porting the editor to the mac but I don't really want to duplicate effort.

As far as I know, AGS.Native's mixed mode assembly means that you won't be able to compile or run under mono. I was looking at creating a pure native lib that could be called via c#'s pinvoke but it would have been a lot of work without the source.  Another alternative would be to slowly port ags to be a pure c# application with an allegro wrapper? :) Any ideas?

timofonic

#5
So the compiler is in C++? Does it uses assembler? I have no idea of C# nor want to, I'm not a fan of programming languages owned by corporations like Microsoft or Oracle.

What about cleaning it and making it multiplatform? ;)

PS: I always forget the username and password of the svn repo, I find more comfortable to lurk into projects by using services like GitHub because of this. Can someone make me remember the read only username and password, please?

Calin Leafshade

I think the best idea is to entirely strip out the compiler from the editor *or* integrate it as pure C#.

I would prefer the latter but the former is easier.

I would argue against P/Invoke since it tends to be hacky at best in a cross-platform environment.

A better model would be to have the AGS editor as an IDE for an AGS source tree. Then the IDE just saves the source tree to disk and then invokes the compiler as a separate binary exactly how something like Eclipse + gcc might work.

This is infinitely more portable and allows us to deal with each element of the AGS source independently (IDE, Compiler, Runtime)

sonneveld

Quote from: Calin Leafshade on Thu 10/05/2012 07:58:27I think the best idea is to entirely strip out the compiler from the editor *or* integrate it as pure C#.

Thing to consider is that ags.native isn't just for compiling scripts.  There's also native code in there to read/write sprite bitmaps for editing, rendering fonts, converting sci fonts, packing data files, rendering guis, reading old formats, etc.. You could reengineer all that so the ide saves to intermediate formats but feels like a lot of work when initially I'm only interested in porting the studio to run on osx.

You're stuck with p/invoke (ags.native is mixed mode so its doing a form of p/invoke anyway) until you rewrite it all in c# or you break everything out as c++ projects.

sonneveld

Quote from: timofonic on Thu 10/05/2012 07:54:22
So the compiler is in C++? Does it uses assembler? I have no idea of C# nor want to, I'm not a fan of programming languages owned by corporations like Microsoft or Oracle.
PS: I always forget the username and password of the svn repo,

The Studio is mostly written in C# with a library written in C++ compiled to a mixedmode .net library.  C# is a very nice language/platform, you're missing out.

username: guest password: blank

TheMagician

This is indeed great news! I'm sure your code is in good hands.

timofonic

Quote from: sonneveld on Thu 10/05/2012 09:40:02
Quote from: timofonic on Thu 10/05/2012 07:54:22
So the compiler is in C++? Does it uses assembler? I have no idea of C# nor want to, I'm not a fan of programming languages owned by corporations like Microsoft or Oracle.
PS: I always forget the username and password of the svn repo,

The Studio is mostly written in C# with a library written in C++ compiled to a mixedmode .net library.  C# is a very nice language/platform, you're missing out.

username: guest password: blank

I don't miss it at all :)

Thanks!

Pumaman

Quote from: sonneveld on Thu 10/05/2012 05:48:44
- AGS.Native project has fixed paths for additional libs/includes in the Release build. Copying the same settings from the Debug build seems to work.

Good point thanks, I didn't check the release build. I've committed a fix.

Quote
- Do you have the source for alfont?  It looks like you changed the font rendering to only change blenders when the alpha level changes (as an optimisation) and possibly you used an older/simpler version of the set_height function?

Yep I'll try and dig it out, basically at some stage a new version of alfont changed the meaning of set_height but for backwards compatibility I didn't want this since it broke the font sizes that people were using in AGS, so I hacked it back to use its old-style font sizes.

Quote- Why was scintilla included in the static lib? Specific version or has something changed?

There are a few custom tweaks to it for AGS. Diff it with the standard source release to see what they are.

Quote- Native solution still has sourcesafe references.  Seems to be safe to ignore. Any chance of using http://code.google.com/p/vss2git/ to port the whole repository to git?

thanks I've checked in a fix with the source control bindings removed. I'll look into git at a later date.

BigMc

#12
That's great news! Maybe someone should write a news entry for the AGS blog.

Quote from: sonneveld on Thu 10/05/2012 05:56:16
So who's going to work on what?  I'd like to work on porting the editor to the mac but I don't really want to duplicate effort.

As long as there's no official community git repository where more people can get commit access, you should start on github or something, keep it working on Windows and announce it here (the creation of the repository). Then hopefully others will align their work with yours.

In the moment I'm mainly interested in a command line compiler for Linux to make it possible to add open source AGS games to Linux distributions (when the ScummVM engine or another proper Linux engine is ready).

sonneveld

Well I started splitting ags.native so there was a native dll linked with a managed dll via swig.  I got far enough that you could open a project and view most resources but I stopped halfway through trying to get the project saving working. I haven't had time to work on it lately.  When I get back home I'll try and remember to push the changes I made to my github repository if someone else would like to continue working on it.

BigMc

Do you mean you can open projects using Mono on Mac OS X?

timofonic

Can that be useful for having a separate AGS compiler without requiring C# too?

SMF spam blocked by CleanTalk