diff --git a/source/common/rendering/gl/renderer/gl_postprocess.cpp b/source/common/rendering/gl/renderer/gl_postprocess.cpp index 3160dfb92..49c8ad4ec 100644 --- a/source/common/rendering/gl/renderer/gl_postprocess.cpp +++ b/source/common/rendering/gl/renderer/gl_postprocess.cpp @@ -1,28 +1,22 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2016 Magnus Norddahl -// All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// /* -** gl_postprocess.cpp -** Post processing effects in the render pipeline +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl ** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. */ #include "gl_load/gl_system.h" diff --git a/source/common/rendering/gl/renderer/gl_postprocessstate.cpp b/source/common/rendering/gl/renderer/gl_postprocessstate.cpp index e74041f9e..e147e6adb 100644 --- a/source/common/rendering/gl/renderer/gl_postprocessstate.cpp +++ b/source/common/rendering/gl/renderer/gl_postprocessstate.cpp @@ -1,29 +1,23 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2016 Magnus Norddahl -// All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// /* -** gl_postprocessstate.cpp -** Render state maintenance +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl ** -**/ +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +*/ #include "templates.h" #include "gl_load/gl_system.h" diff --git a/source/common/rendering/gl/renderer/gl_renderbuffers.cpp b/source/common/rendering/gl/renderer/gl_renderbuffers.cpp index 8dd9f25b5..7547075be 100644 --- a/source/common/rendering/gl/renderer/gl_renderbuffers.cpp +++ b/source/common/rendering/gl/renderer/gl_renderbuffers.cpp @@ -1,28 +1,22 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2016 Magnus Norddahl -// All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// /* -** gl_renderbuffers.cpp -** Render buffers used during rendering +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl ** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. */ #include "gl_load/gl_system.h" diff --git a/source/common/rendering/gl/shaders/gl_shaderprogram.cpp b/source/common/rendering/gl/shaders/gl_shaderprogram.cpp index 40c35f518..a7b9bf7a4 100644 --- a/source/common/rendering/gl/shaders/gl_shaderprogram.cpp +++ b/source/common/rendering/gl/shaders/gl_shaderprogram.cpp @@ -1,28 +1,22 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2016 Magnus Norddahl -// All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// /* -** gl_shaderprogram.cpp -** GLSL shader program compile and link +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl ** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. */ #include "gl_load/gl_system.h" diff --git a/source/common/rendering/gl/system/gl_framebuffer.cpp b/source/common/rendering/gl/system/gl_framebuffer.cpp index 848e49996..bdfe0ca91 100644 --- a/source/common/rendering/gl/system/gl_framebuffer.cpp +++ b/source/common/rendering/gl/system/gl_framebuffer.cpp @@ -408,6 +408,7 @@ void OpenGLFrameBuffer::Draw2D() { GLRenderer->mBuffers->BindCurrentFB(); ::DrawFullscreenBlends(); + DrawRateStuff(); GLInterface.Draw2D(&twodgen); } } diff --git a/source/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp b/source/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp index fd07e69cf..00a5ac358 100644 --- a/source/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp +++ b/source/common/rendering/hwrenderer/postprocessing/hw_postprocess.cpp @@ -1,3 +1,23 @@ +/* +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl +** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. +*/ #include "v_video.h" #include "hw_postprocess.h" diff --git a/source/common/rendering/hwrenderer/postprocessing/hw_postprocess_cvars.cpp b/source/common/rendering/hwrenderer/postprocessing/hw_postprocess_cvars.cpp index 4f47593f4..4f6334a12 100644 --- a/source/common/rendering/hwrenderer/postprocessing/hw_postprocess_cvars.cpp +++ b/source/common/rendering/hwrenderer/postprocessing/hw_postprocess_cvars.cpp @@ -1,28 +1,22 @@ -// -//--------------------------------------------------------------------------- -// -// Copyright(C) 2016 Magnus Norddahl -// All rights reserved. -// -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU Lesser General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public License -// along with this program. If not, see http://www.gnu.org/licenses/ -// -//-------------------------------------------------------------------------- -// /* -** gl_postprocess.cpp -** Post processing effects in the render pipeline +** Postprocessing framework +** Copyright (c) 2016-2020 Magnus Norddahl ** +** This software is provided 'as-is', without any express or implied +** warranty. In no event will the authors be held liable for any damages +** arising from the use of this software. +** +** Permission is granted to anyone to use this software for any purpose, +** including commercial applications, and to alter it and redistribute it +** freely, subject to the following restrictions: +** +** 1. The origin of this software must not be misrepresented; you must not +** claim that you wrote the original software. If you use this software +** in a product, an acknowledgment in the product documentation would be +** appreciated but is not required. +** 2. Altered source versions must be plainly marked as such, and must not be +** misrepresented as being the original software. +** 3. This notice may not be removed or altered from any source distribution. */ #include "hw_postprocess_cvars.h" diff --git a/source/common/rendering/v_framebuffer.cpp b/source/common/rendering/v_framebuffer.cpp index 425ba93fc..0782ae49e 100644 --- a/source/common/rendering/v_framebuffer.cpp +++ b/source/common/rendering/v_framebuffer.cpp @@ -126,6 +126,17 @@ void DFrameBuffer::DrawRateStuff () // Draws frame time and cumulative fps if (vid_fps) { + FString fpsbuff = gi->statFPS(); + + int textScale = active_con_scale(); + int rate_x = Width / textScale - NewConsoleFont->StringWidth(&fpsbuff[0]); + twod->AddColorOnlyQuad(rate_x * textScale, 0, Width, NewConsoleFont->GetHeight() * textScale, MAKEARGB(255,0,0,0)); + DrawText (twod, NewConsoleFont, CR_WHITE, rate_x, 0, (char *)&fpsbuff[0], + DTA_VirtualWidth, screen->GetWidth() / textScale, + DTA_VirtualHeight, screen->GetHeight() / textScale, + DTA_KeepRatio, true, TAG_DONE); + + #if 0 uint64_t ms = screen->FrameTime; uint64_t howlong = ms - LastMS; if ((signed)howlong >= 0) @@ -154,6 +165,7 @@ void DFrameBuffer::DrawRateStuff () FrameCount++; } LastMS = ms; + #endif } }