Fixes I did before leaving to siggraph, couldn't commit it due to freeze:

- buffer overflow was possible with providing a file path argument longer
  than 256 characters.
- buttons "VCol Light" and "VCol Paint" were not mutual exclusive
- quicktime error menu (unable to create) had a enter in end
- deleting points in CurveMapping button (like Curves node in compositor)
  did not give proper recalc event
- edges render menu had a tooltip still mentioning the unified render
This commit is contained in:
Ton Roosendaal 2006-08-09 10:00:27 +00:00
parent 6c48d7bda2
commit c56f04cb5f
6 changed files with 25 additions and 8 deletions

@ -263,7 +263,7 @@ BlendFileData *BLO_read_from_file(char *file, BlendReadError *error_r)
bfd= blo_read_file_internal(fd, error_r);
if (bfd) {
bfd->type= BLENFILETYPE_BLEND;
strcpy(bfd->main->name, file);
strncpy(bfd->main->name, file, sizeof(bfd->main->name)-1);
}
blo_freefiledata(fd);
}

@ -203,6 +203,8 @@ void curvemap_buttons(struct uiBlock *block, struct CurveMapping *cumap, char la
#define B_MAT_LAYERBROWSE 1220
#define B_MAT_USENODES 1221
#define B_MAT_VCOL_PAINT 1222
#define B_MAT_VCOL_LIGHT 1223
/* *********************** */
#define B_TEXBUTS 1400

@ -501,7 +501,7 @@ void start_qt(struct RenderData *rd, int rectx, int recty) {
if(err != noErr) {
G.afbreek = 1;
error("Unable to create Quicktime movie: %s\n", name);
error("Unable to create Quicktime movie: %s", name);
} else {
printf("Created QuickTime movie: %s\n", name);

@ -484,7 +484,7 @@ void curvemap_buttons(uiBlock *block, CurveMapping *cumap, char labeltype, short
bt= uiDefIconBlockBut(block, curvemap_clipping_func, cumap, event, icon, xco, yco, dx, 18, "Clipping Options");
xco= (short)(rect->xmin+8.0f*dx);
bt= uiDefIconBut(block, BUT, redraw, ICON_X, xco, yco, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
bt= uiDefIconBut(block, BUT, event, ICON_X, xco, yco, dx, 18, NULL, 0.0, 0.0, 0.0, 0.0, "Delete points");
uiButSetFunc(bt, curvemap_buttons_delete, cumap, NULL);
uiBlockSetEmboss(block, UI_EMBOSS);

@ -829,11 +829,11 @@ static uiBlock *edge_render_menu(void *arg_unused)
uiBlockBeginAlign(block);
uiDefButF(block, NUMSLI, 0, "R ", 45, 50, 175,19, &G.scene->r.edgeR, 0.0, 1.0, B_EDGECOLSLI, 0,
"For unified renderer: Colour for edges in toon shading mode.");
"Colour for edges in toon shading mode.");
uiDefButF(block, NUMSLI, 0, "G ", 45, 30, 175,19, &G.scene->r.edgeG, 0.0, 1.0, B_EDGECOLSLI, 0,
"For unified renderer: Colour for edges in toon shading mode.");
"Colour for edges in toon shading mode.");
uiDefButF(block, NUMSLI, 0, "B ", 45, 10, 175,19, &G.scene->r.edgeB, 0.0, 1.0, B_EDGECOLSLI, 0,
"For unified renderer: Colour for edges in toon shading mode.");
"Colour for edges in toon shading mode.");
uiBlockSetDirection(block, UI_TOP);

@ -2586,6 +2586,21 @@ void do_matbuts(unsigned short event)
allqueue(REDRAWIPO, 0);
}
break;
case B_MAT_VCOL_PAINT:
if(ma) {
ma->mode &= ~MA_VERTEXCOL;
BIF_preview_changed(ID_MA);
allqueue(REDRAWBUTSSHADING, 0);
}
break;
case B_MAT_VCOL_LIGHT:
if(ma) {
ma->mode &= ~MA_VERTEXCOLP;
BIF_preview_changed(ID_MA);
allqueue(REDRAWBUTSSHADING, 0);
}
break;
}
}
@ -3105,8 +3120,8 @@ static void material_panel_material(Material *ma)
if(!(ma->mode & MA_HALO)) {
uiBlockBeginAlign(block);
uiBlockSetCol(block, TH_BUT_SETTING1);
uiDefButBitI(block, TOG, MA_VERTEXCOL, B_REDR, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colours as extra light");
uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_REDR, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colours with vertex colours");
uiDefButBitI(block, TOG, MA_VERTEXCOL, B_MAT_VCOL_LIGHT, "VCol Light", 8,166,74,20, &(ma->mode), 0, 0, 0, 0, "Adds vertex colours as extra light");
uiDefButBitI(block, TOG, MA_VERTEXCOLP, B_MAT_VCOL_PAINT, "VCol Paint", 82,166,74,20, &(ma->mode), 0, 0, 0, 0, "Replaces material's colours with vertex colours");
uiDefButBitI(block, TOG, MA_FACETEXTURE, B_REDR, "TexFace", 156,166,74,20, &(ma->mode), 0, 0, 0, 0, "Sets UV-Editor assigned texture as color and texture info for faces");
uiDefButBitI(block, TOG, MA_SHLESS, B_MATPRV, "Shadeless", 230,166,73,20, &(ma->mode), 0, 0, 0, 0, "Makes material insensitive to light or shadow");
uiDefButBitI(block, TOG, MA_NOMIST, B_NOP, "No Mist", 8,146,146,20, &(ma->mode), 0, 0, 0, 0, "Sets the material to ignore mist values");