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
path: root/intern
diff options
context:
space:
mode:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 06:03:19 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-04-18 06:03:19 +0400
commitdfe2f8dc03267e041102837e92f547fb04881510 (patch)
treed9582c4667ce5b9e39e2adce40832aa4f44b4fe7 /intern
parentd7e08f2d33207fdf76b1b597ef0de9dec26e3987 (diff)
parent00e46ef739cf2bfddb8805af056aa59fd3b3c71c (diff)
Merged changes in the trunk up to revision 28247.
Diffstat (limited to 'intern')
-rw-r--r--intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp4
-rw-r--r--intern/ghost/GHOST_ISystem.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.h12
-rw-r--r--intern/ghost/intern/GHOST_SystemCocoa.mm20
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemWin32.h2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.cpp2
-rw-r--r--intern/ghost/intern/GHOST_SystemX11.h2
-rw-r--r--intern/ghost/intern/GHOST_WindowWin32.cpp5
-rw-r--r--intern/guardedalloc/intern/mallocn.c7
-rw-r--r--intern/iksolver/intern/TNT/svd.h10
13 files changed, 54 insertions, 18 deletions
diff --git a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
index 027ac015eb5..313ea52e892 100644
--- a/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
+++ b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp
@@ -67,12 +67,12 @@ int AUD_FFMPEGReader::decode(AVPacket* packet, AUD_Buffer* buffer)
audio_pkg_data,
audio_pkg_size);
- buf_pos += data_size;
-
// read error, next packet!
if(read_length < 0)
break;
+ buf_pos += data_size;
+
// move packet parameters
audio_pkg_data += read_length;
audio_pkg_size -= read_length;
diff --git a/intern/ghost/GHOST_ISystem.h b/intern/ghost/GHOST_ISystem.h
index fd8641f2055..8d80c74e140 100644
--- a/intern/ghost/GHOST_ISystem.h
+++ b/intern/ghost/GHOST_ISystem.h
@@ -331,7 +331,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
- virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const = 0;
+ virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) = 0;
/***************************************************************************************
** Access to mouse button and keyboard states.
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index 36ea1c7fe85..5522a0736c4 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -531,7 +531,7 @@ GHOST_TSuccess GHOST_SystemCarbon::getCursorPosition(GHOST_TInt32& x, GHOST_TInt
}
-GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
+GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
float xf=(float)x, yf=(float)y;
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.h b/intern/ghost/intern/GHOST_SystemCarbon.h
index 7f0870674b4..ebd929749b6 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.h
+++ b/intern/ghost/intern/GHOST_SystemCarbon.h
@@ -156,7 +156,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
- virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
+ virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/***************************************************************************************
** Access to mouse button and keyboard states.
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.h b/intern/ghost/intern/GHOST_SystemCocoa.h
index b25f8890cf1..b97c36f04a8 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.h
+++ b/intern/ghost/intern/GHOST_SystemCocoa.h
@@ -179,8 +179,8 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
- virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
-
+ virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
+
/***************************************************************************************
** Access to mouse button and keyboard states.
***************************************************************************************/
@@ -272,6 +272,14 @@ protected:
*/
GHOST_TSuccess handleKeyEvent(void *eventPtr);
+ /**
+ * Performs the actual cursor position update (location in screen coordinates).
+ * @param x The x-coordinate of the cursor.
+ * @param y The y-coordinate of the cursor.
+ * @return Indication of success.
+ */
+ GHOST_TSuccess setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
+
/** Start time at initialization. */
GHOST_TUns64 m_start_time;
diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm
index b66b1e4033d..eb89258e1dd 100644
--- a/intern/ghost/intern/GHOST_SystemCocoa.mm
+++ b/intern/ghost/intern/GHOST_SystemCocoa.mm
@@ -807,7 +807,23 @@ GHOST_TSuccess GHOST_SystemCocoa::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
/**
* @note : expect Cocoa screen coordinates
*/
-GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
+GHOST_TSuccess GHOST_SystemCocoa::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
+{
+ GHOST_TInt32 wx,wy;
+ GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
+ if (!window) return GHOST_kFailure;
+
+ setMouseCursorPosition(x, y);
+
+ //Force mouse move event (not pushed by Cocoa)
+ window->screenToClient(x, y, wx, wy);
+ pushEvent(new GHOST_EventCursor(getMilliSeconds(), GHOST_kEventCursorMove, window, wx,wy));
+ m_outsideLoopEventProcessed = true;
+
+ return GHOST_kSuccess;
+}
+
+GHOST_TSuccess GHOST_SystemCocoa::setMouseCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
float xf=(float)x, yf=(float)y;
GHOST_WindowCocoa* window = (GHOST_WindowCocoa*)m_windowManager->getActiveWindow();
@@ -1517,7 +1533,7 @@ GHOST_TSuccess GHOST_SystemCocoa::handleMouseEvent(void *eventPtr)
//Set new cursor position
window->clientToScreen(x_mouse, y_mouse, x_cur, y_cur);
- setCursorPosition(x_cur, y_cur); /* wrap */
+ setMouseCursorPosition(x_cur, y_cur); /* wrap */
//Post event
window->getCursorGrabInitPos(x_cur, y_cur);
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp
index b1c5ee6e6f2..c4cdbcd0cd5 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.cpp
+++ b/intern/ghost/intern/GHOST_SystemWin32.cpp
@@ -273,7 +273,7 @@ GHOST_TSuccess GHOST_SystemWin32::getCursorPosition(GHOST_TInt32& x, GHOST_TInt3
}
-GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const
+GHOST_TSuccess GHOST_SystemWin32::setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y)
{
return ::SetCursorPos(x, y) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
}
diff --git a/intern/ghost/intern/GHOST_SystemWin32.h b/intern/ghost/intern/GHOST_SystemWin32.h
index 75bb858fb49..e65393a4faa 100644
--- a/intern/ghost/intern/GHOST_SystemWin32.h
+++ b/intern/ghost/intern/GHOST_SystemWin32.h
@@ -153,7 +153,7 @@ public:
* @param y The y-coordinate of the cursor.
* @return Indication of success.
*/
- virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y) const;
+ virtual GHOST_TSuccess setCursorPosition(GHOST_TInt32 x, GHOST_TInt32 y);
/***************************************************************************************
** Access to mouse button and keyboard states.
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index 1b7589fc432..2479d198970 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -970,7 +970,7 @@ GHOST_SystemX11::
setCursorPosition(
GHOST_TInt32 x,
GHOST_TInt32 y
-) const {
+) {
// This is a brute force move in screen coordinates
// XWarpPointer does relative moves so first determine the
diff --git a/intern/ghost/intern/GHOST_SystemX11.h b/intern/ghost/intern/GHOST_SystemX11.h
index 1d9959cc931..ee6cbedb2ae 100644
--- a/intern/ghost/intern/GHOST_SystemX11.h
+++ b/intern/ghost/intern/GHOST_SystemX11.h
@@ -158,7 +158,7 @@ public:
setCursorPosition(
GHOST_TInt32 x,
GHOST_TInt32 y
- ) const;
+ );
/**
* Returns the state of all modifier keys.
diff --git a/intern/ghost/intern/GHOST_WindowWin32.cpp b/intern/ghost/intern/GHOST_WindowWin32.cpp
index 4aeccd7fe2a..27bea2cec95 100644
--- a/intern/ghost/intern/GHOST_WindowWin32.cpp
+++ b/intern/ghost/intern/GHOST_WindowWin32.cpp
@@ -158,11 +158,16 @@ GHOST_WindowWin32::GHOST_WindowWin32(
width = tw;
left = rect.left;
}
+ else if(left < rect.left)
+ left = rect.left;
+
if(th < height)
{
height = th;
top = rect.top;
}
+ else if(top > rect.top)
+ top = rect.top;
m_hWnd = ::CreateWindow(
s_windowClassName, // pointer to registered class name
diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index 806f8d183ba..94453e91912 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -463,12 +463,17 @@ void MEM_printmemlist_stats()
/* sort by length and print */
qsort(printblock, totpb, sizeof(MemPrintBlock), compare_len);
printf("\ntotal memory len: %.3f MB\n", (double)mem_in_use/(double)(1024*1024));
+ printf(" ITEMS TOTAL-MiB AVERAGE-KiB TYPE\n");
for(a=0, pb=printblock; a<totpb; a++, pb++)
- printf("%s items: %d, len: %.3f MB\n", pb->name, pb->items, (double)pb->len/(double)(1024*1024));
+ printf("%6d (%8.3f %8.3f) %s\n", pb->items, (double)pb->len/(double)(1024*1024), (double)pb->len/1024.0/(double)pb->items, pb->name);
free(printblock);
mem_unlock_thread();
+
+#if 0 /* GLIBC only */
+ malloc_stats();
+#endif
}
/* Prints in python syntax for easy */
diff --git a/intern/iksolver/intern/TNT/svd.h b/intern/iksolver/intern/TNT/svd.h
index 9ca51fa2650..9ae289474a9 100644
--- a/intern/iksolver/intern/TNT/svd.h
+++ b/intern/iksolver/intern/TNT/svd.h
@@ -349,8 +349,9 @@ void SVD(MaTRiX &A, MaTRiX &U, VecToR &s, MaTRiX &V, VecToR &work1, VecToR &work
for (j = k; j < p-1; j++) {
typename MaTRiX::value_type t = hypot(f,g);
- typename MaTRiX::value_type cs = f/t;
- typename MaTRiX::value_type sn = g/t;
+ /* division by zero checks added to avoid NaN (brecht) */
+ typename MaTRiX::value_type cs = (t == 0.0f)? 0.0f: f/t;
+ typename MaTRiX::value_type sn = (t == 0.0f)? 0.0f: g/t;
if (j != k) {
e[j-1] = t;
}
@@ -366,8 +367,9 @@ void SVD(MaTRiX &A, MaTRiX &U, VecToR &s, MaTRiX &V, VecToR &work1, VecToR &work
}
t = hypot(f,g);
- cs = f/t;
- sn = g/t;
+ /* division by zero checks added to avoid NaN (brecht) */
+ cs = (t == 0.0f)? 0.0f: f/t;
+ sn = (t == 0.0f)? 0.0f: g/t;
s[j] = t;
f = cs*e[j] + sn*s[j+1];
s[j+1] = -sn*e[j] + cs*s[j+1];