1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
26 #include "nel/misc/bitmap.h"
27 #include "nel/misc/path.h"
29 #include "bitmap_base.h"
30 #include "interfaces_manager.h"
33 //-----------------------------------------------
36 //-----------------------------------------------
37 CBitmapBase::CBitmapBase()
39 init(0, CRGBA(255,255,255,255));
42 //-----------------------------------------------
45 //-----------------------------------------------
46 CBitmapBase::CBitmapBase(uint texture
, const CRGBA
&rgba
)
51 //-----------------------------------------------
53 // Initialize the class(only 1 function for all constructor -> easier).
54 //-----------------------------------------------
55 void CBitmapBase::init(uint texture
, const CRGBA
&rgba
)
59 CBitmapBase::texture( texture
);
63 //-----------------------------------------------
66 //-----------------------------------------------
67 void CBitmapBase::texture(uint texture
)
70 _Texture
= CInterfMngr::getTexture(_TextureId
);
76 if ( _Texture
!= NULL
)
78 _TexturePath
= NLMISC::CPath::lookup( _Texture
->getFileName(), false);
80 if ( ! _TexturePath
.empty() )
82 NLMISC::CBitmap bitmap
;
83 bitmap
.loadSize( _TexturePath
, _TextureWidth
, _TextureHeight
);
89 //-----------------------------------------------
92 //-----------------------------------------------
93 uint
CBitmapBase::textureId() const
99 //-----------------------------------------------
102 //-----------------------------------------------
103 void CBitmapBase::rgba(const CRGBA
&rgba
)
109 //-----------------------------------------------
112 //-----------------------------------------------
113 const CRGBA
&CBitmapBase::rgba() const