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:
authorCampbell Barton <ideasman42@gmail.com>2018-02-27 12:22:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-02-27 12:24:02 +0300
commitefef0ee672d5a65c8cb4a37f2837a371def6daaa (patch)
treeaec294e98ee2b7d6be1d8d39a693334db41a9a93 /source/blender
parent24f759ba5a16305d57c285dbff080d8adb116ed1 (diff)
parent4de50d757233009ccd5db8538fd036a62ce58648 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/gpu/GPU_select.h1
-rw-r--r--source/blender/gpu/intern/gpu_select.c23
-rw-r--r--source/blender/gpu/intern/gpu_select_pick.c18
-rw-r--r--source/blender/gpu/intern/gpu_select_private.h1
-rw-r--r--source/blender/windowmanager/intern/wm_files.c4
5 files changed, 42 insertions, 5 deletions
diff --git a/source/blender/gpu/GPU_select.h b/source/blender/gpu/GPU_select.h
index 0617d58f3b6..f1342a1f6b8 100644
--- a/source/blender/gpu/GPU_select.h
+++ b/source/blender/gpu/GPU_select.h
@@ -47,6 +47,7 @@ enum {
void GPU_select_begin(unsigned int *buffer, unsigned int bufsize, const struct rcti *input, char mode, int oldhits);
bool GPU_select_load_id(unsigned int id);
+void GPU_select_finalize(void);
unsigned int GPU_select_end(void);
bool GPU_select_query_check_active(void);
diff --git a/source/blender/gpu/intern/gpu_select.c b/source/blender/gpu/intern/gpu_select.c
index 153cf5f1e97..3240688d24b 100644
--- a/source/blender/gpu/intern/gpu_select.c
+++ b/source/blender/gpu/intern/gpu_select.c
@@ -150,6 +150,29 @@ bool GPU_select_load_id(unsigned int id)
}
/**
+ * Needed when GL context of #GPU_select_end
+ * can't be used to finalize selection operations
+ * (because of context changes).
+ */
+void GPU_select_finalize(void)
+{
+ if (!g_select_state.select_is_active)
+ return;
+
+ switch (g_select_state.algorithm) {
+ case ALGO_GL_LEGACY:
+ case ALGO_GL_QUERY:
+ {
+ break;
+ }
+ default: /* ALGO_GL_PICK */
+ {
+ gpu_select_pick_finalize();
+ }
+ }
+}
+
+/**
* Cleanup and flush selection results to buffer.
* Return number of hits and hits in buffer.
* if \a dopass is true, we will do a second pass with occlusion queries to get the closest hit.
diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c
index f1d311890e6..2d36c6f120c 100644
--- a/source/blender/gpu/intern/gpu_select_pick.c
+++ b/source/blender/gpu/intern/gpu_select_pick.c
@@ -524,6 +524,19 @@ bool gpu_select_pick_load_id(unsigned int id)
return true;
}
+ /**
+ * (Optional), call before 'gpu_select_pick_end' if GL context is not kept.
+ * is not compatible with regular select case.
+ * */
+void gpu_select_pick_finalize(void)
+{
+ GPUPickState *ps = &g_pick_state;
+ if (ps->gl.is_init) {
+ /* force finishing last pass */
+ gpu_select_pick_load_id(ps->gl.prev_id);
+ }
+}
+
unsigned int gpu_select_pick_end(void)
{
GPUPickState *ps = &g_pick_state;
@@ -533,10 +546,7 @@ unsigned int gpu_select_pick_end(void)
#endif
if (ps->is_cached == false) {
- if (ps->gl.is_init) {
- /* force finishing last pass */
- gpu_select_pick_load_id(ps->gl.prev_id);
- }
+ gpu_select_pick_finalize();
gpuPopAttrib();
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
diff --git a/source/blender/gpu/intern/gpu_select_private.h b/source/blender/gpu/intern/gpu_select_private.h
index 8935bd7b253..8368aaa9edc 100644
--- a/source/blender/gpu/intern/gpu_select_private.h
+++ b/source/blender/gpu/intern/gpu_select_private.h
@@ -35,6 +35,7 @@
/* gpu_select_pick */
void gpu_select_pick_begin(unsigned int (*buffer)[4], unsigned int bufsize, const rcti *input, char mode);
bool gpu_select_pick_load_id(unsigned int id);
+void gpu_select_pick_finalize(void);
unsigned int gpu_select_pick_end(void);
void gpu_select_pick_cache_begin(void);
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 34006fe87b8..4cdca043448 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -2196,11 +2196,13 @@ static int wm_save_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent *U
char path[FILE_MAX];
RNA_string_get(op->ptr, "filepath", path);
- if (BLI_exists(path)) {
+ if (RNA_boolean_get(op->ptr, "check_existing") && BLI_exists(path)) {
ret = WM_operator_confirm_message_ex(C, op, IFACE_("Save Over?"), ICON_QUESTION, path);
}
else {
ret = wm_save_as_mainfile_exec(C, op);
+ /* Without this there is no feedback the file was saved. */
+ BKE_reportf(op->reports, RPT_INFO, "Saved \"%s\"", BLI_path_basename(path));
}
}
else {