From b2d29131fa21e897cd4cc9d0e64f6e522e8edbf8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Beno=C3=AEt=20Jacob?= Date: Wed, 18 Oct 2006 06:33:35 +0000 Subject: [PATCH] Remove Color::operator= Spare a reinterpret_cast in Color::apply() svn path=/trunk/KDE/kdeedu/kalzium/src/kalziumglhelperclasses.cpp; revision=596670 --- kalzium/kalziumglhelperclasses.cpp | 10 ---------- kalzium/kalziumglhelperclasses.h | 4 +--- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/kalzium/kalziumglhelperclasses.cpp b/kalzium/kalziumglhelperclasses.cpp index 94b86f7..a1e5401 100644 --- a/kalzium/kalziumglhelperclasses.cpp +++ b/kalzium/kalziumglhelperclasses.cpp @@ -63,16 +63,6 @@ Color::Color( const OBAtom* atom ) m_alpha = 1.0; } -Color& Color::operator=( const Color& other ) -{ - m_red = other.m_red; - m_green = other.m_green; - m_blue = other.m_blue; - m_alpha = other.m_alpha; - - return *this; -} - void Color::applyAsMaterials() { GLfloat ambientColor [] = { m_red / 2, m_green / 2, m_blue / 2, diff --git a/kalzium/kalziumglhelperclasses.h b/kalzium/kalziumglhelperclasses.h index 7b10125..61b7fee 100644 --- a/kalzium/kalziumglhelperclasses.h +++ b/kalzium/kalziumglhelperclasses.h @@ -135,14 +135,12 @@ struct Color * the atom should be rendered. */ Color( const OpenBabel::OBAtom *atom ); - Color& operator=( const Color& other ); - /** * Sets this color to be the one used by OpenGL for rendering * when lighting is disabled. */ inline void apply() { - glColor4fv( reinterpret_cast( this ) ); + glColor4fv( &m_red ); } /** -- 2.47.3