[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paragui-cvs] CVS: paragui/src/widgets pgimage.cpp,1.3.6.1,1.3.6.2 pgthe
From: |
Alexander Pipelka <address@hidden> |
Subject: |
[paragui-cvs] CVS: paragui/src/widgets pgimage.cpp,1.3.6.1,1.3.6.2 pgthemewidget.cpp,1.3.6.6,1.3.6.7 |
Date: |
Sat, 25 Jan 2003 11:53:59 -0500 |
Update of /cvsroot/paragui/paragui/src/widgets
In directory subversions:/tmp/cvs-serv10783/src/widgets
Modified Files:
Tag: devel-1-0
pgimage.cpp pgthemewidget.cpp
Log Message:
colorkey improvements
Index: pgimage.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgimage.cpp,v
retrieving revision 1.3.6.1
retrieving revision 1.3.6.2
diff -C2 -r1.3.6.1 -r1.3.6.2
*** pgimage.cpp 10 Jul 2002 16:51:26 -0000 1.3.6.1
--- pgimage.cpp 25 Jan 2003 16:53:57 -0000 1.3.6.2
***************
*** 29,32 ****
--- 29,40 ----
#include "pgimage.h"
+ PG_Image::PG_Image(PG_Widget* parent, const PG_Point& p, const char*
filename, Uint32 colorkey, const char* style) : PG_ThemeWidget(parent,
PG_Rect(p.x, p.y, 1, 1), style) {
+ LoadImage(filename, colorkey);
+
+ if(my_image != NULL) {
+ SizeWidget(my_image->w, my_image->h);
+ }
+ }
+
PG_Image::PG_Image(PG_Widget* parent, const PG_Point& p, const char*
filename, const char* style) : PG_ThemeWidget(parent, PG_Rect(p.x, p.y, 1, 1),
style) {
LoadImage(filename);
***************
*** 59,61 ****
--- 67,73 ----
PG_Widget::eventBlit(my_image, my_src, my_dst);
}
+ }
+
+ void PG_Image::SetColorKey(Uint32 key) {
+ SDL_SetColorKey(my_image, SDL_SRCCOLORKEY, key);
}
Index: pgthemewidget.cpp
===================================================================
RCS file: /cvsroot/paragui/paragui/src/widgets/pgthemewidget.cpp,v
retrieving revision 1.3.6.6
retrieving revision 1.3.6.7
diff -C2 -r1.3.6.6 -r1.3.6.7
*** pgthemewidget.cpp 4 Jan 2003 21:13:41 -0000 1.3.6.6
--- pgthemewidget.cpp 25 Jan 2003 16:53:57 -0000 1.3.6.7
***************
*** 340,356 ****
}
! bool PG_ThemeWidget::LoadImage(const char* filename) {
! SDL_Surface* image = PG_Application::LoadSurface(filename);
!
! if(image == NULL) {
! return false;
}
! FreeImage();
! my_internaldata->freeimage = true;
! my_image = image;
!
! Update();
! return true;
}
--- 340,355 ----
}
! bool PG_ThemeWidget::LoadImage(const char* filename, Uint32 key) {
! if(LoadImage(filename)) {
! SDL_SetColorKey(my_image, SDL_SRCCOLORKEY, key);
! return true;
}
+
+ return false;
+ }
! bool PG_ThemeWidget::LoadImage(const char* filename) {
! SDL_Surface* image = PG_Application::LoadSurface(filename);
! return SetImage(image, true);
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paragui-cvs] CVS: paragui/src/widgets pgimage.cpp,1.3.6.1,1.3.6.2 pgthemewidget.cpp,1.3.6.6,1.3.6.7,
Alexander Pipelka <address@hidden> <=
- Prev by Date:
[paragui-cvs] CVS: paragui/include pgimage.h,1.3,1.3.6.1 pgthemewidget.h,1.3.6.3,1.3.6.4
- Next by Date:
[paragui-cvs] CVS: paragui/src/draw/opengl TODO,1.1.2.3,1.1.2.4 pgglcore.cpp,1.1.2.7,1.1.2.8 pgglroot.cpp,1.1.2.7,1.1.2.8 pgglsurf.cpp,1.1.2.9,1.1.2.10
- Previous by thread:
[paragui-cvs] CVS: paragui/include pgimage.h,1.3,1.3.6.1 pgthemewidget.h,1.3.6.3,1.3.6.4
- Next by thread:
[paragui-cvs] CVS: paragui/src/draw/opengl TODO,1.1.2.3,1.1.2.4 pgglcore.cpp,1.1.2.7,1.1.2.8 pgglroot.cpp,1.1.2.7,1.1.2.8 pgglsurf.cpp,1.1.2.9,1.1.2.10
- Index(es):