Bugfix #7051: Stars' preview doesn't update in real time.

Added a new event code (B_WORLDPRV2) that forces an update of the world buttons-window preview AND the 3d-view, instead of having only one of the two getting updated (with REDRAWVIEW3D or REDRAWBUTSSHADING)
This commit is contained in:
Joshua Leung 2007-08-19 06:13:19 +00:00
parent 242413fa57
commit dbef15f99e
2 changed files with 21 additions and 13 deletions

@ -209,6 +209,9 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_MAT_VCOL_PAINT 1222
#define B_MAT_VCOL_LIGHT 1223
/* world buttons: buttons-preview update, and redraw 3dview */
#define B_WORLDPRV2 1224
/* *********************** */
#define B_TEXBUTS 1400

@ -2087,29 +2087,29 @@ static void world_panel_mistaph(World *wrld)
#endif
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButBitS(block, TOG, WO_MIST, REDRAWVIEW3D,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation");
uiDefButBitS(block, TOG, WO_MIST, B_WORLDPRV2,"Mist", 10,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles mist simulation");
uiBlockSetCol(block, TH_AUTO);
uiBlockBeginAlign(block);
uiDefButS(block, ROW, B_DIFF, "Qua", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Mist uses quadratic progression");
uiDefButS(block, ROW, B_DIFF, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Mist uses linear progression");
uiDefButS(block, ROW, B_DIFF, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Mist uses inverse quadratic progression");
uiDefButS(block, ROW, B_WORLDPRV2, "Qua", 10, 90, 40, 19, &wrld->mistype, 1.0, 0.0, 0, 0, "Mist uses quadratic progression");
uiDefButS(block, ROW, B_WORLDPRV2, "Lin", 50, 90, 50, 19, &wrld->mistype, 1.0, 1.0, 0, 0, "Mist uses linear progression");
uiDefButS(block, ROW, B_WORLDPRV2, "Sqr", 100, 90, 50, 19, &wrld->mistype, 1.0, 2.0, 0, 0, "Mist uses inverse quadratic progression");
uiBlockBeginAlign(block);
uiDefButF(block, NUM,REDRAWVIEW3D, "Sta:",10,70,140,19, &wrld->miststa, 0.0, 1000.0, 10, 0, "Specifies the starting distance of the mist");
uiDefButF(block, NUM,REDRAWVIEW3D, "Di:",10,50,140,19, &wrld->mistdist, 0.0,1000.0, 10, 00, "Specifies the depth of the mist");
uiDefButF(block, NUM,B_DIFF,"Hi:", 10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specifies the factor for a less dense mist with increasing height");
uiDefButF(block, NUMSLI, B_DIFF, "Misi ", 10,10,140,19, &(wrld->misi), 0., 1.0, 0, 0, "Sets the mist intensity");
uiDefButF(block, NUM,B_WORLDPRV2, "Sta:",10,70,140,19, &wrld->miststa, 0.0, 1000.0, 10, 0, "Specifies the starting distance of the mist");
uiDefButF(block, NUM,B_WORLDPRV2, "Di:",10,50,140,19, &wrld->mistdist, 0.0,1000.0, 10, 00, "Specifies the depth of the mist");
uiDefButF(block, NUM,B_WORLDPRV2,"Hi:", 10,30,140,19, &wrld->misthi,0.0,100.0, 10, 0, "Specifies the factor for a less dense mist with increasing height");
uiDefButF(block, NUMSLI, B_WORLDPRV2, "Misi ", 10,10,140,19, &(wrld->misi), 0., 1.0, 0, 0, "Sets the mist intensity");
uiBlockEndAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButBitS(block, TOG, WO_STARS, REDRAWVIEW3D, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation");
uiDefButBitS(block, TOG, WO_STARS, B_WORLDPRV2, "Stars",160,120,140,19, &wrld->mode, 0, 0, 0, 0, "Toggles starfield generation");
uiBlockSetCol(block, TH_AUTO);
uiBlockBeginAlign(block);
uiDefButF(block, NUM,B_DIFF,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars");
uiDefButF(block, NUM,B_DIFF,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars");
uiDefButF(block, NUMSLI,B_DIFF,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars");
uiDefButF(block, NUMSLI,B_DIFF,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes star color");
uiDefButF(block, NUM,B_WORLDPRV2,"StarDist:", 160,70,140,19, &(wrld->stardist), 2.0, 1000.0, 100, 0, "Specifies the average distance between any two stars");
uiDefButF(block, NUM,B_WORLDPRV2,"MinDist:", 160,50,140,19, &(wrld->starmindist), 0.0, 1000.0, 100, 0, "Specifies the minimum distance to the camera for stars");
uiDefButF(block, NUMSLI,B_WORLDPRV2,"Size:", 160,30,140,19, &(wrld->starsize), 0.0, 10.0, 10, 0, "Specifies the average screen dimension of stars");
uiDefButF(block, NUMSLI,B_WORLDPRV2,"Colnoise:", 160,10,140,19, &(wrld->starcolnoise), 0.0, 1.0, 100, 0, "Randomizes star color");
uiBlockEndAlign(block);
}
@ -2831,6 +2831,11 @@ void do_matbuts(unsigned short event)
BIF_preview_changed(ID_WO);
allqueue(REDRAWBUTSSHADING, 0);
break;
case B_WORLDPRV2:
BIF_preview_changed(ID_WO);
allqueue(REDRAWBUTSSHADING, 0);
allqueue(REDRAWVIEW3D, 0);
break;
case B_MATHALO:
/* when halo is disabled, clear star flag, this is the same as MA_FACETEXTURE <blush> */
/* same for 'xtreme alpha' which is 'only shadow' */