Thursday, 21 February 2013

Thursday Thrust

On A Mission

Once I had the bits and bobs out my way, AGK project tweaks, builds, emails and other distractions, my aim was to get right back on the Reloaded saddle and continue riding. And that's what is happening now...

Reloaded Full Screen

I will continue the blog format of adding bits to it as I go this evening, as it worked quite well last night and I got a lot of details out the door. I left off looking at a working Test level button with input, but not in a full screen view. Today is about exploring BCG (an old version) and figuring out how to make my MDI child window take up the whole view. I don't need to separate it from the parent, I just want it to take over the title bar, windows task bar, everything basically. Ideally I don't want to hide and move almost ALL the visible sub-windows of the app to achieve this, I'd prefer to just move the child window to fill each corner of the desktop, but life is never that simple and to be fair, child windows where not designed for that.

I just tried an hour of hacking in all sorts of reasonably looking commands but they just resulted in strange window views or crashes. I will read through the BCG documentation and also trace through the app to see exactly how the GUI was assembled, then I will have a much better idea where to go in and what to change.  If time, I also plan to add real time light mapping to the editor system and throw away the old object rendering system and use a whole new one which will support rendering the entire level in one go instead of a sectioned off view of the world which is what you get now.  Watch this space.

01:02 Code and Comments

I found some documentation and started plodding through the GUI code, and there are as many sections of commented out code as there is code!  All the programs are effectively double in size which means lots of scrolling ;)  I am VERY tempted to go through and delete commented code and start re-formatting the source with my own alignment habits and comments, but I know it would take hours and for the whole code base, weeks.  It is well worth doing in the long-term but there is no such thing as long-term with deadlines hitting you over the head like an impatient child.  To compromise, once I find the area of code I am interested in, the window creation section, I will delete the dud code in that area and add my comments. This way I know where I have been and avoid messing up something inadvertently. 

01:44 Well Behaved GUI

I rather suspect all the windows changes I am firing away at the GUI is all for naught, and that BCG is maintaining a 'friendly windows app' with an iron fist. Making the main window full screen maximized does nothing, when it should override the task bar and produce a full screen window. Ah well, going to see what BCG documentation has to say on the subject.  Five minutes later; zip. It says precisely zip about full screen, or anything with the word full or screen in the title (except for the main intro page finding 'full customisation' and 'screen commands'). Oh hum.  Once more unto the breach dear friends. I wonder if I can hack the very style of the window itself to do my bidding.


02:04 Cue Evil Laugh

Successipoos!! I used the SetWindowLong command to change the main window to WS_POPUP and bingo, the title bar disappeared and so did the taskbar. This just leaves the sub-windows, which I am now going to hide using the BCG calls. In theory, I should have my full screen view in 10 minutes or less!


03:13 There And Back Again With Bamber Baggins

Okay so not quite ten minutes.  Maybe multiply my estimates by 6 from now on. I had lots of success, but had one huge fight with some strange edge artefacts and lost.  I can now click Test Level button and it goes full screen, and I click out of the test mode and the windows are restored and it looks just the same as when I left. Hurray. I can also bounce and forth as many times as I want almost instantly.  It used to do it once then tried to reload the mapeditor executable, but now that bug has gone away and it works nicely now.

Here is a shot of the artefact I am seeing. This is my BCG application hacked using SetWindowLong to make it a POPUP and then I resize it to the desktop resolution.


It SHOULD fill the entire area with my window, but for some reason as you can see the window stops short by a few pixels on the horizontal and 22 pixels short of the vertical. I set the window to a larger size than needed, but something seems to resize the window back to this strange sized result.

I am going to let the universe brew over that one as I am sure it is something very very silly. I want to jump straight into getting some real time light mapping into the scene before the weekend and now is as good a time.


03:29 Then Again

I dropped into the P001 prototype and realised it was implemented with double buffer object system, that is, I am using twice as many objects to create a perfect transition in the scene. This would DOUBLE the amount of memory used when editing/testing which is not what we want. This transition will be handled smartly inside DarkLIGHTS eventually but it's not a system I want to put in DBP code now.

Further, it looks like I will need to create a whole new object placement system for the map editor so it works with the 'infinite level' idea I am after, and it makes sense to get these objects in there before I start light mapping anything. All this needs many hours of clear thought, and I only have an hour or so left in the tank, so the best thing I can do is stop right now.

Signing Off

I am going to spend this last hour leaping over to Perceptual Computing world and seeing what I can knock up with the depth stuff. It's not much, but it's all I have got.  For more interesting developments in this area, look no further than our own AGK community, and a member who is already knee deep in Perceptual Computing. We here at TGC think it's awesome and wish the author the best of luck finishing the app: http://www.youtube.com/watch?v=XUqhcI_4nWo&feature=youtu.be



1 comment:

  1. Keep at it Lee, it'll all come right in the end! :)

    ReplyDelete