Make OgreGUI a bit more opaque

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Make OgreGUI a bit more opaque

#1 Post by Mitten.O »

Here is a patch that moves some Ogre stuff that was lying around the code base
inside the OgreGUI.
* Listing of available resolutions away from options window
* Ogre initialization away from chmain.cpp
* Moves some signals from OgreGUI to GUI

It is better for ogre specific things to stay inside the ogre specific parts of the code.
(Yes, this is sneaky preparation for the sdl patch, but this really does make sense entirely independently)

One catch however: there is a code path in HumanClientApp::GetWindowWidthHeight
involving a setting "reset-fullscreen-size" that seems to work around something or something,
but I'm not sure what. That function is not used after this patch so whatever the purpose of that is may
no longer be working. I could detect no change in behaviour. Could someone shed some light on its purpose?
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Make OgreGUI a bit more opaque

#2 Post by adrian_broher »

Just a few pointers:

- We don't use NULL, use 0 instead
- The preprocessor directives should be left aligned and not intended.
- I'm not sure if we need the static initialization of Ogre at all.
Last edited by adrian_broher on Thu Sep 04, 2014 8:35 pm, edited 1 time in total.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Make OgreGUI a bit more opaque

#3 Post by Geoff the Medio »

Mitten.O wrote:..."reset-fullscreen-size" that seems to work around something or something, but I'm not sure what. [...] Could someone shed some light on its purpose?
See commit log: https://sourceforge.net/p/freeorion/code/3837/

Also, could you not manually linebreak your posts within paragraphs?

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Make OgreGUI a bit more opaque

#4 Post by Mitten.O »

- We don't use NULL, use 0 instead
Ok.
- The preprocessor directives should be left aligned and not intended.
That I actually knew, but failed to notice.
- I'm not sure if we need the static initialization of Ogre at all.
Since I don't really know what this is about, I left it in for now.
Thanks. Made that work in the patch.

Offtopic:
Also, could you not manually linebreak your posts within paragraphs?
Ah. I take it it creates problems when viewed such that my lines don't fit on one line? But horrible wide lines like these are a pain to read. I feel my eye attention stretching horribly just writing like this. But I suppose the jagged lines are even more of a pain. And I could just apply a custom CSS style to the board to make it thinner.

But then there are the other benefits of manual line breaks.
They can be used at times for rhythm, for clarity, for style.
A wonderful tool too often ignored.
Fun should be had with language
at all opportune times.

But here we discuss code and other such matters. Precision and clarity must rule. Conveying discrete information is the main purpose of most posts. Anything that hinders that is a badness. Maybe this is an inopportune time. I'll think about being a bit less enter happy.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Make OgreGUI a bit more opaque

#5 Post by Geoff the Medio »

Mitten.O wrote:But then there are the other benefits of manual line breaks.
They can be used at times for rhythm, for clarity, for style.
A wonderful tool too often ignored.
Fun should be had with language
at all opportune times.
Request is in general, for prose, not for (selected instances) when you want to write poetic posts. Unless I missed it, that's not always.
...horrible wide lines like these are a pain to read.
Use a larger font size, or a narrower browser window?

mileser
Space Squid
Posts: 57
Joined: Thu May 15, 2014 2:32 pm

Re: Make OgreGUI a bit more opaque

#6 Post by mileser »

Geoff the Medio wrote:
Mitten.O wrote:But then there are the other benefits of manual line breaks.
They can be used at times for rhythm, for clarity, for style.
A wonderful tool too often ignored.
Fun should be had with language
at all opportune times.
Request is in general, for prose, not for (selected instances) when you want to write poetic posts. Unless I missed it, that's not always.
...horrible wide lines like these are a pain to read.
Use a larger font size, or a narrower browser window?
He could go back to using a TRS 80: 80 columns and only all caps... :P
OS: OS X 10.10 Yosemite, XCode 6.01
Also: If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Make OgreGUI a bit more opaque

#7 Post by Mitten.O »

Sorry, the previous patch was actually missing some of the style fixes mentioned by adrian.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Make OgreGUI a bit more opaque

#8 Post by Geoff the Medio »

Code: Select all

5>C:\Users\Geoff\Desktop\FreeOrion_VS2010_SDK\FreeOrion\GG\GG/Ogre/Plugins/OISInput.h(31): fatal error C1083: Cannot open include file: 'OIS/OISKeyboard.h': No such file or directory
Edit: adding "#include <GG/Ogre/Plugins/OISInput.h>" to OgreGUI.cpp creates, I think, a circular dependency between GiGiOgre and the GiGiOgrePlugin_OIS. GiGiOgre shouldn't need to know the details of the possible plugins it might be passed... that's why they're plugins.

Same applies for the other plugin pointers added to OgreGUI.

I think these changes go against the design of OgreGUI as outline in the OgreGUI.h comments.

Mitten.O
Programmer
Posts: 255
Joined: Sun Apr 06, 2014 4:15 pm

Re: Make OgreGUI a bit more opaque

#9 Post by Mitten.O »

I believe the actual error message results just from the fact that GiGi ogre CMake files contained no dependency on OIS. The circular dependency is not
between headers.

You do however seem to be right that the lack of a dependency is by design. I made a lighter version that does less clean up, but does not require these larger changes.
Attachments

[The extension patch has been deactivated and can no longer be displayed.]

Any code by me in this post is released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13587
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Make OgreGUI a bit more opaque

#10 Post by Geoff the Medio »

Mitten.O wrote:I made a lighter version that does less clean up, but does not require these larger changes.
Seems to build and run OK for me.

Post Reply