Author Topic: wxFRED: March '13 Progress Report  (Read 11185 times)

0 Members and 1 Guest are viewing this topic.

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
wxFRED: March '13 Progress Report
wxFRED2 WIP builds (Windows)
wxFRED2d_13-3-10.exe - Debug build, requires MSVC debug libraries
wxFRED2r_13-3-26.exe - Release build


wxFRED2 patch file (vs. r9565)
wxFRED2d_13-3-23.patch


(Scroll down for pic's)


Well, it's been about 2 months since I started on the wxFRED project, and I thought it might be a good idea to say something about it.

First off, some good news: I've managed to get most of the editors (down to Mission Specs Editor, starting from the top of the Editors menu list) graphics implemented. Bad news? well...

Today, I did an OS theme switch to test whether or not wxFRED would match the color theme of the OS (it does by default). However, when I was doing this I had wxFormBuilder still open. There was no indication that anything was wrong until I tried to save my changes, at which point it decided to crash.

No big deal, right? Kinda is. wxFormBuilder crashed while it was doing the save, thereby nuking the project file completely and trashing whatever saves I had made, along with all progress I had made up until that point. Clumsy me, thinking that such a thing would never happen, did not think it was pertinent to make backups, so I'm basically back to where I started as far as the project file goes...

The silver lining, however, is that I still have a copy of the C++ code that was generated by wxFormBuilder, and I can still compile it in MSVC and get wxFRED to run and show up. It's just that I'll have to completely redo the project file before I can make any  more progress.


Attached:

Notable changes:
I've switched from using the generated XRC files to generated C++ files (wxFRED_base.cpp and wxFRED_base.h). This should allow coders to create their own versions of the wxFRED windows and dialogs by using class inheritance and OOP techniques. This should come in handy whenever a custom or less common widget is needed, such as a floating point spin control (spin controls are usually only integers) and a listbox tool on the FRED toolbar (the new ship type selection).

Windows, frames, and dialogs are named accordingly, so a dlgSomeEditor is expected to be something that has at least an OK button while a frmSomeFrame is something that has more oomph, same thing basically goes for all of the controls, such as btnOK, chkSomeFlag, etc.

All windows and editors are currently restricted to an initial size max of 800x600. It is expected that a number of frames and dialogs will be re-sizable, especially those with multi-line text boxes, such as the Mission Specs editor.

I currently have it setup so that child windows are referenced by their parent windows by way of pointers. The child windows themselves are instanced in heap memory, and should technically be able to run alongside other windows, such as highlighting waypoints in the main FRED window when you're using an editor on them, or real-time updating the position and orientation of selected object(s) from the Object Position/Orientation editor. Oh, and it should allow for better memory management in the future.

The home screen of wxFRED as designed in wxFormBuilder (note lack of the ship listbox):


The home screen of wxFRED, as seen on the first .exe:


Ship Editor:


Background Editor:


Asteroid Field Editor:


Mission Specs Editor:


Mission Specs Editor's Sound Environment child dialog (is also the progress photo just before the crash):




« Last Edit: March 29, 2013, 06:50:24 am by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline General Battuta

  • Poe's Law In Action
  • 214
  • i wonder when my postcount will exceed my iq
Re: wxFRED: March '13 Progress Report
Looking good! Sounds like you should get an SVN or Git repo, though.

 

Offline karajorma

  • King Louie - Jungle VIP
  • Administrator
  • 214
    • Karajorma's Freespace FAQ
Re: wxFRED: March '13 Progress Report
Looks good to me too.
Karajorma's Freespace FAQ. It's almost like asking me yourself.

[ Diaspora ] - [ Seeds Of Rebellion ] - [ Mind Games ]

 
Re: wxFRED: March '13 Progress Report
Alright, now it just needs a back end :D Pity about the project files though... Is there no way to regenerate them from the source or something?

I'll test the patch on Ubuntu as soon as I can find the time.

Looking good! Sounds like you should get an SVN or Git repo, though.
wxFRED is on the FSO SVN... Not sure if it would be sensible to split the two, given that some of the code will likely be shared (I think?)

 
Re: wxFRED: March '13 Progress Report
Unfortunately, I was never able to compile wxFRED2. Not back when it was started and not now with the patch.
make always says:
Code: [Select]
make[1]: Entering directory `/home/maniac/Desktop/sources/fs2_open/code'
  CXX    wxfred2.o
wxfred2/wxfred2.cpp:7:23: fatal error: wx/wxprec.h: No such file or directory
compilation terminated.
make[1]: *** [wxfred2.o] Error 1
make[1]: Leaving directory `/home/maniac/Desktop/sources/fs2_open/code'
make: *** [all-recursive] Error 1
I also tried to symlink the files in question into the fs2-source. Worked for a few of them but not everytime.
Other wxWidgets-projects compile fine, though...

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
Alright, now it just needs a back end :D Pity about the project files though... Is there no way to regenerate them from the source or something?

Most of the RAD tools & WYSIWYG editors for wxWidgets that I've heard about feature the ability to generate a project file from a .XRC, which is a filetype integral to the wxWidgets libraries. In addition to generating C++ files, I'll set up the new project file so that wxFormBuilder will also generate an .XRC, so that when a better designer is found we can switch over to it. :D

Looking good! Sounds like you should get an SVN or Git repo, though.
wxFRED is on the FSO SVN... Not sure if it would be sensible to split the two, given that some of the code will likely be shared (I think?)

Yes, wxFRED2 is on the FSO SVN, as is the original FRED code. I believe the intention concerning the SVN is to get wxFRED working before making any official commits... While this does prevent any potential "fruitless" commits from the wxFRED project, it does hinder development by other members a bit.

Unfortunately, I was never able to compile wxFRED2. Not back when it was started and not now with the patch.
make always says:
Code: [Select]
make[1]: Entering directory `/home/maniac/Desktop/sources/fs2_open/code'
  CXX    wxfred2.o
wxfred2/wxfred2.cpp:7:23: fatal error: wx/wxprec.h: No such file or directory
compilation terminated.
make[1]: *** [wxfred2.o] Error 1
make[1]: Leaving directory `/home/maniac/Desktop/sources/fs2_open/code'
make: *** [all-recursive] Error 1
I also tried to symlink the files in question into the fs2-source. Worked for a few of them but not everytime.
Other wxWidgets-projects compile fine, though...

That has to do with the precompiled headers, MSVC's compiler isn't bother by the fact that they're not really needed, but apparently make is bothered. Try using the attached patch on wxfred2.cpp to see if it helps...



[attachment deleted by a basterd]
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
Thanks for the patch but somehow my system doesn't like wxFRED2 (?), because now it won't even find wx.h...
A few days/weeks ago I tried many things: Cusomizing the C(XX)FLAGS, LDFLAGS and whatnot, copying the header-files into the code-directorys of fso, but nothing really helped. There were always header-files it didn't find.
wxLauncher, on the other side, compiles fine and I couldn't find any major differences in the way CFLAGS were set or the header-files were included... Strange...
Maybe I'll experiment a bit more.
As for SVN, can't you get a wxFRED2-branch in the FSO-Repository?

EDIT
Okay, the patch worked. It didn't find the wx.h because the path was written with a backslash in other files (<wx\wx.h>). Now it fails with this
Code: [Select]
In file included from wxfred2/frmFRED2.h:36:0,
                 from wxfred2/wxfred2.cpp:22:
wxfred2/frmTeamLoadoutEditor.h:30:8: warning: extra tokens at end of #endif directive [enabled by default]
wxfred2/wxfred2.cpp:37:2: warning: identifier 'nullptr' is a keyword in C++11 [-Wc++0x-compat]
wxfred2/wxfred2.cpp: In member function 'virtual bool wxFRED2::OnInit()':
wxfred2/wxfred2.cpp:37:18: error: 'nullptr' was not declared in this scope
make[1]: *** [wxfred2.o] Error 1
make[1]: Leaving directory `/home/maniac/Desktop/sources/fs2_open/code'
make: *** [all-recursive] Error 1
Maybe the -Wc++0x-compat CFLAG alredy will fix this, but for now I won't try it.
« Last Edit: March 12, 2013, 08:07:51 am by Mr_Maniac »

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
Which IDE or toolset are you using? Currently I have a MSVC 2010 project that I'm working on, but I can also make a code::blocks project file.

It'll ultimately be committed to trunk, but for now I'll be making forum posts with attached .diff's or .patch's. As soon as I can grab a copy of Git, I'll have it setup so that I can make a local repo and not worry about manual backups.

Edit: Ok, yeah. The -Wc++0x-compat flag should work. MSVC 2010 snuck in a few keywords and other goodies from the C++10 language spec while the ISO folk were finalizing things.
« Last Edit: March 12, 2013, 08:34:35 am by z64555 »
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: wxFRED: March '13 Progress Report
Yes, wxFRED2 is on the FSO SVN, as is the original FRED code. I believe the intention concerning the SVN is to get wxFRED working before making any official commits... While this does prevent any potential "fruitless" commits from the wxFRED project, it does hinder development by other members a bit.
Whose intention is this?  I don't think there would be a problem if you committed your changes.  WxFRED isn't subject to the FSO code freeze.

 
Re: wxFRED: March '13 Progress Report
Which IDE or toolset are you using? Currently I have a MSVC 2010 project that I'm working on, but I can also make a code::blocks project file.
No IDE at all ;)
Under Linux, I only update the code (svn trunk), configure and make.
Under Windows I download the binaries. But most time I play FS2 in Linux.

  

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
Yes, wxFRED2 is on the FSO SVN, as is the original FRED code. I believe the intention concerning the SVN is to get wxFRED working before making any official commits... While this does prevent any potential "fruitless" commits from the wxFRED project, it does hinder development by other members a bit.

Whose intention is this?  I don't think there would be a problem if you committed your changes.  WxFRED isn't subject to the FSO code freeze.

I honestly don't know whose intention it was, it might've been some hair-brained idea I came up while I was half asleep (not particularly healthy).

(Also kinda difficult to commit to the SVN since I don't have commit rights...)
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 

Offline Goober5000

  • HLP Loremaster
  • Moderator
  • 214
    • Goober5000 Productions
Re: wxFRED: March '13 Progress Report
(Also kinda difficult to commit to the SVN since I don't have commit rights...)

Ah.  Well let me see about changing that.

 
Re: wxFRED: March '13 Progress Report
It didn't find the wx.h because the path was written with a backslash in other files (<wx\wx.h>).
Ugh, yeah, it seems all the generated headers and CPP files are using Windows-style backslashes :ick:

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
No IDE at all ;)
Under Linux, I only update the code (svn trunk), configure and make.
Under Windows I download the binaries. But most time I play FS2 in Linux.

u hardcore programma.  :yes:

It didn't find the wx.h because the path was written with a backslash in other files (<wx\wx.h>).
Ugh, yeah, it seems all the generated headers and CPP files are using Windows-style backslashes :ick:

Those, are... actually not the generated files.  :nervous:

New patch attached to OP and this post, built against SVN r9565. This should correct the filepath backslash issue, in addition to setting up the wxFRED2.vcxproj to something useable, and omitting the precompiled header #include from wxfred2.cpp (since it's the only file that actually uses it, and I don't see a point in doing precompiled headers at this time).

wxFRED_13-3-15.patch
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
Seems wxFRED_base.h is missing from the new patch? :P

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
:|

New patch uploaded!

wxFRED_13-3-15b.patch
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.

 
Re: wxFRED: March '13 Progress Report
Hmm, still no dice. There's another backslash include in frmFRED2.cpp:25. But after fixing that, g++ fails to locate the #includes from wxFRED_base.h. All of them: if I comment one out, it simply fails on the next one.

Now, I know that my WX is set up correctly, as I can compile PCS2 with no problem. Also, WX is just a package download, it's hard to mess that up. So I don't think that's the cause here.

Something that might be related: on running FSO's configure script, I get the following warning: 
Code: [Select]
No config found to match: /usr/bin/wx-config --static --libs
           in /usr/lib/x86_64-linux-gnu/wx/config

This, presumably, because the static WX libs are not in the Ubuntu repos. And I'm guessing wxFRED is currently set up for static linking? I'm not familiar enough with Makefile to see for myself :nervous:

Either way, given how ridiculously easy compilation is on Linux (as well as the binary incompatibility of distros), I'd say we can push compile-it-yourself as the primary way of obtaining wxFRED on Linux - which probably most users will be doing anyway. And then dynamic linking seems the best option, as it won't require people to manually download and compile the static WX libs.
« Last Edit: March 16, 2013, 04:41:20 am by FreeSpaceFreak »

 

Offline Tomo

  • 28
Re: wxFRED: March '13 Progress Report
Sounds like you should get an SVN or Git repo, though.
Indeed z64555, I'd very much recommend firing up a local Git repo on your own machine.

It only requires a copy of Git, and the entire history data simply sits in a subfolder of the source tree, easy to exclude from SVN.

Then you can locally track changes, branch, revert etc and when you have something you consider Worthy, commit it to the 'real' SVN.

- I do this at work, because one of my projects is still on Visual SourceSafe (run for the hills) and thus essentially useless, and for the others it gives me somewhere to work on 'proof-of-concept' (and unofficial) tasks quite easily without cluttering up the 'real' repo with branches that will never go anywhere.

 
Re: wxFRED: March '13 Progress Report
Hmm, still no dice. There's another backslash include in frmFRED2.cpp:25. But after fixing that, g++ fails to locate the #includes from wxFRED_base.h. All of them: if I comment one out, it simply fails on the next one.

Hey, that's exactly what happens for me, too!  :lol:
Well, I copied the include-statements from the WX_CFLAGS to any other CFLAGS and CXXFLAGS (CFLAGS and FS2_CFLAGS in Makefile and code/Makefile) and then it worked... Almost...
Now I had to paste -std=c++11 into the CXXFLAGS, FS2_CXXFLAGS and WX_CXXFLAGS and NOW there are stray-characters in wxFRED_base.h in line 1538. Seems to be some invisible characters at linefeed...
AND (it just won't stop ;) ) ONLY wxfred2.cpp should be compiled with -std=c++11 because otherwise, fsmemory.cpp fails to compile!
And if I managed all that, linking fails with a very long list of "undefined references". Oh man, I need more C++, configure and make knowledge...
But I wonder: Are the WX_*-flags used at all? It seems only the standard- and FS2_*-flags are used. Okay... Maybe I will experiment a bit more later on.
But anyway: Good work! Just concentrate on getting it working like it should in your environment and then we/you/someone can port it to other building-environments.

 

Offline z64555

  • 210
  • Self-proclaimed controls expert
    • Steam
Re: wxFRED: March '13 Progress Report
Hmm, still no dice. There's another backslash include in frmFRED2.cpp:25. But after fixing that, g++ fails to locate the #includes from wxFRED_base.h. All of them: if I comment one out, it simply fails on the next one.

Those are all referenced via <someFile.h> instead of the local reference "someFile.h", there should be some way of adding the WX include paths to something like WX/include/msvc; WX/include/;. If you have a compiler specific folder (such as MSVC does), reference your compiler to that directory first.

Something that might be related: on running FSO's configure script, I get the following warning: 
Code: [Select]
No config found to match: /usr/bin/wx-config --static --libs
           in /usr/lib/x86_64-linux-gnu/wx/config

This, presumably, because the static WX libs are not in the Ubuntu repos. And I'm guessing wxFRED is currently set up for static linking? I'm not familiar enough with Makefile to see for myself :nervous:

Yes, wxFRED is currently set up for static linking, since I was having problems with the dynamic linking not getting setup quite right. I also didn't know if Linux builds would properly run a .dll or not, so I scheduled tackling that whole problem for a later date.

Either way, given how ridiculously easy compilation is on Linux (as well as the binary incompatibility of distros), I'd say we can push compile-it-yourself as the primary way of obtaining wxFRED on Linux - which probably most users will be doing anyway. And then dynamic linking seems the best option, as it won't require people to manually download and compile the static WX libs.

Since the wxFRED project is already setup, all the MSVC developers have to do is batch build the Unicode and Unicode Debug wxWidgets libs (and also make the WXWIN environment variable). I'll definitely have to get in contact with people that have the other compilers and IDE's.

Well, I copied the include-statements from the WX_CFLAGS to any other CFLAGS and CXXFLAGS (CFLAGS and FS2_CFLAGS in Makefile and code/Makefile) and then it worked... Almost...
Now I had to paste -std=c++11 into the CXXFLAGS, FS2_CXXFLAGS and WX_CXXFLAGS and NOW there are stray-characters in wxFRED_base.h in line 1538. Seems to be some invisible characters at linefeed...

Quite likely that the line endings got garbled, try opening up wxFRED_base.h in something like Notepad++ and see if you can convert or otherwise clean the line endings.

ONLY wxfred2.cpp should be compiled with -std=c++11 because otherwise, fsmemory.cpp fails to compile!
And if I managed all that, linking fails with a very long list of "undefined references". Oh man, I need more C++, configure and make knowledge...
But I wonder: Are the WX_*-flags used at all? It seems only the standard- and FS2_*-flags are used. Okay... Maybe I will experiment a bit more later on.

Hmm, you may want to attach your makefile so we can see what's going on.


Thanks for the feedback guys, I should have some more progress with it on Monday and Tuesday, (my days off from work).
Secure the Source, Contain the Code, Protect the Project
chief1983

------------
funtapaz: Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Juche.
z64555: s/J/Do
BotenAlfred: <funtapaz> Hunchon University biologists prove mankind is evolving to new, higher form of life, known as Homopithecus Douche.