Pages: 1
Author Topic: Pls explain Lateral GM's source code  (54,109 Views)
Offline (Unknown gender) Mangolion

Member
Joined: Sep 2014
Posts: 19
View profile
Posted on: September 11, 2014, 02:46:42 AM
I am planning to run Lateral GM on Android, I have experiences making Android Apps, I can design rather complex GUI. However, I am a complete newbie when it comes to Java's Swing, looking at the jumble that is Lateral GM's code on GUI, I have absolutely no idea where to start. Could someone please draw me a picture of its GUI components or something?
Offline (Unknown gender) Goombert

Developer
Joined: Jan 2013
Posts: 2,991
View profile
Reply #1 Posted on: September 11, 2014, 03:23:25 AM
There was an attempt to document LateralGM's editors, there is not much documented about LateralGM's code, you'd have to search the Wiki but I can't really provide anything as I don't think there is much available that would be of use to you. The structure of the program is quantitative to specifics, when it comes to specific things I could better assist and explain to you the components or code involved in a working system of the program. It would be a better idea for you ask specific questions about how something works.

Overall when LGM is launched it loads any jars from a plugins folder, such as the ENIGMA plugin which adds a new format and compiler capabilities. Otherwise LateralGM executed by itself is just a program for editing the GM projects.
Offline (Unknown gender) Mangolion

Member
Joined: Sep 2014
Posts: 19
View profile
Reply #2 Posted on: September 11, 2014, 01:38:00 PM
I know that LG is only meant to edit GM files, I am going to port it onto Android so I can create files on the fly on my tablet. Perhaps in the future we can literally compile enigma projects on Android! There are already C++ compilers on the OS.
Offline (Unknown gender) daz

Contributor
Joined: Jul 2010
Posts: 167
View profile
Reply #3 Posted on: September 11, 2014, 09:00:48 PM
I think you vastly underestimate the amount of work that would go into making an LGM Android port. You would be best off creating your own fork, salvaging the back end and recreating the front end yourself.

Also unless you change how files are loaded, you'll likely be running into out of memory errors with larger project files. I would really not recommend you proceed unless you have a strong stomach.
Offline (Unknown gender) Mangolion

Member
Joined: Sep 2014
Posts: 19
View profile
Reply #4 Posted on: September 12, 2014, 02:13:03 PM
Most Android phones nowadays have 1-2 GB of Ram, so out of memory is no longer a concern, I am thinking of maybe making a library with all of the GUI components and gmk file loading. But I can't figure out how to decode the gmk file and put in the values, perhaps someone could tell me a little about how to open it through Lgm's source code?
I won't be starting the project for a while though, I'm planning to develop a special ide environment for Android tablets that allows viewing of multiple windows(like the lgm IDE) and that i'll take some time.
Offline (Unknown gender) sorlok_reaves

Contributor
Joined: Dec 2013
Posts: 260
View profile
Reply #5 Posted on: September 12, 2014, 02:49:58 PM
You can have a look at the following file, which reads older (GMK) files:
https://github.com/IsmAvatar/LateralGM/blob/master/org/lateralgm/file/GmFileReader.java

There are similar readers in the same package for reading GMX files, etc.
Offline (Unknown gender) Mangolion

Member
Joined: Sep 2014
Posts: 19
View profile
Reply #6 Posted on: September 12, 2014, 05:15:07 PM
Thx, I'll look into it
Offline (Unknown gender) IsmAvatar

LateralGM Developer
LGM Developer
Joined: Apr 2008
Posts: 877
View profile
Reply #7 Posted on: September 17, 2014, 03:22:22 AM
Our wiki has a good deal of information to help you with developing LGM. For starters, getting the code set up for dev initially is documented here:
http://enigma-dev.org/docs/Wiki/LateralGM:Developing

Understanding the layout of the code is the next task, documented here:
http://enigma-dev.org/docs/Wiki/LateralGM:Packages

All of the file-handling code is contained within /org/lateralgm/file/
All of the frame code for e.g. the frame shon for editing a Room or an Object is contained within /org/lateralgm/subfarmes/
All of our custom components, like custom widgets like the ResourceMenu and IntegerField, are in /org/lateralgm/components/


While LGM was designed to be cross-platform, and mobile devices technically support it (since it is Java), I never considered it worthwhile to do, due to the extreme limitations of mobile platforms (such as the lack of a normal keyboard or two-button mouse) which make IDEs on them less-than-trivial. So while you're welcome to do it, and I'm certainly not going to stop you, I'd just discourage it because it seems silly. Instead, you might try shifting your efforts towards getting games to compile for mobile devices (enigma-side).
Pages: 1