extern char *BKE_undo_menu_string(void);
extern void BKE_undo_number(struct bContext *C, int nr);
extern const char *BKE_undo_get_name(int nr, int *active);
-extern int BKE_undo_save_file(const struct bContext *C, char *filename);
+extern int BKE_undo_save_file(const char *filename);
extern struct Main *BKE_undo_get_main(struct Scene **scene);
/* copybuffer */
}
/* saves .blend using undo buffer, returns 1 == success */
-int BKE_undo_save_file(const bContext *C, char *filename)
+int BKE_undo_save_file(const char *filename)
{
UndoElem *uel;
MemFileChunk *chunk;
switch (az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
if (ar->winrct.ymax == sa->totrct.ymin) add = 1; else add = 0;
- az->x1 = ar->winrct.xmax - 2.5 * AZONEPAD_TAB_PLUSW;
+ az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
az->y1 = ar->winrct.ymax - add;
- az->x2 = ar->winrct.xmax - 1.5 * AZONEPAD_TAB_PLUSW;
+ az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
az->y2 = ar->winrct.ymax - add + AZONEPAD_TAB_PLUSH;
break;
case AE_BOTTOM_TO_TOPLEFT:
- az->x1 = ar->winrct.xmax - 2.5 * AZONEPAD_TAB_PLUSW;
+ az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
az->y1 = ar->winrct.ymin - AZONEPAD_TAB_PLUSH;
- az->x2 = ar->winrct.xmax - 1.5 * AZONEPAD_TAB_PLUSW;
+ az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
az->y2 = ar->winrct.ymin;
break;
case AE_LEFT_TO_TOPRIGHT:
az->x1 = ar->winrct.xmin - AZONEPAD_TAB_PLUSH;
- az->y1 = ar->winrct.ymax - 2.5 * AZONEPAD_TAB_PLUSW;
+ az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
az->x2 = ar->winrct.xmin;
- az->y2 = ar->winrct.ymax - 1.5 * AZONEPAD_TAB_PLUSW;
+ az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
break;
case AE_RIGHT_TO_TOPLEFT:
az->x1 = ar->winrct.xmax - 1;
- az->y1 = ar->winrct.ymax - 2.5 * AZONEPAD_TAB_PLUSW;
+ az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TAB_PLUSH;
- az->y2 = ar->winrct.ymax - 1.5 * AZONEPAD_TAB_PLUSW;
+ az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
break;
}
/* rect needed for mouse pointer test */
} RegionAlphaInfo;
#define TIMEOUT 0.3f
-#define TIMESTEP 0.04
+#define TIMESTEP 0.04f
float ED_region_blend_factor(ARegion *ar)
{
alpha = (float)ar->regiontimer->duration / TIMEOUT;
/* makes sure the blend out works 100% - without area redraws */
- if (rgi->hidden) alpha = 0.9 - TIMESTEP - alpha;
+ if (rgi->hidden) alpha = 0.9f - TIMESTEP - alpha;
CLAMP(alpha, 0.0f, 1.0f);
return alpha;
ED_region_tag_redraw(rgi->child_ar);
/* end timer? */
- if (rgi->ar->regiontimer->duration > TIMEOUT) {
+ if (rgi->ar->regiontimer->duration > (double)TIMEOUT) {
region_blend_end(C, rgi->ar, 0);
return (OPERATOR_FINISHED | OPERATOR_PASS_THROUGH);
}
/* XXX firstly draw a little rect to help identify that it's different from the toggles */
glBegin(GL_LINE_LOOP);
glVertex2f((float)v2d->cur.xmax - offset - 1, y - 0.35f * U.widget_unit);
- glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45 * U.widget_unit);
- glVertex2f((float)v2d->cur.xmax - 1, y + 0.45f * U.widget_unit);
+ glVertex2f((float)v2d->cur.xmax - offset - 1, y + 0.45f * U.widget_unit);
+ glVertex2f((float)v2d->cur.xmax - 1, y + 0.45f * U.widget_unit);
glVertex2f((float)v2d->cur.xmax - 1, y - 0.35f * U.widget_unit);
glEnd(); // GL_LINES
/* divider */
UI_ThemeColorShade(TH_BACK, -40);
- glRecti(tempx - 10.0 * ufac, *starty + 4.0f * ufac, tempx - 8.0f * ufac, *starty + UI_UNIT_Y - 4.0f * ufac);
+ glRecti(tempx - 10.0f * ufac,
+ *starty + 4.0f * ufac,
+ tempx - 8.0f * ufac,
+ *starty + UI_UNIT_Y - 4.0f * ufac);
glEnable(GL_BLEND);
glPixelTransferf(GL_ALPHA_SCALE, 0.5);
if (U.uiflag & USER_GLOBALUNDO) {
/* fast save of last undobuffer, now with UI */
- BKE_undo_save_file(C, filepath);
+ BKE_undo_save_file(filepath);
}
else {
/* save as regular blend file */
BLI_make_file_string("/", filename, BLI_temporary_dir(), "quit.blend");
- if (BKE_undo_save_file(C, filename))
+ if (BKE_undo_save_file(filename))
printf("Saved session recovery to '%s'\n", filename);
}
}