[Bf-blender-cvs] [7a0377e] blender2.8: OpenGL: draw lamp objects with new imm mode

Mike Erwin noreply at git.blender.org
Thu Oct 20 20:50:58 CEST 2016


Commit: 7a0377e22ba8e5d3a79e76699b00743e0eca757e
Author: Mike Erwin
Date:   Thu Oct 20 14:48:31 2016 -0400
Branches: blender2.8
https://developer.blender.org/rB7a0377e22ba8e5d3a79e76699b00743e0eca757e

OpenGL: draw lamp objects with new imm mode

Part of T49043. Also uses new matrix API (T49450)

===================================================================

D	source/blender/editors/space_file/CMakeLists.txt
D	source/blender/editors/space_file/file_draw.c
D	source/blender/editors/space_file/file_intern.h
D	source/blender/editors/space_file/file_ops.c
D	source/blender/editors/space_file/file_panels.c
D	source/blender/editors/space_file/file_utils.c
D	source/blender/editors/space_file/filelist.c
D	source/blender/editors/space_file/filelist.h
D	source/blender/editors/space_file/filesel.c
D	source/blender/editors/space_file/fsmenu.c
D	source/blender/editors/space_file/fsmenu.h
D	source/blender/editors/space_file/space_file.c
D	source/blender/editors/space_graph/CMakeLists.txt
D	source/blender/editors/space_graph/graph_buttons.c
D	source/blender/editors/space_graph/graph_draw.c
D	source/blender/editors/space_graph/graph_edit.c
D	source/blender/editors/space_graph/graph_intern.h
D	source/blender/editors/space_graph/graph_ops.c
D	source/blender/editors/space_graph/graph_select.c
D	source/blender/editors/space_graph/graph_utils.c
D	source/blender/editors/space_graph/space_graph.c
D	source/blender/editors/space_image/CMakeLists.txt
D	source/blender/editors/space_image/image_buttons.c
D	source/blender/editors/space_image/image_draw.c
D	source/blender/editors/space_image/image_edit.c
D	source/blender/editors/space_image/image_intern.h
D	source/blender/editors/space_image/image_ops.c
D	source/blender/editors/space_image/space_image.c
D	source/blender/editors/space_info/CMakeLists.txt
D	source/blender/editors/space_info/info_draw.c
D	source/blender/editors/space_info/info_intern.h
D	source/blender/editors/space_info/info_ops.c
D	source/blender/editors/space_info/info_report.c
D	source/blender/editors/space_info/info_stats.c
D	source/blender/editors/space_info/space_info.c
D	source/blender/editors/space_info/textview.c
D	source/blender/editors/space_info/textview.h
D	source/blender/editors/space_logic/CMakeLists.txt
D	source/blender/editors/space_logic/logic_buttons.c
D	source/blender/editors/space_logic/logic_intern.h
D	source/blender/editors/space_logic/logic_ops.c
D	source/blender/editors/space_logic/logic_window.c
D	source/blender/editors/space_logic/space_logic.c
D	source/blender/editors/space_nla/CMakeLists.txt
D	source/blender/editors/space_nla/nla_buttons.c
D	source/blender/editors/space_nla/nla_channels.c
D	source/blender/editors/space_nla/nla_draw.c
D	source/blender/editors/space_nla/nla_edit.c
D	source/blender/editors/space_nla/nla_intern.h
D	source/blender/editors/space_nla/nla_ops.c
D	source/blender/editors/space_nla/nla_select.c
D	source/blender/editors/space_nla/space_nla.c
D	source/blender/editors/space_node/CMakeLists.txt
D	source/blender/editors/space_node/drawnode.c
D	source/blender/editors/space_node/node_add.c
D	source/blender/editors/space_node/node_buttons.c
D	source/blender/editors/space_node/node_draw.c
D	source/blender/editors/space_node/node_edit.c
D	source/blender/editors/space_node/node_group.c
D	source/blender/editors/space_node/node_intern.h
D	source/blender/editors/space_node/node_ops.c
D	source/blender/editors/space_node/node_relationships.c
D	source/blender/editors/space_node/node_select.c
D	source/blender/editors/space_node/node_templates.c
D	source/blender/editors/space_node/node_toolbar.c
D	source/blender/editors/space_node/node_view.c
D	source/blender/editors/space_node/space_node.c
D	source/blender/editors/space_outliner/CMakeLists.txt
D	source/blender/editors/space_outliner/outliner_draw.c
D	source/blender/editors/space_outliner/outliner_edit.c
D	source/blender/editors/space_outliner/outliner_intern.h
D	source/blender/editors/space_outliner/outliner_ops.c
D	source/blender/editors/space_outliner/outliner_select.c
D	source/blender/editors/space_outliner/outliner_tools.c
D	source/blender/editors/space_outliner/outliner_tree.c
D	source/blender/editors/space_outliner/space_outliner.c
D	source/blender/editors/space_script/CMakeLists.txt
D	source/blender/editors/space_script/script_edit.c
D	source/blender/editors/space_script/script_intern.h
D	source/blender/editors/space_script/script_ops.c
D	source/blender/editors/space_script/space_script.c
D	source/blender/editors/space_sequencer/CMakeLists.txt
D	source/blender/editors/space_sequencer/sequencer_add.c
D	source/blender/editors/space_sequencer/sequencer_buttons.c
D	source/blender/editors/space_sequencer/sequencer_draw.c
D	source/blender/editors/space_sequencer/sequencer_edit.c
D	source/blender/editors/space_sequencer/sequencer_intern.h
D	source/blender/editors/space_sequencer/sequencer_modifier.c
D	source/blender/editors/space_sequencer/sequencer_ops.c
D	source/blender/editors/space_sequencer/sequencer_preview.c
D	source/blender/editors/space_sequencer/sequencer_scopes.c
D	source/blender/editors/space_sequencer/sequencer_select.c
D	source/blender/editors/space_sequencer/sequencer_view.c
D	source/blender/editors/space_sequencer/space_sequencer.c
D	source/blender/editors/space_text/CMakeLists.txt
D	source/blender/editors/space_text/space_text.c
D	source/blender/editors/space_text/text_autocomplete.c
D	source/blender/editors/space_text/text_draw.c
D	source/blender/editors/space_text/text_format.c
D	source/blender/editors/space_text/text_format.h
D	source/blender/editors/space_text/text_format_lua.c
D	source/blender/editors/space_text/text_format_osl.c
D	source/blender/editors/space_text/text_format_py.c
D	source/blender/editors/space_text/text_header.c
D	source/blender/editors/space_text/text_intern.h
D	source/blender/editors/space_text/text_ops.c
D	source/blender/editors/space_time/CMakeLists.txt
D	source/blender/editors/space_time/space_time.c
D	source/blender/editors/space_time/time_intern.h
D	source/blender/editors/space_time/time_ops.c
D	source/blender/editors/space_userpref/CMakeLists.txt
D	source/blender/editors/space_userpref/space_userpref.c
D	source/blender/editors/space_userpref/userpref_intern.h
D	source/blender/editors/space_userpref/userpref_ops.c
D	source/blender/editors/space_view3d/CMakeLists.txt
D	source/blender/editors/space_view3d/drawanimviz.c
D	source/blender/editors/space_view3d/drawarmature.c
D	source/blender/editors/space_view3d/drawmesh.c
D	source/blender/editors/space_view3d/drawobject.c
D	source/blender/editors/space_view3d/drawsimdebug.c
D	source/blender/editors/space_view3d/drawvolume.c
D	source/blender/editors/space_view3d/space_view3d.c
D	source/blender/editors/space_view3d/view3d_buttons.c
D	source/blender/editors/space_view3d/view3d_camera_control.c
D	source/blender/editors/space_view3d/view3d_draw.c
D	source/blender/editors/space_view3d/view3d_draw_legacy.c
D	source/blender/editors/space_view3d/view3d_edit.c
D	source/blender/editors/space_view3d/view3d_fly.c
D	source/blender/editors/space_view3d/view3d_header.c
D	source/blender/editors/space_view3d/view3d_intern.h
D	source/blender/editors/space_view3d/view3d_iterators.c
D	source/blender/editors/space_view3d/view3d_ops.c
D	source/blender/editors/space_view3d/view3d_project.c
D	source/blender/editors/space_view3d/view3d_ruler.c
D	source/blender/editors/space_view3d/view3d_select.c
D	source/blender/editors/space_view3d/view3d_snap.c
D	source/blender/editors/space_view3d/view3d_toolbar.c
D	source/blender/editors/space_view3d/view3d_view.c
D	source/blender/editors/space_view3d/view3d_walk.c
D	source/blender/editors/transform/CMakeLists.txt
D	source/blender/editors/transform/transform.c
D	source/blender/editors/transform/transform.h
D	source/blender/editors/transform/transform_constraints.c
D	source/blender/editors/transform/transform_conversions.c
D	source/blender/editors/transform/transform_generics.c
D	source/blender/editors/transform/transform_input.c
D	source/blender/editors/transform/transform_manipulator.c
D	source/blender/editors/transform/transform_ops.c
D	source/blender/editors/transform/transform_orientations.c
D	source/blender/editors/transform/transform_snap.c
D	source/blender/editors/transform/transform_snap_object.c
D	source/blender/physics/BPH_mass_spring.h
D	source/blender/physics/CMakeLists.txt
D	source/blender/physics/intern/BPH_mass_spring.cpp
D	source/blender/physics/intern/ConstrainedConjugateGradient.h
D	source/blender/physics/intern/eigen_utils.h
D	source/blender/physics/intern/hair_volume.cpp
D	source/blender/physics/intern/implicit.h
D	source/blender/physics/intern/implicit_blender.c
D	source/blender/physics/intern/implicit_eigen.cpp

===================================================================

diff --git a/source/blender/editors/space_file/CMakeLists.txt b/source/blender/editors/space_file/CMakeLists.txt
deleted file mode 100644
index fd701a8..0000000
--- a/source/blender/editors/space_file/CMakeLists.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-# ***** BEGIN GPL LICENSE BLOCK *****
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License
-# as published by the Free Software Foundation; either version 2
-# of the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# Contributor(s): Jacques Beaurain.
-#
-# ***** END GPL LICENSE BLOCK *****
-
-set(INC
-	../include
-	../../blenfont
-	../../blenkernel
-	../../blenlib
-	../../blenloader
-	../../blentranslation
-	../../imbuf
-	../../gpu
-	../../makesdna
-	../../makesrna
-	../../render/extern/include
-	../../windowmanager
-	../../../../intern/atomic
-	../../../../intern/guardedalloc
-	../../../../intern/glew-mx
-)
-
-set(INC_SYS
-	${GLEW_INCLUDE_PATH}
-)
-
-set(SRC
-	file_draw.c
-	file_ops.c
-	file_panels.c
-	file_utils.c
-	filelist.c
-	filesel.c
-	fsmenu.c
-	space_file.c
-
-	file_intern.h
-	filelist.h
-	fsmenu.h
-)
-
-if(WITH_HEADLESS)
-	add_definitions(-DWITH_HEADLESS)
-endif()
-
-if(WITH_IMAGE_OPENEXR)
-	add_definitions(-DWITH_OPENEXR)
-endif()
-
-if(WITH_OPENIMAGEIO)
-	add_definitions(-DWITH_OPENIMAGEIO)
-endif()
-
-if(WITH_IMAGE_TIFF)
-	add_definitions(-DWITH_TIFF)
-endif()
-
-if(WITH_IMAGE_OPENJPEG)
-	add_definitions(-DWITH_OPENJPEG)
-endif()
-
-if(WITH_IMAGE_DDS)
-	add_definitions(-DWITH_DDS)
-endif()
-
-if(WITH_IMAGE_CINEON)
-	add_definitions(-DWITH_CINEON)
-endif()
-
-if(WITH_IMAGE_HDR)
-	add_definitions(-DWITH_HDR)
-endif()
-
-if(WITH_INTERNATIONAL)
-	add_definitions(-DWITH_INTERNATIONAL)
-endif()
-
-add_definitions(${GL_DEFINITIONS})
-
-if(WITH_FREESTYLE)
-	add_definitions(-DWITH_FREESTYLE)
-endif()
-
-blender_add_lib(bf_editor_space_file "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
deleted file mode 100644
index 925efec..0000000
--- a/source/blender/editors/space_file/file_draw.c
+++ /dev/null
@@ -1,724 +0,0 @@
-/*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version. 
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * The Original Code is Copyright (C) 2008 Blender Foundation.
- * All rights reserved.
- *
- * 
- * Contributor(s): Blender Foundation
- *
- * ***** END GPL LICENSE BLOCK *****
- */
-
-/** \file blender/editors/space_file/file_draw.c
- *  \ingroup spfile
- */
-
-
-#include <math.h>
-#include <string.h>
-#include <errno.h>
-
-#include "BLI_blenlib.h"
-#include "BLI_utildefines.h"
-#include "BLI_fileops_types.h"
-#include "BLI_math.h"
-
-#ifdef WIN32
-#  include "BLI_winstuff.h"
-#endif
-
-#include "BIF_gl.h"
-#include "BIF_glutil.h"
-
-#include "BKE_context.h"
-#include "BKE_global.h"
-#include "BKE_main.h"
-
-#include "BLO_readfile.h"
-
-#include "BLT_translation.h"
-
-#include "IMB_imbuf_types.h"
-
-#include "DNA_userdef_types.h"
-#include "DNA_windowmanager_types.h"
-
-#include "RNA_access.h"
-
-#include "ED_fileselect.h"
-#include "ED_screen.h"
-
-#include "UI_interface.h"
-#include "UI_interface_icons.h"
-#include "UI_resources.h"
-#include "UI_view2d.h"
-
-#include "WM_api.h"
-#include "WM_types.h"
-
-//#include "GPU_draw.h"
-//#include "GPU_basic_shader.h"
-#include "GPU_immediate.h"
-
-#include "filelist.h"
-
-#include "file_intern.h"    // own include
-
-/* Dummy helper - we need dynamic tooltips here. */
-static char *file_draw_tooltip_func(bContext *UNUSED(C), void *argN, const char *UNUSED(tip))
-{
-	char *dyn_tooltip = argN;
-	return BLI_strdup(dyn_tooltip);
-}
-
-/* Note: This function uses pixelspace (0, 0, winx, winy), not view2d. 
- * The controls are laid out as follows:
- *
- * -------------------------------------------
- * | Directory input               | execute |
- * -------------------------------------------
- * | Filename input        | + | - | cancel  |
- * -------------------------------------------
- *
- * The input widgets will stretch to fill any excess space.
- * When there isn't enough space for all controls to be shown, they are
- * hidden in this order: x/-, execute/cancel, input widgets.
- */
-void file_draw_buttons(const bContext *C, ARegion *ar)
-{
-	/* Button layout. */
-	const int max_x      = ar->winx - 10;
-	const int line1_y    = ar->winy - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
-	const int line2_y    = line1_y - (IMASEL_BUTTONS_HEIGHT / 2 + IMASEL_BUTTONS_MARGIN);
-	const int input_minw = 20;
-	const int btn_h      = UI_UNIT_Y;
-	const int btn_fn_w   = UI_UNIT_X;
-	const int btn_minw   = 80;
-	const int btn_margin = 20;
-	const int separator  = 4;
-
-	/* Additional locals. */
-	char uiblockstr[32];
-	int loadbutton;
-	int fnumbuttons;
-	int min_x       = 10;
-	int chan_offs   = 0;
-	int available_w = max_x - min_x;
-	int line1_w     = available_w;
-	int line2_w     = available_w;
-	
-	uiBut *but;
-	uiBlock *block;
-	SpaceFile *sfile  = CTX_wm_space_file(C);
-	FileSelectParams *params = ED_fileselect_get_params(sfile);
-	ARegion *artmp;
-	const bool is_browse_only = (sfile->op == NULL);
-	
-	/* Initialize UI block. */
-	BLI_snprintf(uiblockstr, sizeof(uiblockstr), "win %p", (void *)ar);
-	block = UI_block_begin(C, ar, uiblockstr, UI_EMBOSS);
-
-	/* exception to make space for collapsed region icon */
-	for (artmp = CTX_wm_area(C)->regionbase.first; artmp; artmp = artmp->next) {
-		if (artmp->regiontype == RGN_TYPE_TOOLS && artmp->flag & RGN_FLAG_HIDDEN) {
-			chan_offs = 16;
-			min_x += chan_offs;
-			available_w -= chan_offs;
-		}
-	}
-
-	/* Is there enough space for the execute / cancel buttons? */
-
-
-	if (is_browse_only) {
-		loadbutton = 0;
-	}
-	else {
-		const uiFontStyle *fstyle = UI_FSTYLE_WIDGET;
-		loadbutton = UI_fontstyle_string_width(fstyle, params->title) + btn_margin;
-		CLAMP_MIN(loadbutton, btn_minw);
-		if (available_w <= loadbutton + separator + input_minw) {
-			loadbutton = 0;
-		}
-	}
-
-	if (loadbutton) {
-		line1_w -= (loadbutton + separator);
-		line2_w  = line1_w;
-	}
-
-	/* Is there enough space for file number increment/decrement buttons? */
-	fnumbuttons = 2 * btn_fn_w;
-	if (!loadbutton || line2_w <= fnumbuttons + separator + input_minw) {
-		fnumbuttons = 0;
-	}
-	else {
-		line2_w -= (fnumbuttons + separator);
-	}
-
-	/* Text input fields for directory and file. */
-	if (available_w > 0) {
-		const struct FileDirEntry *file = sfile->files ? filelist_file(sfile->files, params->active_file) : NULL;
-		int overwrite_alert = file_draw_check_exists(sfile);
-		const bool is_active_dir = file && (file->typeflag & FILE_TYPE_FOLDER);
-
-		/* callbacks for operator check functions */
-		UI_block_func_set(block, file_draw_check_cb, NULL, NULL);
-
-		but = uiDefBut(block, UI_BTYPE_TEXT, -1, "",
-		               min_x, line1_y, line1_w - chan_offs, btn_h,
-		               params->dir, 0.0, (float)FILE_MAX, 0, 0,
-		               TIP_("File path"));
-		UI_but_func_complete_set(but, autocomplete_directory, NULL);
-		UI_but_flag_enable(but, UI_BUT_NO_UTF8);
-		UI_but_flag_disable(but, UI_BUT_UNDO);
-		UI_but_funcN_set(but, file_directory_enter_handle, NULL, but);
-
-		/* TODO, directory editing is non-functional while a library is loaded
-		 * until this is properly supported just disable it. */
-		if (sfile->files && filelist_lib(sfile->files))
-			UI_but_flag_enable(but, UI_BUT_DISABLED);
-
-		if ((params->flag & FILE_DIRSEL_ONLY) == 0) {
-			but = uiDefBut(block, UI_BTYPE_TEXT, -1, "",
-			               min_x, line2_y, line2_w - chan_offs, btn_h,
-			               is_active_dir ? (char *)"" : params->file,
-			               0.0, (float)FILE_MAXFILE, 0, 0,
-			               TIP_(overwrite_alert ? N_("File name, overwrite existing") : N_("File name")));
-			UI_but_func_complete_set(but, autocomplete_file, NULL);
-			UI_but_flag_enable(but, UI_BUT_NO_UTF8);
-			UI_but_flag_disable(but, UI_BUT_UNDO);
-			/* silly workaround calling NFunc to ensure this does not get called
-			 * immediate ui_apply_but_func but only after button deactivates */
-			UI_but_funcN_set(but, file_filename_enter_handle, NULL, but);
-
-			/* check if this overrides a file and if the operator option is used */
-			if (overwrite_alert) {
-				UI_but_flag_enable(but, UI_BUT_REDALERT);
-			}
-		}
-		
-		/* clear func */
-		UI_block_func_set(block, NULL, NULL, NULL);
-	}
-	
-	/* Filename number increment / decrement buttons. */
-	if (fnumbuttons && (params->flag & FILE_DIRSEL_ONLY) == 0) {
-		UI_block_align_begin(block);
-		but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_filenum", 0, ICON_ZOOMOUT,
-		                    min_x + line2_w + separator - chan_offs, line2_y,
-		                    btn_fn_w, btn_h,
-		                    TIP_("Decrement the filename number"));
-		RNA_int_set(UI_but_operator_ptr_get(but), "increment", -1);
-
-		but = uiDefIconButO(block, UI_BTYPE_BUT, "FILE_OT_filenum", 0, ICON_ZOOMIN,
-		                    min_x + line2_w + separator + btn_fn_w - chan_offs, line2_y,
-		                    btn_fn_w, btn_h,
-	

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list