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>2012-09-07 03:41:03 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-09-07 03:41:03 +0400
commit0ecbc047e8a540175b00ed967050abb5f7363dbc (patch)
treefdf8a8011f919fb606b07d357a3be8b9606bf592 /source/blender/editors/space_view3d
parent774cc0ab1663a5d31eeda797ac71c5143086ca98 (diff)
code cleanup
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c9
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_select.c4
-rw-r--r--source/blender/editors/space_view3d/view3d_view.c3
4 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 39b92645166..8a334423ab0 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1389,14 +1389,17 @@ unsigned int view3d_sample_backbuf(ViewContext *vc, int x, int y)
{
unsigned int col;
- if (x >= vc->ar->winx || y >= vc->ar->winy) return 0;
+ if (x >= vc->ar->winx || y >= vc->ar->winy) {
+ return 0;
+ }
+
x += vc->ar->winrct.xmin;
y += vc->ar->winrct.ymin;
view3d_validate_backbuf(vc);
- glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
- glReadBuffer(GL_BACK);
+ glReadPixels(x, y, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col);
+ glReadBuffer(GL_BACK);
if (ENDIAN_ORDER == B_ENDIAN) {
BLI_endian_switch_uint32(&col);
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 5169d823bd8..17f1081f5c4 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -475,8 +475,8 @@ static void viewops_data_create(bContext *C, wmOperator *op, wmEvent *event)
{
/* for dolly */
- float mval_f[2];
- VECCOPY2D(mval_f, event->mval);
+ const float mval_f[2] = {(float)event->mval[0],
+ (float)event->mval[1]};
ED_view3d_win_to_vector(vod->ar, mval_f, vod->mousevec);
}
diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index d8e394ab68c..df0908e445e 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -119,8 +119,8 @@ int view3d_get_view_aligned_coordinate(ViewContext *vc, float fp[3], const int m
initgrabz(vc->rv3d, fp[0], fp[1], fp[2]);
if (mval_cpy[0] != IS_CLIPPED) {
- float mval_f[2];
- VECSUB2D(mval_f, mval_cpy, mval);
+ const float mval_f[2] = {(float)(mval_cpy[0] - mval[0]),
+ (float)(mval_cpy[1] - mval[1])};
ED_view3d_win_to_delta(vc->ar, mval_f, dvec);
sub_v3_v3(fp, dvec);
diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c
index fbbf23beca4..1d40ae280b7 100644
--- a/source/blender/editors/space_view3d/view3d_view.c
+++ b/source/blender/editors/space_view3d/view3d_view.c
@@ -87,8 +87,9 @@ void view3d_operator_needs_opengl(const bContext *C)
void view3d_region_operator_needs_opengl(wmWindow *win, ARegion *ar)
{
/* for debugging purpose, context should always be OK */
- if ((ar == NULL) || (ar->regiontype != RGN_TYPE_WINDOW))
+ if ((ar == NULL) || (ar->regiontype != RGN_TYPE_WINDOW)) {
printf("view3d_region_operator_needs_opengl error, wrong region\n");
+ }
else {
RegionView3D *rv3d = ar->regiondata;