Reimplement debug window #1147

Merged
merged 3 commits into from Jan 20, 2017

Conversation

Projects
None yet
3 participants
@asarium
Member

asarium commented Jan 18, 2017

This allows to show the debug output in a second window in real time.
This system could be expanded further to allow more interactivity but
the current status is good enough.

This is a cross-platform reimplementation of a system that was removed when antipodes was merged.

Add debug window
This allows to show the debug output in a second window in real time.
This system could be expanded further to allow more interactivity but
the current status is good enough.

@asarium asarium added the bugfix label Jan 18, 2017

@z64555

Looks good as far as I can tell, should at least have somebody more familiar with the graphics code than myself to give it a look over.

I like the idea of having the class switch the render output within its doFrame, this is likely something we'll exploit in the future for wxFRED.

+ auto numDisplays = SDL_GetNumVideoDisplays();
+
+ if (numDisplays < 1) {
+ // Some kind of error

This comment has been minimized.

@z64555

z64555 Jan 18, 2017

Member

Not sure what the proper error handler should be. Int3() is the first to come to mind, but I don't think that's the best.

Could put "TODO" in the comment to serve as a marker if we decide to defer putting in the error handler.

@z64555

z64555 Jan 18, 2017

Member

Not sure what the proper error handler should be. Int3() is the first to come to mind, but I don't think that's the best.

Could put "TODO" in the comment to serve as a marker if we decide to defer putting in the error handler.

This comment has been minimized.

@asarium

asarium Jan 18, 2017

Member

Well, that code is the error handler. IMO simply defaulting to the primary screen if there was an error is a good solution.

@asarium

asarium Jan 18, 2017

Member

Well, that code is the error handler. IMO simply defaulting to the primary screen if there was an error is a good solution.

+ gr_use_viewport(os::getMainViewport());
+}
+
+float DebugWindow::print_line(float bottom_y, const LineInfo& line) {

This comment has been minimized.

@z64555

z64555 Jan 18, 2017

Member

The debug console code has word wrapping and whitespace handling, if you wanted a reference.

@z64555

z64555 Jan 18, 2017

Member

The debug console code has word wrapping and whitespace handling, if you wanted a reference.

This comment has been minimized.

@asarium

asarium Jan 18, 2017

Member

I'll take a look at those.

@asarium

asarium Jan 18, 2017

Member

I'll take a look at those.

This comment has been minimized.

@asarium

asarium Jan 18, 2017

Member

I have added word wrapping using the standard split_str.

@asarium

asarium Jan 18, 2017

Member

I have added word wrapping using the standard split_str.

This comment has been minimized.

@z64555

z64555 Jan 19, 2017

Member

Which library is split_str from? I don't see it in stdlib

@z64555

z64555 Jan 19, 2017

Member

Which library is split_str from? I don't see it in stdlib

This comment has been minimized.

@MageKing17

MageKing17 Jan 19, 2017

Member

It's in parselo.cpp; it's used for wordwrapping all throughout the FSO codebase.

@MageKing17

MageKing17 Jan 19, 2017

Member

It's in parselo.cpp; it's used for wordwrapping all throughout the FSO codebase.

This comment has been minimized.

@z64555

z64555 Jan 19, 2017

Member

Ok, split_str looks good to use, and it respects kerning of the font.

@z64555

z64555 Jan 19, 2017

Member

Ok, split_str looks good to use, and it respects kerning of the font.

code/osapi/DebugWindow.h
+
+namespace osapi {
+
+class DebugWindow {

This comment has been minimized.

@z64555

z64555 Jan 18, 2017

Member

Would you please doxy the rest of the class? Each method and the class itself should be documented, and so should any of the non-trivial members.

@z64555

z64555 Jan 18, 2017

Member

Would you please doxy the rest of the class? Each method and the class itself should be documented, and so should any of the non-trivial members.

This comment has been minimized.

@asarium

asarium Jan 18, 2017

Member

Yeah, I can do that.

@asarium

asarium Jan 18, 2017

Member

Yeah, I can do that.

This comment has been minimized.

@asarium

asarium Jan 18, 2017

Member

Doxygen comments have been added.

@asarium

asarium Jan 18, 2017

Member

Doxygen comments have been added.

asarium added some commits Jan 18, 2017

@z64555

z64555 approved these changes Jan 19, 2017

@asarium asarium merged commit 09e18c1 into scp-fs2open:master Jan 20, 2017

2 checks passed

continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@asarium asarium deleted the asarium:feature/debugWindow branch Jan 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment