Commit Graph

116 Commits

Author SHA1 Message Date
Campbell Barton
77e3d5dfb4 define UNUSED() locally for mmap_win 2010-11-24 20:56:25 +00:00
Campbell Barton
c5f7207948 fix for crash introduced r33257, also tag some vars as unused. 2010-11-24 20:13:37 +00:00
Campbell Barton
39b7bfe6bd - check IF WIN32 AND NOT UNIX (for cygwin)
- patch from Mike S to enable OpenMP and xcode
2010-11-21 13:41:43 +00:00
Campbell Barton
f383e2e0e6 Remove msvc build files which are not needed anymore. 2010-10-23 15:14:54 +00:00
Campbell Barton
433f871f0f bugfix [#24302] Ctrl+Click Extrude gets old mouse events
double click didnt check mouse distance moved so you could click twice in different areas of the screen very fast and generate a double click event which had old mouse coords copied into it but was sent to an operator set to run on single click (because the double click wasnt handled).

Also added MEM_name_ptr function (included in debug mode only), prints the name of allocated memory.
used for debugging where events came from.
2010-10-18 00:25:32 +00:00
Nathan Letwory
c9d240626d c++ -> C++ 2010-10-08 20:40:42 +00:00
Nathan Letwory
663ce490e0 Enable CXX_GUARDEDALLOC support through SCons. 2010-10-08 20:39:56 +00:00
Campbell Barton
dea59cc5eb warning fixes and minor cmake changes. 2010-09-18 03:55:56 +00:00
Campbell Barton
4b40d73bfb rename most scons build targets to match cmake 2010-08-25 04:30:47 +00:00
Campbell Barton
6464718083 rename some cmake build targets 2010-08-24 04:29:23 +00:00
Campbell Barton
885bbe6999 from Luca's recent commit noticed there are more typo's: lenght -> length 2010-07-25 01:45:53 +00:00
Joseph Eagar
a7cbd5008e merging revisions 28564-28569 from render branch into trunk 2010-05-04 12:31:24 +00:00
Campbell Barton
5e74542bb6 use size_t for MEM_allocN_len as well as some of its callers 2010-04-29 21:46:25 +00:00
Nathan Letwory
d2f5a60ca2 Amendment to r28508 (Make Blender malloc be 64 bit ready)
- one function missed in header causes compile problems (intern/guardedalloc/intern/mallocn.c:352: error: conflicting types for ‘MEM_mapallocN’)
2010-04-29 19:41:12 +00:00
Guillermo S. Romero
1fc7ea774f Make Blender malloc wrapper be 64 bit ready. 2010-04-29 17:34:40 +00:00
Campbell Barton
c757c66f92 reverting 28469, there is no use in using a long, while the allocation functions only accepts an int.
- only wastes 4 bytes per alloc.
Also would be most correct to use size_t
2010-04-28 08:15:26 +00:00
Guillermo S. Romero
d6b71243c2 Make len portable (as best as can tested with a 32 bit machine). 2010-04-27 18:21:49 +00:00
Campbell Barton
c80d0f1f85 fix for allocations over 2gig crashing blender (even on 64 bit systems)
the memheader len would wrap to a negative number and when freeing it would write into the memheader.
2010-04-27 15:46:58 +00:00
Campbell Barton
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
Guillermo S. Romero
7d9067ca2c Make memstat easier to read, add missing Intel ID and cleanups. 2010-04-14 21:12:05 +00:00
Campbell Barton
aefe9be5db [#18961] Use const char * where appropriate (2.5)
from Sean Bartell (wtachi) 

added own changes bpy_props.c
2010-02-16 16:47:41 +00:00
Campbell Barton
39c3ebdc91 fix for memory leak: node animation data wasnt being free'd
also some corrections to memory debug stuff.
2010-02-13 13:38:10 +00:00
Campbell Barton
c1ee920db6 simple malloc counter for debugging. disabled so no functional change.
Use when memory isnt being freed to easily set a breakpoint the Nth allocation.
2010-02-13 13:09:06 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Brecht Van Lommel
cac3443d4e Guardedalloc: added MEM_reallocN function to do simple alloc/memcpy/free,
not as optimized as a system realloc but I've had to do this often enough
manually to justify a utility function.
2010-02-08 14:59:59 +00:00
Joseph Eagar
27db00bf18 remove own experiemental code 2010-01-24 02:59:09 +00:00
Brecht Van Lommel
0c2d03e69f Fix MEM_testN not unlocking mutex correctly, unlikely to lead to
problems in practice but might as well fix.
2010-01-22 10:56:50 +00:00
Joseph Eagar
7ad7820f7f Added a new notifyer, NC_SPACE_CHANGED, to signal an editor that
replaces another so it can do updates (e.g. dopesheet editor can
sync channel selection).

Also coded a simple optimization for allocating small objects,
based on mempools.  It's #ifdef'd out, you can enabled it by 
defining OPTIMIZE_SMALL_BLOCKS (e.g. adding -DDOPTIMIZE_SMALL_BLOCKS to
your compiler flags).

We suffer from a great deal of performance loss from the system allocator
(vgroups, ghash, edgehash, the singly-linked list implementation in blenlib,
editmesh, and likely a great many areas I'm forgetting), and this is the 
common solution for handling the many-small-objects problem.  It's not
really production-ready yet (it's long-term memory consequencers need to
be profiled first, and the implementation tweaked as necassary), but for
people on systems with slow system allocators it's worth trying.

Note that since this creates a guardedalloc<->blenlib link, the build systems
need to be updated accordingly (I've already done this for scons, though I'm
not sure if the player builds).
2010-01-21 03:08:57 +00:00
Martin Poirier
f7d7149936 Debug tools: new function MEM_testN(void*)
returns 0 if pointer is not in memlist
2009-11-11 03:45:26 +00:00
Martin Poirier
21385eb4ec New function:
void MEM_callbackmemlist(void (*func)(void*));

Will call the function passed as argument with all allocated address as parameter. Useful for debuging.
2009-11-10 21:33:53 +00:00
Brecht Van Lommel
b466286c3e Render & Compositing Thread Fixes
* Rendering twice or more could crash layer/pass buttons.
* Compositing would crash while drawing the image.
* Rendering animations could also crash drawing the image.
* Compositing could crash 
* Starting to rendering while preview render / compo was
  still running could crash.
* Exiting while rendering an animation would not abort the
  renderer properly, making Blender seemingly freeze.
* Fixes theoretically possible issue with setting malloc
  lock with nested threads.
* Drawing previews inside nodes could crash when those nodes
  were being rendered at the same time.

There's more crashes, manipulating the scene data or undo can
still crash, this commit only focuses on making sure the image
buffer and render result access is thread safe.


Implementation:
* Rather than assuming the render result does not get freed
  during render, which seems to be quite difficult to do given
  that e.g. the compositor is allowed to change the size of
  the buffer or output different passes, the render result is
  now protected with a read/write mutex.
* The read/write mutex allows multiple readers (and pixel
  writers) at the same time, but only allows one writer to
  manipulate the data structure.
* Added BKE_image_acquire_ibuf/BKE_image_release_ibuf to access
  images being rendered, cases where this is not needed (most
  code) can still use BKE_image_get_ibuf.
* The job manager now allows only one rendering job at the same
  time, rather than the G.rendering check which was not reliable.
2009-09-30 18:18:32 +00:00
Benoit Bolsee
1483fafd13 Merge of itasc branch. Project files, scons and cmake should be working. Makefile updated but not tested. Comes with Eigen2 2.0.6 C++ matrix library. 2009-09-24 21:22:24 +00:00
Guillermo S. Romero
986f8a9ea3 SVN maintenance. 2009-09-22 19:09:04 +00:00
Campbell Barton
0a3694cd6e white space commit. (2 spaces -> tab).
Was annoying to use a different editor for cmake only.
theeth says this should be ok with gsoc and merges from branches.
2009-09-06 01:51:23 +00:00
Nathan Letwory
9216efcba2 == SCons ==
* bring back 'player' libtype, after investigation with ideasman.
  scons/mingw works nicely, for some reason msvc fails to link still, will look further into it.
2009-09-05 01:58:02 +00:00
Nathan Letwory
20f39ec7d8 == SCons ==
* further cleaning of 'player' stuff. Now only 3 libs are remaining, of which ideally the stubs lib will be fixed at some point, fading away into the dark history of not-so-nice code. The current blenderplayer part is still a little bit hackish, I'll see if I can find a better alternative, for now it works good enough.
2009-09-04 12:56:30 +00:00
Nathan Letwory
bade641408 == SCons ==
* first working changes to get blenderplayer linking
* blenderplayer/ moved into source/ (CMakeLists.txt changed for that too)
* added externs for bprogname to gp_ghost, so that it links properly
2009-09-04 10:40:41 +00:00
Guillermo S. Romero
0747977317 SVN maintenance. 2009-08-18 20:24:40 +00:00
Campbell Barton
ede954b938 compile time option to override C++'s new/delete to use guardedalloc, useful for debugging. shows memory leaks very quickly. currently cmake only - WITH_CXX_GUARDEDALLOC 2009-08-18 15:20:29 +00:00
Campbell Barton
c32fce0705 some fixes for netbsd with cmake
- CMake, use FIND_PACKAGE(Freetype) for unix/linux
- Only link with libdl.so on linux
- use statvfs rather then statfs for netbsd (size of statfs wasnt available)
- add x11 include path with ghost, glu.
2009-08-14 13:13:36 +00:00
Campbell Barton
8ead648fd1 Spring Cleaning
* removed radiosity render code, DNA and RNA (left in radio render pass options), we'll get GI to replace this probably, better allow baking to vertex colors for people who used this.
* removed deprecated solid physics library, sumo integrations and qhull, a dependency
* removed ODE, was no longer being build or supported
* remove BEOS and AMIGA defines and references in Makefiles.
2009-06-21 16:18:38 +00:00
Brecht Van Lommel
c8b4cf9206 2.50:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19820:HEAD

Notes:
* Game and sequencer RNA, and sequencer header are now out of date
  a bit after changes in trunk.
* I didn't know how to port these bugfixes, most likely they are
  not needed anymore.
  * Fix "duplicate strip" always increase the user count for ipo.
  * IPO pinning on sequencer strips was lost during Undo.
2009-06-08 20:08:19 +00:00
Brecht Van Lommel
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
Guillermo S. Romero
441f26a170 Clean up for the imminent migration from SVN to GIT. 2009-03-31 22:34:34 +00:00
Chris Want
77e0199dc3 Makefile updates for Blender 2.5 (from GSR) 2009-03-19 01:50:45 +00:00
Brecht Van Lommel
bdfe7d89e2 Merge of trunk into blender 2.5:
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r12987:17416

Issues:
* GHOST/X11 had conflicting changes. Some code was added in 2.5, which was
  later added in trunk also, but reverted partially, specifically revision
  16683. I have left out this reversion in the 2.5 branch since I think it is
  needed there.
  http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16683
* Scons had various conflicting changes, I decided to go with trunk version
  for everything except priorities and some library renaming.
* In creator.c, there were various fixes and fixes for fixes related to the -w
  -W and -p options. In 2.5 -w and -W is not coded yet, and -p is done
  differently. Since this is changed so much, and I don't think those fixes
  would be needed in 2.5, I've left them out.
* Also in creator.c: there was code for a python bugfix where the screen was not
  initialized when running with -P. The code that initializes the screen there
  I had to disable, that can't work in 2.5 anymore but left it commented as a
  reminder.

Further I had to disable some new function calls. using src/ and python/, as
was done already in this branch, disabled function calls:
* bpath.c: error reporting
* BME_conversions.c: editmesh conversion functions.
* SHD_dynamic: disabled almost completely, there is no python/.
* KX_PythonInit.cpp and Ketsji/ build files: Mathutils is not there, disabled.
* text.c: clipboard copy call.
* object.c: OB_SUPPORT_MATERIAL.
* DerivedMesh.c and subsurf_ccg, stipple_quarttone.

Still to be done:
* Go over files and functions that were moved to a different location but could
  still use changes that were done in trunk.
2008-11-12 21:16:53 +00:00
Benoit Bolsee
61a83d2fba Add MSVC90 project files - part 3. Extern and Intern projects are merged in projectfiles_vc9\blender\blender.sln solution, you just need to open that solution to compile everything with VS2008. 2008-11-10 21:22:22 +00:00
Benoit Bolsee
8eec6cecc0 Add MSVC90 project files - part 1. 2008-11-10 15:36:58 +00:00
Brecht Van Lommel
cb89decfdc Merge of first part of changes from the apricot branch, especially
the features that are needed to run the game. Compile tested with
scons, make, but not cmake, that seems to have an issue not related
to these changes. The changes include:

* GLSL support in the viewport and game engine, enable in the game
  menu in textured draw mode.
* Synced and merged part of the duplicated blender and gameengine/
  gameplayer drawing code.
* Further refactoring of game engine drawing code, especially mesh
  storage changed a lot.
* Optimizations in game engine armatures to avoid recomputations.
* A python function to get the framerate estimate in game.

* An option take object color into account in materials.
* An option to restrict shadow casters to a lamp's layers.
* Increase from 10 to 18 texture slots for materials, lamps, word.
  An extra texture slot shows up once the last slot is used.

* Memory limit for undo, not enabled by default yet because it
  needs the .B.blend to be changed.
* Multiple undo for image painting.

* An offset for dupligroups, so not all objects in a group have to
  be at the origin.
2008-09-04 20:51:28 +00:00
Daniel Genrich
a84d346939 #2: Fixing compile errors on mingw/cygwin (reported by aligorith) 2008-08-18 10:48:37 +00:00