Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2005-03-27 22:17:48 +0400
committerTon Roosendaal <ton@blender.org>2005-03-27 22:17:48 +0400
commitb8d59ccb6911adb34613c588b76b8df62801b42f (patch)
tree6dca5e53b263ac0cb9329a28153c47f9579af879 /source/blender/src/resources.c
parent642012064bfc50cb0e2c266e36738e965bcabab3 (diff)
Transform goodies;
- Added icons for the Widgets to blenderbuttons pic - Added in header - if widget in use - three buttons to choose widget type (hold shift for combo widgets) - Hotkey CTRL+space now switches widgets on/off I also noticed negative scaling doesn't work satisfying yet; - for scale widget, using center didn't work correct anymore (fixed) - negative scaling didn't even get applied! (fixed) - but; scaling somethig negative now flips back to positive... ???? Last one i need Martin P for! Note that I had to change Mat3ToSize....
Diffstat (limited to 'source/blender/src/resources.c')
-rw-r--r--source/blender/src/resources.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/source/blender/src/resources.c b/source/blender/src/resources.c
index 9e7e88a96e9..cd3d0990644 100644
--- a/source/blender/src/resources.c
+++ b/source/blender/src/resources.c
@@ -229,6 +229,26 @@ static void def_icon(ImBuf *bbuf, GLuint texid, BIFIconID icon, int xidx, int yi
/***/
+static void clear_transp_rect_soft(unsigned char *transp, unsigned char *rect, int w, int h, int rowstride)
+{
+ int x,y;
+
+ for (y=0; y<h; y++) {
+ unsigned char *row= &rect[y*rowstride];
+ for (x=0; x<w; x++) {
+ unsigned char *pxl= &row[x*4];
+
+ if (*((unsigned int*) pxl)==*((unsigned int*) transp)) {
+ pxl[3]= 0;
+ }
+ else if( abs(pxl[0]-transp[0])<10 && abs(pxl[1]-transp[1])<10 && abs(pxl[2]-transp[2])<10) {
+ pxl[3]= 40;
+ }
+ }
+ }
+}
+
+
static void clear_transp_rect(unsigned char *transp, unsigned char *rect, int w, int h, int rowstride)
{
int x,y;
@@ -252,7 +272,7 @@ void BIF_resources_init(void)
common_icons_arr= MEM_mallocN(sizeof(*common_icons_arr)*BIFNICONIDS, "common_icons");
/* hack! */
- for (y=0; y<11; y++) {
+ for (y=0; y<12; y++) {
for (x=0; x<21; x++) {
int rowstride= bbuf->x*4;
unsigned char *start= ((char*) bbuf->rect) + (y*21 + 3)*rowstride + (x*20 + 3)*4;
@@ -262,7 +282,7 @@ void BIF_resources_init(void)
transp[1]= start[1];
transp[2]= start[2];
transp[3]= start[3];
- clear_transp_rect(transp, start, 20, 21, rowstride);
+ clear_transp_rect_soft(transp, start, 20, 21, rowstride);
/* this sets outside of icon to zero alpha */
start= ((char*) bbuf->rect) + (y*21)*rowstride + (x*20)*4;
@@ -275,7 +295,7 @@ void BIF_resources_init(void)
// texid= init_icon_texture(bbuf);
/* hack! */
- for (y=0; y<11; y++) {
+ for (y=0; y<12; y++) {
for (x=0; x<21; x++) {
if (x==11 && y==6) {
def_icon(bbuf, texid, ICON_BEVELBUT_HLT, x, y, 7, 13, 4, 2);