From ceb8fb0c81ef786f84f9388f7045927922bc9608 Mon Sep 17 00:00:00 2001 From: kko Date: Sun, 7 Jul 2013 18:40:53 -0400 Subject: [PATCH] Remove DeadVideoLink --- .gitattributes | 1 - src/DeadVideoLink.cpp | 77 ---------------------------- src/DeadVideoLink.h | 33 ------------ src/Makefile.am | 2 - win32/vc2010/pioneer.vcxproj | 2 - win32/vc2010/pioneer.vcxproj.filters | 6 --- 6 files changed, 121 deletions(-) delete mode 100644 .gitattributes delete mode 100644 src/DeadVideoLink.cpp delete mode 100644 src/DeadVideoLink.h diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index d01653a88..000000000 --- a/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -text eol=lf diff --git a/src/DeadVideoLink.cpp b/src/DeadVideoLink.cpp deleted file mode 100644 index 99b4be586..000000000 --- a/src/DeadVideoLink.cpp +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright © 2008-2013 Pioneer Developers. See AUTHORS.txt for details -// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt - -#include "DeadVideoLink.h" -#include "Pi.h" -#include "Lang.h" - -static const int textureSize = 512; - -DeadVideoLink::DeadVideoLink(float w, float h) : VideoLink(w, h) -{ - m_created = SDL_GetTicks(); - m_message = new Gui::ToolTip(0, Lang::VID_LINK_DOWN); - - Graphics::TextureDescriptor descriptor(Graphics::TEXTURE_RGB_888, vector2f(textureSize), Graphics::LINEAR_CLAMP); - m_texture.Reset(Gui::Screen::GetRenderer()->CreateTexture(descriptor)); - m_quad.Reset(new Gui::TexturedQuad(m_texture.Get())); - - UpdateWhiteNoise(); -} - -DeadVideoLink::~DeadVideoLink() -{ - delete m_message; -} - -void DeadVideoLink::Draw() -{ - float size[2]; - GetSize(size); - - Uint32 now = SDL_GetTicks(); - - if (now - m_created < 1500) { - glBegin(GL_QUADS); - glColor3f(0,0,0); - glVertex2f(0,0); - glVertex2f(0,size[1]); - glVertex2f(size[0],size[1]); - glVertex2f(size[0],0); - glEnd(); - - m_message->SetText(Lang::VID_CONNECTING); - DrawMessage(); - - return; - } - - m_message->SetText(Lang::VID_LINK_DOWN); - - UpdateWhiteNoise(); - - m_quad->Draw(Gui::Screen::GetRenderer(), vector2f(0.0f), vector2f(size[0],size[1])); - DrawMessage(); -} - -void DeadVideoLink::DrawMessage() -{ - float size[2]; - float msgSize[2]; - GetSize(size); - m_message->GetSize(msgSize); - glPushMatrix(); - glTranslatef(size[0]*0.5f-msgSize[0]*0.5f, size[1]*0.5f-msgSize[1]*0.5f, 0); - m_message->Draw(); - glPopMatrix(); -} - -void DeadVideoLink::UpdateWhiteNoise() -{ - Uint32 noise[textureSize*textureSize*4]; - for (unsigned int i=0; iUpdate(noise, vector2f(textureSize), Graphics::TEXTURE_RGB_888); -} diff --git a/src/DeadVideoLink.h b/src/DeadVideoLink.h deleted file mode 100644 index 4b62beb96..000000000 --- a/src/DeadVideoLink.h +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright © 2008-2013 Pioneer Developers. See AUTHORS.txt for details -// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt - -// DEPRECATED due to new ui system - -#ifndef _DEADVIDEOLINK -#define _DEADVIDEOLINK - -#include "VideoLink.h" -#include "graphics/Texture.h" -#include "gui/GuiTexturedQuad.h" -#include "RefCounted.h" -#include "SmartPtr.h" - -class DeadVideoLink : public VideoLink { -public: - DeadVideoLink(float w, float h); - virtual ~DeadVideoLink(); - - virtual void Draw(); - -private: - void DrawMessage(); - void UpdateWhiteNoise(); - - Uint32 m_created; - Gui::ToolTip *m_message; - - RefCountedPtr m_texture; - ScopedPtr m_quad; -}; - -#endif diff --git a/src/Makefile.am b/src/Makefile.am index a12409a34..da3dd55dc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -31,7 +31,6 @@ noinst_HEADERS = \ CoreCount.h \ Cutscene.h \ CRC32.h \ - DeadVideoLink.h \ DeathView.h \ DeleteEmitter.h \ DynamicBody.h \ @@ -176,7 +175,6 @@ pioneer_SOURCES = \ CommodityTradeWidget.cpp \ CoreCount.cpp \ CRC32.cpp \ - DeadVideoLink.cpp \ DeathView.cpp \ DynamicBody.cpp \ EnumStrings.cpp \ diff --git a/win32/vc2010/pioneer.vcxproj b/win32/vc2010/pioneer.vcxproj index ce07cbf4b..7eb4a10fd 100644 --- a/win32/vc2010/pioneer.vcxproj +++ b/win32/vc2010/pioneer.vcxproj @@ -120,7 +120,6 @@ - @@ -285,7 +284,6 @@ - diff --git a/win32/vc2010/pioneer.vcxproj.filters b/win32/vc2010/pioneer.vcxproj.filters index 24bbf542e..757039694 100644 --- a/win32/vc2010/pioneer.vcxproj.filters +++ b/win32/vc2010/pioneer.vcxproj.filters @@ -27,9 +27,6 @@ src - - src - src @@ -482,9 +479,6 @@ src - - src - src