Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

RopeDecor.cpp

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2004 Ivo Danihelka (ivo@danihelka.net)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008  */
00009 #include "RopeDecor.h"
00010 
00011 #include "Cube.h"
00012 
00013 #include "View.h"
00014 
00015 #include "SDL_gfxPrimitives.h"
00016 
00017 //-----------------------------------------------------------------
00018 RopeDecor::RopeDecor(const Cube *model1, const Cube *model2,
00019         const V2 &shift1, const V2 &shift2)
00020 : m_shift1(shift1), m_shift2(shift2)
00021 {
00022     m_model1 = model1;
00023     m_model2 = model2;
00024 }
00025 //-----------------------------------------------------------------
00026 /**
00027  * Draw line from one model to second model.
00028  */
00029 void
00030 RopeDecor::drawOnScreen(const View *view, SDL_Surface *screen)
00031 {
00032     V2 loc1 = view->getScreenPos(m_model1).plus(m_shift1);
00033     V2 loc2 = view->getScreenPos(m_model2).plus(m_shift2);
00034 
00035     //NOTE: steel color
00036     Uint32 colorRGBA = 0x30404eff;
00037     lineColor(screen, loc1.getX(), loc1.getY(),
00038             loc2.getX(), loc2.getY(), colorRGBA);
00039 }
00040 

Generated on Wed Jun 1 09:54:31 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2