Commit Graph

373 Commits

Author SHA1 Message Date
Campbell Barton
e4cfcdc3a6 header comment cleanup, explain whats the difference between confusingly named drarnode.c and node_draw.c. 2012-07-14 15:29:45 +00:00
Campbell Barton
98520ce4de use gcc attributes for BLI alloc functions 2012-07-14 12:47:49 +00:00
Bastien Montagne
4c6abb8105 Fix for error from grumpy gcc in "over-warning" mode. Must explicitely cast uintptr_t to unsigned int (othe solution would be to use PRIuPTR macro from inttypes.h, but that would probably causes some problems with windows...). 2012-07-08 15:48:47 +00:00
Campbell Barton
76629c11ae correct use of __attribute__((nonnull)) 2012-07-08 15:11:13 +00:00
Campbell Barton
b91bc4f037 use gcc attrubutes to warn on unused return values and arguments which shouldnt be NULL.
also remove IDP_AppendArray's return value which wasnt the new item in the array (which is odd/misleading), but wasnt used anywhere either.
2012-07-08 06:00:27 +00:00
Campbell Barton
1d29ee0d3b use alloc_size attribute for guarded alloc functions with gcc. 2012-07-08 03:15:37 +00:00
Campbell Barton
c8c743b609 code cleanup: compile with clang and quiet some warnings. 2012-06-28 12:32:06 +00:00
Campbell Barton
a89d551a1c committed debug memcount by accident 2012-06-27 22:27:04 +00:00
Campbell Barton
a09feb7386 option so operators can be executed with undo enabled (and redo). 2012-06-27 21:41:17 +00:00
Campbell Barton
d008807a2d style cleanup: header comments, use more doxy compat formatting 2012-06-27 17:48:39 +00:00
Brecht Van Lommel
ae797383b7 Guardedalloc/C++: delete is valid on a NULL pointer, add a check so MEM_freeN
doesn't print warning messages.
2012-06-25 11:43:12 +00:00
Campbell Barton
3c8a4c458b more guardedalloc use in C++, also make compositorMutex a static var, was allocated and never freed. 2012-06-25 10:35:24 +00:00
Campbell Barton
cc0784c1b9 optionally use guarded alloc for tiles compositor, also replace allocation functions with a macro. 2012-06-25 09:14:37 +00:00
Campbell Barton
26ca0008ee typo/style edits 2012-06-08 05:53:30 +00:00
Campbell Barton
a6f3e15d6e - remove redundant NULL checks from mallocn's local linked list functions.
- minor changes to warning cleanup.
2012-06-08 05:46:00 +00:00
Campbell Barton
857dedbc58 style cleanup 2012-05-27 00:36:50 +00:00
Campbell Barton
76599a4989 update python script memory printout to python3 and some style cleanup 2012-05-26 13:59:34 +00:00
Campbell Barton
88e646b0d4 style cleanup: our own malloc code 2012-05-26 13:36:12 +00:00
Campbell Barton
ed98de3398 code cleanup: dutch -> english (comments) 2012-05-26 13:31:57 +00:00
Campbell Barton
eb023322ef style cleanup: mmap_win32 2012-05-22 13:20:01 +00:00
Brecht Van Lommel
0c318c4a47 Fix (harmless) uninitialized memory usage in BVH binning.
Fix unneeded warnings with c++ guardedalloc, delete NULL is valid.
2012-05-04 16:38:11 +00:00
Campbell Barton
b340f930ec style cleanup: changes to brace placement / newlines - for/while/if/switch 2012-04-28 06:31:57 +00:00
Antony Riakiotakis
8b476d0275 First MinGW-w64 support for cmake has been added. To test I recommend this build:
http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/ray_linn/GCC-4.7.0-with-ada/mingw-w64-gcc-4.7.0-runtime-2.0.1-static-ada-20120330.7z/download

Other builds may also work but due to the constantly changing nature of the compiler this cannot be guaranteed. I often had to change compilers while building the libraries and this one is the one that did the job for most of them.

This first support is experimental and considered "advanced". To enable pass -DWITH_MINGW64 during cmake configuration. Also make sure to extract the compiler on C:/MinGW and that MinGW/bin is in your path. To build check out lib/mingw64.

Initially the support is lacking until I get every library compiled correctly. For now you should disable WITH_CYCLES(sorry, I know some people are dying to do benchmarks, but still a few libs to go), WITH_IMAGE_OPENEXR, WITH_OPENCOLLADA, WITH_LIBMV and WITH_CODEC_FFMPEG(links but hangs on startup).

Still the tools are working, the memory limit is increased and due to the experimental nature of the setup, full optimization with SSE2 is available, which makes the build quite fast. Also the compiler and especially, the linker are way faster than regular MinGW.

The wiki docs have also updated. Happy testing!
2012-04-23 20:09:59 +00:00
Campbell Barton
df29e91a69 code cleanup: header cleanup, remove commented workaround for mingw since its no longer needed. 2012-04-06 04:46:47 +00:00
Campbell Barton
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
Campbell Barton
47c373c7a9 style cleanup (mostly whitespace) 2012-02-27 10:35:39 +00:00
Campbell Barton
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
Campbell Barton
65c74f1570 workaround for error building with clang and quiet some warnings building without libmv. 2011-12-31 03:01:18 +00:00
Campbell Barton
eb3beca8d4 replace u_int64_t with cc99's uint64_t as suggested by Nicholas Bishop. 2011-12-24 03:03:42 +00:00
Campbell Barton
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
Sergey Sharybin
3be50219fd Abort on guarded memory manager errors if WITH_ASSERT_ABORT is set 2011-09-26 14:21:40 +00:00
Campbell Barton
4b449aefea remove support for irix 2011-09-21 08:40:30 +00:00
Campbell Barton
83a2f02a78 cleanup endian handling
- define __BIG_ENDIAN__ or __LITTLE_ENDIAN__ with cmake & scons.
- ENDIAN_ORDER is now a define rather than a global short.
- replace checks like this with single ifdef: #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
- remove BKE_endian.h which isn't used
2011-09-19 08:02:17 +00:00
Antony Riakiotakis
aabd702dbd fix link issues with MinGW - a substitute declaration(correctByteOrder) for itoln that was not present in MinGW was being used. Duplicated the declaration from <winsock2.h>(tried including but gave some errors) and added the appropriate link library, wsock32, according to MinGW documentation. 2011-09-06 11:17:29 +00:00
Campbell Barton
a01ffbbddb minor edits to build on openbsd 2011-09-03 09:43:20 +00:00
Campbell Barton
fa2ba5fbf5 - use static vars and functions where possible.
- use NULL rather than 0 when used as pointers.
2011-08-28 05:06:30 +00:00
Campbell Barton
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Campbell Barton
fca91f550b rename duplicate header defines & remove unused var. 2011-04-28 05:15:47 +00:00
Campbell Barton
f9f771cd01 converted more mixed tab/space indentations to tabs. only whitespace changes. 2011-04-21 15:53:30 +00:00
Campbell Barton
210ee1ade4 whitespace only, no functional change mixed tabs/spaces --> tabs. 2011-04-21 13:11:51 +00:00
Campbell Barton
53139432dd image.depth, 96/128 for float color images, was 24/32 for byte images.
also use <> for system includes
2011-03-09 01:25:59 +00:00
Campbell Barton
709c727c51 replace 0 with NULL when used as a pointer 2011-03-03 17:58:06 +00:00
Nathan Letwory
56a4b21695 doxygen: intern/guardedalloc tagged 2011-02-25 11:41:12 +00:00
Nathan Letwory
5e41760a15 doxygen: add bullet to extern libs, some small changes in page names, and fixes around license blocks 2011-02-22 16:12:12 +00:00
Campbell Barton
c14aca0e95 add includes to cmake files 2011-02-21 12:18:34 +00:00
Nathan Letwory
d9563f5e2b doxygen: some code shuffle to prevent clashing file names, ensure MEM_guardedalloc.h also shows in docs 2011-02-21 11:38:55 +00:00
Nathan Letwory
212d67734c doxygen: add guardedalloc and AVI 2011-02-21 09:23:34 +00:00
Campbell Barton
55f68c3657 fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
2011-02-12 16:54:24 +00:00
Campbell Barton
6e47ffcc0d fix for uninitialized value in BLI_path_cwd() if PWD wasn't defined and the CWD was longer then 160. 2011-02-12 10:37:37 +00:00
Campbell Barton
89c617a116 remove nan-makefiles 2011-01-30 15:29:22 +00:00
Campbell Barton
d2076e38f1 correct own bad spelling 2011-01-23 12:42:07 +00:00
Campbell Barton
f66912a335 misc edits, no functional changes
- enabling/disabling no longer prints in the terminal unless in debug mode.
- remove 'header' struct from BLI_storage_types.h, from revision 2 and is not used.
- Add GCC property to guardedalloc to warn if the return value from allocation functions isn't used.
2011-01-15 15:48:46 +00:00
Campbell Barton
5e382eb8e5 rename blenderlib to blender_add_lib 2010-12-22 23:09:30 +00:00
Campbell Barton
afacd18498 use lowercase for cmake builtin names and macros, remove contents in else() and endif() which is no longer needed. 2010-12-08 08:43:06 +00:00
Campbell Barton
cd97253502 - added GCC warning -Wstrict-prototypes
- fixed bug in paste material, exposed by stricter warnings.
- removed/renamed various shadowed vars.
- removed BGE lamp.colour, only allow lamp.color attribute.
2010-12-03 12:30:59 +00:00
Campbell Barton
b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
Campbell Barton
e8397e6193 include headers in cmake source, added a script to check for consistency, reporting missing headers & C files.
this is important so IDE's using CMake integration always get blender headers. - QtCreator & MSVC for eg, probably others too.
2010-11-29 04:35:56 +00:00
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
Daniel Genrich
f876fd66b4 Fixing compile errors on mingw/cygwin (reported by aligorith) 2008-08-18 10:37:15 +00:00
Benoit Bolsee
ed9a0fe7e9 Update MSVC project files after Win64 patch 2008-08-17 22:32:40 +00:00
Benoit Bolsee
9f6109002b Fix compile problem in MSVC after Win64 patch 2008-08-17 22:28:30 +00:00
Daniel Genrich
fd0072e77c Win64: please check my changes if you ran across them ;) But should be fine since no additional crashes were reported! 2008-08-17 17:08:00 +00:00
Joshua Leung
86a0afb829 Compiler warning fixes (unused vars).
Notes:
- edgehash.c still has some weirdo code causing warnings on lines 80 and 117
i.e.  if (v1<v0) v0 ^= v1 ^= v0 ^= v1;
- material.c (in pyapi) apparently doesn't seem to be making use of some functions for glossy stuff
2008-06-02 01:02:08 +00:00
Andrea Weikert
e7c3ff6458 == mmap for win32 ==
replacement for mmap/munmap on Windows.
Implemented using CreateFileMapping/MapViewOfFile.
2008-04-29 18:41:34 +00:00
Chris Want
5d0a207ecb Patch from GSR that a) fixes a whole bunch of GPL/BL license
blocks that were previously missed; and b) greatly increase my
ohloh stats!
2008-04-16 22:40:48 +00:00
Stephen Swaney
bb48a75c37 compiler warning cleanup 2008-03-15 14:41:47 +00:00
Campbell Barton
b7af3d2cbd fix for [#8257] double-freeing pointers from sculpt code
http://projects.blender.org/tracker/index.php?func=detail&aid=8257&group_id=9&atid=125

Cleaned up scene_copy, and moved some scene copying into this function that was inline in the user interface.

Also moved malloc error prints onto separate lines so you can set breakpoints.
2008-02-16 16:35:47 +00:00
Brecht Van Lommel
baf7be9e46 Memory usage debugging: now with the -d debug option enabled, at the end
of rendering it prints memory usage for images and all memory blocks.
2008-02-01 12:14:15 +00:00
Nathan Letwory
15da2232f7 * tweak linking priorities - should help for GCC users
* some lib renaming
2008-01-08 09:47:44 +00:00
Chris Want
5e3cffc64a Patch to change license to GPL only, from GSR. 2008-01-07 19:13:47 +00:00
Campbell Barton
86471f8b72 Split guardedalloc print into 2 funcs, 1 that prints on errors, another then prints the memory blocks as a python dict, minor changes to help text 2008-01-03 14:53:44 +00:00
Campbell Barton
9db2035e36 while trying to debug memory leaks, extended MEM_printmemlist to print a python dict and some lines at the end to format it in a useful way when run as a python script. 2008-01-01 16:14:08 +00:00
Nathan Letwory
0326ec77a9 === SCons ===
Bugfix #6168

* instead of compiling mallocn manually for makesdna, use the bf_guardedalloc lib
 that was already created looooooong time ago.
2007-03-27 10:50:03 +00:00
Ton Roosendaal
6d540b6333 More debug goodies:
WINDOWS CRASH EMULATION!

If you use the -d (debug) argument for starting blender, it will now:

- set all freed memory to 0xFFFFFFFF
- set all malloced memory to 0xFFFFFFFF

The first option will give nice crashers when you read from freed memory.
The second option is for OSX especially, it has the nasty habit to give
zeroed mallocs.
2006-11-27 13:59:55 +00:00
Jacques Beuarain
24f4440d05 CMake lists initial submission. Documentationand further verification for different platforms will follow soon. This was just tested against current CVS on MSVC 2005 with Verse, QuickTime, OpenEXR, Player all on. 2006-11-17 02:27:12 +00:00
Kent Mein
4657db2a38 More bugs found thanks to klockwork
mallocn.c  check malloced memory before using it.
ssp_blas2.c free memory that wasn't but should have been.

Kent
2006-10-27 15:00:31 +00:00
Brecht Van Lommel
e7d6537f1c Added support for threadsafe MEM_mallocN/MEM_freeN in the guardedalloc
module itself, replacing the special MEM_mallocT/MEM_freeT functions.
Mutex locking is only enabled when threads are running.

There was no good reason to have these separate, it just led to ugly
hacks when calling functions with non-threadsafe malloc from threads.
2006-09-06 19:13:23 +00:00
Ton Roosendaal
56322ca051 Minor fix: default name for dupli-alloc was mixed up, using mapalloc for
malloc, and vice versa.
2006-07-22 17:04:18 +00:00
Ton Roosendaal
64ff9ae4a8 Mac intel commit
- patch from Douglas with endian fixes
- Makefile adds static libiconv.a from lib/
- this version will use OpenEXR libs from lib/ too, and is latest release
  with threading support
- openAL is missing, added it as default to not include it
2006-07-03 19:50:53 +00:00
Joseph Gilbert
f54a113cde Update to the VC7 projectfiles.
This should bring the projectfiles upto date for msvc7.

Moving these to version 7.1 so that the version 8 people don't have such a hard time importing into 2005.

Build intern.sln, extern.sln and then blender.sln. Enjoy. :p
2006-04-17 20:05:39 +00:00
Kent Mein
391ae8f7ac Updated mallocn.c MEM_check_memory_integrity was casting
a string as an int and it was causing a warning.
I changed it to check to see if the string == 0
return 0 else return 1.

The only thing that called this function was memtest.c and it
had outdated code, so I fixed that...
        was calling MEM_set_error_stream updated to
                    MEM_set_error_callback

Kent
2006-03-23 17:45:40 +00:00
Ton Roosendaal
c8d295080c mmap allocs now fall back on regular malloc when mmap fails. 2006-03-15 15:06:53 +00:00
Chris Want
46daa8d742 It looks like Irix works alright with the /dev/zero trick for mmap().
I had to include fcntl.h for Irix to get symbol O_RDWR.
2006-03-05 14:58:56 +00:00
Ton Roosendaal
2286118acc To prevent confusement; used %u (unsigned int) for printing memory error. 2006-03-04 22:22:38 +00:00
Ton Roosendaal
61824579b0 Improved error print in case malloc returns NULL; it now adds the current
total allocated.
2006-03-02 19:49:51 +00:00
Chris Want
5e3163041a I had to disable mmap altogether for Irix. 2006-02-24 14:37:24 +00:00
Ton Roosendaal
3bd57e6a64 Paranoia "volatile" assignment to globals in MEM module. Was suggested to
do this for globals that can be changed within threads.
2006-02-24 10:18:48 +00:00
Chris Want
a30dc3866c Some issues compiling on Irix:
+ the code in writemovie.c no longer compiles (since the renderer
refactor). I have #if 0-ed it.

+ OpenGL on Irix doesn't have GL_ARB_vertex_program

+ mmap on Irix doesn't like MAP_ANON.

+ If using the MipsPro 7.3 compiler, the variable MIPS73_ISOHEADERS
can be set to point to the directory with those weird C++ headers
that don't have .h in the name
2006-02-22 23:34:12 +00:00
Erwin Coumans
78942aa843 temporarily fix from Johnny Matthews committed, win32 doesn't have munmap. Someone can worry about a future mmap-like implementation. 2006-02-17 20:18:49 +00:00
Ton Roosendaal
fe036a0538 Added new malloc type in our MEM module; using the unix feature 'mmap'.
In Orange we've been fighting the past weeks with memory usage a lot...
at the moment incredible huge scenes are being rendered, with multiple
layers and all compositing, stressing limits of memory a lot.
I had hoped that less frequently used blocks would be swapped away
nicely, so fragmented memory could survive. Unfortunately (in OSX) the
malloc range is limited to 2 GB only (upped half of address space).
Other OS's have a limit too, but typically larger afaik.

Now here's mmap to the rescue! It has a very nice feature to map to
a virtual (non existing) file, allowing to allocate disk-mapped memory
on the fly. For as long there's real memory it works nearly as fast as
a regular malloc, and when you go to the swap boundary, it knows nicely
what to swap first.

The upcoming commit will use mmap for all large memory blocks, like
the composit stack, render layers, lamp buffers and images. Tested here
on my 1 GB system, and compositing huge images with a total of 2.5 gig
still works acceptable here. :)

http://www.blender.org/bf/memory.jpg
This is a silly composit test, using 64 MB images with a load of nodes.
Check the header print... the (2323.33M) is the mmap disk-cache in use.

BTW: note that is still limited to the virtual address space of 4 GB.

The new call is:
MEM_mapalloc()

Per definition, mmap() returns zero'ed memory, so a calloc isn't required.

For Windows there's no mmap() available, but I'm pretty sure there's an
equivalent. Windows gurus here are invited to insert that here in code! At
the moment it's nicely ifdeffed, so for Windows the mmap defaults to a
regular alloc.
2006-02-16 17:51:01 +00:00
Nathan Letwory
ef1b7a5735 ==SCons==
+ 'scons blenderplayer' builds blender AND blenderplayer now (tested on Linux
  only, but was only linking issue, so should work on other platforms too).

  NOTE: I noticed some compileflags for GE specific libs that were left out -
  I re-enabled them in the SConscripts, but I'm going to do a test build my-
  self now, so if there are problems with them on win32, I probably already
  know about them :)
2006-02-07 21:24:36 +00:00
Nathan Letwory
ba97d47df4 ==SCons==
* Changing linking order of a few libs, hopefully it solves a unresolved issue.
2006-02-05 20:38:40 +00:00
Nathan Letwory
3bb82a27fc == SCons ==
* This commit is all of the rewrite work done on the SCons system. For
  documentation see doc/blender-scons.txt and doc/blender-scons-dev.txt.
  Also http://mediawiki.blender.org/index.php/BlenderDev/SconsRefactoring
  contains valuable information, along with what still needs to be done.

    - linux, os x and windows compile now.
    - files are compiled to BF_INSTALLDIR (see config/(platform)-config.py)
        - NOTE: Jean-Luc P will commit sometime during the weekend proper
          appit() for OS X. For now, copy the resulting binary to an
          existing .app bundle.
    - features:
        - cleaner structure for better maintenance
        - cleaner output during compile
        - better handling of build options
        - general overall speed increase
        - see the wiki for more info

  Cygwin, FreeBSD and Solaris systems still need work. For these systems:
    1) copy a config/(platform)-config.py to ie. config/cygwin-config.py
    2) set the proper defaults for your platform
    3) mail me at jesterking at letwory dot net with you configuration. if
       you need any modifications to the system, do send a patch, too.

  I'll be giving first-aid today and tomorrow, after that it'll be all
  regular development work :)

  /Nathan
2006-02-04 14:15:10 +00:00
Chris Want
b44ba190d2 Fix for bug #3414 provided by Lewis Saunders.
It appears that removing the 'int level' field from the
MemHead struct caused alignment issues for gcc builds of blender
on Irix (zr, who removed this field, commented that this problem
might occur, and sure enough it did happen). I've renamed the
field from 'level' to 'pad' to reflect that it has no meaning
beyond addressing alignment issues.
2005-11-17 14:48:11 +00:00
Ton Roosendaal
4d58808512 MEM_alloc allocated in units of 8 for 32 bits systems, and units of 4 for
64 bits systems... weird bug. :)
It now only does a unit-of-4 check, for all systems. This will work fine,
since the malloc code will return aligned anyway, and the guarded alloc
system only stores ints in the headers. Also, the sizeof() call will
correctly do padding, so there's no risk of allocating too small blocks.
2005-08-21 10:05:50 +00:00
Jean-Luc Peurière
b12f801681 updates to the OS X build system :
- XCode project
- Scons :
    scons stopped working for Os X in the last month (dont know when) :

     * the '.' and '..' keywords in CCPPATH
          are not recognized anymore for sconscripts compiling files at
          a sub level
     * when doing a scons clean, the 3 subdirs in build dir are removed
      and scons then fail to recreate them (exten, intern, source)

this commit solve the first problem as a temp workaround
for the latter simply recreate the dirs manually

I will investigate that further when on vacations,  which i should already
 be.
 ;(

all 3 build systems are now working on Os X
2005-08-04 16:05:28 +00:00
Joseph Gilbert
292c03ab8e _.NET projectfiles update_
* converted files to .NET 2002
* removed unneeded projectfiles from bullet
* PHY_Bullet outputs to correct directories
* Bullet linked to activex and blenderplayer
* misc updates
2005-08-02 13:44:49 +00:00
Erwin Coumans
49499c49be updated vc7 projectfiles so they work with bullet 2005-07-31 14:40:51 +00:00
Daniel Dunbar
b6b352e0b7 - got fed up with not being able to put a breakpoint on MEM_
errors, switched MEM_set_error_stream to MEM_set_error_callback
   that calls a function to print result instead of just giving
   a FILE *

Note: requires intern recompile
2005-07-22 16:40:26 +00:00
Daniel Dunbar
ca1873df56 - remove MEM_dupallocN's warning on dup of len==0 sized object 2005-07-20 03:49:36 +00:00
Joseph Gilbert
61767b4f48 MSVC7 update and freetype2 source
- Added correct .libs to be linked to GP_Ghost
- Fixed incorrect library extensions for the linker (*.lib and not unix *.a)
- Projects have been set to be multi-threaded - projects were being linked to different versions of the CRT
- All projects are now linking to python 2.3 (this fixes an error regarding struct sizes in python)
- Removed invalid source paths from inclusion for the compiler
- Fix dependency issues with the GP_Ghost module
- Proper .dll's are now being copied to their respective locations for debug and release version of blender/blenderplayer
- Warnings have been set to level 2
- Import paths have been updated and organized for the compiler
- Duplicate import paths for the compiler have been removed
- Removed silly silly silly silly unix path-separators from window paths
- Post-Build scripts have been updated where neccessary (XCOPY is retatined)
- Fixed the output of various .lib files (PHY_Sumo and Yafray)
- PHY_Sumo now uses a .pch
- Removed #undef _DEBUG from debug builds :p
- FTF_Font is now contains a debug build and is being set to it's correct output path
- Blender/Blenderplayer/3DPlugin all linkto Debug libs where appropriate (instead of static release libs to avoid conflicts with the CRT)
- Python23_d.dll is now loaded into a true debug output of both blenderplayer and blender debug builds
- msvcrtd.dll is now loaded into a true debug output of both blenderplayer and blender debug builds
- Post-builds now clean up their mess
- ActiveX controller now builds
- BlenderPlayer now builds
- Internal libs now using .pch
- Moved the build directory from /blender/obj to ../build/msvc_7/  to follow precedence with scons builds
- Builds are now organized to follow precedence with scons builds with a /libs and a /intern /extern /source obj folders
- Set the proper build path for opennl
- Forcing BLO_loader source files to follow project defaults
- Added an 'extern' project that mimics the /make build of the 'intern' project
- Extern build includes solid and it's associated builds, ftgl, and freetype
- Added .vcproj files to /extern directory
- Added new extern.sln file to /extern directory
- All project now link to the built solid.lib from the extern project instead of lib/windows
- Removed uneeded XCOPYs commands from post-builds
- Added conditional Directory building to post-builds
- Freetype2 source commit (this is need for the building of a correct MFC linked version of the activeX controller as well as a correct release and debug build of the blender project)
- Ftgl is built and linked by the 'extern' project
- Intern/Extern project are now exporting their proper header files
- PHY_Physics is now linking to the correct set of header files (in build path not source)
- Makesdna builds object files into build directory now
- Projects are now ignoring the CORRECT versions of the CRT's  :)
- Renderconverter is now outputting it's obj file to it's own directory instead of /render
- Gen_system is now being built to ../kernel
- BL_src_cre is now being built to /creator
- *.exp and *.ilk are now being cleaned up from linkers
- Libpng.dll and zlib.dll are now being copied to the /bin
- MTDLL build are now available for the correct projects
- ActiveX 3D Plugin now links correctly to solid and freetype2
- Corrected the Preprocessor #define that was labeled incorrectly in FTF_Font and Blender that was causing the FTGL libs to export dll calling conventions.
- Changed the solution configurations to 3D Plugin Release, Debug and Blender Release, Debug for internal and external librarys
- Changed the solution configurations to 3D Plugin Release, Debug and Blender Release, Debug for blender and added 2 new solutions configurations BlenderPlayer Release, Debug
-
2005-02-20 21:33:11 +00:00
Joseph Gilbert
5af05c9610 Update to the MSVC7 project files (vcproj) for Blender's internal libraries
- set build_install_all as the default project (if you give me a quarter ill tell you how :)
- set SoundSystem to it's proper dependencies
- updated those silly silly unix path separators
- set project warning levels to something not so noisy
2005-02-12 02:06:52 +00:00
Kester Maddock
d5fde6c48b Added #!/usr/bin/python standard script identifier to the start of SConscript files.
Makes text editors identify SConscripts as Python, and syntax highlight properly.
2004-05-16 13:07:20 +00:00
Nathan Letwory
9dea66a835 Major update for Visual Studio .Net project files. Both Release and Debug modes have been sanitised (ie. use .lib instead of .a). This update also makes the structure similar to the msvc6 projectfiles.
The new blender.sln is now found in directory projectfiles_vc7\\blender.

Update to the INSTALL file will follow soon.
2004-04-07 18:17:37 +00:00
Kent Mein
9ed4436058 Updated the Sun ifdef's basically I standardized them so they
were all the same and make sure all platforms see them.

Kent
2004-03-06 19:32:33 +00:00
Michel Selten
70a4ead0ae SCons updates
* Blender static now links. By default this option is disabled on all
  platforms. Simply set the option in config.opts to 'true'.
* Added the following flags to config.opts:
  - HOST_CC.    This is the C compiler for the host platform. This value is the
                same as TARGET_CC when not cross compiling.
  - HOST_CXX.   This is the C++ compiler for the host platform. This value is
                the same as TARGET_CXX when not cross compiling.
  - TARGET_CC.  This is the C compiler for the target platform.
  - TARGET_CXX. This is the C++ compiler for the target platform.
  - TARGET_AR.  This is the linker command for linking libraries.
  - PATH        This is the standard search path
  All SConscript files have been updated to reflect these changes. Now it's
  possible to change only the root SConstruct file, and all compiler specific
  variables are passed automatically to all SConscript files. Of course, this
  does not apply to makesdna because there the host and target platform is
  different from all other libraries.
  To pass a variable that applies to all platforms, all we now have to do is
  set the correct value in library_env


Note: as usual, to get the latest options in the config.opts file, first
      remove your version.
2004-02-29 21:40:48 +00:00
Michel Selten
9330e553e8 SCons updates
* libraries are now generated in [BUILD_DIR]/lib
* passed the user_options to all libraries now.
  This means I could remove a couple of Export/Import lines.
* Changed the order in source/blender/src/SConscript and
  source/gameengine/SConscript.
  All libraries are now sorted alphabetically. This has no impact on the build
  process.
2004-02-15 19:25:32 +00:00
Wouter van Heyst
57a7dfe5a5 - Revert to NaN makefiles 2004-01-05 00:06:11 +00:00
Alejandro Conty Estevez
eff07b8329 Basic initial yafray integration by Eeshlo.
Materials are exported the best we can do by now. It will look almost as in
blender except for the missing procedural textures and some minor issues.
You have to tweak normal modulation amount to get the desired result cause
is not the same in yafray.

We added a panel in render space to adjust some yafray settings (GI and so)

Also we export transparency and reflection using new raytracing settings,
but that will be changed and improved soon.

Remember that you have to set YFexport path in user defaults and yafray must
be on path (version 0.0.6)

We added the "yafray" button to activate all this stuff in the render window.
Panel and settings are only shown when checked.

So now when activated the code calls yafray export instead of the internal
renderer and finally the resulting image is loaded back into render window's
buffer. So animation is also possible and results can be saved using blender
usual scheme.
2004-01-04 22:10:36 +00:00
Michel Selten
d3e1fc8870 SCons build system files added.
You'll need SCons (www.scons.org) to build.
Platforms currently working:
* Linux (me)
  - options for quicktime, openal and international disabled
  - uses the system libs and include files for building - no option to build
    with the precompiled libraries yet.
* Windows (jesterKing)
  - builds with quicktime (optional)
  - builds with openal (optional)
  - builds with international support (optional)
  - Use the DOS box to build
  - builds with precompiled libraries
* Irix (Hos)
  - Uses default Irix compiler
  - Not all optimization levels correct yet
  - options for quicktime, openal and international disabled
  - builds with precompiled libraries
* Cygwin (me)
  - has a problem in the linking stage
  - uses free build tools (gcc)
  - options for quicktime, openal and international disabled
  - uses the system libs and include files for building - no option to build
    with the precompiled libraries yet.
* MacOS (sgefant)
  - builds with quicktime (optional)
  - options for openal and international disabled
  - builds a nice bundle
  - builds with precompiled libraries

Thanks to IanWill for a bugfix in the Linux build.
Note: This is a work in progress. A lot still has to be done - for example the
      optional parts are only to be enabled by directly setting 'true' or
      'false' in the SConstruct file. This needs to be moved to a user config
      file. Also, the .o/.obj files are stored in the source tree. This needs
      to be fixed as well.
      The game engine is not yet built.
2004-01-04 21:11:59 +00:00
Daniel Dunbar
2aad6b3321 Kill 2 undefined function warnings. 2003-03-24 15:05:51 +00:00
Daniel Dunbar
f06ca3e196 First set of VC-7 project files. Also first my first commit in the free
world, what hath hell wrought.
2003-03-18 19:27:13 +00:00
Simon Clitherow
a0c1e2bd3d updated intern project files to suit the lib dir move. 2003-03-12 22:45:34 +00:00
Simon Clitherow
1bbd7b1392 Modified MSVC intern projectfiles - XCOPY doesn't need the /E option.
Updated README to suit the new 'merged' blender target.

--aphex
2003-01-28 19:39:06 +00:00
Francis Laurence
c6a905f7e9 Hello,
*Fixed boolean buglet in the bsp lib. I have not committed any libraries so you'll
have to do this to see the changes in blender.
*Got the bsp test program working again with the new GHOST createWindow
interface.
*(Visual C++) Modfied some of the dsp in the intern library to NOT prompt when
overwirting old libs and header files. This is the /Y option after XCOPY
Cheers
Laurence.
2003-01-12 19:48:53 +00:00
Hans Lambermont
45b243ac47 Workaround for the header file copying dependency hell 2003-01-04 15:07:25 +00:00
Kent Mein
f78de74b20 WooHoo me again ;)
I took out the following from the includes in the intern dir that still had
it:
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif

Kent
--
mein@cs.umn.edu
2002-12-26 18:25:17 +00:00
Simon Clitherow
cfceb16f4a Corrected intern lib names so blendercreator.dsp can find them.
Previous commit broke this. --aphex
2002-12-14 12:31:17 +00:00
Simon Clitherow
0c1e935175 And the rest! ;) --aphex 2002-12-12 21:16:46 +00:00
Kent Mein
0fbadc8eb7 Yes I did it again ;)
added the following 3 lines to everything in the intern dir:
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

Kent
--
mein@cs.umn.edu
2002-11-25 09:53:07 +00:00
Maarten Gribnau
f21dd64460 Added almost all projects in intern to the main MSVC project for intern (in
intern/make/msvc_6_0. Changed paths in all these files to build to
lib/windows and use obj/window/intern for object files and other temporary
stuff.
Added project files for guardedalloc and blenkey (in keymaker directory).
blenkey still assumes openssl being installed in lib/windows.
The only thing not automated is is the frozen Python stuff.

Maarten
2002-11-08 23:34:53 +00:00
Maarten Gribnau
7325eff128 Added extra ranlib on libary files after being copied to the lib tree for OSX only.
This saves other OSX developers the trouble of manually running ranlib.
This is not a good solution (because I don't know the correct one) but it works.
Maarten
2002-11-07 22:41:42 +00:00
Kent Mein
01bff70383 fixed spacing in the headers to get rid of some warnings and some other
little minor spacing issues.
2002-10-30 02:07:20 +00:00
Hans Lambermont
12315f4d0e Initial revision 2002-10-12 11:37:38 +00:00