forked from bartvdbraak/blender
svn merge -r 22628:22714 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blender
This commit is contained in:
commit
f5711909a6
@ -70,6 +70,9 @@ MACRO(SETUP_LIBDIRS)
|
|||||||
IF(WITH_JACK)
|
IF(WITH_JACK)
|
||||||
LINK_DIRECTORIES(${JACK_LIBPATH})
|
LINK_DIRECTORIES(${JACK_LIBPATH})
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
IF(WITH_SNDFILE)
|
||||||
|
LINK_DIRECTORIES(${SNDFILE_LIBPATH})
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
IF(WITH_FFTW3)
|
IF(WITH_FFTW3)
|
||||||
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
LINK_DIRECTORIES(${FFTW3_LIBPATH})
|
||||||
ENDIF(WITH_FFTW3)
|
ENDIF(WITH_FFTW3)
|
||||||
@ -118,6 +121,9 @@ MACRO(SETUP_LIBLINKS
|
|||||||
IF(WITH_JACK)
|
IF(WITH_JACK)
|
||||||
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
TARGET_LINK_LIBRARIES(${target} ${JACK_LIB})
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
IF(WITH_SNDFILE)
|
||||||
|
TARGET_LINK_LIBRARIES(${target} ${SNDFILE_LIB})
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
IF(WITH_SDL)
|
IF(WITH_SDL)
|
||||||
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
TARGET_LINK_LIBRARIES(${target} ${SDL_LIBRARY})
|
||||||
ENDIF(WITH_SDL)
|
ENDIF(WITH_SDL)
|
||||||
|
@ -70,7 +70,9 @@ OPTION(WITH_OPENMP "Enable OpenMP (has to be supported by the compiler)"
|
|||||||
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
OPTION(WITH_WEBPLUGIN "Enable Web Plugin (Unix only)" OFF)
|
||||||
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
|
OPTION(WITH_FFTW3 "Enable FFTW3 support" OFF)
|
||||||
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
OPTION(WITH_JACK "Enable Jack Support (http://www.jackaudio.org)" OFF)
|
||||||
|
OPTION(WITH_SNDFILE "Enable libsndfile Support (http://www.mega-nerd.com/libsndfile)" OFF)
|
||||||
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
|
OPTION(WITH_CXX_GUARDEDALLOC "Enable GuardedAlloc for C++ memory allocation" OFF)
|
||||||
|
# OPTION(WITH_BUILDINFO "Include extra build details" ON)
|
||||||
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
OPTION(WITH_INSTALL "Install accompanying scripts and language files needed to run blender" ON)
|
||||||
|
|
||||||
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
|
||||||
@ -109,6 +111,13 @@ IF(UNIX AND NOT APPLE)
|
|||||||
SET(JACK_LIBPATH ${JACK}/lib)
|
SET(JACK_LIBPATH ${JACK}/lib)
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
|
||||||
|
IF(WITH_SNDFILE)
|
||||||
|
SET(SNDFILE /usr)
|
||||||
|
SET(SNDFILE_INC ${SNDFILE}/include)
|
||||||
|
SET(SNDFILE_LIB sndfile)
|
||||||
|
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
|
|
||||||
FIND_LIBRARY(INTL_LIBRARY
|
FIND_LIBRARY(INTL_LIBRARY
|
||||||
NAMES intl
|
NAMES intl
|
||||||
PATHS
|
PATHS
|
||||||
@ -204,7 +213,7 @@ IF(UNIX AND NOT APPLE)
|
|||||||
SET(PLATFORM_LINKFLAGS "-pthread")
|
SET(PLATFORM_LINKFLAGS "-pthread")
|
||||||
|
|
||||||
# Better warnings
|
# Better warnings
|
||||||
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wnested-externs -Wdeclaration-after-statement")
|
SET(C_WARNINGS "-Wall -Wno-char-subscripts -Wpointer-arith -Wcast-align -Wdeclaration-after-statement")
|
||||||
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
|
SET(CXX_WARNINGS "-Wall -Wno-invalid-offsetof -Wno-sign-compare")
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
INCLUDE_DIRECTORIES(${JPEG_INCLUDE_DIR} ${PNG_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} )
|
||||||
@ -247,6 +256,13 @@ IF(WIN32)
|
|||||||
SET(JACK_LIBPATH ${JACK}/lib)
|
SET(JACK_LIBPATH ${JACK}/lib)
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
|
||||||
|
IF(WITH_SNDFILE)
|
||||||
|
SET(SNDFILE ${LIBDIR}/sndfile)
|
||||||
|
SET(SNDFILE_INC ${SNDFILE}/include)
|
||||||
|
SET(SNDFILE_LIB sndfile)
|
||||||
|
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
|
|
||||||
IF(CMAKE_CL_64)
|
IF(CMAKE_CL_64)
|
||||||
SET(PNG_LIBRARIES libpng)
|
SET(PNG_LIBRARIES libpng)
|
||||||
ELSE(CMAKE_CL_64)
|
ELSE(CMAKE_CL_64)
|
||||||
@ -256,7 +272,11 @@ IF(WIN32)
|
|||||||
|
|
||||||
SET(ZLIB ${LIBDIR}/zlib)
|
SET(ZLIB ${LIBDIR}/zlib)
|
||||||
SET(ZLIB_INC ${ZLIB}/include)
|
SET(ZLIB_INC ${ZLIB}/include)
|
||||||
SET(ZLIB_LIBRARIES zlib)
|
IF(CMAKE_CL_64)
|
||||||
|
SET(ZLIB_LIBRARIES libz)
|
||||||
|
ELSE(CMAKE_CL_64)
|
||||||
|
SET(ZLIB_LIBRARIES zlib)
|
||||||
|
ENDIF(CMAKE_CL_64)
|
||||||
SET(ZLIB_LIBPATH ${ZLIB}/lib)
|
SET(ZLIB_LIBPATH ${ZLIB}/lib)
|
||||||
|
|
||||||
SET(PTHREADS ${LIBDIR}/pthreads)
|
SET(PTHREADS ${LIBDIR}/pthreads)
|
||||||
@ -279,7 +299,7 @@ IF(WIN32)
|
|||||||
SET(GETTEXT ${LIBDIR}/gettext)
|
SET(GETTEXT ${LIBDIR}/gettext)
|
||||||
SET(GETTEXT_INC ${GETTEXT}/include)
|
SET(GETTEXT_INC ${GETTEXT}/include)
|
||||||
IF(CMAKE_CL_64)
|
IF(CMAKE_CL_64)
|
||||||
SET(GETTEXT_LIB gettextlib)
|
SET(GETTEXT_LIB gettext)
|
||||||
ELSE(CMAKE_CL_64)
|
ELSE(CMAKE_CL_64)
|
||||||
SET(GETTEXT_LIB gnu_gettext)
|
SET(GETTEXT_LIB gnu_gettext)
|
||||||
ENDIF(CMAKE_CL_64)
|
ENDIF(CMAKE_CL_64)
|
||||||
@ -388,6 +408,13 @@ IF(APPLE)
|
|||||||
SET(JACK_LIBPATH ${JACK}/lib)
|
SET(JACK_LIBPATH ${JACK}/lib)
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
|
||||||
|
IF(WITH_SNDFILE)
|
||||||
|
SET(SNDFILE /usr)
|
||||||
|
SET(SNDFILE_INC ${SNDFILE}/include)
|
||||||
|
SET(SNDFILE_LIB sndfile)
|
||||||
|
SET(SNDFILE_LIBPATH ${SNDFILE}/lib)
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
|
|
||||||
SET(PYTHON_VERSION 3.1)
|
SET(PYTHON_VERSION 3.1)
|
||||||
|
|
||||||
IF(PYTHON_VERSION MATCHES 3.1)
|
IF(PYTHON_VERSION MATCHES 3.1)
|
||||||
@ -485,6 +512,17 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|||||||
SET(BINRELOC_INC ${BINRELOC}/include)
|
SET(BINRELOC_INC ${BINRELOC}/include)
|
||||||
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux")
|
||||||
|
|
||||||
|
|
||||||
|
# TODO - buildinfo
|
||||||
|
# IF(UNIX)
|
||||||
|
# IF(WITH_BUILDINFO)
|
||||||
|
# EXEC_PROGRAM("date \"+%Y-%m-%d\"" OUTPUT_VARIABLE BUILD_DATE)
|
||||||
|
# EXEC_PROGRAM("date \"+%H:%M:%S\"" OUTPUT_VARIABLE BUILD_TIME)
|
||||||
|
# EXEC_PROGRAM("svnversion ${CMAKE_SOURCE_DIR}" OUTPUT_VARIABLE BUILD_REV)
|
||||||
|
# SET(BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||||
|
# ENDIF(WITH_BUILDINFO)
|
||||||
|
# ENDIF(UNIX)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Common.
|
# Common.
|
||||||
|
|
||||||
|
@ -181,8 +181,9 @@ REL_CCFLAGS = ['-O2']
|
|||||||
##ARFLAGSQUIET = ru
|
##ARFLAGSQUIET = ru
|
||||||
##
|
##
|
||||||
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
|
C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement']
|
||||||
|
|
||||||
CC_WARN = ['-Wall']
|
CC_WARN = ['-Wall']
|
||||||
|
CXX_WARN = ['-Wno-invalid-offsetof', '-Wno-sign-compare']
|
||||||
|
|
||||||
|
|
||||||
##FIX_STUBS_WARNINGS = -Wno-unused
|
##FIX_STUBS_WARNINGS = -Wno-unused
|
||||||
|
|
||||||
|
3
extern/CMakeLists.txt
vendored
3
extern/CMakeLists.txt
vendored
@ -37,3 +37,6 @@ ADD_SUBDIRECTORY(glew)
|
|||||||
IF(WITH_OPENJPEG)
|
IF(WITH_OPENJPEG)
|
||||||
ADD_SUBDIRECTORY(libopenjpeg)
|
ADD_SUBDIRECTORY(libopenjpeg)
|
||||||
ENDIF(WITH_OPENJPEG)
|
ENDIF(WITH_OPENJPEG)
|
||||||
|
|
||||||
|
ADD_SUBDIRECTORY(lzo)
|
||||||
|
ADD_SUBDIRECTORY(lzma)
|
||||||
|
8
extern/Makefile
vendored
8
extern/Makefile
vendored
@ -54,6 +54,14 @@ ifeq ($(WITH_OPENJPEG), true)
|
|||||||
DIRS += libopenjpeg
|
DIRS += libopenjpeg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_LZO), true)
|
||||||
|
DIRS += lzo/minilzo
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_LZMA), true)
|
||||||
|
DIRS += lzma
|
||||||
|
endif
|
||||||
|
|
||||||
TARGET = solid
|
TARGET = solid
|
||||||
|
|
||||||
all::
|
all::
|
||||||
|
4
extern/SConscript
vendored
4
extern/SConscript
vendored
@ -22,5 +22,5 @@ if env['WITH_BF_REDCODE'] and env['BF_REDCODE_LIB'] == '':
|
|||||||
if env['OURPLATFORM'] == 'linux2':
|
if env['OURPLATFORM'] == 'linux2':
|
||||||
SConscript(['binreloc/SConscript']);
|
SConscript(['binreloc/SConscript']);
|
||||||
|
|
||||||
# FFTW not needed atm - dg
|
SConscript(['lzo/SConscript'])
|
||||||
# SConscript(['fftw/SConscript'])
|
SConscript(['lzma/SConscript'])
|
||||||
|
127
extern/lzma/Alloc.c
vendored
Normal file
127
extern/lzma/Alloc.c
vendored
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
/* Alloc.c -- Memory allocation functions
|
||||||
|
2008-09-24
|
||||||
|
Igor Pavlov
|
||||||
|
Public domain */
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "Alloc.h"
|
||||||
|
|
||||||
|
/* #define _SZ_ALLOC_DEBUG */
|
||||||
|
|
||||||
|
/* use _SZ_ALLOC_DEBUG to debug alloc/free operations */
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
#include <stdio.h>
|
||||||
|
int g_allocCount = 0;
|
||||||
|
int g_allocCountMid = 0;
|
||||||
|
int g_allocCountBig = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void *MyAlloc(size_t size)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
return 0;
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
{
|
||||||
|
void *p = malloc(size);
|
||||||
|
fprintf(stderr, "\nAlloc %10d bytes, count = %10d, addr = %8X", size, g_allocCount++, (unsigned)p);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
return malloc(size);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void MyFree(void *address)
|
||||||
|
{
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
if (address != 0)
|
||||||
|
fprintf(stderr, "\nFree; count = %10d, addr = %8X", --g_allocCount, (unsigned)address);
|
||||||
|
#endif
|
||||||
|
free(address);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
void *MidAlloc(size_t size)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
return 0;
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
fprintf(stderr, "\nAlloc_Mid %10d bytes; count = %10d", size, g_allocCountMid++);
|
||||||
|
#endif
|
||||||
|
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MidFree(void *address)
|
||||||
|
{
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
if (address != 0)
|
||||||
|
fprintf(stderr, "\nFree_Mid; count = %10d", --g_allocCountMid);
|
||||||
|
#endif
|
||||||
|
if (address == 0)
|
||||||
|
return;
|
||||||
|
VirtualFree(address, 0, MEM_RELEASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifndef MEM_LARGE_PAGES
|
||||||
|
#undef _7ZIP_LARGE_PAGES
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _7ZIP_LARGE_PAGES
|
||||||
|
SIZE_T g_LargePageSize = 0;
|
||||||
|
typedef SIZE_T (WINAPI *GetLargePageMinimumP)();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void SetLargePageSize()
|
||||||
|
{
|
||||||
|
#ifdef _7ZIP_LARGE_PAGES
|
||||||
|
SIZE_T size = 0;
|
||||||
|
GetLargePageMinimumP largePageMinimum = (GetLargePageMinimumP)
|
||||||
|
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetLargePageMinimum");
|
||||||
|
if (largePageMinimum == 0)
|
||||||
|
return;
|
||||||
|
size = largePageMinimum();
|
||||||
|
if (size == 0 || (size & (size - 1)) != 0)
|
||||||
|
return;
|
||||||
|
g_LargePageSize = size;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void *BigAlloc(size_t size)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
|
return 0;
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
fprintf(stderr, "\nAlloc_Big %10d bytes; count = %10d", size, g_allocCountBig++);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _7ZIP_LARGE_PAGES
|
||||||
|
if (g_LargePageSize != 0 && g_LargePageSize <= (1 << 30) && size >= (1 << 18))
|
||||||
|
{
|
||||||
|
void *res = VirtualAlloc(0, (size + g_LargePageSize - 1) & (~(g_LargePageSize - 1)),
|
||||||
|
MEM_COMMIT | MEM_LARGE_PAGES, PAGE_READWRITE);
|
||||||
|
if (res != 0)
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return VirtualAlloc(0, size, MEM_COMMIT, PAGE_READWRITE);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BigFree(void *address)
|
||||||
|
{
|
||||||
|
#ifdef _SZ_ALLOC_DEBUG
|
||||||
|
if (address != 0)
|
||||||
|
fprintf(stderr, "\nFree_Big; count = %10d", --g_allocCountBig);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (address == 0)
|
||||||
|
return;
|
||||||
|
VirtualFree(address, 0, MEM_RELEASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
32
extern/lzma/Alloc.h
vendored
Normal file
32
extern/lzma/Alloc.h
vendored
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
/* Alloc.h -- Memory allocation functions
|
||||||
|
2008-03-13
|
||||||
|
Igor Pavlov
|
||||||
|
Public domain */
|
||||||
|
|
||||||
|
#ifndef __COMMON_ALLOC_H
|
||||||
|
#define __COMMON_ALLOC_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
void *MyAlloc(size_t size);
|
||||||
|
void MyFree(void *address);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
|
||||||
|
void SetLargePageSize();
|
||||||
|
|
||||||
|
void *MidAlloc(size_t size);
|
||||||
|
void MidFree(void *address);
|
||||||
|
void *BigAlloc(size_t size);
|
||||||
|
void BigFree(void *address);
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define MidAlloc(size) MyAlloc(size)
|
||||||
|
#define MidFree(address) MyFree(address)
|
||||||
|
#define BigAlloc(size) MyAlloc(size)
|
||||||
|
#define BigFree(address) MyFree(address)
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
34
extern/lzma/CMakeLists.txt
vendored
Normal file
34
extern/lzma/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# $Id$
|
||||||
|
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# The Original Code is: all of this file.
|
||||||
|
#
|
||||||
|
# Contributor(s): Daniel Genrich
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
|
SET(INC . )
|
||||||
|
|
||||||
|
FILE(GLOB SRC ./*.c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BLENDERLIB(bf_lzma "${SRC}" "${INC}")
|
||||||
|
#, libtype='blender', priority = 0 )
|
751
extern/lzma/LzFind.c
vendored
Normal file
751
extern/lzma/LzFind.c
vendored
Normal file
@ -0,0 +1,751 @@
|
|||||||
|
/* LzFind.c -- Match finder for LZ algorithms
|
||||||
|
2008-10-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "LzFind.h"
|
||||||
|
#include "LzHash.h"
|
||||||
|
|
||||||
|
#define kEmptyHashValue 0
|
||||||
|
#define kMaxValForNormalize ((UInt32)0xFFFFFFFF)
|
||||||
|
#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */
|
||||||
|
#define kNormalizeMask (~(kNormalizeStepMin - 1))
|
||||||
|
#define kMaxHistorySize ((UInt32)3 << 30)
|
||||||
|
|
||||||
|
#define kStartMaxLen 3
|
||||||
|
|
||||||
|
static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
if (!p->directInput)
|
||||||
|
{
|
||||||
|
alloc->Free(alloc, p->bufferBase);
|
||||||
|
p->bufferBase = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */
|
||||||
|
|
||||||
|
static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv;
|
||||||
|
if (p->directInput)
|
||||||
|
{
|
||||||
|
p->blockSize = blockSize;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
if (p->bufferBase == 0 || p->blockSize != blockSize)
|
||||||
|
{
|
||||||
|
LzInWindow_Free(p, alloc);
|
||||||
|
p->blockSize = blockSize;
|
||||||
|
p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize);
|
||||||
|
}
|
||||||
|
return (p->bufferBase != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; }
|
||||||
|
Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; }
|
||||||
|
|
||||||
|
UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; }
|
||||||
|
|
||||||
|
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue)
|
||||||
|
{
|
||||||
|
p->posLimit -= subValue;
|
||||||
|
p->pos -= subValue;
|
||||||
|
p->streamPos -= subValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_ReadBlock(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
if (p->streamEndWasReached || p->result != SZ_OK)
|
||||||
|
return;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
Byte *dest = p->buffer + (p->streamPos - p->pos);
|
||||||
|
size_t size = (p->bufferBase + p->blockSize - dest);
|
||||||
|
if (size == 0)
|
||||||
|
return;
|
||||||
|
p->result = p->stream->Read(p->stream, dest, &size);
|
||||||
|
if (p->result != SZ_OK)
|
||||||
|
return;
|
||||||
|
if (size == 0)
|
||||||
|
{
|
||||||
|
p->streamEndWasReached = 1;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
p->streamPos += (UInt32)size;
|
||||||
|
if (p->streamPos - p->pos > p->keepSizeAfter)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_MoveBlock(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
memmove(p->bufferBase,
|
||||||
|
p->buffer - p->keepSizeBefore,
|
||||||
|
(size_t)(p->streamPos - p->pos + p->keepSizeBefore));
|
||||||
|
p->buffer = p->bufferBase + p->keepSizeBefore;
|
||||||
|
}
|
||||||
|
|
||||||
|
int MatchFinder_NeedMove(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
/* if (p->streamEndWasReached) return 0; */
|
||||||
|
return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_ReadIfRequired(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
if (p->streamEndWasReached)
|
||||||
|
return;
|
||||||
|
if (p->keepSizeAfter >= p->streamPos - p->pos)
|
||||||
|
MatchFinder_ReadBlock(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
if (MatchFinder_NeedMove(p))
|
||||||
|
MatchFinder_MoveBlock(p);
|
||||||
|
MatchFinder_ReadBlock(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_SetDefaultSettings(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
p->cutValue = 32;
|
||||||
|
p->btMode = 1;
|
||||||
|
p->numHashBytes = 4;
|
||||||
|
/* p->skipModeBits = 0; */
|
||||||
|
p->directInput = 0;
|
||||||
|
p->bigHash = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#define kCrcPoly 0xEDB88320
|
||||||
|
|
||||||
|
void MatchFinder_Construct(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
UInt32 i;
|
||||||
|
p->bufferBase = 0;
|
||||||
|
p->directInput = 0;
|
||||||
|
p->hash = 0;
|
||||||
|
MatchFinder_SetDefaultSettings(p);
|
||||||
|
|
||||||
|
for (i = 0; i < 256; i++)
|
||||||
|
{
|
||||||
|
UInt32 r = i;
|
||||||
|
int j;
|
||||||
|
for (j = 0; j < 8; j++)
|
||||||
|
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
|
||||||
|
p->crc[i] = r;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
alloc->Free(alloc, p->hash);
|
||||||
|
p->hash = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
MatchFinder_FreeThisClassMemory(p, alloc);
|
||||||
|
LzInWindow_Free(p, alloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
size_t sizeInBytes = (size_t)num * sizeof(CLzRef);
|
||||||
|
if (sizeInBytes / sizeof(CLzRef) != num)
|
||||||
|
return 0;
|
||||||
|
return (CLzRef *)alloc->Alloc(alloc, sizeInBytes);
|
||||||
|
}
|
||||||
|
|
||||||
|
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||||
|
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
||||||
|
ISzAlloc *alloc)
|
||||||
|
{
|
||||||
|
UInt32 sizeReserv;
|
||||||
|
if (historySize > kMaxHistorySize)
|
||||||
|
{
|
||||||
|
MatchFinder_Free(p, alloc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
sizeReserv = historySize >> 1;
|
||||||
|
if (historySize > ((UInt32)2 << 30))
|
||||||
|
sizeReserv = historySize >> 2;
|
||||||
|
sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19);
|
||||||
|
|
||||||
|
p->keepSizeBefore = historySize + keepAddBufferBefore + 1;
|
||||||
|
p->keepSizeAfter = matchMaxLen + keepAddBufferAfter;
|
||||||
|
/* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */
|
||||||
|
if (LzInWindow_Create(p, sizeReserv, alloc))
|
||||||
|
{
|
||||||
|
UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1;
|
||||||
|
UInt32 hs;
|
||||||
|
p->matchMaxLen = matchMaxLen;
|
||||||
|
{
|
||||||
|
p->fixedHashSize = 0;
|
||||||
|
if (p->numHashBytes == 2)
|
||||||
|
hs = (1 << 16) - 1;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hs = historySize - 1;
|
||||||
|
hs |= (hs >> 1);
|
||||||
|
hs |= (hs >> 2);
|
||||||
|
hs |= (hs >> 4);
|
||||||
|
hs |= (hs >> 8);
|
||||||
|
hs >>= 1;
|
||||||
|
/* hs >>= p->skipModeBits; */
|
||||||
|
hs |= 0xFFFF; /* don't change it! It's required for Deflate */
|
||||||
|
if (hs > (1 << 24))
|
||||||
|
{
|
||||||
|
if (p->numHashBytes == 3)
|
||||||
|
hs = (1 << 24) - 1;
|
||||||
|
else
|
||||||
|
hs >>= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
p->hashMask = hs;
|
||||||
|
hs++;
|
||||||
|
if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size;
|
||||||
|
if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size;
|
||||||
|
if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size;
|
||||||
|
hs += p->fixedHashSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
UInt32 prevSize = p->hashSizeSum + p->numSons;
|
||||||
|
UInt32 newSize;
|
||||||
|
p->historySize = historySize;
|
||||||
|
p->hashSizeSum = hs;
|
||||||
|
p->cyclicBufferSize = newCyclicBufferSize;
|
||||||
|
p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize);
|
||||||
|
newSize = p->hashSizeSum + p->numSons;
|
||||||
|
if (p->hash != 0 && prevSize == newSize)
|
||||||
|
return 1;
|
||||||
|
MatchFinder_FreeThisClassMemory(p, alloc);
|
||||||
|
p->hash = AllocRefs(newSize, alloc);
|
||||||
|
if (p->hash != 0)
|
||||||
|
{
|
||||||
|
p->son = p->hash + p->hashSizeSum;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MatchFinder_Free(p, alloc);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_SetLimits(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
UInt32 limit = kMaxValForNormalize - p->pos;
|
||||||
|
UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos;
|
||||||
|
if (limit2 < limit)
|
||||||
|
limit = limit2;
|
||||||
|
limit2 = p->streamPos - p->pos;
|
||||||
|
if (limit2 <= p->keepSizeAfter)
|
||||||
|
{
|
||||||
|
if (limit2 > 0)
|
||||||
|
limit2 = 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
limit2 -= p->keepSizeAfter;
|
||||||
|
if (limit2 < limit)
|
||||||
|
limit = limit2;
|
||||||
|
{
|
||||||
|
UInt32 lenLimit = p->streamPos - p->pos;
|
||||||
|
if (lenLimit > p->matchMaxLen)
|
||||||
|
lenLimit = p->matchMaxLen;
|
||||||
|
p->lenLimit = lenLimit;
|
||||||
|
}
|
||||||
|
p->posLimit = p->pos + limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_Init(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
UInt32 i;
|
||||||
|
for (i = 0; i < p->hashSizeSum; i++)
|
||||||
|
p->hash[i] = kEmptyHashValue;
|
||||||
|
p->cyclicBufferPos = 0;
|
||||||
|
p->buffer = p->bufferBase;
|
||||||
|
p->pos = p->streamPos = p->cyclicBufferSize;
|
||||||
|
p->result = SZ_OK;
|
||||||
|
p->streamEndWasReached = 0;
|
||||||
|
MatchFinder_ReadBlock(p);
|
||||||
|
MatchFinder_SetLimits(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UInt32 MatchFinder_GetSubValue(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
return (p->pos - p->historySize - 1) & kNormalizeMask;
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems)
|
||||||
|
{
|
||||||
|
UInt32 i;
|
||||||
|
for (i = 0; i < numItems; i++)
|
||||||
|
{
|
||||||
|
UInt32 value = items[i];
|
||||||
|
if (value <= subValue)
|
||||||
|
value = kEmptyHashValue;
|
||||||
|
else
|
||||||
|
value -= subValue;
|
||||||
|
items[i] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_Normalize(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
UInt32 subValue = MatchFinder_GetSubValue(p);
|
||||||
|
MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons);
|
||||||
|
MatchFinder_ReduceOffsets(p, subValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void MatchFinder_CheckLimits(CMatchFinder *p)
|
||||||
|
{
|
||||||
|
if (p->pos == kMaxValForNormalize)
|
||||||
|
MatchFinder_Normalize(p);
|
||||||
|
if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos)
|
||||||
|
MatchFinder_CheckAndMoveAndRead(p);
|
||||||
|
if (p->cyclicBufferPos == p->cyclicBufferSize)
|
||||||
|
p->cyclicBufferPos = 0;
|
||||||
|
MatchFinder_SetLimits(p);
|
||||||
|
}
|
||||||
|
|
||||||
|
static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||||
|
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
|
||||||
|
UInt32 *distances, UInt32 maxLen)
|
||||||
|
{
|
||||||
|
son[_cyclicBufferPos] = curMatch;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
UInt32 delta = pos - curMatch;
|
||||||
|
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||||
|
return distances;
|
||||||
|
{
|
||||||
|
const Byte *pb = cur - delta;
|
||||||
|
curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)];
|
||||||
|
if (pb[maxLen] == cur[maxLen] && *pb == *cur)
|
||||||
|
{
|
||||||
|
UInt32 len = 0;
|
||||||
|
while (++len != lenLimit)
|
||||||
|
if (pb[len] != cur[len])
|
||||||
|
break;
|
||||||
|
if (maxLen < len)
|
||||||
|
{
|
||||||
|
*distances++ = maxLen = len;
|
||||||
|
*distances++ = delta - 1;
|
||||||
|
if (len == lenLimit)
|
||||||
|
return distances;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||||
|
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue,
|
||||||
|
UInt32 *distances, UInt32 maxLen)
|
||||||
|
{
|
||||||
|
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
|
||||||
|
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
|
||||||
|
UInt32 len0 = 0, len1 = 0;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
UInt32 delta = pos - curMatch;
|
||||||
|
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||||
|
{
|
||||||
|
*ptr0 = *ptr1 = kEmptyHashValue;
|
||||||
|
return distances;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
|
||||||
|
const Byte *pb = cur - delta;
|
||||||
|
UInt32 len = (len0 < len1 ? len0 : len1);
|
||||||
|
if (pb[len] == cur[len])
|
||||||
|
{
|
||||||
|
if (++len != lenLimit && pb[len] == cur[len])
|
||||||
|
while (++len != lenLimit)
|
||||||
|
if (pb[len] != cur[len])
|
||||||
|
break;
|
||||||
|
if (maxLen < len)
|
||||||
|
{
|
||||||
|
*distances++ = maxLen = len;
|
||||||
|
*distances++ = delta - 1;
|
||||||
|
if (len == lenLimit)
|
||||||
|
{
|
||||||
|
*ptr1 = pair[0];
|
||||||
|
*ptr0 = pair[1];
|
||||||
|
return distances;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pb[len] < cur[len])
|
||||||
|
{
|
||||||
|
*ptr1 = curMatch;
|
||||||
|
ptr1 = pair + 1;
|
||||||
|
curMatch = *ptr1;
|
||||||
|
len1 = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ptr0 = curMatch;
|
||||||
|
ptr0 = pair;
|
||||||
|
curMatch = *ptr0;
|
||||||
|
len0 = len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son,
|
||||||
|
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue)
|
||||||
|
{
|
||||||
|
CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1;
|
||||||
|
CLzRef *ptr1 = son + (_cyclicBufferPos << 1);
|
||||||
|
UInt32 len0 = 0, len1 = 0;
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
UInt32 delta = pos - curMatch;
|
||||||
|
if (cutValue-- == 0 || delta >= _cyclicBufferSize)
|
||||||
|
{
|
||||||
|
*ptr0 = *ptr1 = kEmptyHashValue;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
{
|
||||||
|
CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1);
|
||||||
|
const Byte *pb = cur - delta;
|
||||||
|
UInt32 len = (len0 < len1 ? len0 : len1);
|
||||||
|
if (pb[len] == cur[len])
|
||||||
|
{
|
||||||
|
while (++len != lenLimit)
|
||||||
|
if (pb[len] != cur[len])
|
||||||
|
break;
|
||||||
|
{
|
||||||
|
if (len == lenLimit)
|
||||||
|
{
|
||||||
|
*ptr1 = pair[0];
|
||||||
|
*ptr0 = pair[1];
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pb[len] < cur[len])
|
||||||
|
{
|
||||||
|
*ptr1 = curMatch;
|
||||||
|
ptr1 = pair + 1;
|
||||||
|
curMatch = *ptr1;
|
||||||
|
len1 = len;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*ptr0 = curMatch;
|
||||||
|
ptr0 = pair;
|
||||||
|
curMatch = *ptr0;
|
||||||
|
len0 = len;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#define MOVE_POS \
|
||||||
|
++p->cyclicBufferPos; \
|
||||||
|
p->buffer++; \
|
||||||
|
if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p);
|
||||||
|
|
||||||
|
#define MOVE_POS_RET MOVE_POS return offset;
|
||||||
|
|
||||||
|
static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; }
|
||||||
|
|
||||||
|
#define GET_MATCHES_HEADER2(minLen, ret_op) \
|
||||||
|
UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \
|
||||||
|
lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \
|
||||||
|
cur = p->buffer;
|
||||||
|
|
||||||
|
#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0)
|
||||||
|
#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue)
|
||||||
|
|
||||||
|
#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue
|
||||||
|
|
||||||
|
#define GET_MATCHES_FOOTER(offset, maxLen) \
|
||||||
|
offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \
|
||||||
|
distances + offset, maxLen) - distances); MOVE_POS_RET;
|
||||||
|
|
||||||
|
#define SKIP_FOOTER \
|
||||||
|
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS;
|
||||||
|
|
||||||
|
static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 offset;
|
||||||
|
GET_MATCHES_HEADER(2)
|
||||||
|
HASH2_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
offset = 0;
|
||||||
|
GET_MATCHES_FOOTER(offset, 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 offset;
|
||||||
|
GET_MATCHES_HEADER(3)
|
||||||
|
HASH_ZIP_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
offset = 0;
|
||||||
|
GET_MATCHES_FOOTER(offset, 2)
|
||||||
|
}
|
||||||
|
|
||||||
|
static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 hash2Value, delta2, maxLen, offset;
|
||||||
|
GET_MATCHES_HEADER(3)
|
||||||
|
|
||||||
|
HASH3_CALC;
|
||||||
|
|
||||||
|
delta2 = p->pos - p->hash[hash2Value];
|
||||||
|
curMatch = p->hash[kFix3HashSize + hashValue];
|
||||||
|
|
||||||
|
p->hash[hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hashValue] = p->pos;
|
||||||
|
|
||||||
|
|
||||||
|
maxLen = 2;
|
||||||
|
offset = 0;
|
||||||
|
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
|
||||||
|
{
|
||||||
|
for (; maxLen != lenLimit; maxLen++)
|
||||||
|
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
|
||||||
|
break;
|
||||||
|
distances[0] = maxLen;
|
||||||
|
distances[1] = delta2 - 1;
|
||||||
|
offset = 2;
|
||||||
|
if (maxLen == lenLimit)
|
||||||
|
{
|
||||||
|
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
|
||||||
|
MOVE_POS_RET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
GET_MATCHES_FOOTER(offset, maxLen)
|
||||||
|
}
|
||||||
|
|
||||||
|
static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
|
||||||
|
GET_MATCHES_HEADER(4)
|
||||||
|
|
||||||
|
HASH4_CALC;
|
||||||
|
|
||||||
|
delta2 = p->pos - p->hash[ hash2Value];
|
||||||
|
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
|
||||||
|
curMatch = p->hash[kFix4HashSize + hashValue];
|
||||||
|
|
||||||
|
p->hash[ hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hash3Value] =
|
||||||
|
p->hash[kFix4HashSize + hashValue] = p->pos;
|
||||||
|
|
||||||
|
maxLen = 1;
|
||||||
|
offset = 0;
|
||||||
|
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
|
||||||
|
{
|
||||||
|
distances[0] = maxLen = 2;
|
||||||
|
distances[1] = delta2 - 1;
|
||||||
|
offset = 2;
|
||||||
|
}
|
||||||
|
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
|
||||||
|
{
|
||||||
|
maxLen = 3;
|
||||||
|
distances[offset + 1] = delta3 - 1;
|
||||||
|
offset += 2;
|
||||||
|
delta2 = delta3;
|
||||||
|
}
|
||||||
|
if (offset != 0)
|
||||||
|
{
|
||||||
|
for (; maxLen != lenLimit; maxLen++)
|
||||||
|
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
|
||||||
|
break;
|
||||||
|
distances[offset - 2] = maxLen;
|
||||||
|
if (maxLen == lenLimit)
|
||||||
|
{
|
||||||
|
SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p));
|
||||||
|
MOVE_POS_RET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxLen < 3)
|
||||||
|
maxLen = 3;
|
||||||
|
GET_MATCHES_FOOTER(offset, maxLen)
|
||||||
|
}
|
||||||
|
|
||||||
|
static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset;
|
||||||
|
GET_MATCHES_HEADER(4)
|
||||||
|
|
||||||
|
HASH4_CALC;
|
||||||
|
|
||||||
|
delta2 = p->pos - p->hash[ hash2Value];
|
||||||
|
delta3 = p->pos - p->hash[kFix3HashSize + hash3Value];
|
||||||
|
curMatch = p->hash[kFix4HashSize + hashValue];
|
||||||
|
|
||||||
|
p->hash[ hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hash3Value] =
|
||||||
|
p->hash[kFix4HashSize + hashValue] = p->pos;
|
||||||
|
|
||||||
|
maxLen = 1;
|
||||||
|
offset = 0;
|
||||||
|
if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur)
|
||||||
|
{
|
||||||
|
distances[0] = maxLen = 2;
|
||||||
|
distances[1] = delta2 - 1;
|
||||||
|
offset = 2;
|
||||||
|
}
|
||||||
|
if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur)
|
||||||
|
{
|
||||||
|
maxLen = 3;
|
||||||
|
distances[offset + 1] = delta3 - 1;
|
||||||
|
offset += 2;
|
||||||
|
delta2 = delta3;
|
||||||
|
}
|
||||||
|
if (offset != 0)
|
||||||
|
{
|
||||||
|
for (; maxLen != lenLimit; maxLen++)
|
||||||
|
if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen])
|
||||||
|
break;
|
||||||
|
distances[offset - 2] = maxLen;
|
||||||
|
if (maxLen == lenLimit)
|
||||||
|
{
|
||||||
|
p->son[p->cyclicBufferPos] = curMatch;
|
||||||
|
MOVE_POS_RET;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (maxLen < 3)
|
||||||
|
maxLen = 3;
|
||||||
|
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
|
||||||
|
distances + offset, maxLen) - (distances));
|
||||||
|
MOVE_POS_RET
|
||||||
|
}
|
||||||
|
|
||||||
|
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances)
|
||||||
|
{
|
||||||
|
UInt32 offset;
|
||||||
|
GET_MATCHES_HEADER(3)
|
||||||
|
HASH_ZIP_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p),
|
||||||
|
distances, 2) - (distances));
|
||||||
|
MOVE_POS_RET
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
SKIP_HEADER(2)
|
||||||
|
HASH2_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
SKIP_FOOTER
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
SKIP_HEADER(3)
|
||||||
|
HASH_ZIP_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
SKIP_FOOTER
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
UInt32 hash2Value;
|
||||||
|
SKIP_HEADER(3)
|
||||||
|
HASH3_CALC;
|
||||||
|
curMatch = p->hash[kFix3HashSize + hashValue];
|
||||||
|
p->hash[hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hashValue] = p->pos;
|
||||||
|
SKIP_FOOTER
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
UInt32 hash2Value, hash3Value;
|
||||||
|
SKIP_HEADER(4)
|
||||||
|
HASH4_CALC;
|
||||||
|
curMatch = p->hash[kFix4HashSize + hashValue];
|
||||||
|
p->hash[ hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hash3Value] = p->pos;
|
||||||
|
p->hash[kFix4HashSize + hashValue] = p->pos;
|
||||||
|
SKIP_FOOTER
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
UInt32 hash2Value, hash3Value;
|
||||||
|
SKIP_HEADER(4)
|
||||||
|
HASH4_CALC;
|
||||||
|
curMatch = p->hash[kFix4HashSize + hashValue];
|
||||||
|
p->hash[ hash2Value] =
|
||||||
|
p->hash[kFix3HashSize + hash3Value] =
|
||||||
|
p->hash[kFix4HashSize + hashValue] = p->pos;
|
||||||
|
p->son[p->cyclicBufferPos] = curMatch;
|
||||||
|
MOVE_POS
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num)
|
||||||
|
{
|
||||||
|
do
|
||||||
|
{
|
||||||
|
SKIP_HEADER(3)
|
||||||
|
HASH_ZIP_CALC;
|
||||||
|
curMatch = p->hash[hashValue];
|
||||||
|
p->hash[hashValue] = p->pos;
|
||||||
|
p->son[p->cyclicBufferPos] = curMatch;
|
||||||
|
MOVE_POS
|
||||||
|
}
|
||||||
|
while (--num != 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable)
|
||||||
|
{
|
||||||
|
vTable->Init = (Mf_Init_Func)MatchFinder_Init;
|
||||||
|
vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte;
|
||||||
|
vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes;
|
||||||
|
vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos;
|
||||||
|
if (!p->btMode)
|
||||||
|
{
|
||||||
|
vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches;
|
||||||
|
vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip;
|
||||||
|
}
|
||||||
|
else if (p->numHashBytes == 2)
|
||||||
|
{
|
||||||
|
vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches;
|
||||||
|
vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip;
|
||||||
|
}
|
||||||
|
else if (p->numHashBytes == 3)
|
||||||
|
{
|
||||||
|
vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches;
|
||||||
|
vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches;
|
||||||
|
vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip;
|
||||||
|
}
|
||||||
|
}
|
107
extern/lzma/LzFind.h
vendored
Normal file
107
extern/lzma/LzFind.h
vendored
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
/* LzFind.h -- Match finder for LZ algorithms
|
||||||
|
2008-10-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __LZFIND_H
|
||||||
|
#define __LZFIND_H
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
typedef UInt32 CLzRef;
|
||||||
|
|
||||||
|
typedef struct _CMatchFinder
|
||||||
|
{
|
||||||
|
Byte *buffer;
|
||||||
|
UInt32 pos;
|
||||||
|
UInt32 posLimit;
|
||||||
|
UInt32 streamPos;
|
||||||
|
UInt32 lenLimit;
|
||||||
|
|
||||||
|
UInt32 cyclicBufferPos;
|
||||||
|
UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */
|
||||||
|
|
||||||
|
UInt32 matchMaxLen;
|
||||||
|
CLzRef *hash;
|
||||||
|
CLzRef *son;
|
||||||
|
UInt32 hashMask;
|
||||||
|
UInt32 cutValue;
|
||||||
|
|
||||||
|
Byte *bufferBase;
|
||||||
|
ISeqInStream *stream;
|
||||||
|
int streamEndWasReached;
|
||||||
|
|
||||||
|
UInt32 blockSize;
|
||||||
|
UInt32 keepSizeBefore;
|
||||||
|
UInt32 keepSizeAfter;
|
||||||
|
|
||||||
|
UInt32 numHashBytes;
|
||||||
|
int directInput;
|
||||||
|
int btMode;
|
||||||
|
/* int skipModeBits; */
|
||||||
|
int bigHash;
|
||||||
|
UInt32 historySize;
|
||||||
|
UInt32 fixedHashSize;
|
||||||
|
UInt32 hashSizeSum;
|
||||||
|
UInt32 numSons;
|
||||||
|
SRes result;
|
||||||
|
UInt32 crc[256];
|
||||||
|
} CMatchFinder;
|
||||||
|
|
||||||
|
#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer)
|
||||||
|
#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)])
|
||||||
|
|
||||||
|
#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos)
|
||||||
|
|
||||||
|
int MatchFinder_NeedMove(CMatchFinder *p);
|
||||||
|
Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p);
|
||||||
|
void MatchFinder_MoveBlock(CMatchFinder *p);
|
||||||
|
void MatchFinder_ReadIfRequired(CMatchFinder *p);
|
||||||
|
|
||||||
|
void MatchFinder_Construct(CMatchFinder *p);
|
||||||
|
|
||||||
|
/* Conditions:
|
||||||
|
historySize <= 3 GB
|
||||||
|
keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB
|
||||||
|
*/
|
||||||
|
int MatchFinder_Create(CMatchFinder *p, UInt32 historySize,
|
||||||
|
UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter,
|
||||||
|
ISzAlloc *alloc);
|
||||||
|
void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc);
|
||||||
|
void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems);
|
||||||
|
void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue);
|
||||||
|
|
||||||
|
UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son,
|
||||||
|
UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue,
|
||||||
|
UInt32 *distances, UInt32 maxLen);
|
||||||
|
|
||||||
|
/*
|
||||||
|
Conditions:
|
||||||
|
Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func.
|
||||||
|
Mf_GetPointerToCurrentPos_Func's result must be used only before any other function
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef void (*Mf_Init_Func)(void *object);
|
||||||
|
typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index);
|
||||||
|
typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object);
|
||||||
|
typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object);
|
||||||
|
typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances);
|
||||||
|
typedef void (*Mf_Skip_Func)(void *object, UInt32);
|
||||||
|
|
||||||
|
typedef struct _IMatchFinder
|
||||||
|
{
|
||||||
|
Mf_Init_Func Init;
|
||||||
|
Mf_GetIndexByte_Func GetIndexByte;
|
||||||
|
Mf_GetNumAvailableBytes_Func GetNumAvailableBytes;
|
||||||
|
Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos;
|
||||||
|
Mf_GetMatches_Func GetMatches;
|
||||||
|
Mf_Skip_Func Skip;
|
||||||
|
} IMatchFinder;
|
||||||
|
|
||||||
|
void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable);
|
||||||
|
|
||||||
|
void MatchFinder_Init(CMatchFinder *p);
|
||||||
|
UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
||||||
|
UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances);
|
||||||
|
void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
||||||
|
void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num);
|
||||||
|
|
||||||
|
#endif
|
54
extern/lzma/LzHash.h
vendored
Normal file
54
extern/lzma/LzHash.h
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
/* LzHash.h -- HASH functions for LZ algorithms
|
||||||
|
2008-10-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __LZHASH_H
|
||||||
|
#define __LZHASH_H
|
||||||
|
|
||||||
|
#define kHash2Size (1 << 10)
|
||||||
|
#define kHash3Size (1 << 16)
|
||||||
|
#define kHash4Size (1 << 20)
|
||||||
|
|
||||||
|
#define kFix3HashSize (kHash2Size)
|
||||||
|
#define kFix4HashSize (kHash2Size + kHash3Size)
|
||||||
|
#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
|
||||||
|
|
||||||
|
#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8);
|
||||||
|
|
||||||
|
#define HASH3_CALC { \
|
||||||
|
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||||
|
hash2Value = temp & (kHash2Size - 1); \
|
||||||
|
hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; }
|
||||||
|
|
||||||
|
#define HASH4_CALC { \
|
||||||
|
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||||
|
hash2Value = temp & (kHash2Size - 1); \
|
||||||
|
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
|
||||||
|
hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; }
|
||||||
|
|
||||||
|
#define HASH5_CALC { \
|
||||||
|
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||||
|
hash2Value = temp & (kHash2Size - 1); \
|
||||||
|
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
|
||||||
|
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \
|
||||||
|
hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \
|
||||||
|
hash4Value &= (kHash4Size - 1); }
|
||||||
|
|
||||||
|
/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */
|
||||||
|
#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF;
|
||||||
|
|
||||||
|
|
||||||
|
#define MT_HASH2_CALC \
|
||||||
|
hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1);
|
||||||
|
|
||||||
|
#define MT_HASH3_CALC { \
|
||||||
|
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||||
|
hash2Value = temp & (kHash2Size - 1); \
|
||||||
|
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); }
|
||||||
|
|
||||||
|
#define MT_HASH4_CALC { \
|
||||||
|
UInt32 temp = p->crc[cur[0]] ^ cur[1]; \
|
||||||
|
hash2Value = temp & (kHash2Size - 1); \
|
||||||
|
hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \
|
||||||
|
hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); }
|
||||||
|
|
||||||
|
#endif
|
1007
extern/lzma/LzmaDec.c
vendored
Normal file
1007
extern/lzma/LzmaDec.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
223
extern/lzma/LzmaDec.h
vendored
Normal file
223
extern/lzma/LzmaDec.h
vendored
Normal file
@ -0,0 +1,223 @@
|
|||||||
|
/* LzmaDec.h -- LZMA Decoder
|
||||||
|
2008-10-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __LZMADEC_H
|
||||||
|
#define __LZMADEC_H
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
/* #define _LZMA_PROB32 */
|
||||||
|
/* _LZMA_PROB32 can increase the speed on some CPUs,
|
||||||
|
but memory usage for CLzmaDec::probs will be doubled in that case */
|
||||||
|
|
||||||
|
#ifdef _LZMA_PROB32
|
||||||
|
#define CLzmaProb UInt32
|
||||||
|
#else
|
||||||
|
#define CLzmaProb UInt16
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- LZMA Properties ---------- */
|
||||||
|
|
||||||
|
#define LZMA_PROPS_SIZE 5
|
||||||
|
|
||||||
|
typedef struct _CLzmaProps
|
||||||
|
{
|
||||||
|
unsigned lc, lp, pb;
|
||||||
|
UInt32 dicSize;
|
||||||
|
} CLzmaProps;
|
||||||
|
|
||||||
|
/* LzmaProps_Decode - decodes properties
|
||||||
|
Returns:
|
||||||
|
SZ_OK
|
||||||
|
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- LZMA Decoder state ---------- */
|
||||||
|
|
||||||
|
/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
|
||||||
|
Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
|
||||||
|
|
||||||
|
#define LZMA_REQUIRED_INPUT_MAX 20
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
CLzmaProps prop;
|
||||||
|
CLzmaProb *probs;
|
||||||
|
Byte *dic;
|
||||||
|
const Byte *buf;
|
||||||
|
UInt32 range, code;
|
||||||
|
SizeT dicPos;
|
||||||
|
SizeT dicBufSize;
|
||||||
|
UInt32 processedPos;
|
||||||
|
UInt32 checkDicSize;
|
||||||
|
unsigned state;
|
||||||
|
UInt32 reps[4];
|
||||||
|
unsigned remainLen;
|
||||||
|
int needFlush;
|
||||||
|
int needInitState;
|
||||||
|
UInt32 numProbs;
|
||||||
|
unsigned tempBufSize;
|
||||||
|
Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
|
||||||
|
} CLzmaDec;
|
||||||
|
|
||||||
|
#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
|
||||||
|
|
||||||
|
void LzmaDec_Init(CLzmaDec *p);
|
||||||
|
|
||||||
|
/* There are two types of LZMA streams:
|
||||||
|
0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
|
||||||
|
1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
LZMA_FINISH_ANY, /* finish at any point */
|
||||||
|
LZMA_FINISH_END /* block must be finished at the end */
|
||||||
|
} ELzmaFinishMode;
|
||||||
|
|
||||||
|
/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
|
||||||
|
|
||||||
|
You must use LZMA_FINISH_END, when you know that current output buffer
|
||||||
|
covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
|
||||||
|
|
||||||
|
If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
|
||||||
|
and output value of destLen will be less than output buffer size limit.
|
||||||
|
You can check status result also.
|
||||||
|
|
||||||
|
You can use multiple checks to test data integrity after full decompression:
|
||||||
|
1) Check Result and "status" variable.
|
||||||
|
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
|
||||||
|
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
|
||||||
|
You must use correct finish mode in that case. */
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */
|
||||||
|
LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */
|
||||||
|
LZMA_STATUS_NOT_FINISHED, /* stream was not finished */
|
||||||
|
LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */
|
||||||
|
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */
|
||||||
|
} ELzmaStatus;
|
||||||
|
|
||||||
|
/* ELzmaStatus is used only as output value for function call */
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- Interfaces ---------- */
|
||||||
|
|
||||||
|
/* There are 3 levels of interfaces:
|
||||||
|
1) Dictionary Interface
|
||||||
|
2) Buffer Interface
|
||||||
|
3) One Call Interface
|
||||||
|
You can select any of these interfaces, but don't mix functions from different
|
||||||
|
groups for same object. */
|
||||||
|
|
||||||
|
|
||||||
|
/* There are two variants to allocate state for Dictionary Interface:
|
||||||
|
1) LzmaDec_Allocate / LzmaDec_Free
|
||||||
|
2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
|
||||||
|
You can use variant 2, if you set dictionary buffer manually.
|
||||||
|
For Buffer Interface you must always use variant 1.
|
||||||
|
|
||||||
|
LzmaDec_Allocate* can return:
|
||||||
|
SZ_OK
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
|
||||||
|
void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
|
||||||
|
|
||||||
|
SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
|
||||||
|
void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
|
||||||
|
|
||||||
|
/* ---------- Dictionary Interface ---------- */
|
||||||
|
|
||||||
|
/* You can use it, if you want to eliminate the overhead for data copying from
|
||||||
|
dictionary to some other external buffer.
|
||||||
|
You must work with CLzmaDec variables directly in this interface.
|
||||||
|
|
||||||
|
STEPS:
|
||||||
|
LzmaDec_Constr()
|
||||||
|
LzmaDec_Allocate()
|
||||||
|
for (each new stream)
|
||||||
|
{
|
||||||
|
LzmaDec_Init()
|
||||||
|
while (it needs more decompression)
|
||||||
|
{
|
||||||
|
LzmaDec_DecodeToDic()
|
||||||
|
use data from CLzmaDec::dic and update CLzmaDec::dicPos
|
||||||
|
}
|
||||||
|
}
|
||||||
|
LzmaDec_Free()
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* LzmaDec_DecodeToDic
|
||||||
|
|
||||||
|
The decoding to internal dictionary buffer (CLzmaDec::dic).
|
||||||
|
You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
|
||||||
|
|
||||||
|
finishMode:
|
||||||
|
It has meaning only if the decoding reaches output limit (dicLimit).
|
||||||
|
LZMA_FINISH_ANY - Decode just dicLimit bytes.
|
||||||
|
LZMA_FINISH_END - Stream must be finished after dicLimit.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
SZ_OK
|
||||||
|
status:
|
||||||
|
LZMA_STATUS_FINISHED_WITH_MARK
|
||||||
|
LZMA_STATUS_NOT_FINISHED
|
||||||
|
LZMA_STATUS_NEEDS_MORE_INPUT
|
||||||
|
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|
||||||
|
SZ_ERROR_DATA - Data error
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
|
||||||
|
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- Buffer Interface ---------- */
|
||||||
|
|
||||||
|
/* It's zlib-like interface.
|
||||||
|
See LzmaDec_DecodeToDic description for information about STEPS and return results,
|
||||||
|
but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
|
||||||
|
to work with CLzmaDec variables manually.
|
||||||
|
|
||||||
|
finishMode:
|
||||||
|
It has meaning only if the decoding reaches output limit (*destLen).
|
||||||
|
LZMA_FINISH_ANY - Decode just destLen bytes.
|
||||||
|
LZMA_FINISH_END - Stream must be finished after (*destLen).
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
|
||||||
|
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- One Call Interface ---------- */
|
||||||
|
|
||||||
|
/* LzmaDecode
|
||||||
|
|
||||||
|
finishMode:
|
||||||
|
It has meaning only if the decoding reaches output limit (*destLen).
|
||||||
|
LZMA_FINISH_ANY - Decode just destLen bytes.
|
||||||
|
LZMA_FINISH_END - Stream must be finished after (*destLen).
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
SZ_OK
|
||||||
|
status:
|
||||||
|
LZMA_STATUS_FINISHED_WITH_MARK
|
||||||
|
LZMA_STATUS_NOT_FINISHED
|
||||||
|
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|
||||||
|
SZ_ERROR_DATA - Data error
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||||
|
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
|
||||||
|
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
|
||||||
|
ELzmaStatus *status, ISzAlloc *alloc);
|
||||||
|
|
||||||
|
#endif
|
2281
extern/lzma/LzmaEnc.c
vendored
Normal file
2281
extern/lzma/LzmaEnc.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
72
extern/lzma/LzmaEnc.h
vendored
Normal file
72
extern/lzma/LzmaEnc.h
vendored
Normal file
@ -0,0 +1,72 @@
|
|||||||
|
/* LzmaEnc.h -- LZMA Encoder
|
||||||
|
2008-10-04 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __LZMAENC_H
|
||||||
|
#define __LZMAENC_H
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
#define LZMA_PROPS_SIZE 5
|
||||||
|
|
||||||
|
typedef struct _CLzmaEncProps
|
||||||
|
{
|
||||||
|
int level; /* 0 <= level <= 9 */
|
||||||
|
UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version
|
||||||
|
(1 << 12) <= dictSize <= (1 << 30) for 64-bit version
|
||||||
|
default = (1 << 24) */
|
||||||
|
int lc; /* 0 <= lc <= 8, default = 3 */
|
||||||
|
int lp; /* 0 <= lp <= 4, default = 0 */
|
||||||
|
int pb; /* 0 <= pb <= 4, default = 2 */
|
||||||
|
int algo; /* 0 - fast, 1 - normal, default = 1 */
|
||||||
|
int fb; /* 5 <= fb <= 273, default = 32 */
|
||||||
|
int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */
|
||||||
|
int numHashBytes; /* 2, 3 or 4, default = 4 */
|
||||||
|
UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */
|
||||||
|
unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */
|
||||||
|
int numThreads; /* 1 or 2, default = 2 */
|
||||||
|
} CLzmaEncProps;
|
||||||
|
|
||||||
|
void LzmaEncProps_Init(CLzmaEncProps *p);
|
||||||
|
void LzmaEncProps_Normalize(CLzmaEncProps *p);
|
||||||
|
UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2);
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------- CLzmaEncHandle Interface ---------- */
|
||||||
|
|
||||||
|
/* LzmaEnc_* functions can return the following exit codes:
|
||||||
|
Returns:
|
||||||
|
SZ_OK - OK
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_PARAM - Incorrect paramater in props
|
||||||
|
SZ_ERROR_WRITE - Write callback error.
|
||||||
|
SZ_ERROR_PROGRESS - some break from progress callback
|
||||||
|
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
|
||||||
|
*/
|
||||||
|
|
||||||
|
typedef void * CLzmaEncHandle;
|
||||||
|
|
||||||
|
CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc);
|
||||||
|
void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||||
|
SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props);
|
||||||
|
SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size);
|
||||||
|
SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream,
|
||||||
|
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||||
|
SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||||
|
int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||||
|
|
||||||
|
/* ---------- One Call Interface ---------- */
|
||||||
|
|
||||||
|
/* LzmaEncode
|
||||||
|
Return code:
|
||||||
|
SZ_OK - OK
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_PARAM - Incorrect paramater
|
||||||
|
SZ_ERROR_OUTPUT_EOF - output buffer overflow
|
||||||
|
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
|
||||||
|
*/
|
||||||
|
|
||||||
|
SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||||
|
const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
|
||||||
|
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||||
|
|
||||||
|
#endif
|
46
extern/lzma/LzmaLib.c
vendored
Normal file
46
extern/lzma/LzmaLib.c
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/* LzmaLib.c -- LZMA library wrapper
|
||||||
|
2008-08-05
|
||||||
|
Igor Pavlov
|
||||||
|
Public domain */
|
||||||
|
|
||||||
|
#include "LzmaEnc.h"
|
||||||
|
#include "LzmaDec.h"
|
||||||
|
#include "Alloc.h"
|
||||||
|
#include "LzmaLib.h"
|
||||||
|
|
||||||
|
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
|
||||||
|
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
|
||||||
|
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
|
||||||
|
|
||||||
|
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
|
||||||
|
unsigned char *outProps, size_t *outPropsSize,
|
||||||
|
int level, /* 0 <= level <= 9, default = 5 */
|
||||||
|
unsigned dictSize, /* use (1 << N) or (3 << N). 4 KB < dictSize <= 128 MB */
|
||||||
|
int lc, /* 0 <= lc <= 8, default = 3 */
|
||||||
|
int lp, /* 0 <= lp <= 4, default = 0 */
|
||||||
|
int pb, /* 0 <= pb <= 4, default = 2 */
|
||||||
|
int fb, /* 5 <= fb <= 273, default = 32 */
|
||||||
|
int numThreads /* 1 or 2, default = 2 */
|
||||||
|
)
|
||||||
|
{
|
||||||
|
CLzmaEncProps props;
|
||||||
|
LzmaEncProps_Init(&props);
|
||||||
|
props.level = level;
|
||||||
|
props.dictSize = dictSize;
|
||||||
|
props.lc = lc;
|
||||||
|
props.lp = lp;
|
||||||
|
props.pb = pb;
|
||||||
|
props.fb = fb;
|
||||||
|
props.numThreads = numThreads;
|
||||||
|
|
||||||
|
return LzmaEncode(dest, destLen, src, srcLen, &props, outProps, outPropsSize, 0,
|
||||||
|
NULL, &g_Alloc, &g_Alloc);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t *srcLen,
|
||||||
|
const unsigned char *props, size_t propsSize)
|
||||||
|
{
|
||||||
|
ELzmaStatus status;
|
||||||
|
return LzmaDecode(dest, destLen, src, srcLen, props, (unsigned)propsSize, LZMA_FINISH_ANY, &status, &g_Alloc);
|
||||||
|
}
|
135
extern/lzma/LzmaLib.h
vendored
Normal file
135
extern/lzma/LzmaLib.h
vendored
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
/* LzmaLib.h -- LZMA library interface
|
||||||
|
2008-08-05
|
||||||
|
Igor Pavlov
|
||||||
|
Public domain */
|
||||||
|
|
||||||
|
#ifndef __LZMALIB_H
|
||||||
|
#define __LZMALIB_H
|
||||||
|
|
||||||
|
#include "Types.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
#define MY_EXTERN_C extern "C"
|
||||||
|
#else
|
||||||
|
#define MY_EXTERN_C extern
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MY_STDAPI MY_EXTERN_C int MY_STD_CALL
|
||||||
|
|
||||||
|
#define LZMA_PROPS_SIZE 5
|
||||||
|
|
||||||
|
/*
|
||||||
|
RAM requirements for LZMA:
|
||||||
|
for compression: (dictSize * 11.5 + 6 MB) + state_size
|
||||||
|
for decompression: dictSize + state_size
|
||||||
|
state_size = (4 + (1.5 << (lc + lp))) KB
|
||||||
|
by default (lc=3, lp=0), state_size = 16 KB.
|
||||||
|
|
||||||
|
LZMA properties (5 bytes) format
|
||||||
|
Offset Size Description
|
||||||
|
0 1 lc, lp and pb in encoded form.
|
||||||
|
1 4 dictSize (little endian).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
LzmaCompress
|
||||||
|
------------
|
||||||
|
|
||||||
|
outPropsSize -
|
||||||
|
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
|
||||||
|
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
|
||||||
|
|
||||||
|
LZMA Encoder will use defult values for any parameter, if it is
|
||||||
|
-1 for any from: level, loc, lp, pb, fb, numThreads
|
||||||
|
0 for dictSize
|
||||||
|
|
||||||
|
level - compression level: 0 <= level <= 9;
|
||||||
|
|
||||||
|
level dictSize algo fb
|
||||||
|
0: 16 KB 0 32
|
||||||
|
1: 64 KB 0 32
|
||||||
|
2: 256 KB 0 32
|
||||||
|
3: 1 MB 0 32
|
||||||
|
4: 4 MB 0 32
|
||||||
|
5: 16 MB 1 32
|
||||||
|
6: 32 MB 1 32
|
||||||
|
7+: 64 MB 1 64
|
||||||
|
|
||||||
|
The default value for "level" is 5.
|
||||||
|
|
||||||
|
algo = 0 means fast method
|
||||||
|
algo = 1 means normal method
|
||||||
|
|
||||||
|
dictSize - The dictionary size in bytes. The maximum value is
|
||||||
|
128 MB = (1 << 27) bytes for 32-bit version
|
||||||
|
1 GB = (1 << 30) bytes for 64-bit version
|
||||||
|
The default value is 16 MB = (1 << 24) bytes.
|
||||||
|
It's recommended to use the dictionary that is larger than 4 KB and
|
||||||
|
that can be calculated as (1 << N) or (3 << N) sizes.
|
||||||
|
|
||||||
|
lc - The number of literal context bits (high bits of previous literal).
|
||||||
|
It can be in the range from 0 to 8. The default value is 3.
|
||||||
|
Sometimes lc=4 gives the gain for big files.
|
||||||
|
|
||||||
|
lp - The number of literal pos bits (low bits of current position for literals).
|
||||||
|
It can be in the range from 0 to 4. The default value is 0.
|
||||||
|
The lp switch is intended for periodical data when the period is equal to 2^lp.
|
||||||
|
For example, for 32-bit (4 bytes) periodical data you can use lp=2. Often it's
|
||||||
|
better to set lc=0, if you change lp switch.
|
||||||
|
|
||||||
|
pb - The number of pos bits (low bits of current position).
|
||||||
|
It can be in the range from 0 to 4. The default value is 2.
|
||||||
|
The pb switch is intended for periodical data when the period is equal 2^pb.
|
||||||
|
|
||||||
|
fb - Word size (the number of fast bytes).
|
||||||
|
It can be in the range from 5 to 273. The default value is 32.
|
||||||
|
Usually, a big number gives a little bit better compression ratio and
|
||||||
|
slower compression process.
|
||||||
|
|
||||||
|
numThreads - The number of thereads. 1 or 2. The default value is 2.
|
||||||
|
Fast mode (algo = 0) can use only 1 thread.
|
||||||
|
|
||||||
|
Out:
|
||||||
|
destLen - processed output size
|
||||||
|
Returns:
|
||||||
|
SZ_OK - OK
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_PARAM - Incorrect paramater
|
||||||
|
SZ_ERROR_OUTPUT_EOF - output buffer overflow
|
||||||
|
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
|
||||||
|
*/
|
||||||
|
|
||||||
|
MY_STDAPI LzmaCompress(unsigned char *dest, size_t *destLen, const unsigned char *src, size_t srcLen,
|
||||||
|
unsigned char *outProps, size_t *outPropsSize, /* *outPropsSize must be = 5 */
|
||||||
|
int level, /* 0 <= level <= 9, default = 5 */
|
||||||
|
unsigned dictSize, /* default = (1 << 24) */
|
||||||
|
int lc, /* 0 <= lc <= 8, default = 3 */
|
||||||
|
int lp, /* 0 <= lp <= 4, default = 0 */
|
||||||
|
int pb, /* 0 <= pb <= 4, default = 2 */
|
||||||
|
int fb, /* 5 <= fb <= 273, default = 32 */
|
||||||
|
int numThreads /* 1 or 2, default = 2 */
|
||||||
|
);
|
||||||
|
|
||||||
|
/*
|
||||||
|
LzmaUncompress
|
||||||
|
--------------
|
||||||
|
In:
|
||||||
|
dest - output data
|
||||||
|
destLen - output data size
|
||||||
|
src - input data
|
||||||
|
srcLen - input data size
|
||||||
|
Out:
|
||||||
|
destLen - processed output size
|
||||||
|
srcLen - processed input size
|
||||||
|
Returns:
|
||||||
|
SZ_OK - OK
|
||||||
|
SZ_ERROR_DATA - Data error
|
||||||
|
SZ_ERROR_MEM - Memory allocation arror
|
||||||
|
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||||
|
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
|
||||||
|
*/
|
||||||
|
|
||||||
|
MY_STDAPI LzmaUncompress(unsigned char *dest, size_t *destLen, const unsigned char *src, SizeT *srcLen,
|
||||||
|
const unsigned char *props, size_t propsSize);
|
||||||
|
|
||||||
|
#endif
|
46
extern/lzma/Makefile
vendored
Normal file
46
extern/lzma/Makefile
vendored
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# ***** BEGIN GPL/BL DUAL 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. The Blender
|
||||||
|
# Foundation also sells licenses for use in proprietary software under
|
||||||
|
# the Blender License. See http://www.blender.org/BL/ for information
|
||||||
|
# about this.
|
||||||
|
#
|
||||||
|
# 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# The Original Code is: all of this file.
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
# ***** END GPL/BL DUAL LICENSE BLOCK *****
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
LIBNAME = lzma
|
||||||
|
DIR = $(OCGDIR)/extern/$(LIBNAME)
|
||||||
|
|
||||||
|
include nan_compile.mk
|
||||||
|
|
||||||
|
install: $(ALL_OR_DEBUG)
|
||||||
|
@[ -d $(NAN_LZMA) ] || mkdir -p $(NAN_LZMA)
|
||||||
|
@[ -d $(NAN_LZMA)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZMA)/lib/$(DEBUG_DIR)
|
||||||
|
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZMA)/lib/$(DEBUG_DIR)
|
||||||
|
ifeq ($(OS),darwin)
|
||||||
|
ranlib $(NAN_LZMA)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
|
||||||
|
endif
|
||||||
|
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZMA)
|
9
extern/lzma/SConscript
vendored
Normal file
9
extern/lzma/SConscript
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
Import ('env')
|
||||||
|
|
||||||
|
sources = env.Glob('./*.c')
|
||||||
|
|
||||||
|
defs = ''
|
||||||
|
incs = ' . '
|
||||||
|
|
||||||
|
env.BlenderLib ('bf_lzma', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )
|
208
extern/lzma/Types.h
vendored
Normal file
208
extern/lzma/Types.h
vendored
Normal file
@ -0,0 +1,208 @@
|
|||||||
|
/* Types.h -- Basic types
|
||||||
|
2008-11-23 : Igor Pavlov : Public domain */
|
||||||
|
|
||||||
|
#ifndef __7Z_TYPES_H
|
||||||
|
#define __7Z_TYPES_H
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define SZ_OK 0
|
||||||
|
|
||||||
|
#define SZ_ERROR_DATA 1
|
||||||
|
#define SZ_ERROR_MEM 2
|
||||||
|
#define SZ_ERROR_CRC 3
|
||||||
|
#define SZ_ERROR_UNSUPPORTED 4
|
||||||
|
#define SZ_ERROR_PARAM 5
|
||||||
|
#define SZ_ERROR_INPUT_EOF 6
|
||||||
|
#define SZ_ERROR_OUTPUT_EOF 7
|
||||||
|
#define SZ_ERROR_READ 8
|
||||||
|
#define SZ_ERROR_WRITE 9
|
||||||
|
#define SZ_ERROR_PROGRESS 10
|
||||||
|
#define SZ_ERROR_FAIL 11
|
||||||
|
#define SZ_ERROR_THREAD 12
|
||||||
|
|
||||||
|
#define SZ_ERROR_ARCHIVE 16
|
||||||
|
#define SZ_ERROR_NO_ARCHIVE 17
|
||||||
|
|
||||||
|
typedef int SRes;
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
typedef DWORD WRes;
|
||||||
|
#else
|
||||||
|
typedef int WRes;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef RINOK
|
||||||
|
#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef unsigned char Byte;
|
||||||
|
typedef short Int16;
|
||||||
|
typedef unsigned short UInt16;
|
||||||
|
|
||||||
|
#ifdef _LZMA_UINT32_IS_ULONG
|
||||||
|
typedef long Int32;
|
||||||
|
typedef unsigned long UInt32;
|
||||||
|
#else
|
||||||
|
typedef int Int32;
|
||||||
|
typedef unsigned int UInt32;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _SZ_NO_INT_64
|
||||||
|
|
||||||
|
/* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers.
|
||||||
|
NOTES: Some code will work incorrectly in that case! */
|
||||||
|
|
||||||
|
typedef long Int64;
|
||||||
|
typedef unsigned long UInt64;
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) || defined(__BORLANDC__)
|
||||||
|
typedef __int64 Int64;
|
||||||
|
typedef unsigned __int64 UInt64;
|
||||||
|
#else
|
||||||
|
typedef long long int Int64;
|
||||||
|
typedef unsigned long long int UInt64;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef _LZMA_NO_SYSTEM_SIZE_T
|
||||||
|
typedef UInt32 SizeT;
|
||||||
|
#else
|
||||||
|
typedef size_t SizeT;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
typedef int Bool;
|
||||||
|
#define True 1
|
||||||
|
#define False 0
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
#if _MSC_VER >= 1300
|
||||||
|
#define MY_NO_INLINE __declspec(noinline)
|
||||||
|
#else
|
||||||
|
#define MY_NO_INLINE
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define MY_CDECL __cdecl
|
||||||
|
#define MY_STD_CALL __stdcall
|
||||||
|
#define MY_FAST_CALL MY_NO_INLINE __fastcall
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define MY_CDECL
|
||||||
|
#define MY_STD_CALL
|
||||||
|
#define MY_FAST_CALL
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/* The following interfaces use first parameter as pointer to structure */
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SRes (*Read)(void *p, void *buf, size_t *size);
|
||||||
|
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
||||||
|
(output(*size) < input(*size)) is allowed */
|
||||||
|
} ISeqInStream;
|
||||||
|
|
||||||
|
/* it can return SZ_ERROR_INPUT_EOF */
|
||||||
|
SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size);
|
||||||
|
SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType);
|
||||||
|
SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
size_t (*Write)(void *p, const void *buf, size_t size);
|
||||||
|
/* Returns: result - the number of actually written bytes.
|
||||||
|
(result < size) means error */
|
||||||
|
} ISeqOutStream;
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
SZ_SEEK_SET = 0,
|
||||||
|
SZ_SEEK_CUR = 1,
|
||||||
|
SZ_SEEK_END = 2
|
||||||
|
} ESzSeek;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */
|
||||||
|
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
|
||||||
|
} ISeekInStream;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SRes (*Look)(void *p, void **buf, size_t *size);
|
||||||
|
/* if (input(*size) != 0 && output(*size) == 0) means end_of_stream.
|
||||||
|
(output(*size) > input(*size)) is not allowed
|
||||||
|
(output(*size) < input(*size)) is allowed */
|
||||||
|
SRes (*Skip)(void *p, size_t offset);
|
||||||
|
/* offset must be <= output(*size) of Look */
|
||||||
|
|
||||||
|
SRes (*Read)(void *p, void *buf, size_t *size);
|
||||||
|
/* reads directly (without buffer). It's same as ISeqInStream::Read */
|
||||||
|
SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin);
|
||||||
|
} ILookInStream;
|
||||||
|
|
||||||
|
SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size);
|
||||||
|
SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset);
|
||||||
|
|
||||||
|
/* reads via ILookInStream::Read */
|
||||||
|
SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType);
|
||||||
|
SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size);
|
||||||
|
|
||||||
|
#define LookToRead_BUF_SIZE (1 << 14)
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ILookInStream s;
|
||||||
|
ISeekInStream *realStream;
|
||||||
|
size_t pos;
|
||||||
|
size_t size;
|
||||||
|
Byte buf[LookToRead_BUF_SIZE];
|
||||||
|
} CLookToRead;
|
||||||
|
|
||||||
|
void LookToRead_CreateVTable(CLookToRead *p, int lookahead);
|
||||||
|
void LookToRead_Init(CLookToRead *p);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ISeqInStream s;
|
||||||
|
ILookInStream *realStream;
|
||||||
|
} CSecToLook;
|
||||||
|
|
||||||
|
void SecToLook_CreateVTable(CSecToLook *p);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
ISeqInStream s;
|
||||||
|
ILookInStream *realStream;
|
||||||
|
} CSecToRead;
|
||||||
|
|
||||||
|
void SecToRead_CreateVTable(CSecToRead *p);
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize);
|
||||||
|
/* Returns: result. (result != SZ_OK) means break.
|
||||||
|
Value (UInt64)(Int64)-1 for size means unknown value. */
|
||||||
|
} ICompressProgress;
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
void *(*Alloc)(void *p, size_t size);
|
||||||
|
void (*Free)(void *p, void *address); /* address can be 0 */
|
||||||
|
} ISzAlloc;
|
||||||
|
|
||||||
|
#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
|
||||||
|
#define IAlloc_Free(p, a) (p)->Free((p), a)
|
||||||
|
|
||||||
|
#endif
|
236
extern/lzma/history.txt
vendored
Normal file
236
extern/lzma/history.txt
vendored
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
HISTORY of the LZMA SDK
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
4.65 2009-02-03
|
||||||
|
-------------------------
|
||||||
|
- Some minor fixes
|
||||||
|
|
||||||
|
|
||||||
|
4.63 2008-12-31
|
||||||
|
-------------------------
|
||||||
|
- Some minor fixes
|
||||||
|
|
||||||
|
|
||||||
|
4.61 beta 2008-11-23
|
||||||
|
-------------------------
|
||||||
|
- The bug in ANSI-C LZMA Decoder was fixed:
|
||||||
|
If encoded stream was corrupted, decoder could access memory
|
||||||
|
outside of allocated range.
|
||||||
|
- Some changes in ANSI-C 7z Decoder interfaces.
|
||||||
|
- LZMA SDK is placed in the public domain.
|
||||||
|
|
||||||
|
|
||||||
|
4.60 beta 2008-08-19
|
||||||
|
-------------------------
|
||||||
|
- Some minor fixes.
|
||||||
|
|
||||||
|
|
||||||
|
4.59 beta 2008-08-13
|
||||||
|
-------------------------
|
||||||
|
- The bug was fixed:
|
||||||
|
LZMA Encoder in fast compression mode could access memory outside of
|
||||||
|
allocated range in some rare cases.
|
||||||
|
|
||||||
|
|
||||||
|
4.58 beta 2008-05-05
|
||||||
|
-------------------------
|
||||||
|
- ANSI-C LZMA Decoder was rewritten for speed optimizations.
|
||||||
|
- ANSI-C LZMA Encoder was included to LZMA SDK.
|
||||||
|
- C++ LZMA code now is just wrapper over ANSI-C code.
|
||||||
|
|
||||||
|
|
||||||
|
4.57 2007-12-12
|
||||||
|
-------------------------
|
||||||
|
- Speed optimizations in Ñ++ LZMA Decoder.
|
||||||
|
- Small changes for more compatibility with some C/C++ compilers.
|
||||||
|
|
||||||
|
|
||||||
|
4.49 beta 2007-07-05
|
||||||
|
-------------------------
|
||||||
|
- .7z ANSI-C Decoder:
|
||||||
|
- now it supports BCJ and BCJ2 filters
|
||||||
|
- now it supports files larger than 4 GB.
|
||||||
|
- now it supports "Last Write Time" field for files.
|
||||||
|
- C++ code for .7z archives compressing/decompressing from 7-zip
|
||||||
|
was included to LZMA SDK.
|
||||||
|
|
||||||
|
|
||||||
|
4.43 2006-06-04
|
||||||
|
-------------------------
|
||||||
|
- Small changes for more compatibility with some C/C++ compilers.
|
||||||
|
|
||||||
|
|
||||||
|
4.42 2006-05-15
|
||||||
|
-------------------------
|
||||||
|
- Small changes in .h files in ANSI-C version.
|
||||||
|
|
||||||
|
|
||||||
|
4.39 beta 2006-04-14
|
||||||
|
-------------------------
|
||||||
|
- The bug in versions 4.33b:4.38b was fixed:
|
||||||
|
C++ version of LZMA encoder could not correctly compress
|
||||||
|
files larger than 2 GB with HC4 match finder (-mfhc4).
|
||||||
|
|
||||||
|
|
||||||
|
4.37 beta 2005-04-06
|
||||||
|
-------------------------
|
||||||
|
- Fixes in C++ code: code could no be compiled if _NO_EXCEPTIONS was defined.
|
||||||
|
|
||||||
|
|
||||||
|
4.35 beta 2005-03-02
|
||||||
|
-------------------------
|
||||||
|
- The bug was fixed in C++ version of LZMA Decoder:
|
||||||
|
If encoded stream was corrupted, decoder could access memory
|
||||||
|
outside of allocated range.
|
||||||
|
|
||||||
|
|
||||||
|
4.34 beta 2006-02-27
|
||||||
|
-------------------------
|
||||||
|
- Compressing speed and memory requirements for compressing were increased
|
||||||
|
- LZMA now can use only these match finders: HC4, BT2, BT3, BT4
|
||||||
|
|
||||||
|
|
||||||
|
4.32 2005-12-09
|
||||||
|
-------------------------
|
||||||
|
- Java version of LZMA SDK was included
|
||||||
|
|
||||||
|
|
||||||
|
4.30 2005-11-20
|
||||||
|
-------------------------
|
||||||
|
- Compression ratio was improved in -a2 mode
|
||||||
|
- Speed optimizations for compressing in -a2 mode
|
||||||
|
- -fb switch now supports values up to 273
|
||||||
|
- The bug in 7z_C (7zIn.c) was fixed:
|
||||||
|
It used Alloc/Free functions from different memory pools.
|
||||||
|
So if program used two memory pools, it worked incorrectly.
|
||||||
|
- 7z_C: .7z format supporting was improved
|
||||||
|
- LZMA# SDK (C#.NET version) was included
|
||||||
|
|
||||||
|
|
||||||
|
4.27 (Updated) 2005-09-21
|
||||||
|
-------------------------
|
||||||
|
- Some GUIDs/interfaces in C++ were changed.
|
||||||
|
IStream.h:
|
||||||
|
ISequentialInStream::Read now works as old ReadPart
|
||||||
|
ISequentialOutStream::Write now works as old WritePart
|
||||||
|
|
||||||
|
|
||||||
|
4.27 2005-08-07
|
||||||
|
-------------------------
|
||||||
|
- The bug in LzmaDecodeSize.c was fixed:
|
||||||
|
if _LZMA_IN_CB and _LZMA_OUT_READ were defined,
|
||||||
|
decompressing worked incorrectly.
|
||||||
|
|
||||||
|
|
||||||
|
4.26 2005-08-05
|
||||||
|
-------------------------
|
||||||
|
- Fixes in 7z_C code and LzmaTest.c:
|
||||||
|
previous versions could work incorrectly,
|
||||||
|
if malloc(0) returns 0
|
||||||
|
|
||||||
|
|
||||||
|
4.23 2005-06-29
|
||||||
|
-------------------------
|
||||||
|
- Small fixes in C++ code
|
||||||
|
|
||||||
|
|
||||||
|
4.22 2005-06-10
|
||||||
|
-------------------------
|
||||||
|
- Small fixes
|
||||||
|
|
||||||
|
|
||||||
|
4.21 2005-06-08
|
||||||
|
-------------------------
|
||||||
|
- Interfaces for ANSI-C LZMA Decoder (LzmaDecode.c) were changed
|
||||||
|
- New additional version of ANSI-C LZMA Decoder with zlib-like interface:
|
||||||
|
- LzmaStateDecode.h
|
||||||
|
- LzmaStateDecode.c
|
||||||
|
- LzmaStateTest.c
|
||||||
|
- ANSI-C LZMA Decoder now can decompress files larger than 4 GB
|
||||||
|
|
||||||
|
|
||||||
|
4.17 2005-04-18
|
||||||
|
-------------------------
|
||||||
|
- New example for RAM->RAM compressing/decompressing:
|
||||||
|
LZMA + BCJ (filter for x86 code):
|
||||||
|
- LzmaRam.h
|
||||||
|
- LzmaRam.cpp
|
||||||
|
- LzmaRamDecode.h
|
||||||
|
- LzmaRamDecode.c
|
||||||
|
- -f86 switch for lzma.exe
|
||||||
|
|
||||||
|
|
||||||
|
4.16 2005-03-29
|
||||||
|
-------------------------
|
||||||
|
- The bug was fixed in LzmaDecode.c (ANSI-C LZMA Decoder):
|
||||||
|
If _LZMA_OUT_READ was defined, and if encoded stream was corrupted,
|
||||||
|
decoder could access memory outside of allocated range.
|
||||||
|
- Speed optimization of ANSI-C LZMA Decoder (now it's about 20% faster).
|
||||||
|
Old version of LZMA Decoder now is in file LzmaDecodeSize.c.
|
||||||
|
LzmaDecodeSize.c can provide slightly smaller code than LzmaDecode.c
|
||||||
|
- Small speed optimization in LZMA C++ code
|
||||||
|
- filter for SPARC's code was added
|
||||||
|
- Simplified version of .7z ANSI-C Decoder was included
|
||||||
|
|
||||||
|
|
||||||
|
4.06 2004-09-05
|
||||||
|
-------------------------
|
||||||
|
- The bug in v4.05 was fixed:
|
||||||
|
LZMA-Encoder didn't release output stream in some cases.
|
||||||
|
|
||||||
|
|
||||||
|
4.05 2004-08-25
|
||||||
|
-------------------------
|
||||||
|
- Source code of filters for x86, IA-64, ARM, ARM-Thumb
|
||||||
|
and PowerPC code was included to SDK
|
||||||
|
- Some internal minor changes
|
||||||
|
|
||||||
|
|
||||||
|
4.04 2004-07-28
|
||||||
|
-------------------------
|
||||||
|
- More compatibility with some C++ compilers
|
||||||
|
|
||||||
|
|
||||||
|
4.03 2004-06-18
|
||||||
|
-------------------------
|
||||||
|
- "Benchmark" command was added. It measures compressing
|
||||||
|
and decompressing speed and shows rating values.
|
||||||
|
Also it checks hardware errors.
|
||||||
|
|
||||||
|
|
||||||
|
4.02 2004-06-10
|
||||||
|
-------------------------
|
||||||
|
- C++ LZMA Encoder/Decoder code now is more portable
|
||||||
|
and it can be compiled by GCC on Linux.
|
||||||
|
|
||||||
|
|
||||||
|
4.01 2004-02-15
|
||||||
|
-------------------------
|
||||||
|
- Some detection of data corruption was enabled.
|
||||||
|
LzmaDecode.c / RangeDecoderReadByte
|
||||||
|
.....
|
||||||
|
{
|
||||||
|
rd->ExtraBytes = 1;
|
||||||
|
return 0xFF;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
4.00 2004-02-13
|
||||||
|
-------------------------
|
||||||
|
- Original version of LZMA SDK
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
HISTORY of the LZMA
|
||||||
|
-------------------
|
||||||
|
2001-2008: Improvements to LZMA compressing/decompressing code,
|
||||||
|
keeping compatibility with original LZMA format
|
||||||
|
1996-2001: Development of LZMA compression format
|
||||||
|
|
||||||
|
Some milestones:
|
||||||
|
|
||||||
|
2001-08-30: LZMA compression was added to 7-Zip
|
||||||
|
1999-01-02: First version of 7-Zip was released
|
||||||
|
|
||||||
|
|
||||||
|
End of document
|
594
extern/lzma/lzma.txt
vendored
Normal file
594
extern/lzma/lzma.txt
vendored
Normal file
@ -0,0 +1,594 @@
|
|||||||
|
LZMA SDK 4.65
|
||||||
|
-------------
|
||||||
|
|
||||||
|
LZMA SDK provides the documentation, samples, header files, libraries,
|
||||||
|
and tools you need to develop applications that use LZMA compression.
|
||||||
|
|
||||||
|
LZMA is default and general compression method of 7z format
|
||||||
|
in 7-Zip compression program (www.7-zip.org). LZMA provides high
|
||||||
|
compression ratio and very fast decompression.
|
||||||
|
|
||||||
|
LZMA is an improved version of famous LZ77 compression algorithm.
|
||||||
|
It was improved in way of maximum increasing of compression ratio,
|
||||||
|
keeping high decompression speed and low memory requirements for
|
||||||
|
decompressing.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LICENSE
|
||||||
|
-------
|
||||||
|
|
||||||
|
LZMA SDK is written and placed in the public domain by Igor Pavlov.
|
||||||
|
|
||||||
|
|
||||||
|
LZMA SDK Contents
|
||||||
|
-----------------
|
||||||
|
|
||||||
|
LZMA SDK includes:
|
||||||
|
|
||||||
|
- ANSI-C/C++/C#/Java source code for LZMA compressing and decompressing
|
||||||
|
- Compiled file->file LZMA compressing/decompressing program for Windows system
|
||||||
|
|
||||||
|
|
||||||
|
UNIX/Linux version
|
||||||
|
------------------
|
||||||
|
To compile C++ version of file->file LZMA encoding, go to directory
|
||||||
|
C++/7zip/Compress/LZMA_Alone
|
||||||
|
and call make to recompile it:
|
||||||
|
make -f makefile.gcc clean all
|
||||||
|
|
||||||
|
In some UNIX/Linux versions you must compile LZMA with static libraries.
|
||||||
|
To compile with static libraries, you can use
|
||||||
|
LIB = -lm -static
|
||||||
|
|
||||||
|
|
||||||
|
Files
|
||||||
|
---------------------
|
||||||
|
lzma.txt - LZMA SDK description (this file)
|
||||||
|
7zFormat.txt - 7z Format description
|
||||||
|
7zC.txt - 7z ANSI-C Decoder description
|
||||||
|
methods.txt - Compression method IDs for .7z
|
||||||
|
lzma.exe - Compiled file->file LZMA encoder/decoder for Windows
|
||||||
|
history.txt - history of the LZMA SDK
|
||||||
|
|
||||||
|
|
||||||
|
Source code structure
|
||||||
|
---------------------
|
||||||
|
|
||||||
|
C/ - C files
|
||||||
|
7zCrc*.* - CRC code
|
||||||
|
Alloc.* - Memory allocation functions
|
||||||
|
Bra*.* - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
|
||||||
|
LzFind.* - Match finder for LZ (LZMA) encoders
|
||||||
|
LzFindMt.* - Match finder for LZ (LZMA) encoders for multithreading encoding
|
||||||
|
LzHash.h - Additional file for LZ match finder
|
||||||
|
LzmaDec.* - LZMA decoding
|
||||||
|
LzmaEnc.* - LZMA encoding
|
||||||
|
LzmaLib.* - LZMA Library for DLL calling
|
||||||
|
Types.h - Basic types for another .c files
|
||||||
|
Threads.* - The code for multithreading.
|
||||||
|
|
||||||
|
LzmaLib - LZMA Library (.DLL for Windows)
|
||||||
|
|
||||||
|
LzmaUtil - LZMA Utility (file->file LZMA encoder/decoder).
|
||||||
|
|
||||||
|
Archive - files related to archiving
|
||||||
|
7z - 7z ANSI-C Decoder
|
||||||
|
|
||||||
|
CPP/ -- CPP files
|
||||||
|
|
||||||
|
Common - common files for C++ projects
|
||||||
|
Windows - common files for Windows related code
|
||||||
|
|
||||||
|
7zip - files related to 7-Zip Project
|
||||||
|
|
||||||
|
Common - common files for 7-Zip
|
||||||
|
|
||||||
|
Compress - files related to compression/decompression
|
||||||
|
|
||||||
|
Copy - Copy coder
|
||||||
|
RangeCoder - Range Coder (special code of compression/decompression)
|
||||||
|
LZMA - LZMA compression/decompression on C++
|
||||||
|
LZMA_Alone - file->file LZMA compression/decompression
|
||||||
|
Branch - Filters for x86, IA-64, ARM, ARM-Thumb, PowerPC and SPARC code
|
||||||
|
|
||||||
|
Archive - files related to archiving
|
||||||
|
|
||||||
|
Common - common files for archive handling
|
||||||
|
7z - 7z C++ Encoder/Decoder
|
||||||
|
|
||||||
|
Bundles - Modules that are bundles of other modules
|
||||||
|
|
||||||
|
Alone7z - 7zr.exe: Standalone version of 7z.exe that supports only 7z/LZMA/BCJ/BCJ2
|
||||||
|
Format7zR - 7zr.dll: Reduced version of 7za.dll: extracting/compressing to 7z/LZMA/BCJ/BCJ2
|
||||||
|
Format7zExtractR - 7zxr.dll: Reduced version of 7zxa.dll: extracting from 7z/LZMA/BCJ/BCJ2.
|
||||||
|
|
||||||
|
UI - User Interface files
|
||||||
|
|
||||||
|
Client7z - Test application for 7za.dll, 7zr.dll, 7zxr.dll
|
||||||
|
Common - Common UI files
|
||||||
|
Console - Code for console archiver
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
CS/ - C# files
|
||||||
|
7zip
|
||||||
|
Common - some common files for 7-Zip
|
||||||
|
Compress - files related to compression/decompression
|
||||||
|
LZ - files related to LZ (Lempel-Ziv) compression algorithm
|
||||||
|
LZMA - LZMA compression/decompression
|
||||||
|
LzmaAlone - file->file LZMA compression/decompression
|
||||||
|
RangeCoder - Range Coder (special code of compression/decompression)
|
||||||
|
|
||||||
|
Java/ - Java files
|
||||||
|
SevenZip
|
||||||
|
Compression - files related to compression/decompression
|
||||||
|
LZ - files related to LZ (Lempel-Ziv) compression algorithm
|
||||||
|
LZMA - LZMA compression/decompression
|
||||||
|
RangeCoder - Range Coder (special code of compression/decompression)
|
||||||
|
|
||||||
|
|
||||||
|
C/C++ source code of LZMA SDK is part of 7-Zip project.
|
||||||
|
7-Zip source code can be downloaded from 7-Zip's SourceForge page:
|
||||||
|
|
||||||
|
http://sourceforge.net/projects/sevenzip/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LZMA features
|
||||||
|
-------------
|
||||||
|
- Variable dictionary size (up to 1 GB)
|
||||||
|
- Estimated compressing speed: about 2 MB/s on 2 GHz CPU
|
||||||
|
- Estimated decompressing speed:
|
||||||
|
- 20-30 MB/s on 2 GHz Core 2 or AMD Athlon 64
|
||||||
|
- 1-2 MB/s on 200 MHz ARM, MIPS, PowerPC or other simple RISC
|
||||||
|
- Small memory requirements for decompressing (16 KB + DictionarySize)
|
||||||
|
- Small code size for decompressing: 5-8 KB
|
||||||
|
|
||||||
|
LZMA decoder uses only integer operations and can be
|
||||||
|
implemented in any modern 32-bit CPU (or on 16-bit CPU with some conditions).
|
||||||
|
|
||||||
|
Some critical operations that affect the speed of LZMA decompression:
|
||||||
|
1) 32*16 bit integer multiply
|
||||||
|
2) Misspredicted branches (penalty mostly depends from pipeline length)
|
||||||
|
3) 32-bit shift and arithmetic operations
|
||||||
|
|
||||||
|
The speed of LZMA decompressing mostly depends from CPU speed.
|
||||||
|
Memory speed has no big meaning. But if your CPU has small data cache,
|
||||||
|
overall weight of memory speed will slightly increase.
|
||||||
|
|
||||||
|
|
||||||
|
How To Use
|
||||||
|
----------
|
||||||
|
|
||||||
|
Using LZMA encoder/decoder executable
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
Usage: LZMA <e|d> inputFile outputFile [<switches>...]
|
||||||
|
|
||||||
|
e: encode file
|
||||||
|
|
||||||
|
d: decode file
|
||||||
|
|
||||||
|
b: Benchmark. There are two tests: compressing and decompressing
|
||||||
|
with LZMA method. Benchmark shows rating in MIPS (million
|
||||||
|
instructions per second). Rating value is calculated from
|
||||||
|
measured speed and it is normalized with Intel's Core 2 results.
|
||||||
|
Also Benchmark checks possible hardware errors (RAM
|
||||||
|
errors in most cases). Benchmark uses these settings:
|
||||||
|
(-a1, -d21, -fb32, -mfbt4). You can change only -d parameter.
|
||||||
|
Also you can change the number of iterations. Example for 30 iterations:
|
||||||
|
LZMA b 30
|
||||||
|
Default number of iterations is 10.
|
||||||
|
|
||||||
|
<Switches>
|
||||||
|
|
||||||
|
|
||||||
|
-a{N}: set compression mode 0 = fast, 1 = normal
|
||||||
|
default: 1 (normal)
|
||||||
|
|
||||||
|
d{N}: Sets Dictionary size - [0, 30], default: 23 (8MB)
|
||||||
|
The maximum value for dictionary size is 1 GB = 2^30 bytes.
|
||||||
|
Dictionary size is calculated as DictionarySize = 2^N bytes.
|
||||||
|
For decompressing file compressed by LZMA method with dictionary
|
||||||
|
size D = 2^N you need about D bytes of memory (RAM).
|
||||||
|
|
||||||
|
-fb{N}: set number of fast bytes - [5, 273], default: 128
|
||||||
|
Usually big number gives a little bit better compression ratio
|
||||||
|
and slower compression process.
|
||||||
|
|
||||||
|
-lc{N}: set number of literal context bits - [0, 8], default: 3
|
||||||
|
Sometimes lc=4 gives gain for big files.
|
||||||
|
|
||||||
|
-lp{N}: set number of literal pos bits - [0, 4], default: 0
|
||||||
|
lp switch is intended for periodical data when period is
|
||||||
|
equal 2^N. For example, for 32-bit (4 bytes)
|
||||||
|
periodical data you can use lp=2. Often it's better to set lc0,
|
||||||
|
if you change lp switch.
|
||||||
|
|
||||||
|
-pb{N}: set number of pos bits - [0, 4], default: 2
|
||||||
|
pb switch is intended for periodical data
|
||||||
|
when period is equal 2^N.
|
||||||
|
|
||||||
|
-mf{MF_ID}: set Match Finder. Default: bt4.
|
||||||
|
Algorithms from hc* group doesn't provide good compression
|
||||||
|
ratio, but they often works pretty fast in combination with
|
||||||
|
fast mode (-a0).
|
||||||
|
|
||||||
|
Memory requirements depend from dictionary size
|
||||||
|
(parameter "d" in table below).
|
||||||
|
|
||||||
|
MF_ID Memory Description
|
||||||
|
|
||||||
|
bt2 d * 9.5 + 4MB Binary Tree with 2 bytes hashing.
|
||||||
|
bt3 d * 11.5 + 4MB Binary Tree with 3 bytes hashing.
|
||||||
|
bt4 d * 11.5 + 4MB Binary Tree with 4 bytes hashing.
|
||||||
|
hc4 d * 7.5 + 4MB Hash Chain with 4 bytes hashing.
|
||||||
|
|
||||||
|
-eos: write End Of Stream marker. By default LZMA doesn't write
|
||||||
|
eos marker, since LZMA decoder knows uncompressed size
|
||||||
|
stored in .lzma file header.
|
||||||
|
|
||||||
|
-si: Read data from stdin (it will write End Of Stream marker).
|
||||||
|
-so: Write data to stdout
|
||||||
|
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
|
||||||
|
1) LZMA e file.bin file.lzma -d16 -lc0
|
||||||
|
|
||||||
|
compresses file.bin to file.lzma with 64 KB dictionary (2^16=64K)
|
||||||
|
and 0 literal context bits. -lc0 allows to reduce memory requirements
|
||||||
|
for decompression.
|
||||||
|
|
||||||
|
|
||||||
|
2) LZMA e file.bin file.lzma -lc0 -lp2
|
||||||
|
|
||||||
|
compresses file.bin to file.lzma with settings suitable
|
||||||
|
for 32-bit periodical data (for example, ARM or MIPS code).
|
||||||
|
|
||||||
|
3) LZMA d file.lzma file.bin
|
||||||
|
|
||||||
|
decompresses file.lzma to file.bin.
|
||||||
|
|
||||||
|
|
||||||
|
Compression ratio hints
|
||||||
|
-----------------------
|
||||||
|
|
||||||
|
Recommendations
|
||||||
|
---------------
|
||||||
|
|
||||||
|
To increase the compression ratio for LZMA compressing it's desirable
|
||||||
|
to have aligned data (if it's possible) and also it's desirable to locate
|
||||||
|
data in such order, where code is grouped in one place and data is
|
||||||
|
grouped in other place (it's better than such mixing: code, data, code,
|
||||||
|
data, ...).
|
||||||
|
|
||||||
|
|
||||||
|
Filters
|
||||||
|
-------
|
||||||
|
You can increase the compression ratio for some data types, using
|
||||||
|
special filters before compressing. For example, it's possible to
|
||||||
|
increase the compression ratio on 5-10% for code for those CPU ISAs:
|
||||||
|
x86, IA-64, ARM, ARM-Thumb, PowerPC, SPARC.
|
||||||
|
|
||||||
|
You can find C source code of such filters in C/Bra*.* files
|
||||||
|
|
||||||
|
You can check the compression ratio gain of these filters with such
|
||||||
|
7-Zip commands (example for ARM code):
|
||||||
|
No filter:
|
||||||
|
7z a a1.7z a.bin -m0=lzma
|
||||||
|
|
||||||
|
With filter for little-endian ARM code:
|
||||||
|
7z a a2.7z a.bin -m0=arm -m1=lzma
|
||||||
|
|
||||||
|
It works in such manner:
|
||||||
|
Compressing = Filter_encoding + LZMA_encoding
|
||||||
|
Decompressing = LZMA_decoding + Filter_decoding
|
||||||
|
|
||||||
|
Compressing and decompressing speed of such filters is very high,
|
||||||
|
so it will not increase decompressing time too much.
|
||||||
|
Moreover, it reduces decompression time for LZMA_decoding,
|
||||||
|
since compression ratio with filtering is higher.
|
||||||
|
|
||||||
|
These filters convert CALL (calling procedure) instructions
|
||||||
|
from relative offsets to absolute addresses, so such data becomes more
|
||||||
|
compressible.
|
||||||
|
|
||||||
|
For some ISAs (for example, for MIPS) it's impossible to get gain from such filter.
|
||||||
|
|
||||||
|
|
||||||
|
LZMA compressed file format
|
||||||
|
---------------------------
|
||||||
|
Offset Size Description
|
||||||
|
0 1 Special LZMA properties (lc,lp, pb in encoded form)
|
||||||
|
1 4 Dictionary size (little endian)
|
||||||
|
5 8 Uncompressed size (little endian). -1 means unknown size
|
||||||
|
13 Compressed data
|
||||||
|
|
||||||
|
|
||||||
|
ANSI-C LZMA Decoder
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
Please note that interfaces for ANSI-C code were changed in LZMA SDK 4.58.
|
||||||
|
If you want to use old interfaces you can download previous version of LZMA SDK
|
||||||
|
from sourceforge.net site.
|
||||||
|
|
||||||
|
To use ANSI-C LZMA Decoder you need the following files:
|
||||||
|
1) LzmaDec.h + LzmaDec.c + Types.h
|
||||||
|
LzmaUtil/LzmaUtil.c is example application that uses these files.
|
||||||
|
|
||||||
|
|
||||||
|
Memory requirements for LZMA decoding
|
||||||
|
-------------------------------------
|
||||||
|
|
||||||
|
Stack usage of LZMA decoding function for local variables is not
|
||||||
|
larger than 200-400 bytes.
|
||||||
|
|
||||||
|
LZMA Decoder uses dictionary buffer and internal state structure.
|
||||||
|
Internal state structure consumes
|
||||||
|
state_size = (4 + (1.5 << (lc + lp))) KB
|
||||||
|
by default (lc=3, lp=0), state_size = 16 KB.
|
||||||
|
|
||||||
|
|
||||||
|
How To decompress data
|
||||||
|
----------------------
|
||||||
|
|
||||||
|
LZMA Decoder (ANSI-C version) now supports 2 interfaces:
|
||||||
|
1) Single-call Decompressing
|
||||||
|
2) Multi-call State Decompressing (zlib-like interface)
|
||||||
|
|
||||||
|
You must use external allocator:
|
||||||
|
Example:
|
||||||
|
void *SzAlloc(void *p, size_t size) { p = p; return malloc(size); }
|
||||||
|
void SzFree(void *p, void *address) { p = p; free(address); }
|
||||||
|
ISzAlloc alloc = { SzAlloc, SzFree };
|
||||||
|
|
||||||
|
You can use p = p; operator to disable compiler warnings.
|
||||||
|
|
||||||
|
|
||||||
|
Single-call Decompressing
|
||||||
|
-------------------------
|
||||||
|
When to use: RAM->RAM decompressing
|
||||||
|
Compile files: LzmaDec.h + LzmaDec.c + Types.h
|
||||||
|
Compile defines: no defines
|
||||||
|
Memory Requirements:
|
||||||
|
- Input buffer: compressed size
|
||||||
|
- Output buffer: uncompressed size
|
||||||
|
- LZMA Internal Structures: state_size (16 KB for default settings)
|
||||||
|
|
||||||
|
Interface:
|
||||||
|
int LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
|
||||||
|
const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
|
||||||
|
ELzmaStatus *status, ISzAlloc *alloc);
|
||||||
|
In:
|
||||||
|
dest - output data
|
||||||
|
destLen - output data size
|
||||||
|
src - input data
|
||||||
|
srcLen - input data size
|
||||||
|
propData - LZMA properties (5 bytes)
|
||||||
|
propSize - size of propData buffer (5 bytes)
|
||||||
|
finishMode - It has meaning only if the decoding reaches output limit (*destLen).
|
||||||
|
LZMA_FINISH_ANY - Decode just destLen bytes.
|
||||||
|
LZMA_FINISH_END - Stream must be finished after (*destLen).
|
||||||
|
You can use LZMA_FINISH_END, when you know that
|
||||||
|
current output buffer covers last bytes of stream.
|
||||||
|
alloc - Memory allocator.
|
||||||
|
|
||||||
|
Out:
|
||||||
|
destLen - processed output size
|
||||||
|
srcLen - processed input size
|
||||||
|
|
||||||
|
Output:
|
||||||
|
SZ_OK
|
||||||
|
status:
|
||||||
|
LZMA_STATUS_FINISHED_WITH_MARK
|
||||||
|
LZMA_STATUS_NOT_FINISHED
|
||||||
|
LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
|
||||||
|
SZ_ERROR_DATA - Data error
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_UNSUPPORTED - Unsupported properties
|
||||||
|
SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
|
||||||
|
|
||||||
|
If LZMA decoder sees end_marker before reaching output limit, it returns OK result,
|
||||||
|
and output value of destLen will be less than output buffer size limit.
|
||||||
|
|
||||||
|
You can use multiple checks to test data integrity after full decompression:
|
||||||
|
1) Check Result and "status" variable.
|
||||||
|
2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
|
||||||
|
3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
|
||||||
|
You must use correct finish mode in that case. */
|
||||||
|
|
||||||
|
|
||||||
|
Multi-call State Decompressing (zlib-like interface)
|
||||||
|
----------------------------------------------------
|
||||||
|
|
||||||
|
When to use: file->file decompressing
|
||||||
|
Compile files: LzmaDec.h + LzmaDec.c + Types.h
|
||||||
|
|
||||||
|
Memory Requirements:
|
||||||
|
- Buffer for input stream: any size (for example, 16 KB)
|
||||||
|
- Buffer for output stream: any size (for example, 16 KB)
|
||||||
|
- LZMA Internal Structures: state_size (16 KB for default settings)
|
||||||
|
- LZMA dictionary (dictionary size is encoded in LZMA properties header)
|
||||||
|
|
||||||
|
1) read LZMA properties (5 bytes) and uncompressed size (8 bytes, little-endian) to header:
|
||||||
|
unsigned char header[LZMA_PROPS_SIZE + 8];
|
||||||
|
ReadFile(inFile, header, sizeof(header)
|
||||||
|
|
||||||
|
2) Allocate CLzmaDec structures (state + dictionary) using LZMA properties
|
||||||
|
|
||||||
|
CLzmaDec state;
|
||||||
|
LzmaDec_Constr(&state);
|
||||||
|
res = LzmaDec_Allocate(&state, header, LZMA_PROPS_SIZE, &g_Alloc);
|
||||||
|
if (res != SZ_OK)
|
||||||
|
return res;
|
||||||
|
|
||||||
|
3) Init LzmaDec structure before any new LZMA stream. And call LzmaDec_DecodeToBuf in loop
|
||||||
|
|
||||||
|
LzmaDec_Init(&state);
|
||||||
|
for (;;)
|
||||||
|
{
|
||||||
|
...
|
||||||
|
int res = LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
|
||||||
|
const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode);
|
||||||
|
...
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
4) Free all allocated structures
|
||||||
|
LzmaDec_Free(&state, &g_Alloc);
|
||||||
|
|
||||||
|
For full code example, look at C/LzmaUtil/LzmaUtil.c code.
|
||||||
|
|
||||||
|
|
||||||
|
How To compress data
|
||||||
|
--------------------
|
||||||
|
|
||||||
|
Compile files: LzmaEnc.h + LzmaEnc.c + Types.h +
|
||||||
|
LzFind.c + LzFind.h + LzFindMt.c + LzFindMt.h + LzHash.h
|
||||||
|
|
||||||
|
Memory Requirements:
|
||||||
|
- (dictSize * 11.5 + 6 MB) + state_size
|
||||||
|
|
||||||
|
Lzma Encoder can use two memory allocators:
|
||||||
|
1) alloc - for small arrays.
|
||||||
|
2) allocBig - for big arrays.
|
||||||
|
|
||||||
|
For example, you can use Large RAM Pages (2 MB) in allocBig allocator for
|
||||||
|
better compression speed. Note that Windows has bad implementation for
|
||||||
|
Large RAM Pages.
|
||||||
|
It's OK to use same allocator for alloc and allocBig.
|
||||||
|
|
||||||
|
|
||||||
|
Single-call Compression with callbacks
|
||||||
|
--------------------------------------
|
||||||
|
|
||||||
|
Check C/LzmaUtil/LzmaUtil.c as example,
|
||||||
|
|
||||||
|
When to use: file->file decompressing
|
||||||
|
|
||||||
|
1) you must implement callback structures for interfaces:
|
||||||
|
ISeqInStream
|
||||||
|
ISeqOutStream
|
||||||
|
ICompressProgress
|
||||||
|
ISzAlloc
|
||||||
|
|
||||||
|
static void *SzAlloc(void *p, size_t size) { p = p; return MyAlloc(size); }
|
||||||
|
static void SzFree(void *p, void *address) { p = p; MyFree(address); }
|
||||||
|
static ISzAlloc g_Alloc = { SzAlloc, SzFree };
|
||||||
|
|
||||||
|
CFileSeqInStream inStream;
|
||||||
|
CFileSeqOutStream outStream;
|
||||||
|
|
||||||
|
inStream.funcTable.Read = MyRead;
|
||||||
|
inStream.file = inFile;
|
||||||
|
outStream.funcTable.Write = MyWrite;
|
||||||
|
outStream.file = outFile;
|
||||||
|
|
||||||
|
|
||||||
|
2) Create CLzmaEncHandle object;
|
||||||
|
|
||||||
|
CLzmaEncHandle enc;
|
||||||
|
|
||||||
|
enc = LzmaEnc_Create(&g_Alloc);
|
||||||
|
if (enc == 0)
|
||||||
|
return SZ_ERROR_MEM;
|
||||||
|
|
||||||
|
|
||||||
|
3) initialize CLzmaEncProps properties;
|
||||||
|
|
||||||
|
LzmaEncProps_Init(&props);
|
||||||
|
|
||||||
|
Then you can change some properties in that structure.
|
||||||
|
|
||||||
|
4) Send LZMA properties to LZMA Encoder
|
||||||
|
|
||||||
|
res = LzmaEnc_SetProps(enc, &props);
|
||||||
|
|
||||||
|
5) Write encoded properties to header
|
||||||
|
|
||||||
|
Byte header[LZMA_PROPS_SIZE + 8];
|
||||||
|
size_t headerSize = LZMA_PROPS_SIZE;
|
||||||
|
UInt64 fileSize;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
res = LzmaEnc_WriteProperties(enc, header, &headerSize);
|
||||||
|
fileSize = MyGetFileLength(inFile);
|
||||||
|
for (i = 0; i < 8; i++)
|
||||||
|
header[headerSize++] = (Byte)(fileSize >> (8 * i));
|
||||||
|
MyWriteFileAndCheck(outFile, header, headerSize)
|
||||||
|
|
||||||
|
6) Call encoding function:
|
||||||
|
res = LzmaEnc_Encode(enc, &outStream.funcTable, &inStream.funcTable,
|
||||||
|
NULL, &g_Alloc, &g_Alloc);
|
||||||
|
|
||||||
|
7) Destroy LZMA Encoder Object
|
||||||
|
LzmaEnc_Destroy(enc, &g_Alloc, &g_Alloc);
|
||||||
|
|
||||||
|
|
||||||
|
If callback function return some error code, LzmaEnc_Encode also returns that code.
|
||||||
|
|
||||||
|
|
||||||
|
Single-call RAM->RAM Compression
|
||||||
|
--------------------------------
|
||||||
|
|
||||||
|
Single-call RAM->RAM Compression is similar to Compression with callbacks,
|
||||||
|
but you provide pointers to buffers instead of pointers to stream callbacks:
|
||||||
|
|
||||||
|
HRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen,
|
||||||
|
CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark,
|
||||||
|
ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig);
|
||||||
|
|
||||||
|
Return code:
|
||||||
|
SZ_OK - OK
|
||||||
|
SZ_ERROR_MEM - Memory allocation error
|
||||||
|
SZ_ERROR_PARAM - Incorrect paramater
|
||||||
|
SZ_ERROR_OUTPUT_EOF - output buffer overflow
|
||||||
|
SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
LZMA Defines
|
||||||
|
------------
|
||||||
|
|
||||||
|
_LZMA_SIZE_OPT - Enable some optimizations in LZMA Decoder to get smaller executable code.
|
||||||
|
|
||||||
|
_LZMA_PROB32 - It can increase the speed on some 32-bit CPUs, but memory usage for
|
||||||
|
some structures will be doubled in that case.
|
||||||
|
|
||||||
|
_LZMA_UINT32_IS_ULONG - Define it if int is 16-bit on your compiler and long is 32-bit.
|
||||||
|
|
||||||
|
_LZMA_NO_SYSTEM_SIZE_T - Define it if you don't want to use size_t type.
|
||||||
|
|
||||||
|
|
||||||
|
C++ LZMA Encoder/Decoder
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
C++ LZMA code use COM-like interfaces. So if you want to use it,
|
||||||
|
you can study basics of COM/OLE.
|
||||||
|
C++ LZMA code is just wrapper over ANSI-C code.
|
||||||
|
|
||||||
|
|
||||||
|
C++ Notes
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
If you use some C++ code folders in 7-Zip (for example, C++ code for .7z handling),
|
||||||
|
you must check that you correctly work with "new" operator.
|
||||||
|
7-Zip can be compiled with MSVC 6.0 that doesn't throw "exception" from "new" operator.
|
||||||
|
So 7-Zip uses "CPP\Common\NewHandler.cpp" that redefines "new" operator:
|
||||||
|
operator new(size_t size)
|
||||||
|
{
|
||||||
|
void *p = ::malloc(size);
|
||||||
|
if (p == 0)
|
||||||
|
throw CNewException();
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
If you use MSCV that throws exception for "new" operator, you can compile without
|
||||||
|
"NewHandler.cpp". So standard exception will be used. Actually some code of
|
||||||
|
7-Zip catches any exception in internal code and converts it to HRESULT code.
|
||||||
|
So you don't need to catch CNewException, if you call COM interfaces of 7-Zip.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
http://www.7-zip.org
|
||||||
|
http://www.7-zip.org/sdk.html
|
||||||
|
http://www.7-zip.org/support.html
|
385
extern/lzma/make/msvc_9_0/lzma.vcproj
vendored
Normal file
385
extern/lzma/make/msvc_9_0/lzma.vcproj
vendored
Normal file
@ -0,0 +1,385 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9,00"
|
||||||
|
Name="EXT_lzma"
|
||||||
|
ProjectGUID="{79D0B232-208C-F208-DA71-79B4AC088602}"
|
||||||
|
RootNamespace="lzma"
|
||||||
|
TargetFrameworkVersion="131072"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Blender Debug|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\debug"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
|
||||||
|
ExceptionHandling="1"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\lzma.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\debug\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzma.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Blender Release|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
|
||||||
|
StringPooling="true"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableFunctionLevelLinking="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\lzma.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="1"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzma.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="3D Plugin Debug|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\lzma.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\debug\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzma.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="3D Plugin Release|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
|
||||||
|
StringPooling="true"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
EnableFunctionLevelLinking="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\lzma.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzma\mtdll\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="1"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzma.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\Alloc.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzFind.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaDec.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaEnc.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaLib.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\Alloc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzFind.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzHash.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaDec.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaEnc.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\LzmaLib.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\Types.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
34
extern/lzo/CMakeLists.txt
vendored
Normal file
34
extern/lzo/CMakeLists.txt
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# $Id$
|
||||||
|
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2006, Blender Foundation
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# The Original Code is: all of this file.
|
||||||
|
#
|
||||||
|
# Contributor(s): Daniel Genrich
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
|
SET(INC include)
|
||||||
|
|
||||||
|
FILE(GLOB SRC minilzo/*.c)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BLENDERLIB(bf_minilzo "${SRC}" "${INC}")
|
||||||
|
#, libtype='blender', priority = 0 )
|
9
extern/lzo/SConscript
vendored
Normal file
9
extern/lzo/SConscript
vendored
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
Import ('env')
|
||||||
|
|
||||||
|
sources = env.Glob('minilzo/*.c')
|
||||||
|
|
||||||
|
defs = ''
|
||||||
|
incs = ' include '
|
||||||
|
|
||||||
|
env.BlenderLib ('bf_minilzo', sources, Split(incs), Split(defs), libtype=['intern'], priority=[40] )
|
353
extern/lzo/make/msvc_9_0/lzo.vcproj
vendored
Normal file
353
extern/lzo/make/msvc_9_0/lzo.vcproj
vendored
Normal file
@ -0,0 +1,353 @@
|
|||||||
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
|
<VisualStudioProject
|
||||||
|
ProjectType="Visual C++"
|
||||||
|
Version="9,00"
|
||||||
|
Name="EXT_lzo"
|
||||||
|
ProjectGUID="{8BFA4082-773B-D100-BC24-659083BA023F}"
|
||||||
|
RootNamespace="lzo"
|
||||||
|
TargetFrameworkVersion="131072"
|
||||||
|
>
|
||||||
|
<Platforms>
|
||||||
|
<Platform
|
||||||
|
Name="Win32"
|
||||||
|
/>
|
||||||
|
</Platforms>
|
||||||
|
<ToolFiles>
|
||||||
|
</ToolFiles>
|
||||||
|
<Configurations>
|
||||||
|
<Configuration
|
||||||
|
Name="Blender Debug|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\debug"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
|
||||||
|
ExceptionHandling="1"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="1"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\lzo.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\debug\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\debug\lzo.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="Blender Release|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
|
||||||
|
StringPooling="true"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
RuntimeLibrary="0"
|
||||||
|
EnableFunctionLevelLinking="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\lzo.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="1"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\lzo.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="3D Plugin Debug|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="0"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="_DEBUG;_LIB;WIN32"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
BasicRuntimeChecks="3"
|
||||||
|
RuntimeLibrary="3"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\lzo.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\debug\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="4"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="_DEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\debug\lzo.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
<Configuration
|
||||||
|
Name="3D Plugin Release|Win32"
|
||||||
|
OutputDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
|
||||||
|
IntermediateDirectory="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll"
|
||||||
|
ConfigurationType="4"
|
||||||
|
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
|
||||||
|
UseOfMFC="0"
|
||||||
|
ATLMinimizesCRunTimeLibraryUsage="false"
|
||||||
|
CharacterSet="2"
|
||||||
|
>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreBuildEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCustomBuildTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXMLDataGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCWebServiceProxyGeneratorTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCMIDLTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCCLCompilerTool"
|
||||||
|
Optimization="2"
|
||||||
|
InlineFunctionExpansion="1"
|
||||||
|
AdditionalIncludeDirectories=""
|
||||||
|
PreprocessorDefinitions="NDEBUG;_LIB;WIN32"
|
||||||
|
StringPooling="true"
|
||||||
|
ExceptionHandling="0"
|
||||||
|
RuntimeLibrary="2"
|
||||||
|
EnableFunctionLevelLinking="true"
|
||||||
|
UsePrecompiledHeader="0"
|
||||||
|
PrecompiledHeaderFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\lzo.pch"
|
||||||
|
AssemblerListingLocation="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
|
||||||
|
ObjectFile="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
|
||||||
|
ProgramDataBaseFileName="..\..\..\..\..\build\msvc_9\extern\lzo\mtdll\"
|
||||||
|
WarningLevel="3"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
DebugInformationFormat="1"
|
||||||
|
CompileAs="0"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCManagedResourceCompilerTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCResourceCompilerTool"
|
||||||
|
PreprocessorDefinitions="NDEBUG"
|
||||||
|
Culture="1033"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPreLinkEventTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCLibrarianTool"
|
||||||
|
OutputFile="..\..\..\..\..\build\msvc_9\libs\extern\mtdll\lzo.lib"
|
||||||
|
SuppressStartupBanner="true"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCALinkTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCXDCMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCBscMakeTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCFxCopTool"
|
||||||
|
/>
|
||||||
|
<Tool
|
||||||
|
Name="VCPostBuildEventTool"
|
||||||
|
/>
|
||||||
|
</Configuration>
|
||||||
|
</Configurations>
|
||||||
|
<References>
|
||||||
|
</References>
|
||||||
|
<Files>
|
||||||
|
<Filter
|
||||||
|
Name="Source Files"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\minilzo\minilzo.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="Header Files"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\minilzo\lzoconf.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\minilzo\lzodefs.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\minilzo\minilzo.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
|
</Files>
|
||||||
|
<Globals>
|
||||||
|
</Globals>
|
||||||
|
</VisualStudioProject>
|
340
extern/lzo/minilzo/COPYING
vendored
Normal file
340
extern/lzo/minilzo/COPYING
vendored
Normal file
@ -0,0 +1,340 @@
|
|||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
Version 2, June 1991
|
||||||
|
|
||||||
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The licenses for most software are designed to take away your
|
||||||
|
freedom to share and change it. By contrast, the GNU General Public
|
||||||
|
License is intended to guarantee your freedom to share and change free
|
||||||
|
software--to make sure the software is free for all its users. This
|
||||||
|
General Public License applies to most of the Free Software
|
||||||
|
Foundation's software and to any other program whose authors commit to
|
||||||
|
using it. (Some other Free Software Foundation software is covered by
|
||||||
|
the GNU Library General Public License instead.) You can apply it to
|
||||||
|
your programs, too.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
this service if you wish), that you receive source code or can get it
|
||||||
|
if you want it, that you can change the software or use pieces of it
|
||||||
|
in new free programs; and that you know you can do these things.
|
||||||
|
|
||||||
|
To protect your rights, we need to make restrictions that forbid
|
||||||
|
anyone to deny you these rights or to ask you to surrender the rights.
|
||||||
|
These restrictions translate to certain responsibilities for you if you
|
||||||
|
distribute copies of the software, or if you modify it.
|
||||||
|
|
||||||
|
For example, if you distribute copies of such a program, whether
|
||||||
|
gratis or for a fee, you must give the recipients all the rights that
|
||||||
|
you have. You must make sure that they, too, receive or can get the
|
||||||
|
source code. And you must show them these terms so they know their
|
||||||
|
rights.
|
||||||
|
|
||||||
|
We protect your rights with two steps: (1) copyright the software, and
|
||||||
|
(2) offer you this license which gives you legal permission to copy,
|
||||||
|
distribute and/or modify the software.
|
||||||
|
|
||||||
|
Also, for each author's protection and ours, we want to make certain
|
||||||
|
that everyone understands that there is no warranty for this free
|
||||||
|
software. If the software is modified by someone else and passed on, we
|
||||||
|
want its recipients to know that what they have is not the original, so
|
||||||
|
that any problems introduced by others will not reflect on the original
|
||||||
|
authors' reputations.
|
||||||
|
|
||||||
|
Finally, any free program is threatened constantly by software
|
||||||
|
patents. We wish to avoid the danger that redistributors of a free
|
||||||
|
program will individually obtain patent licenses, in effect making the
|
||||||
|
program proprietary. To prevent this, we have made it clear that any
|
||||||
|
patent must be licensed for everyone's free use or not licensed at all.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
GNU GENERAL PUBLIC LICENSE
|
||||||
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
|
0. This License applies to any program or other work which contains
|
||||||
|
a notice placed by the copyright holder saying it may be distributed
|
||||||
|
under the terms of this General Public License. The "Program", below,
|
||||||
|
refers to any such program or work, and a "work based on the Program"
|
||||||
|
means either the Program or any derivative work under copyright law:
|
||||||
|
that is to say, a work containing the Program or a portion of it,
|
||||||
|
either verbatim or with modifications and/or translated into another
|
||||||
|
language. (Hereinafter, translation is included without limitation in
|
||||||
|
the term "modification".) Each licensee is addressed as "you".
|
||||||
|
|
||||||
|
Activities other than copying, distribution and modification are not
|
||||||
|
covered by this License; they are outside its scope. The act of
|
||||||
|
running the Program is not restricted, and the output from the Program
|
||||||
|
is covered only if its contents constitute a work based on the
|
||||||
|
Program (independent of having been made by running the Program).
|
||||||
|
Whether that is true depends on what the Program does.
|
||||||
|
|
||||||
|
1. You may copy and distribute verbatim copies of the Program's
|
||||||
|
source code as you receive it, in any medium, provided that you
|
||||||
|
conspicuously and appropriately publish on each copy an appropriate
|
||||||
|
copyright notice and disclaimer of warranty; keep intact all the
|
||||||
|
notices that refer to this License and to the absence of any warranty;
|
||||||
|
and give any other recipients of the Program a copy of this License
|
||||||
|
along with the Program.
|
||||||
|
|
||||||
|
You may charge a fee for the physical act of transferring a copy, and
|
||||||
|
you may at your option offer warranty protection in exchange for a fee.
|
||||||
|
|
||||||
|
2. You may modify your copy or copies of the Program or any portion
|
||||||
|
of it, thus forming a work based on the Program, and copy and
|
||||||
|
distribute such modifications or work under the terms of Section 1
|
||||||
|
above, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) You must cause the modified files to carry prominent notices
|
||||||
|
stating that you changed the files and the date of any change.
|
||||||
|
|
||||||
|
b) You must cause any work that you distribute or publish, that in
|
||||||
|
whole or in part contains or is derived from the Program or any
|
||||||
|
part thereof, to be licensed as a whole at no charge to all third
|
||||||
|
parties under the terms of this License.
|
||||||
|
|
||||||
|
c) If the modified program normally reads commands interactively
|
||||||
|
when run, you must cause it, when started running for such
|
||||||
|
interactive use in the most ordinary way, to print or display an
|
||||||
|
announcement including an appropriate copyright notice and a
|
||||||
|
notice that there is no warranty (or else, saying that you provide
|
||||||
|
a warranty) and that users may redistribute the program under
|
||||||
|
these conditions, and telling the user how to view a copy of this
|
||||||
|
License. (Exception: if the Program itself is interactive but
|
||||||
|
does not normally print such an announcement, your work based on
|
||||||
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
|
These requirements apply to the modified work as a whole. If
|
||||||
|
identifiable sections of that work are not derived from the Program,
|
||||||
|
and can be reasonably considered independent and separate works in
|
||||||
|
themselves, then this License, and its terms, do not apply to those
|
||||||
|
sections when you distribute them as separate works. But when you
|
||||||
|
distribute the same sections as part of a whole which is a work based
|
||||||
|
on the Program, the distribution of the whole must be on the terms of
|
||||||
|
this License, whose permissions for other licensees extend to the
|
||||||
|
entire whole, and thus to each and every part regardless of who wrote it.
|
||||||
|
|
||||||
|
Thus, it is not the intent of this section to claim rights or contest
|
||||||
|
your rights to work written entirely by you; rather, the intent is to
|
||||||
|
exercise the right to control the distribution of derivative or
|
||||||
|
collective works based on the Program.
|
||||||
|
|
||||||
|
In addition, mere aggregation of another work not based on the Program
|
||||||
|
with the Program (or with a work based on the Program) on a volume of
|
||||||
|
a storage or distribution medium does not bring the other work under
|
||||||
|
the scope of this License.
|
||||||
|
|
||||||
|
3. You may copy and distribute the Program (or a work based on it,
|
||||||
|
under Section 2) in object code or executable form under the terms of
|
||||||
|
Sections 1 and 2 above provided that you also do one of the following:
|
||||||
|
|
||||||
|
a) Accompany it with the complete corresponding machine-readable
|
||||||
|
source code, which must be distributed under the terms of Sections
|
||||||
|
1 and 2 above on a medium customarily used for software interchange; or,
|
||||||
|
|
||||||
|
b) Accompany it with a written offer, valid for at least three
|
||||||
|
years, to give any third party, for a charge no more than your
|
||||||
|
cost of physically performing source distribution, a complete
|
||||||
|
machine-readable copy of the corresponding source code, to be
|
||||||
|
distributed under the terms of Sections 1 and 2 above on a medium
|
||||||
|
customarily used for software interchange; or,
|
||||||
|
|
||||||
|
c) Accompany it with the information you received as to the offer
|
||||||
|
to distribute corresponding source code. (This alternative is
|
||||||
|
allowed only for noncommercial distribution and only if you
|
||||||
|
received the program in object code or executable form with such
|
||||||
|
an offer, in accord with Subsection b above.)
|
||||||
|
|
||||||
|
The source code for a work means the preferred form of the work for
|
||||||
|
making modifications to it. For an executable work, complete source
|
||||||
|
code means all the source code for all modules it contains, plus any
|
||||||
|
associated interface definition files, plus the scripts used to
|
||||||
|
control compilation and installation of the executable. However, as a
|
||||||
|
special exception, the source code distributed need not include
|
||||||
|
anything that is normally distributed (in either source or binary
|
||||||
|
form) with the major components (compiler, kernel, and so on) of the
|
||||||
|
operating system on which the executable runs, unless that component
|
||||||
|
itself accompanies the executable.
|
||||||
|
|
||||||
|
If distribution of executable or object code is made by offering
|
||||||
|
access to copy from a designated place, then offering equivalent
|
||||||
|
access to copy the source code from the same place counts as
|
||||||
|
distribution of the source code, even though third parties are not
|
||||||
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
|
except as expressly provided under this License. Any attempt
|
||||||
|
otherwise to copy, modify, sublicense or distribute the Program is
|
||||||
|
void, and will automatically terminate your rights under this License.
|
||||||
|
However, parties who have received copies, or rights, from you under
|
||||||
|
this License will not have their licenses terminated so long as such
|
||||||
|
parties remain in full compliance.
|
||||||
|
|
||||||
|
5. You are not required to accept this License, since you have not
|
||||||
|
signed it. However, nothing else grants you permission to modify or
|
||||||
|
distribute the Program or its derivative works. These actions are
|
||||||
|
prohibited by law if you do not accept this License. Therefore, by
|
||||||
|
modifying or distributing the Program (or any work based on the
|
||||||
|
Program), you indicate your acceptance of this License to do so, and
|
||||||
|
all its terms and conditions for copying, distributing or modifying
|
||||||
|
the Program or works based on it.
|
||||||
|
|
||||||
|
6. Each time you redistribute the Program (or any work based on the
|
||||||
|
Program), the recipient automatically receives a license from the
|
||||||
|
original licensor to copy, distribute or modify the Program subject to
|
||||||
|
these terms and conditions. You may not impose any further
|
||||||
|
restrictions on the recipients' exercise of the rights granted herein.
|
||||||
|
You are not responsible for enforcing compliance by third parties to
|
||||||
|
this License.
|
||||||
|
|
||||||
|
7. If, as a consequence of a court judgment or allegation of patent
|
||||||
|
infringement or for any other reason (not limited to patent issues),
|
||||||
|
conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot
|
||||||
|
distribute so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you
|
||||||
|
may not distribute the Program at all. For example, if a patent
|
||||||
|
license would not permit royalty-free redistribution of the Program by
|
||||||
|
all those who receive copies directly or indirectly through you, then
|
||||||
|
the only way you could satisfy both it and this License would be to
|
||||||
|
refrain entirely from distribution of the Program.
|
||||||
|
|
||||||
|
If any portion of this section is held invalid or unenforceable under
|
||||||
|
any particular circumstance, the balance of the section is intended to
|
||||||
|
apply and the section as a whole is intended to apply in other
|
||||||
|
circumstances.
|
||||||
|
|
||||||
|
It is not the purpose of this section to induce you to infringe any
|
||||||
|
patents or other property right claims or to contest validity of any
|
||||||
|
such claims; this section has the sole purpose of protecting the
|
||||||
|
integrity of the free software distribution system, which is
|
||||||
|
implemented by public license practices. Many people have made
|
||||||
|
generous contributions to the wide range of software distributed
|
||||||
|
through that system in reliance on consistent application of that
|
||||||
|
system; it is up to the author/donor to decide if he or she is willing
|
||||||
|
to distribute software through any other system and a licensee cannot
|
||||||
|
impose that choice.
|
||||||
|
|
||||||
|
This section is intended to make thoroughly clear what is believed to
|
||||||
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
|
original copyright holder who places the Program under this License
|
||||||
|
may add an explicit geographical distribution limitation excluding
|
||||||
|
those countries, so that distribution is permitted only in or among
|
||||||
|
countries not thus excluded. In such case, this License incorporates
|
||||||
|
the limitation as if written in the body of this License.
|
||||||
|
|
||||||
|
9. The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the General Public License from time to time. Such new versions will
|
||||||
|
be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the Program
|
||||||
|
specifies a version number of this License which applies to it and "any
|
||||||
|
later version", you have the option of following the terms and conditions
|
||||||
|
either of that version or of any later version published by the Free
|
||||||
|
Software Foundation. If the Program does not specify a version number of
|
||||||
|
this License, you may choose any version ever published by the Free Software
|
||||||
|
Foundation.
|
||||||
|
|
||||||
|
10. If you wish to incorporate parts of the Program into other free
|
||||||
|
programs whose distribution conditions are different, write to the author
|
||||||
|
to ask for permission. For software which is copyrighted by the Free
|
||||||
|
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||||
|
make exceptions for this. Our decision will be guided by the two goals
|
||||||
|
of preserving the free status of all derivatives of our free software and
|
||||||
|
of promoting the sharing and reuse of software generally.
|
||||||
|
|
||||||
|
NO WARRANTY
|
||||||
|
|
||||||
|
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||||
|
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||||
|
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||||
|
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||||
|
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||||
|
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||||
|
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||||
|
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||||
|
REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||||
|
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||||
|
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||||
|
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||||
|
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||||
|
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||||
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
convey the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) 19yy <name of author>
|
||||||
|
|
||||||
|
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If the program is interactive, make it output a short notice like this
|
||||||
|
when it starts in an interactive mode:
|
||||||
|
|
||||||
|
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||||
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
|
This is free software, and you are welcome to redistribute it
|
||||||
|
under certain conditions; type `show c' for details.
|
||||||
|
|
||||||
|
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||||
|
parts of the General Public License. Of course, the commands you use may
|
||||||
|
be called something other than `show w' and `show c'; they could even be
|
||||||
|
mouse-clicks or menu items--whatever suits your program.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or your
|
||||||
|
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||||
|
necessary. Here is a sample; alter the names:
|
||||||
|
|
||||||
|
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||||
|
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||||
|
|
||||||
|
<signature of Ty Coon>, 1 April 1989
|
||||||
|
Ty Coon, President of Vice
|
||||||
|
|
||||||
|
This General Public License does not permit incorporating your program into
|
||||||
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
|
consider it more useful to permit linking proprietary applications with the
|
||||||
|
library. If this is what you want to do, use the GNU Library General
|
||||||
|
Public License instead of this License.
|
40
extern/lzo/minilzo/Makefile
vendored
Normal file
40
extern/lzo/minilzo/Makefile
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# $Id:
|
||||||
|
#
|
||||||
|
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2009 Blender Foundation
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# Contributor(s): none yet.
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
|
||||||
|
LIBNAME = minilzo
|
||||||
|
DIR = $(OCGDIR)/extern/$(LIBNAME)
|
||||||
|
|
||||||
|
include nan_compile.mk
|
||||||
|
|
||||||
|
install: $(ALL_OR_DEBUG)
|
||||||
|
@[ -d $(NAN_LZO) ] || mkdir -p $(NAN_LZO)
|
||||||
|
@[ -d $(NAN_LZO)/minilzo ] || mkdir -p $(NAN_LZO)/minilzo
|
||||||
|
@[ -d $(NAN_LZO)/lib/$(DEBUG_DIR) ] || mkdir -p $(NAN_LZO)/lib/$(DEBUG_DIR)
|
||||||
|
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)lib$(LIBNAME).a $(NAN_LZO)/lib/$(DEBUG_DIR)
|
||||||
|
ifeq ($(OS),darwin)
|
||||||
|
ranlib $(NAN_LZO)/lib/$(DEBUG_DIR)lib$(LIBNAME).a
|
||||||
|
endif
|
||||||
|
@$(NANBLENDERHOME)/intern/tools/cpifdiff.sh *.h $(NAN_LZO)/minilzo
|
123
extern/lzo/minilzo/README.LZO
vendored
Normal file
123
extern/lzo/minilzo/README.LZO
vendored
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
|
||||||
|
============================================================================
|
||||||
|
miniLZO -- mini subset of the LZO real-time data compression library
|
||||||
|
============================================================================
|
||||||
|
|
||||||
|
Author : Markus Franz Xaver Johannes Oberhumer
|
||||||
|
<markus@oberhumer.com>
|
||||||
|
http://www.oberhumer.com/opensource/lzo/
|
||||||
|
Version : 2.03
|
||||||
|
Date : 30 Apr 2008
|
||||||
|
|
||||||
|
I've created miniLZO for projects where it is inconvenient to
|
||||||
|
include (or require) the full LZO source code just because you
|
||||||
|
want to add a little bit of data compression to your application.
|
||||||
|
|
||||||
|
miniLZO implements the LZO1X-1 compressor and both the standard and
|
||||||
|
safe LZO1X decompressor. Apart from fast compression it also useful
|
||||||
|
for situations where you want to use pre-compressed data files (which
|
||||||
|
must have been compressed with LZO1X-999).
|
||||||
|
|
||||||
|
miniLZO consists of one C source file and three header files:
|
||||||
|
minilzo.c
|
||||||
|
minilzo.h, lzoconf.h, lzodefs.h
|
||||||
|
|
||||||
|
To use miniLZO just copy these files into your source directory, add
|
||||||
|
minilzo.c to your Makefile and #include minilzo.h from your program.
|
||||||
|
Note: you also must distribute this file (`README.LZO') with your project.
|
||||||
|
|
||||||
|
minilzo.o compiles to about 6 kB (using gcc or Visual C on a i386), and
|
||||||
|
the sources are about 30 kB when packed with zip - so there's no more
|
||||||
|
excuse that your application doesn't support data compression :-)
|
||||||
|
|
||||||
|
For more information, documentation, example programs and other support
|
||||||
|
files (like Makefiles and build scripts) please download the full LZO
|
||||||
|
package from
|
||||||
|
http://www.oberhumer.com/opensource/lzo/
|
||||||
|
|
||||||
|
Have fun,
|
||||||
|
Markus
|
||||||
|
|
||||||
|
|
||||||
|
P.S. minilzo.c is generated automatically from the LZO sources and
|
||||||
|
therefore functionality is completely identical
|
||||||
|
|
||||||
|
|
||||||
|
Appendix A: building miniLZO
|
||||||
|
----------------------------
|
||||||
|
miniLZO is written such a way that it should compile and run
|
||||||
|
out-of-the-box on most machines.
|
||||||
|
|
||||||
|
If you are running on a very unusual architecture and lzo_init() fails then
|
||||||
|
you should first recompile with `-DLZO_DEBUG' to see what causes the failure.
|
||||||
|
The most probable case is something like `sizeof(char *) != sizeof(long)'.
|
||||||
|
After identifying the problem you can compile by adding some defines
|
||||||
|
like `-DSIZEOF_CHAR_P=8' to your Makefile.
|
||||||
|
|
||||||
|
The best solution is (of course) using Autoconf - if your project uses
|
||||||
|
Autoconf anyway just add `-DMINILZO_HAVE_CONFIG_H' to your compiler
|
||||||
|
flags when compiling minilzo.c. See the LZO distribution for an example
|
||||||
|
how to set up configure.in.
|
||||||
|
|
||||||
|
|
||||||
|
Appendix B: list of public functions available in miniLZO
|
||||||
|
---------------------------------------------------------
|
||||||
|
Library initialization
|
||||||
|
lzo_init()
|
||||||
|
|
||||||
|
Compression
|
||||||
|
lzo1x_1_compress()
|
||||||
|
|
||||||
|
Decompression
|
||||||
|
lzo1x_decompress()
|
||||||
|
lzo1x_decompress_safe()
|
||||||
|
|
||||||
|
Checksum functions
|
||||||
|
lzo_adler32()
|
||||||
|
|
||||||
|
Version functions
|
||||||
|
lzo_version()
|
||||||
|
lzo_version_string()
|
||||||
|
lzo_version_date()
|
||||||
|
|
||||||
|
Portable (but slow) string functions
|
||||||
|
lzo_memcmp()
|
||||||
|
lzo_memcpy()
|
||||||
|
lzo_memmove()
|
||||||
|
lzo_memset()
|
||||||
|
|
||||||
|
|
||||||
|
Appendix C: suggested macros for `configure.in' when using Autoconf
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Checks for typedefs and structures
|
||||||
|
AC_CHECK_TYPE(ptrdiff_t,long)
|
||||||
|
AC_TYPE_SIZE_T
|
||||||
|
AC_CHECK_SIZEOF(short)
|
||||||
|
AC_CHECK_SIZEOF(int)
|
||||||
|
AC_CHECK_SIZEOF(long)
|
||||||
|
AC_CHECK_SIZEOF(long long)
|
||||||
|
AC_CHECK_SIZEOF(__int64)
|
||||||
|
AC_CHECK_SIZEOF(void *)
|
||||||
|
AC_CHECK_SIZEOF(size_t)
|
||||||
|
AC_CHECK_SIZEOF(ptrdiff_t)
|
||||||
|
|
||||||
|
Checks for compiler characteristics
|
||||||
|
AC_C_CONST
|
||||||
|
|
||||||
|
Checks for library functions
|
||||||
|
AC_CHECK_FUNCS(memcmp memcpy memmove memset)
|
||||||
|
|
||||||
|
|
||||||
|
Appendix D: Copyright
|
||||||
|
---------------------
|
||||||
|
LZO and miniLZO are Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||||
|
2003, 2004, 2005, 2006, 2007, 2008 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
|
||||||
|
LZO and miniLZO are distributed under the terms of the GNU General
|
||||||
|
Public License (GPL). See the file COPYING.
|
||||||
|
|
||||||
|
Special licenses for commercial and other applications which
|
||||||
|
are not willing to accept the GNU General Public License
|
||||||
|
are available by contacting the author.
|
||||||
|
|
||||||
|
|
417
extern/lzo/minilzo/lzoconf.h
vendored
Normal file
417
extern/lzo/minilzo/lzoconf.h
vendored
Normal file
@ -0,0 +1,417 @@
|
|||||||
|
/* lzoconf.h -- configuration for the LZO real-time data compression library
|
||||||
|
|
||||||
|
This file is part of the LZO real-time data compression library.
|
||||||
|
|
||||||
|
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
The LZO library 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.
|
||||||
|
|
||||||
|
The LZO library 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 the LZO library; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer
|
||||||
|
<markus@oberhumer.com>
|
||||||
|
http://www.oberhumer.com/opensource/lzo/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __LZOCONF_H_INCLUDED
|
||||||
|
#define __LZOCONF_H_INCLUDED
|
||||||
|
|
||||||
|
#define LZO_VERSION 0x2030
|
||||||
|
#define LZO_VERSION_STRING "2.03"
|
||||||
|
#define LZO_VERSION_DATE "Apr 30 2008"
|
||||||
|
|
||||||
|
/* internal Autoconf configuration file - only used when building LZO */
|
||||||
|
#if defined(LZO_HAVE_CONFIG_H)
|
||||||
|
# include <config.h>
|
||||||
|
#endif
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// LZO requires a conforming <limits.h>
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
|
||||||
|
# error "invalid CHAR_BIT"
|
||||||
|
#endif
|
||||||
|
#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
|
||||||
|
# error "check your compiler installation"
|
||||||
|
#endif
|
||||||
|
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
|
||||||
|
# error "your limits.h macros are broken"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* get OS and architecture defines */
|
||||||
|
#ifndef __LZODEFS_H_INCLUDED
|
||||||
|
#include "lzodefs.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// some core defines
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
#if !defined(LZO_UINT32_C)
|
||||||
|
# if (UINT_MAX < LZO_0xffffffffL)
|
||||||
|
# define LZO_UINT32_C(c) c ## UL
|
||||||
|
# else
|
||||||
|
# define LZO_UINT32_C(c) ((c) + 0U)
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* memory checkers */
|
||||||
|
#if !defined(__LZO_CHECKER)
|
||||||
|
# if defined(__BOUNDS_CHECKING_ON)
|
||||||
|
# define __LZO_CHECKER 1
|
||||||
|
# elif defined(__CHECKER__)
|
||||||
|
# define __LZO_CHECKER 1
|
||||||
|
# elif defined(__INSURE__)
|
||||||
|
# define __LZO_CHECKER 1
|
||||||
|
# elif defined(__PURIFY__)
|
||||||
|
# define __LZO_CHECKER 1
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// integral and pointer types
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
/* lzo_uint should match size_t */
|
||||||
|
#if !defined(LZO_UINT_MAX)
|
||||||
|
# if defined(LZO_ABI_LLP64) /* WIN64 */
|
||||||
|
# if defined(LZO_OS_WIN64)
|
||||||
|
typedef unsigned __int64 lzo_uint;
|
||||||
|
typedef __int64 lzo_int;
|
||||||
|
# else
|
||||||
|
typedef unsigned long long lzo_uint;
|
||||||
|
typedef long long lzo_int;
|
||||||
|
# endif
|
||||||
|
# define LZO_UINT_MAX 0xffffffffffffffffull
|
||||||
|
# define LZO_INT_MAX 9223372036854775807LL
|
||||||
|
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
|
||||||
|
# elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
|
||||||
|
typedef unsigned int lzo_uint;
|
||||||
|
typedef int lzo_int;
|
||||||
|
# define LZO_UINT_MAX UINT_MAX
|
||||||
|
# define LZO_INT_MAX INT_MAX
|
||||||
|
# define LZO_INT_MIN INT_MIN
|
||||||
|
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
||||||
|
typedef unsigned long lzo_uint;
|
||||||
|
typedef long lzo_int;
|
||||||
|
# define LZO_UINT_MAX ULONG_MAX
|
||||||
|
# define LZO_INT_MAX LONG_MAX
|
||||||
|
# define LZO_INT_MIN LONG_MIN
|
||||||
|
# else
|
||||||
|
# error "lzo_uint"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Integral types with 32 bits or more. */
|
||||||
|
#if !defined(LZO_UINT32_MAX)
|
||||||
|
# if (UINT_MAX >= LZO_0xffffffffL)
|
||||||
|
typedef unsigned int lzo_uint32;
|
||||||
|
typedef int lzo_int32;
|
||||||
|
# define LZO_UINT32_MAX UINT_MAX
|
||||||
|
# define LZO_INT32_MAX INT_MAX
|
||||||
|
# define LZO_INT32_MIN INT_MIN
|
||||||
|
# elif (ULONG_MAX >= LZO_0xffffffffL)
|
||||||
|
typedef unsigned long lzo_uint32;
|
||||||
|
typedef long lzo_int32;
|
||||||
|
# define LZO_UINT32_MAX ULONG_MAX
|
||||||
|
# define LZO_INT32_MAX LONG_MAX
|
||||||
|
# define LZO_INT32_MIN LONG_MIN
|
||||||
|
# else
|
||||||
|
# error "lzo_uint32"
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* The larger type of lzo_uint and lzo_uint32. */
|
||||||
|
#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
|
||||||
|
# define lzo_xint lzo_uint
|
||||||
|
#else
|
||||||
|
# define lzo_xint lzo_uint32
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Memory model that allows to access memory at offsets of lzo_uint. */
|
||||||
|
#if !defined(__LZO_MMODEL)
|
||||||
|
# if (LZO_UINT_MAX <= UINT_MAX)
|
||||||
|
# define __LZO_MMODEL
|
||||||
|
# elif defined(LZO_HAVE_MM_HUGE_PTR)
|
||||||
|
# define __LZO_MMODEL_HUGE 1
|
||||||
|
# define __LZO_MMODEL __huge
|
||||||
|
# else
|
||||||
|
# define __LZO_MMODEL
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* no typedef here because of const-pointer issues */
|
||||||
|
#define lzo_bytep unsigned char __LZO_MMODEL *
|
||||||
|
#define lzo_charp char __LZO_MMODEL *
|
||||||
|
#define lzo_voidp void __LZO_MMODEL *
|
||||||
|
#define lzo_shortp short __LZO_MMODEL *
|
||||||
|
#define lzo_ushortp unsigned short __LZO_MMODEL *
|
||||||
|
#define lzo_uint32p lzo_uint32 __LZO_MMODEL *
|
||||||
|
#define lzo_int32p lzo_int32 __LZO_MMODEL *
|
||||||
|
#define lzo_uintp lzo_uint __LZO_MMODEL *
|
||||||
|
#define lzo_intp lzo_int __LZO_MMODEL *
|
||||||
|
#define lzo_xintp lzo_xint __LZO_MMODEL *
|
||||||
|
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
|
||||||
|
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
|
||||||
|
/* deprecated - use `lzo_bytep' instead of `lzo_byte *' */
|
||||||
|
#define lzo_byte unsigned char __LZO_MMODEL
|
||||||
|
|
||||||
|
typedef int lzo_bool;
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// function types
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
/* name mangling */
|
||||||
|
#if !defined(__LZO_EXTERN_C)
|
||||||
|
# ifdef __cplusplus
|
||||||
|
# define __LZO_EXTERN_C extern "C"
|
||||||
|
# else
|
||||||
|
# define __LZO_EXTERN_C extern
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* calling convention */
|
||||||
|
#if !defined(__LZO_CDECL)
|
||||||
|
# define __LZO_CDECL __lzo_cdecl
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* DLL export information */
|
||||||
|
#if !defined(__LZO_EXPORT1)
|
||||||
|
# define __LZO_EXPORT1
|
||||||
|
#endif
|
||||||
|
#if !defined(__LZO_EXPORT2)
|
||||||
|
# define __LZO_EXPORT2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* __cdecl calling convention for public C and assembly functions */
|
||||||
|
#if !defined(LZO_PUBLIC)
|
||||||
|
# define LZO_PUBLIC(_rettype) __LZO_EXPORT1 _rettype __LZO_EXPORT2 __LZO_CDECL
|
||||||
|
#endif
|
||||||
|
#if !defined(LZO_EXTERN)
|
||||||
|
# define LZO_EXTERN(_rettype) __LZO_EXTERN_C LZO_PUBLIC(_rettype)
|
||||||
|
#endif
|
||||||
|
#if !defined(LZO_PRIVATE)
|
||||||
|
# define LZO_PRIVATE(_rettype) static _rettype __LZO_CDECL
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* function types */
|
||||||
|
typedef int
|
||||||
|
(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem );
|
||||||
|
|
||||||
|
typedef int
|
||||||
|
(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem );
|
||||||
|
|
||||||
|
typedef int
|
||||||
|
(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem );
|
||||||
|
|
||||||
|
typedef int
|
||||||
|
(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem,
|
||||||
|
const lzo_bytep dict, lzo_uint dict_len );
|
||||||
|
|
||||||
|
typedef int
|
||||||
|
(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem,
|
||||||
|
const lzo_bytep dict, lzo_uint dict_len );
|
||||||
|
|
||||||
|
|
||||||
|
/* Callback interface. Currently only the progress indicator ("nprogress")
|
||||||
|
* is used, but this may change in a future release. */
|
||||||
|
|
||||||
|
struct lzo_callback_t;
|
||||||
|
typedef struct lzo_callback_t lzo_callback_t;
|
||||||
|
#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
|
||||||
|
|
||||||
|
/* malloc & free function types */
|
||||||
|
typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
|
||||||
|
(lzo_callback_p self, lzo_uint items, lzo_uint size);
|
||||||
|
typedef void (__LZO_CDECL *lzo_free_func_t)
|
||||||
|
(lzo_callback_p self, lzo_voidp ptr);
|
||||||
|
|
||||||
|
/* a progress indicator callback function */
|
||||||
|
typedef void (__LZO_CDECL *lzo_progress_func_t)
|
||||||
|
(lzo_callback_p, lzo_uint, lzo_uint, int);
|
||||||
|
|
||||||
|
struct lzo_callback_t
|
||||||
|
{
|
||||||
|
/* custom allocators (set to 0 to disable) */
|
||||||
|
lzo_alloc_func_t nalloc; /* [not used right now] */
|
||||||
|
lzo_free_func_t nfree; /* [not used right now] */
|
||||||
|
|
||||||
|
/* a progress indicator callback function (set to 0 to disable) */
|
||||||
|
lzo_progress_func_t nprogress;
|
||||||
|
|
||||||
|
/* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
|
||||||
|
* callbacks points back to this struct, so you are free to store
|
||||||
|
* some extra info in the following variables. */
|
||||||
|
lzo_voidp user1;
|
||||||
|
lzo_xint user2;
|
||||||
|
lzo_xint user3;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// error codes and prototypes
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
/* Error codes for the compression/decompression functions. Negative
|
||||||
|
* values are errors, positive values will be used for special but
|
||||||
|
* normal events.
|
||||||
|
*/
|
||||||
|
#define LZO_E_OK 0
|
||||||
|
#define LZO_E_ERROR (-1)
|
||||||
|
#define LZO_E_OUT_OF_MEMORY (-2) /* [not used right now] */
|
||||||
|
#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
|
||||||
|
#define LZO_E_INPUT_OVERRUN (-4)
|
||||||
|
#define LZO_E_OUTPUT_OVERRUN (-5)
|
||||||
|
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
|
||||||
|
#define LZO_E_EOF_NOT_FOUND (-7)
|
||||||
|
#define LZO_E_INPUT_NOT_CONSUMED (-8)
|
||||||
|
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef lzo_sizeof_dict_t
|
||||||
|
# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* lzo_init() should be the first function you call.
|
||||||
|
* Check the return code !
|
||||||
|
*
|
||||||
|
* lzo_init() is a macro to allow checking that the library and the
|
||||||
|
* compiler's view of various types are consistent.
|
||||||
|
*/
|
||||||
|
#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
|
||||||
|
(int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
|
||||||
|
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
|
||||||
|
(int)sizeof(lzo_callback_t))
|
||||||
|
LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
|
||||||
|
|
||||||
|
/* version functions (useful for shared libraries) */
|
||||||
|
LZO_EXTERN(unsigned) lzo_version(void);
|
||||||
|
LZO_EXTERN(const char *) lzo_version_string(void);
|
||||||
|
LZO_EXTERN(const char *) lzo_version_date(void);
|
||||||
|
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
|
||||||
|
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
|
||||||
|
|
||||||
|
/* string functions */
|
||||||
|
LZO_EXTERN(int)
|
||||||
|
lzo_memcmp(const lzo_voidp _s1, const lzo_voidp _s2, lzo_uint _len);
|
||||||
|
LZO_EXTERN(lzo_voidp)
|
||||||
|
lzo_memcpy(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
||||||
|
LZO_EXTERN(lzo_voidp)
|
||||||
|
lzo_memmove(lzo_voidp _dest, const lzo_voidp _src, lzo_uint _len);
|
||||||
|
LZO_EXTERN(lzo_voidp)
|
||||||
|
lzo_memset(lzo_voidp _s, int _c, lzo_uint _len);
|
||||||
|
|
||||||
|
/* checksum functions */
|
||||||
|
LZO_EXTERN(lzo_uint32)
|
||||||
|
lzo_adler32(lzo_uint32 _adler, const lzo_bytep _buf, lzo_uint _len);
|
||||||
|
LZO_EXTERN(lzo_uint32)
|
||||||
|
lzo_crc32(lzo_uint32 _c, const lzo_bytep _buf, lzo_uint _len);
|
||||||
|
LZO_EXTERN(const lzo_uint32p)
|
||||||
|
lzo_get_crc32_table(void);
|
||||||
|
|
||||||
|
/* misc. */
|
||||||
|
LZO_EXTERN(int) _lzo_config_check(void);
|
||||||
|
typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
|
||||||
|
typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
|
||||||
|
typedef union { void *vp; lzo_bytep bp; lzo_uint32 u32; long l; } lzo_align_t;
|
||||||
|
|
||||||
|
/* align a char pointer on a boundary that is a multiple of `size' */
|
||||||
|
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp _ptr, lzo_uint _size);
|
||||||
|
#define LZO_PTR_ALIGN_UP(_ptr,_size) \
|
||||||
|
((_ptr) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(_ptr),(lzo_uint)(_size)))
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
// deprecated macros - only for backward compatibility with LZO v1.xx
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
#if defined(LZO_CFG_COMPAT)
|
||||||
|
|
||||||
|
#define __LZOCONF_H 1
|
||||||
|
|
||||||
|
#if defined(LZO_ARCH_I086)
|
||||||
|
# define __LZO_i386 1
|
||||||
|
#elif defined(LZO_ARCH_I386)
|
||||||
|
# define __LZO_i386 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(LZO_OS_DOS16)
|
||||||
|
# define __LZO_DOS 1
|
||||||
|
# define __LZO_DOS16 1
|
||||||
|
#elif defined(LZO_OS_DOS32)
|
||||||
|
# define __LZO_DOS 1
|
||||||
|
#elif defined(LZO_OS_WIN16)
|
||||||
|
# define __LZO_WIN 1
|
||||||
|
# define __LZO_WIN16 1
|
||||||
|
#elif defined(LZO_OS_WIN32)
|
||||||
|
# define __LZO_WIN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define __LZO_CMODEL
|
||||||
|
#define __LZO_DMODEL
|
||||||
|
#define __LZO_ENTRY __LZO_CDECL
|
||||||
|
#define LZO_EXTERN_CDECL LZO_EXTERN
|
||||||
|
#define LZO_ALIGN LZO_PTR_ALIGN_UP
|
||||||
|
|
||||||
|
#define lzo_compress_asm_t lzo_compress_t
|
||||||
|
#define lzo_decompress_asm_t lzo_decompress_t
|
||||||
|
|
||||||
|
#endif /* LZO_CFG_COMPAT */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* already included */
|
||||||
|
|
||||||
|
|
||||||
|
/* vim:set ts=4 et: */
|
1807
extern/lzo/minilzo/lzodefs.h
vendored
Normal file
1807
extern/lzo/minilzo/lzodefs.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
4112
extern/lzo/minilzo/minilzo.c
vendored
Normal file
4112
extern/lzo/minilzo/minilzo.c
vendored
Normal file
File diff suppressed because it is too large
Load Diff
112
extern/lzo/minilzo/minilzo.h
vendored
Normal file
112
extern/lzo/minilzo/minilzo.h
vendored
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
/* minilzo.h -- mini subset of the LZO real-time data compression library
|
||||||
|
|
||||||
|
This file is part of the LZO real-time data compression library.
|
||||||
|
|
||||||
|
Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
|
||||||
|
All Rights Reserved.
|
||||||
|
|
||||||
|
The LZO library 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.
|
||||||
|
|
||||||
|
The LZO library 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 the LZO library; see the file COPYING.
|
||||||
|
If not, write to the Free Software Foundation, Inc.,
|
||||||
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
|
Markus F.X.J. Oberhumer
|
||||||
|
<markus@oberhumer.com>
|
||||||
|
http://www.oberhumer.com/opensource/lzo/
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* NOTE:
|
||||||
|
* the full LZO package can be found at
|
||||||
|
* http://www.oberhumer.com/opensource/lzo/
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef __MINILZO_H
|
||||||
|
#define __MINILZO_H
|
||||||
|
|
||||||
|
#define MINILZO_VERSION 0x2030
|
||||||
|
|
||||||
|
#ifdef __LZOCONF_H
|
||||||
|
# error "you cannot use both LZO and miniLZO"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef LZO_HAVE_CONFIG_H
|
||||||
|
#include "lzoconf.h"
|
||||||
|
|
||||||
|
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
|
||||||
|
# error "version mismatch in header files"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
//
|
||||||
|
************************************************************************/
|
||||||
|
|
||||||
|
/* Memory required for the wrkmem parameter.
|
||||||
|
* When the required size is 0, you can also pass a NULL pointer.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
|
||||||
|
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32) (16384L * lzo_sizeof_dict_t))
|
||||||
|
#define LZO1X_MEM_DECOMPRESS (0)
|
||||||
|
|
||||||
|
|
||||||
|
/* compression */
|
||||||
|
LZO_EXTERN(int)
|
||||||
|
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem );
|
||||||
|
|
||||||
|
/* decompression */
|
||||||
|
LZO_EXTERN(int)
|
||||||
|
lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem /* NOT USED */ );
|
||||||
|
|
||||||
|
/* safe decompression with overrun testing */
|
||||||
|
LZO_EXTERN(int)
|
||||||
|
lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
|
||||||
|
lzo_bytep dst, lzo_uintp dst_len,
|
||||||
|
lzo_voidp wrkmem /* NOT USED */ );
|
||||||
|
|
||||||
|
|
||||||
|
#define LZO_OUT_LEN(size) ((size) + (size) / 16 + 64 + 3)
|
||||||
|
|
||||||
|
#define LZO_HEAP_ALLOC(var,size) \
|
||||||
|
lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ]
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
} /* extern "C" */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* already included */
|
||||||
|
|
@ -53,6 +53,12 @@ IF(WITH_JACK)
|
|||||||
ADD_DEFINITIONS(-DWITH_JACK)
|
ADD_DEFINITIONS(-DWITH_JACK)
|
||||||
ENDIF(WITH_JACK)
|
ENDIF(WITH_JACK)
|
||||||
|
|
||||||
SET(SRC ${SRC} ${FFMPEGSRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
|
IF(WITH_SNDFILE)
|
||||||
|
SET(INC ${INC} sndfile ${SNDFILE_INC})
|
||||||
|
FILE(GLOB SNDFILESRC sndfile/*.cpp)
|
||||||
|
ADD_DEFINITIONS(-DWITH_SNDFILE)
|
||||||
|
ENDIF(WITH_SNDFILE)
|
||||||
|
|
||||||
|
SET(SRC ${SRC} ${FFMPEGSRC} ${SNDFILESRC} ${SDLSRC} ${OPENALSRC} ${JACKSRC})
|
||||||
|
|
||||||
BLENDERLIB(bf_audaspace "${SRC}" "${INC}")
|
BLENDERLIB(bf_audaspace "${SRC}" "${INC}")
|
||||||
|
@ -44,19 +44,63 @@ ifeq ($(WITH_FFMPEG),true)
|
|||||||
DIRS += ffmpeg
|
DIRS += ffmpeg
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_OPENAL),true)
|
||||||
|
DIRS += OpenAL
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_JACK),true)
|
||||||
|
DIRS += jack
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_SNDFILE),true)
|
||||||
|
DIRS += sndfile
|
||||||
|
endif
|
||||||
|
|
||||||
include nan_subdirs.mk
|
include nan_subdirs.mk
|
||||||
|
|
||||||
install: $(ALL_OR_DEBUG)
|
install: $(ALL_OR_DEBUG)
|
||||||
@[ -d $(NAN_AUDASPACE) ] || mkdir $(NAN_AUDASPACE)
|
@[ -d $(NAN_AUDASPACE) ] || mkdir $(NAN_AUDASPACE)
|
||||||
@[ -d $(NAN_AUDASPACE)/include ] || mkdir $(NAN_AUDASPACE)/include
|
@[ -d $(NAN_AUDASPACE)/include ] || mkdir $(NAN_AUDASPACE)/include
|
||||||
@[ -d $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
@[ -d $(NAN_AUDASPACE)/lib/$(DEBUG_DIR) ] || mkdir $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaudaspace.a $(DIR)/$(DEBUG_DIR)libaud_sdl.a $(DIR)/$(DEBUG_DIR)libaud_fx.a $(DIR)/$(DEBUG_DIR)libaud_src.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
|
|
||||||
|
ifeq ($(WITH_FFMPEG),true)
|
||||||
|
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_ffmpeg.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_OPENAL),true)
|
||||||
|
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_openal.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_JACK),true)
|
||||||
|
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_jack.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_SNDFILE),true)
|
||||||
|
@../tools/cpifdiff.sh $(DIR)/$(DEBUG_DIR)libaud_sndfile.a $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)
|
||||||
|
endif
|
||||||
|
|
||||||
ifeq ($(OS),darwin)
|
ifeq ($(OS),darwin)
|
||||||
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaudaspace.a
|
||||||
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_src.a
|
||||||
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_fx.a
|
||||||
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sdl.a
|
||||||
|
|
||||||
|
ifeq ($(WITH_FFMPEG),true)
|
||||||
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_ffmpeg.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_OPENAL),true)
|
||||||
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_openal.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_JACK),true)
|
||||||
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_jack.a
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_SNDFILE),true)
|
||||||
|
ranlib $(NAN_AUDASPACE)/lib/$(DEBUG_DIR)libaud_sndfile.a
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
@../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/
|
@../tools/cpifdiff.sh intern/*.h $(NAN_AUDASPACE)/include/
|
||||||
|
|
||||||
|
|
||||||
|
39
intern/audaspace/OpenAL/Makefile
Normal file
39
intern/audaspace/OpenAL/Makefile
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# The Original Code is: all of this file.
|
||||||
|
#
|
||||||
|
# Contributor(s): none yet.
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
LIBNAME = aud_openal
|
||||||
|
DIR = $(OCGDIR)/intern/audaspace
|
||||||
|
|
||||||
|
include nan_compile.mk
|
||||||
|
|
||||||
|
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||||
|
|
||||||
|
CPPFLAGS += -I../intern
|
||||||
|
CPPFLAGS += -I.
|
@ -29,7 +29,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
LIBNAME = aud_sdl
|
LIBNAME = aud_sdl
|
||||||
DIR = $(OCGDIR)/intern/$(LIBNAME)
|
DIR = $(OCGDIR)/intern/audaspace
|
||||||
|
|
||||||
include nan_compile.mk
|
include nan_compile.mk
|
||||||
|
|
||||||
|
@ -25,31 +25,24 @@
|
|||||||
|
|
||||||
#include "AUD_FFMPEGFactory.h"
|
#include "AUD_FFMPEGFactory.h"
|
||||||
#include "AUD_FFMPEGReader.h"
|
#include "AUD_FFMPEGReader.h"
|
||||||
#include "AUD_Space.h"
|
#include "AUD_Buffer.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include <libavformat/avformat.h>
|
|
||||||
}
|
|
||||||
|
|
||||||
AUD_FFMPEGFactory::AUD_FFMPEGFactory(const char* filename)
|
AUD_FFMPEGFactory::AUD_FFMPEGFactory(const char* filename)
|
||||||
{
|
{
|
||||||
if(filename != 0)
|
if(filename != NULL)
|
||||||
{
|
{
|
||||||
m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
|
m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
|
||||||
strcpy(m_filename, filename);
|
strcpy(m_filename, filename);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_filename = 0;
|
m_filename = NULL;
|
||||||
m_buffer = 0;
|
|
||||||
m_size = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_FFMPEGFactory::AUD_FFMPEGFactory(unsigned char* buffer, int size)
|
AUD_FFMPEGFactory::AUD_FFMPEGFactory(unsigned char* buffer, int size)
|
||||||
{
|
{
|
||||||
m_filename = 0;
|
m_filename = NULL;
|
||||||
m_buffer = (unsigned char*)av_malloc(size); AUD_NEW("buffer")
|
m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
|
||||||
m_size = size;
|
memcpy(m_buffer.get()->getBuffer(), buffer, size);
|
||||||
memcpy(m_buffer, buffer, size);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_FFMPEGFactory::~AUD_FFMPEGFactory()
|
AUD_FFMPEGFactory::~AUD_FFMPEGFactory()
|
||||||
@ -58,31 +51,15 @@ AUD_FFMPEGFactory::~AUD_FFMPEGFactory()
|
|||||||
{
|
{
|
||||||
delete[] m_filename; AUD_DELETE("string")
|
delete[] m_filename; AUD_DELETE("string")
|
||||||
}
|
}
|
||||||
if(m_buffer)
|
|
||||||
{
|
|
||||||
av_free(m_buffer); AUD_DELETE("buffer")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_IReader* AUD_FFMPEGFactory::createReader()
|
AUD_IReader* AUD_FFMPEGFactory::createReader()
|
||||||
{
|
{
|
||||||
try
|
AUD_IReader* reader;
|
||||||
{
|
if(m_filename)
|
||||||
AUD_IReader* reader;
|
reader = new AUD_FFMPEGReader(m_filename);
|
||||||
if(m_filename)
|
else
|
||||||
reader = new AUD_FFMPEGReader(m_filename);
|
reader = new AUD_FFMPEGReader(m_buffer);
|
||||||
else
|
AUD_NEW("reader")
|
||||||
reader = new AUD_FFMPEGReader(m_buffer, m_size);
|
return reader;
|
||||||
AUD_NEW("reader")
|
|
||||||
return reader;
|
|
||||||
}
|
|
||||||
catch(AUD_Exception e)
|
|
||||||
{
|
|
||||||
// return 0 if ffmpeg cannot read the file
|
|
||||||
if(e.error == AUD_ERROR_FFMPEG)
|
|
||||||
return 0;
|
|
||||||
// but throw an exception if the file doesn't exist
|
|
||||||
else
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -27,6 +27,8 @@
|
|||||||
#define AUD_FFMPEGFACTORY
|
#define AUD_FFMPEGFACTORY
|
||||||
|
|
||||||
#include "AUD_IFactory.h"
|
#include "AUD_IFactory.h"
|
||||||
|
#include "AUD_Reference.h"
|
||||||
|
class AUD_Buffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This factory reads a sound file via ffmpeg.
|
* This factory reads a sound file via ffmpeg.
|
||||||
@ -44,12 +46,7 @@ private:
|
|||||||
/**
|
/**
|
||||||
* The buffer to read from.
|
* The buffer to read from.
|
||||||
*/
|
*/
|
||||||
unsigned char* m_buffer;
|
AUD_Reference<AUD_Buffer> m_buffer;
|
||||||
|
|
||||||
/**
|
|
||||||
* The size of the buffer.
|
|
||||||
*/
|
|
||||||
int m_size;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
|
@ -158,21 +158,22 @@ AUD_FFMPEGReader::AUD_FFMPEGReader(const char* filename)
|
|||||||
AUD_NEW("buffer")
|
AUD_NEW("buffer")
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_FFMPEGReader::AUD_FFMPEGReader(unsigned char* buffer, int size)
|
AUD_FFMPEGReader::AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer)
|
||||||
{
|
{
|
||||||
m_position = 0;
|
m_position = 0;
|
||||||
m_pkgbuf_left = 0;
|
m_pkgbuf_left = 0;
|
||||||
m_byteiocontext = (ByteIOContext*)av_mallocz(sizeof(ByteIOContext));
|
m_byteiocontext = (ByteIOContext*)av_mallocz(sizeof(ByteIOContext));
|
||||||
AUD_NEW("byteiocontext")
|
AUD_NEW("byteiocontext")
|
||||||
|
m_membuffer = buffer;
|
||||||
|
|
||||||
if(init_put_byte(m_byteiocontext, buffer, size, 0,
|
if(init_put_byte(m_byteiocontext, buffer.get()->getBuffer(), buffer.get()->getSize(), 0,
|
||||||
NULL, NULL, NULL, NULL) != 0)
|
NULL, NULL, NULL, NULL) != 0)
|
||||||
AUD_THROW(AUD_ERROR_FILE);
|
AUD_THROW(AUD_ERROR_FILE);
|
||||||
|
|
||||||
AVProbeData probe_data;
|
AVProbeData probe_data;
|
||||||
probe_data.filename = "";
|
probe_data.filename = "";
|
||||||
probe_data.buf = buffer;
|
probe_data.buf = buffer.get()->getBuffer();
|
||||||
probe_data.buf_size = size;
|
probe_data.buf_size = buffer.get()->getSize();
|
||||||
AVInputFormat* fmt = av_probe_input_format(&probe_data, 1);
|
AVInputFormat* fmt = av_probe_input_format(&probe_data, 1);
|
||||||
|
|
||||||
// open stream
|
// open stream
|
||||||
|
@ -27,7 +27,9 @@
|
|||||||
#define AUD_FFMPEGREADER
|
#define AUD_FFMPEGREADER
|
||||||
|
|
||||||
#include "AUD_IReader.h"
|
#include "AUD_IReader.h"
|
||||||
|
#include "AUD_Reference.h"
|
||||||
class AUD_Buffer;
|
class AUD_Buffer;
|
||||||
|
|
||||||
struct AVCodecContext;
|
struct AVCodecContext;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
@ -89,6 +91,11 @@ private:
|
|||||||
*/
|
*/
|
||||||
int m_stream;
|
int m_stream;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The memory file to read from, only saved to keep the buffer alive.
|
||||||
|
*/
|
||||||
|
AUD_Reference<AUD_Buffer> m_membuffer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Decodes a packet into the given buffer.
|
* Decodes a packet into the given buffer.
|
||||||
* \param packet The AVPacket to decode.
|
* \param packet The AVPacket to decode.
|
||||||
@ -109,11 +116,10 @@ public:
|
|||||||
/**
|
/**
|
||||||
* Creates a new reader.
|
* Creates a new reader.
|
||||||
* \param buffer The buffer to read from.
|
* \param buffer The buffer to read from.
|
||||||
* \param size The size of the buffer.
|
|
||||||
* \exception AUD_Exception Thrown if the buffer specified cannot be read
|
* \exception AUD_Exception Thrown if the buffer specified cannot be read
|
||||||
* with ffmpeg.
|
* with ffmpeg.
|
||||||
*/
|
*/
|
||||||
AUD_FFMPEGReader(unsigned char* buffer, int size);
|
AUD_FFMPEGReader(AUD_Reference<AUD_Buffer> buffer);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroys the reader and closes the file.
|
* Destroys the reader and closes the file.
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
LIBNAME = aud_ffmpeg
|
LIBNAME = aud_ffmpeg
|
||||||
DIR = $(OCGDIR)/intern/$(LIBNAME)
|
DIR = $(OCGDIR)/intern/audaspace
|
||||||
|
|
||||||
include nan_compile.mk
|
include nan_compile.mk
|
||||||
|
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "AUD_NULLDevice.h"
|
#include "AUD_NULLDevice.h"
|
||||||
#include "AUD_I3DDevice.h"
|
#include "AUD_I3DDevice.h"
|
||||||
|
#include "AUD_FileFactory.h"
|
||||||
#include "AUD_StreamBufferFactory.h"
|
#include "AUD_StreamBufferFactory.h"
|
||||||
#include "AUD_DelayFactory.h"
|
#include "AUD_DelayFactory.h"
|
||||||
#include "AUD_LimiterFactory.h"
|
#include "AUD_LimiterFactory.h"
|
||||||
@ -48,7 +49,6 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_FFMPEG
|
#ifdef WITH_FFMPEG
|
||||||
#include "AUD_FFMPEGFactory.h"
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include <libavformat/avformat.h>
|
#include <libavformat/avformat.h>
|
||||||
}
|
}
|
||||||
@ -187,21 +187,13 @@ AUD_SoundInfo AUD_getInfo(AUD_Sound* sound)
|
|||||||
AUD_Sound* AUD_load(const char* filename)
|
AUD_Sound* AUD_load(const char* filename)
|
||||||
{
|
{
|
||||||
assert(filename);
|
assert(filename);
|
||||||
#ifdef WITH_FFMPEG
|
return new AUD_FileFactory(filename);
|
||||||
return new AUD_FFMPEGFactory(filename);
|
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_Sound* AUD_loadBuffer(unsigned char* buffer, int size)
|
AUD_Sound* AUD_loadBuffer(unsigned char* buffer, int size)
|
||||||
{
|
{
|
||||||
assert(buffer);
|
assert(buffer);
|
||||||
#ifdef WITH_FFMPEG
|
return new AUD_FileFactory(buffer, size);
|
||||||
return new AUD_FFMPEGFactory(buffer, size);
|
|
||||||
#else
|
|
||||||
return NULL;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AUD_Sound* AUD_bufferSound(AUD_Sound* sound)
|
AUD_Sound* AUD_bufferSound(AUD_Sound* sound)
|
||||||
|
95
intern/audaspace/intern/AUD_FileFactory.cpp
Normal file
95
intern/audaspace/intern/AUD_FileFactory.cpp
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AUD_FileFactory.h"
|
||||||
|
#include "AUD_Buffer.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
#ifdef WITH_FFMPEG
|
||||||
|
#include "AUD_FFMPEGReader.h"
|
||||||
|
#endif
|
||||||
|
#ifdef WITH_SNDFILE
|
||||||
|
#include "AUD_SndFileReader.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
AUD_FileFactory::AUD_FileFactory(const char* filename)
|
||||||
|
{
|
||||||
|
if(filename != NULL)
|
||||||
|
{
|
||||||
|
m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
|
||||||
|
strcpy(m_filename, filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_filename = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_FileFactory::AUD_FileFactory(unsigned char* buffer, int size)
|
||||||
|
{
|
||||||
|
m_filename = NULL;
|
||||||
|
m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
|
||||||
|
memcpy(m_buffer.get()->getBuffer(), buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_FileFactory::~AUD_FileFactory()
|
||||||
|
{
|
||||||
|
if(m_filename)
|
||||||
|
{
|
||||||
|
delete[] m_filename; AUD_DELETE("string")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_IReader* AUD_FileFactory::createReader()
|
||||||
|
{
|
||||||
|
AUD_IReader* reader = 0;
|
||||||
|
|
||||||
|
#ifdef WITH_SNDFILE
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(m_filename)
|
||||||
|
reader = new AUD_SndFileReader(m_filename);
|
||||||
|
else
|
||||||
|
reader = new AUD_SndFileReader(m_buffer);
|
||||||
|
AUD_NEW("reader")
|
||||||
|
return reader;
|
||||||
|
}
|
||||||
|
catch(AUD_Exception e) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef WITH_FFMPEG
|
||||||
|
try
|
||||||
|
{
|
||||||
|
if(m_filename)
|
||||||
|
reader = new AUD_FFMPEGReader(m_filename);
|
||||||
|
else
|
||||||
|
reader = new AUD_FFMPEGReader(m_buffer);
|
||||||
|
AUD_NEW("reader")
|
||||||
|
return reader;
|
||||||
|
}
|
||||||
|
catch(AUD_Exception e) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return reader;
|
||||||
|
}
|
71
intern/audaspace/intern/AUD_FileFactory.h
Normal file
71
intern/audaspace/intern/AUD_FileFactory.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AUD_FILEFACTORY
|
||||||
|
#define AUD_FILEFACTORY
|
||||||
|
|
||||||
|
#include "AUD_IFactory.h"
|
||||||
|
#include "AUD_Reference.h"
|
||||||
|
class AUD_Buffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This factory tries to read a sound file via all available file readers.
|
||||||
|
*/
|
||||||
|
class AUD_FileFactory : public AUD_IFactory
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The filename of the sound source file.
|
||||||
|
*/
|
||||||
|
char* m_filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The buffer to read from.
|
||||||
|
*/
|
||||||
|
AUD_Reference<AUD_Buffer> m_buffer;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new factory.
|
||||||
|
* \param filename The sound file path.
|
||||||
|
*/
|
||||||
|
AUD_FileFactory(const char* filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new factory.
|
||||||
|
* \param buffer The buffer to read from.
|
||||||
|
* \param size The size of the buffer.
|
||||||
|
*/
|
||||||
|
AUD_FileFactory(unsigned char* buffer, int size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the factory.
|
||||||
|
*/
|
||||||
|
~AUD_FileFactory();
|
||||||
|
|
||||||
|
virtual AUD_IReader* createReader();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //AUD_FILEFACTORY
|
@ -35,6 +35,31 @@ include nan_compile.mk
|
|||||||
|
|
||||||
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||||
|
|
||||||
|
ifeq ($(WITH_SDL),true)
|
||||||
|
CPPFLAGS += -DWITH_SDL
|
||||||
|
CPPFLAGS += $(NAN_SDLCFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_OPENAL),true)
|
||||||
|
CPPFLAGS += -DWITH_OPENAL
|
||||||
|
CPPFLAGS += -I../OpenAL
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_JACK),true)
|
||||||
|
CPPFLAGS += -DWITH_JACK
|
||||||
|
CPPFLAGS += -I$(NAN_JACKCFLAGS)
|
||||||
|
CPPFLAGS += -I../jack
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_FFMPEG),true)
|
||||||
|
CPPFLAGS += -DWITH_FFMPEG
|
||||||
|
CPPFLAGS += $(NAN_FFMPEGCFLAGS)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(WITH_SNDFILE),true)
|
||||||
|
CPPFLAGS += -DWITH_SNDFILE
|
||||||
|
endif
|
||||||
|
|
||||||
CPPFLAGS += -I$(LCGDIR)/samplerate/include/
|
CPPFLAGS += -I$(LCGDIR)/samplerate/include/
|
||||||
CPPFLAGS += -I../ffmpeg
|
CPPFLAGS += -I../ffmpeg
|
||||||
CPPFLAGS += -I../FX
|
CPPFLAGS += -I../FX
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
#ifndef AUD_JACKDEVICE
|
#ifndef AUD_JACKDEVICE
|
||||||
#define AUD_JACKDEVICE
|
#define AUD_JACKDEVICE
|
||||||
|
|
||||||
|
|
||||||
#include "AUD_SoftwareDevice.h"
|
#include "AUD_SoftwareDevice.h"
|
||||||
class AUD_Buffer;
|
class AUD_Buffer;
|
||||||
|
|
||||||
|
@ -35,6 +35,10 @@ include nan_compile.mk
|
|||||||
|
|
||||||
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||||
|
|
||||||
|
# If we are here, jack is enable.
|
||||||
|
CPPFLAGS += -DWITH_JACK
|
||||||
|
CPPFLAGS += $(NAN_JACKCFLAGS)
|
||||||
|
|
||||||
CPPFLAGS += -I../intern
|
CPPFLAGS += -I../intern
|
||||||
CPPFLAGS += -I..
|
CPPFLAGS += -I..
|
||||||
CPPFLAGS += -I.
|
CPPFLAGS += -I.
|
||||||
|
@ -380,6 +380,14 @@
|
|||||||
RelativePath="..\..\intern\AUD_ConverterReader.h"
|
RelativePath="..\..\intern\AUD_ConverterReader.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\intern\AUD_FileFactory.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\intern\AUD_FileFactory.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\intern\AUD_FloatMixer.cpp"
|
RelativePath="..\..\intern\AUD_FloatMixer.cpp"
|
||||||
>
|
>
|
||||||
@ -717,6 +725,18 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="jack"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\jack\AUD_JackDevice.cpp"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\jack\AUD_JackDevice.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\AUD_C-API.h"
|
RelativePath="..\..\AUD_C-API.h"
|
||||||
>
|
>
|
||||||
|
67
intern/audaspace/sndfile/AUD_SndFileFactory.cpp
Normal file
67
intern/audaspace/sndfile/AUD_SndFileFactory.cpp
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AUD_SndFileFactory.h"
|
||||||
|
#include "AUD_SndFileReader.h"
|
||||||
|
#include "AUD_Buffer.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
AUD_SndFileFactory::AUD_SndFileFactory(const char* filename)
|
||||||
|
{
|
||||||
|
if(filename != NULL)
|
||||||
|
{
|
||||||
|
m_filename = new char[strlen(filename)+1]; AUD_NEW("string")
|
||||||
|
strcpy(m_filename, filename);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
m_filename = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_SndFileFactory::AUD_SndFileFactory(unsigned char* buffer, int size)
|
||||||
|
{
|
||||||
|
m_filename = NULL;
|
||||||
|
m_buffer = AUD_Reference<AUD_Buffer>(new AUD_Buffer(size));
|
||||||
|
memcpy(m_buffer.get()->getBuffer(), buffer, size);
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_SndFileFactory::~AUD_SndFileFactory()
|
||||||
|
{
|
||||||
|
if(m_filename)
|
||||||
|
{
|
||||||
|
delete[] m_filename; AUD_DELETE("string")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_IReader* AUD_SndFileFactory::createReader()
|
||||||
|
{
|
||||||
|
AUD_IReader* reader;
|
||||||
|
if(m_filename)
|
||||||
|
reader = new AUD_SndFileReader(m_filename);
|
||||||
|
else
|
||||||
|
reader = new AUD_SndFileReader(m_buffer);
|
||||||
|
AUD_NEW("reader")
|
||||||
|
return reader;
|
||||||
|
}
|
71
intern/audaspace/sndfile/AUD_SndFileFactory.h
Normal file
71
intern/audaspace/sndfile/AUD_SndFileFactory.h
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AUD_SNDFILEFACTORY
|
||||||
|
#define AUD_SNDFILEFACTORY
|
||||||
|
|
||||||
|
#include "AUD_IFactory.h"
|
||||||
|
#include "AUD_Reference.h"
|
||||||
|
class AUD_Buffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This factory reads a sound file via libsndfile.
|
||||||
|
*/
|
||||||
|
class AUD_SndFileFactory : public AUD_IFactory
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The filename of the sound source file.
|
||||||
|
*/
|
||||||
|
char* m_filename;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The buffer to read from.
|
||||||
|
*/
|
||||||
|
AUD_Reference<AUD_Buffer> m_buffer;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new factory.
|
||||||
|
* \param filename The sound file path.
|
||||||
|
*/
|
||||||
|
AUD_SndFileFactory(const char* filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new factory.
|
||||||
|
* \param buffer The buffer to read from.
|
||||||
|
* \param size The size of the buffer.
|
||||||
|
*/
|
||||||
|
AUD_SndFileFactory(unsigned char* buffer, int size);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the factory.
|
||||||
|
*/
|
||||||
|
~AUD_SndFileFactory();
|
||||||
|
|
||||||
|
virtual AUD_IReader* createReader();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //AUD_SNDFILEFACTORY
|
233
intern/audaspace/sndfile/AUD_SndFileReader.cpp
Normal file
233
intern/audaspace/sndfile/AUD_SndFileReader.cpp
Normal file
@ -0,0 +1,233 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "AUD_SndFileReader.h"
|
||||||
|
#include "AUD_Buffer.h"
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
// This function transforms a SampleFormat to our own sample format
|
||||||
|
static inline AUD_SampleFormat SNDFILE_TO_AUD(int fmt)
|
||||||
|
{
|
||||||
|
switch(fmt & SF_FORMAT_SUBMASK)
|
||||||
|
{
|
||||||
|
// only read s16, s32 and double as they are
|
||||||
|
case SF_FORMAT_PCM_16:
|
||||||
|
return AUD_FORMAT_S16;
|
||||||
|
case SF_FORMAT_PCM_32:
|
||||||
|
return AUD_FORMAT_S32;
|
||||||
|
case SF_FORMAT_DOUBLE:
|
||||||
|
return AUD_FORMAT_FLOAT64;
|
||||||
|
// read all other formats as floats
|
||||||
|
default:
|
||||||
|
return AUD_FORMAT_FLOAT32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sf_count_t AUD_SndFileReader::vio_get_filelen(void *user_data)
|
||||||
|
{
|
||||||
|
AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
|
||||||
|
return reader->m_membuffer.get()->getSize();
|
||||||
|
}
|
||||||
|
|
||||||
|
sf_count_t AUD_SndFileReader::vio_seek(sf_count_t offset, int whence, void *user_data)
|
||||||
|
{
|
||||||
|
AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
|
||||||
|
|
||||||
|
switch(whence)
|
||||||
|
{
|
||||||
|
case SEEK_SET:
|
||||||
|
reader->m_memoffset = offset;
|
||||||
|
break;
|
||||||
|
case SEEK_CUR:
|
||||||
|
reader->m_memoffset = reader->m_memoffset + offset;
|
||||||
|
break;
|
||||||
|
case SEEK_END:
|
||||||
|
reader->m_memoffset = reader->m_membuffer.get()->getSize() + offset;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return reader->m_memoffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
sf_count_t AUD_SndFileReader::vio_read(void *ptr, sf_count_t count, void *user_data)
|
||||||
|
{
|
||||||
|
AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
|
||||||
|
|
||||||
|
if(reader->m_memoffset + count > reader->m_membuffer.get()->getSize())
|
||||||
|
count = reader->m_membuffer.get()->getSize() - reader->m_memoffset;
|
||||||
|
|
||||||
|
memcpy(ptr, reader->m_membuffer.get()->getBuffer() + reader->m_memoffset, count);
|
||||||
|
reader->m_memoffset += count;
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
sf_count_t AUD_SndFileReader::vio_tell(void *user_data)
|
||||||
|
{
|
||||||
|
AUD_SndFileReader* reader = (AUD_SndFileReader*)user_data;
|
||||||
|
|
||||||
|
return reader->m_memoffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_SndFileReader::AUD_SndFileReader(const char* filename)
|
||||||
|
{
|
||||||
|
SF_INFO sfinfo;
|
||||||
|
|
||||||
|
sfinfo.format = 0;
|
||||||
|
m_sndfile = sf_open(filename, SFM_READ, &sfinfo);
|
||||||
|
|
||||||
|
if(!m_sndfile)
|
||||||
|
AUD_THROW(AUD_ERROR_FILE);
|
||||||
|
|
||||||
|
m_specs.channels = (AUD_Channels) sfinfo.channels;
|
||||||
|
m_specs.format = SNDFILE_TO_AUD(sfinfo.format);
|
||||||
|
m_specs.rate = (AUD_SampleRate) sfinfo.samplerate;
|
||||||
|
m_length = sfinfo.frames;
|
||||||
|
m_seekable = sfinfo.seekable;
|
||||||
|
m_position = 0;
|
||||||
|
|
||||||
|
switch(m_specs.format)
|
||||||
|
{
|
||||||
|
case AUD_FORMAT_S16:
|
||||||
|
m_read = (sf_read_f) sf_readf_short;
|
||||||
|
break;
|
||||||
|
case AUD_FORMAT_S32:
|
||||||
|
m_read = (sf_read_f) sf_readf_int;
|
||||||
|
break;
|
||||||
|
case AUD_FORMAT_FLOAT64:
|
||||||
|
m_read = (sf_read_f) sf_readf_double;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_read = (sf_read_f) sf_readf_float;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_SndFileReader::AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer)
|
||||||
|
{
|
||||||
|
m_membuffer = buffer;
|
||||||
|
m_memoffset = 0;
|
||||||
|
|
||||||
|
m_vio.get_filelen = vio_get_filelen;
|
||||||
|
m_vio.read = vio_read;
|
||||||
|
m_vio.seek = vio_seek;
|
||||||
|
m_vio.tell = vio_tell;
|
||||||
|
m_vio.write = NULL;
|
||||||
|
|
||||||
|
SF_INFO sfinfo;
|
||||||
|
|
||||||
|
sfinfo.format = 0;
|
||||||
|
m_sndfile = sf_open_virtual(&m_vio, SFM_READ, &sfinfo, this);
|
||||||
|
|
||||||
|
if(!m_sndfile)
|
||||||
|
AUD_THROW(AUD_ERROR_FILE);
|
||||||
|
|
||||||
|
m_specs.channels = (AUD_Channels) sfinfo.channels;
|
||||||
|
m_specs.format = SNDFILE_TO_AUD(sfinfo.format);
|
||||||
|
m_specs.rate = (AUD_SampleRate) sfinfo.samplerate;
|
||||||
|
m_length = sfinfo.frames;
|
||||||
|
m_seekable = sfinfo.seekable;
|
||||||
|
m_position = 0;
|
||||||
|
|
||||||
|
switch(m_specs.format)
|
||||||
|
{
|
||||||
|
case AUD_FORMAT_S16:
|
||||||
|
m_read = (sf_read_f) sf_readf_short;
|
||||||
|
break;
|
||||||
|
case AUD_FORMAT_S32:
|
||||||
|
m_read = (sf_read_f) sf_readf_int;
|
||||||
|
break;
|
||||||
|
case AUD_FORMAT_FLOAT64:
|
||||||
|
m_read = (sf_read_f) sf_readf_double;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_read = (sf_read_f) sf_readf_float;
|
||||||
|
}
|
||||||
|
|
||||||
|
m_buffer = new AUD_Buffer(); AUD_NEW("buffer")
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_SndFileReader::~AUD_SndFileReader()
|
||||||
|
{
|
||||||
|
sf_close(m_sndfile);
|
||||||
|
|
||||||
|
delete m_buffer; AUD_DELETE("buffer")
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AUD_SndFileReader::isSeekable()
|
||||||
|
{
|
||||||
|
return m_seekable;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AUD_SndFileReader::seek(int position)
|
||||||
|
{
|
||||||
|
if(m_seekable)
|
||||||
|
{
|
||||||
|
position = sf_seek(m_sndfile, position, SEEK_SET);
|
||||||
|
m_position = position;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int AUD_SndFileReader::getLength()
|
||||||
|
{
|
||||||
|
return m_length;
|
||||||
|
}
|
||||||
|
|
||||||
|
int AUD_SndFileReader::getPosition()
|
||||||
|
{
|
||||||
|
return m_position;
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_Specs AUD_SndFileReader::getSpecs()
|
||||||
|
{
|
||||||
|
return m_specs;
|
||||||
|
}
|
||||||
|
|
||||||
|
AUD_ReaderType AUD_SndFileReader::getType()
|
||||||
|
{
|
||||||
|
return AUD_TYPE_STREAM;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AUD_SndFileReader::notify(AUD_Message &message)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void AUD_SndFileReader::read(int & length, sample_t* & buffer)
|
||||||
|
{
|
||||||
|
int sample_size = AUD_SAMPLE_SIZE(m_specs);
|
||||||
|
|
||||||
|
// resize output buffer if necessary
|
||||||
|
if(m_buffer->getSize() < length*sample_size)
|
||||||
|
m_buffer->resize(length*sample_size);
|
||||||
|
|
||||||
|
buffer = m_buffer->getBuffer();
|
||||||
|
|
||||||
|
length = m_read(m_sndfile, buffer, length);
|
||||||
|
|
||||||
|
m_position += length;
|
||||||
|
}
|
131
intern/audaspace/sndfile/AUD_SndFileReader.h
Normal file
131
intern/audaspace/sndfile/AUD_SndFileReader.h
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
/*
|
||||||
|
* $Id$
|
||||||
|
*
|
||||||
|
* ***** BEGIN LGPL LICENSE BLOCK *****
|
||||||
|
*
|
||||||
|
* Copyright 2009 Jörg Hermann Müller
|
||||||
|
*
|
||||||
|
* This file is part of AudaSpace.
|
||||||
|
*
|
||||||
|
* AudaSpace is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* AudaSpace 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 Lesser General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Lesser General Public License
|
||||||
|
* along with AudaSpace. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*
|
||||||
|
* ***** END LGPL LICENSE BLOCK *****
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AUD_SNDFILEREADER
|
||||||
|
#define AUD_SNDFILEREADER
|
||||||
|
|
||||||
|
#include "AUD_IReader.h"
|
||||||
|
#include "AUD_Reference.h"
|
||||||
|
class AUD_Buffer;
|
||||||
|
|
||||||
|
#include <sndfile.h>
|
||||||
|
|
||||||
|
typedef sf_count_t (*sf_read_f)(SNDFILE *sndfile, void *ptr, sf_count_t frames);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class reads a sound file via libsndfile.
|
||||||
|
*/
|
||||||
|
class AUD_SndFileReader : public AUD_IReader
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
/**
|
||||||
|
* The current position in samples.
|
||||||
|
*/
|
||||||
|
int m_position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sample count in the file.
|
||||||
|
*/
|
||||||
|
int m_length;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the file is seekable.
|
||||||
|
*/
|
||||||
|
bool m_seekable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The specification of the audio data.
|
||||||
|
*/
|
||||||
|
AUD_Specs m_specs;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The playback buffer.
|
||||||
|
*/
|
||||||
|
AUD_Buffer* m_buffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The sndfile.
|
||||||
|
*/
|
||||||
|
SNDFILE* m_sndfile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The reading function.
|
||||||
|
*/
|
||||||
|
sf_read_f m_read;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The virtual IO structure for memory file reading.
|
||||||
|
*/
|
||||||
|
SF_VIRTUAL_IO m_vio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The pointer to the memory file.
|
||||||
|
*/
|
||||||
|
AUD_Reference<AUD_Buffer> m_membuffer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The current reading pointer of the memory file.
|
||||||
|
*/
|
||||||
|
int m_memoffset;
|
||||||
|
|
||||||
|
// Functions for libsndfile virtual IO functionality
|
||||||
|
static sf_count_t vio_get_filelen(void *user_data);
|
||||||
|
static sf_count_t vio_seek(sf_count_t offset, int whence, void *user_data);
|
||||||
|
static sf_count_t vio_read(void *ptr, sf_count_t count, void *user_data);
|
||||||
|
static sf_count_t vio_tell(void *user_data);
|
||||||
|
|
||||||
|
public:
|
||||||
|
/**
|
||||||
|
* Creates a new reader.
|
||||||
|
* \param filename The path to the file to be read.
|
||||||
|
* \exception AUD_Exception Thrown if the file specified does not exist or
|
||||||
|
* cannot be read with libsndfile.
|
||||||
|
*/
|
||||||
|
AUD_SndFileReader(const char* filename);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new reader.
|
||||||
|
* \param buffer The buffer to read from.
|
||||||
|
* \exception AUD_Exception Thrown if the buffer specified cannot be read
|
||||||
|
* with libsndfile.
|
||||||
|
*/
|
||||||
|
AUD_SndFileReader(AUD_Reference<AUD_Buffer> buffer);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Destroys the reader and closes the file.
|
||||||
|
*/
|
||||||
|
virtual ~AUD_SndFileReader();
|
||||||
|
|
||||||
|
virtual bool isSeekable();
|
||||||
|
virtual void seek(int position);
|
||||||
|
virtual int getLength();
|
||||||
|
virtual int getPosition();
|
||||||
|
virtual AUD_Specs getSpecs();
|
||||||
|
virtual AUD_ReaderType getType();
|
||||||
|
virtual bool notify(AUD_Message &message);
|
||||||
|
virtual void read(int & length, sample_t* & buffer);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif //AUD_SNDFILEREADER
|
40
intern/audaspace/sndfile/Makefile
Normal file
40
intern/audaspace/sndfile/Makefile
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
#
|
||||||
|
# $Id$
|
||||||
|
#
|
||||||
|
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
#
|
||||||
|
# The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# The Original Code is: all of this file.
|
||||||
|
#
|
||||||
|
# Contributor(s):
|
||||||
|
#
|
||||||
|
# ***** END GPL LICENSE BLOCK *****
|
||||||
|
#
|
||||||
|
#
|
||||||
|
|
||||||
|
LIBNAME = aud_sndfile
|
||||||
|
DIR = $(OCGDIR)/intern/audaspace
|
||||||
|
|
||||||
|
include nan_compile.mk
|
||||||
|
|
||||||
|
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
|
||||||
|
|
||||||
|
CPPFLAGS += -I../intern
|
||||||
|
CPPFLAGS += -I..
|
||||||
|
CPPFLAGS += -I.
|
@ -289,9 +289,9 @@ GHOST_TSuccess GHOST_System::init()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GHOST_DEBUG
|
#ifdef GHOST_DEBUG
|
||||||
m_eventPrinter = new GHOST_EventPrinter();
|
|
||||||
if (m_eventManager) {
|
if (m_eventManager) {
|
||||||
m_eventManager->addConsumer(m_eventPrinter);
|
m_eventPrinter = new GHOST_EventPrinter();
|
||||||
|
//m_eventManager->addConsumer(m_eventPrinter);
|
||||||
}
|
}
|
||||||
#endif // GHOST_DEBUG
|
#endif // GHOST_DEBUG
|
||||||
|
|
||||||
|
15
intern/smoke/extern/smoke_API.h
vendored
15
intern/smoke/extern/smoke_API.h
vendored
@ -20,7 +20,7 @@
|
|||||||
* The Original Code is Copyright (C) 2009 by Daniel Genrich
|
* The Original Code is Copyright (C) 2009 by Daniel Genrich
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): None
|
* Contributor(s): Daniel Genrich
|
||||||
*
|
*
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@ -32,6 +32,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// export
|
||||||
|
void smoke_export(struct FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles);
|
||||||
|
|
||||||
|
// low res
|
||||||
struct FLUID_3D *smoke_init(int *res, float *p0, float dt);
|
struct FLUID_3D *smoke_init(int *res, float *p0, float dt);
|
||||||
void smoke_free(struct FLUID_3D *fluid);
|
void smoke_free(struct FLUID_3D *fluid);
|
||||||
|
|
||||||
@ -57,11 +61,14 @@ void smoke_turbulence_free(struct WTURBULENCE *wt);
|
|||||||
void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
|
void smoke_turbulence_step(struct WTURBULENCE *wt, struct FLUID_3D *fluid);
|
||||||
|
|
||||||
float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
|
float *smoke_turbulence_get_density(struct WTURBULENCE *wt);
|
||||||
void smoke_turbulence_get_res(struct WTURBULENCE *wt, int *res);
|
void smoke_turbulence_get_res(struct WTURBULENCE *wt, unsigned int *res);
|
||||||
void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
|
void smoke_turbulence_set_noise(struct WTURBULENCE *wt, int type);
|
||||||
void smoke_initWaveletBlenderRNA(struct WTURBULENCE *wt, float *strength);
|
void smoke_turbulence_initBlenderRNA(struct WTURBULENCE *wt, float *strength);
|
||||||
|
|
||||||
void smoke_dissolve_wavelet(struct WTURBULENCE *wt, int speed, int log);
|
void smoke_turbulence_dissolve(struct WTURBULENCE *wt, int speed, int log);
|
||||||
|
|
||||||
|
// export
|
||||||
|
void smoke_turbulence_export(struct WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
@ -75,8 +75,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
|
|||||||
// allocate arrays
|
// allocate arrays
|
||||||
_totalCells = _xRes * _yRes * _zRes;
|
_totalCells = _xRes * _yRes * _zRes;
|
||||||
_slabSize = _xRes * _yRes;
|
_slabSize = _xRes * _yRes;
|
||||||
_divergence = new float[_totalCells];
|
|
||||||
_pressure = new float[_totalCells];
|
|
||||||
_xVelocity = new float[_totalCells];
|
_xVelocity = new float[_totalCells];
|
||||||
_yVelocity = new float[_totalCells];
|
_yVelocity = new float[_totalCells];
|
||||||
_zVelocity = new float[_totalCells];
|
_zVelocity = new float[_totalCells];
|
||||||
@ -86,20 +84,11 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
|
|||||||
_xForce = new float[_totalCells];
|
_xForce = new float[_totalCells];
|
||||||
_yForce = new float[_totalCells];
|
_yForce = new float[_totalCells];
|
||||||
_zForce = new float[_totalCells];
|
_zForce = new float[_totalCells];
|
||||||
_vorticity = new float[_totalCells];
|
|
||||||
_density = new float[_totalCells];
|
_density = new float[_totalCells];
|
||||||
_densityOld = new float[_totalCells];
|
_densityOld = new float[_totalCells];
|
||||||
_heat = new float[_totalCells];
|
_heat = new float[_totalCells];
|
||||||
_heatOld = new float[_totalCells];
|
_heatOld = new float[_totalCells];
|
||||||
_residual = new float[_totalCells];
|
_obstacles = new unsigned char[_totalCells]; // set 0 at end of step
|
||||||
_direction = new float[_totalCells];
|
|
||||||
_q = new float[_totalCells];
|
|
||||||
_obstacles = new unsigned char[_totalCells];
|
|
||||||
_xVorticity = new float[_totalCells];
|
|
||||||
_yVorticity = new float[_totalCells];
|
|
||||||
_zVorticity = new float[_totalCells];
|
|
||||||
_h = new float[_totalCells];
|
|
||||||
_Precond = new float[_totalCells];
|
|
||||||
|
|
||||||
// DG TODO: check if alloc went fine
|
// DG TODO: check if alloc went fine
|
||||||
|
|
||||||
@ -109,8 +98,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
|
|||||||
_densityOld[x] = 0.0f;
|
_densityOld[x] = 0.0f;
|
||||||
_heat[x] = 0.0f;
|
_heat[x] = 0.0f;
|
||||||
_heatOld[x] = 0.0f;
|
_heatOld[x] = 0.0f;
|
||||||
_divergence[x] = 0.0f;
|
|
||||||
_pressure[x] = 0.0f;
|
|
||||||
_xVelocity[x] = 0.0f;
|
_xVelocity[x] = 0.0f;
|
||||||
_yVelocity[x] = 0.0f;
|
_yVelocity[x] = 0.0f;
|
||||||
_zVelocity[x] = 0.0f;
|
_zVelocity[x] = 0.0f;
|
||||||
@ -120,19 +107,11 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
|
|||||||
_xForce[x] = 0.0f;
|
_xForce[x] = 0.0f;
|
||||||
_yForce[x] = 0.0f;
|
_yForce[x] = 0.0f;
|
||||||
_zForce[x] = 0.0f;
|
_zForce[x] = 0.0f;
|
||||||
_xVorticity[x] = 0.0f;
|
|
||||||
_yVorticity[x] = 0.0f;
|
|
||||||
_zVorticity[x] = 0.0f;
|
|
||||||
_residual[x] = 0.0f;
|
|
||||||
_q[x] = 0.0f;
|
|
||||||
_direction[x] = 0.0f;
|
|
||||||
_h[x] = 0.0f;
|
|
||||||
_Precond[x] = 0.0f;
|
|
||||||
_obstacles[x] = false;
|
_obstacles[x] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// set side obstacles
|
// set side obstacles
|
||||||
int index;
|
size_t index;
|
||||||
for (int y = 0; y < _yRes; y++) // z
|
for (int y = 0; y < _yRes; y++) // z
|
||||||
for (int x = 0; x < _xRes; x++)
|
for (int x = 0; x < _xRes; x++)
|
||||||
{
|
{
|
||||||
@ -177,8 +156,6 @@ FLUID_3D::FLUID_3D(int *res, float *p0, float dt) :
|
|||||||
|
|
||||||
FLUID_3D::~FLUID_3D()
|
FLUID_3D::~FLUID_3D()
|
||||||
{
|
{
|
||||||
if (_divergence) delete[] _divergence;
|
|
||||||
if (_pressure) delete[] _pressure;
|
|
||||||
if (_xVelocity) delete[] _xVelocity;
|
if (_xVelocity) delete[] _xVelocity;
|
||||||
if (_yVelocity) delete[] _yVelocity;
|
if (_yVelocity) delete[] _yVelocity;
|
||||||
if (_zVelocity) delete[] _zVelocity;
|
if (_zVelocity) delete[] _zVelocity;
|
||||||
@ -188,23 +165,14 @@ FLUID_3D::~FLUID_3D()
|
|||||||
if (_xForce) delete[] _xForce;
|
if (_xForce) delete[] _xForce;
|
||||||
if (_yForce) delete[] _yForce;
|
if (_yForce) delete[] _yForce;
|
||||||
if (_zForce) delete[] _zForce;
|
if (_zForce) delete[] _zForce;
|
||||||
if (_residual) delete[] _residual;
|
|
||||||
if (_direction) delete[] _direction;
|
|
||||||
if (_q) delete[] _q;
|
|
||||||
if (_density) delete[] _density;
|
if (_density) delete[] _density;
|
||||||
if (_densityOld) delete[] _densityOld;
|
if (_densityOld) delete[] _densityOld;
|
||||||
if (_heat) delete[] _heat;
|
if (_heat) delete[] _heat;
|
||||||
if (_heatOld) delete[] _heatOld;
|
if (_heatOld) delete[] _heatOld;
|
||||||
if (_xVorticity) delete[] _xVorticity;
|
|
||||||
if (_yVorticity) delete[] _yVorticity;
|
|
||||||
if (_zVorticity) delete[] _zVorticity;
|
|
||||||
if (_vorticity) delete[] _vorticity;
|
|
||||||
if (_h) delete[] _h;
|
|
||||||
if (_Precond) delete[] _Precond;
|
|
||||||
if (_obstacles) delete[] _obstacles;
|
if (_obstacles) delete[] _obstacles;
|
||||||
// if (_wTurbulence) delete _wTurbulence;
|
// if (_wTurbulence) delete _wTurbulence;
|
||||||
|
|
||||||
printf("deleted fluid\n");
|
// printf("deleted fluid\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
// init direct access functions from blender
|
// init direct access functions from blender
|
||||||
@ -263,6 +231,8 @@ void FLUID_3D::step()
|
|||||||
*/
|
*/
|
||||||
_totalTime += _dt;
|
_totalTime += _dt;
|
||||||
_totalSteps++;
|
_totalSteps++;
|
||||||
|
|
||||||
|
memset(_obstacles, 0, sizeof(unsigned char)*_xRes*_yRes*_zRes);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -300,7 +270,7 @@ void FLUID_3D::artificialDamping(float* field) {
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void FLUID_3D::copyBorderAll(float* field)
|
void FLUID_3D::copyBorderAll(float* field)
|
||||||
{
|
{
|
||||||
int index;
|
size_t index;
|
||||||
for (int y = 0; y < _yRes; y++)
|
for (int y = 0; y < _yRes; y++)
|
||||||
for (int x = 0; x < _xRes; x++)
|
for (int x = 0; x < _xRes; x++)
|
||||||
{
|
{
|
||||||
@ -367,9 +337,16 @@ void FLUID_3D::addForce()
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void FLUID_3D::project()
|
void FLUID_3D::project()
|
||||||
{
|
{
|
||||||
int index, x, y, z;
|
int x, y, z;
|
||||||
|
size_t index;
|
||||||
|
|
||||||
setObstacleBoundaries();
|
float *_pressure = new float[_totalCells];
|
||||||
|
float *_divergence = new float[_totalCells];
|
||||||
|
|
||||||
|
memset(_pressure, 0, sizeof(float)*_totalCells);
|
||||||
|
memset(_divergence, 0, sizeof(float)*_totalCells);
|
||||||
|
|
||||||
|
setObstacleBoundaries(_pressure);
|
||||||
|
|
||||||
// copy out the boundaries
|
// copy out the boundaries
|
||||||
if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res);
|
if(DOMAIN_BC_LEFT == 0) setNeumannX(_xVelocity, _res);
|
||||||
@ -414,7 +391,7 @@ void FLUID_3D::project()
|
|||||||
// solve Poisson equation
|
// solve Poisson equation
|
||||||
solvePressurePre(_pressure, _divergence, _obstacles);
|
solvePressurePre(_pressure, _divergence, _obstacles);
|
||||||
|
|
||||||
setObstaclePressure();
|
setObstaclePressure(_pressure);
|
||||||
|
|
||||||
// project out solution
|
// project out solution
|
||||||
float invDx = 1.0f / _dx;
|
float invDx = 1.0f / _dx;
|
||||||
@ -430,6 +407,9 @@ void FLUID_3D::project()
|
|||||||
_zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx;
|
_zVelocity[index] -= 0.5f * (_pressure[index + _slabSize] - _pressure[index - _slabSize]) * invDx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_pressure) delete[] _pressure;
|
||||||
|
if (_divergence) delete[] _divergence;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -465,7 +445,7 @@ void FLUID_3D::addObstacle(OBSTACLE* obstacle)
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// calculate the obstacle directional types
|
// calculate the obstacle directional types
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void FLUID_3D::setObstaclePressure()
|
void FLUID_3D::setObstaclePressure(float *_pressure)
|
||||||
{
|
{
|
||||||
// tag remaining obstacle blocks
|
// tag remaining obstacle blocks
|
||||||
for (int z = 1, index = _slabSize + _xRes + 1;
|
for (int z = 1, index = _slabSize + _xRes + 1;
|
||||||
@ -539,7 +519,7 @@ void FLUID_3D::setObstaclePressure()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FLUID_3D::setObstacleBoundaries()
|
void FLUID_3D::setObstacleBoundaries(float *_pressure)
|
||||||
{
|
{
|
||||||
// cull degenerate obstacles , move to addObstacle?
|
// cull degenerate obstacles , move to addObstacle?
|
||||||
for (int z = 1, index = _slabSize + _xRes + 1;
|
for (int z = 1, index = _slabSize + _xRes + 1;
|
||||||
@ -600,6 +580,18 @@ void FLUID_3D::addVorticity()
|
|||||||
int x,y,z,index;
|
int x,y,z,index;
|
||||||
if(_vorticityEps<=0.) return;
|
if(_vorticityEps<=0.) return;
|
||||||
|
|
||||||
|
float *_xVorticity, *_yVorticity, *_zVorticity, *_vorticity;
|
||||||
|
|
||||||
|
_xVorticity = new float[_totalCells];
|
||||||
|
_yVorticity = new float[_totalCells];
|
||||||
|
_zVorticity = new float[_totalCells];
|
||||||
|
_vorticity = new float[_totalCells];
|
||||||
|
|
||||||
|
memset(_xVorticity, 0, sizeof(float)*_totalCells);
|
||||||
|
memset(_yVorticity, 0, sizeof(float)*_totalCells);
|
||||||
|
memset(_zVorticity, 0, sizeof(float)*_totalCells);
|
||||||
|
memset(_vorticity, 0, sizeof(float)*_totalCells);
|
||||||
|
|
||||||
// calculate vorticity
|
// calculate vorticity
|
||||||
float gridSize = 0.5f / _dx;
|
float gridSize = 0.5f / _dx;
|
||||||
index = _slabSize + _xRes + 1;
|
index = _slabSize + _xRes + 1;
|
||||||
@ -662,6 +654,11 @@ void FLUID_3D::addVorticity()
|
|||||||
_zForce[index] += (N[0] * _yVorticity[index] - N[1] * _xVorticity[index]) * _dx * eps;
|
_zForce[index] += (N[0] * _yVorticity[index] - N[1] * _xVorticity[index]) * _dx * eps;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (_xVorticity) delete[] _xVorticity;
|
||||||
|
if (_yVorticity) delete[] _yVorticity;
|
||||||
|
if (_zVorticity) delete[] _zVorticity;
|
||||||
|
if (_vorticity) delete[] _vorticity;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
@ -64,7 +64,7 @@ class FLUID_3D
|
|||||||
// dimensions
|
// dimensions
|
||||||
int _xRes, _yRes, _zRes, _maxRes;
|
int _xRes, _yRes, _zRes, _maxRes;
|
||||||
Vec3Int _res;
|
Vec3Int _res;
|
||||||
int _totalCells;
|
size_t _totalCells;
|
||||||
int _slabSize;
|
int _slabSize;
|
||||||
float _dx;
|
float _dx;
|
||||||
float _p0[3];
|
float _p0[3];
|
||||||
@ -81,7 +81,6 @@ class FLUID_3D
|
|||||||
float* _densityOld;
|
float* _densityOld;
|
||||||
float* _heat;
|
float* _heat;
|
||||||
float* _heatOld;
|
float* _heatOld;
|
||||||
float* _pressure;
|
|
||||||
float* _xVelocity;
|
float* _xVelocity;
|
||||||
float* _yVelocity;
|
float* _yVelocity;
|
||||||
float* _zVelocity;
|
float* _zVelocity;
|
||||||
@ -91,19 +90,9 @@ class FLUID_3D
|
|||||||
float* _xForce;
|
float* _xForce;
|
||||||
float* _yForce;
|
float* _yForce;
|
||||||
float* _zForce;
|
float* _zForce;
|
||||||
float* _divergence;
|
|
||||||
float* _xVorticity;
|
|
||||||
float* _yVorticity;
|
|
||||||
float* _zVorticity;
|
|
||||||
float* _vorticity;
|
|
||||||
float* _h;
|
|
||||||
float* _Precond;
|
|
||||||
unsigned char* _obstacles;
|
unsigned char* _obstacles;
|
||||||
|
|
||||||
// CG fields
|
// CG fields
|
||||||
float* _residual;
|
|
||||||
float* _direction;
|
|
||||||
float* _q;
|
|
||||||
int _iterations;
|
int _iterations;
|
||||||
|
|
||||||
// simulation constants
|
// simulation constants
|
||||||
@ -134,8 +123,8 @@ class FLUID_3D
|
|||||||
void solveHeat(float* field, float* b, unsigned char* skip);
|
void solveHeat(float* field, float* b, unsigned char* skip);
|
||||||
|
|
||||||
// handle obstacle boundaries
|
// handle obstacle boundaries
|
||||||
void setObstacleBoundaries();
|
void setObstacleBoundaries(float *_pressure);
|
||||||
void setObstaclePressure();
|
void setObstaclePressure(float *_pressure);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
// advection, accessed e.g. by WTURBULENCE class
|
// advection, accessed e.g. by WTURBULENCE class
|
||||||
|
@ -28,10 +28,17 @@ void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip)
|
|||||||
{
|
{
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
size_t index;
|
size_t index;
|
||||||
|
float *_q, *_Precond, *_h, *_residual, *_direction;
|
||||||
|
|
||||||
// i = 0
|
// i = 0
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
_residual = new float[_totalCells]; // set 0
|
||||||
|
_direction = new float[_totalCells]; // set 0
|
||||||
|
_q = new float[_totalCells]; // set 0
|
||||||
|
_h = new float[_totalCells]; // set 0
|
||||||
|
_Precond = new float[_totalCells]; // set 0
|
||||||
|
|
||||||
memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
@ -191,11 +198,18 @@ void FLUID_3D::solvePressurePre(float* field, float* b, unsigned char* skip)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// cout << i << " iterations converged to " << sqrt(maxR) << endl;
|
// cout << i << " iterations converged to " << sqrt(maxR) << endl;
|
||||||
|
|
||||||
|
if (_h) delete[] _h;
|
||||||
|
if (_Precond) delete[] _Precond;
|
||||||
|
if (_residual) delete[] _residual;
|
||||||
|
if (_direction) delete[] _direction;
|
||||||
|
if (_q) delete[] _q;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// solve the poisson equation with CG
|
// solve the poisson equation with CG
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
|
#if 0
|
||||||
void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
|
void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
|
||||||
{
|
{
|
||||||
int x, y, z;
|
int x, y, z;
|
||||||
@ -344,6 +358,7 @@ void FLUID_3D::solvePressure(float* field, float* b, unsigned char* skip)
|
|||||||
}
|
}
|
||||||
// cout << i << " iterations converged to " << maxR << endl;
|
// cout << i << " iterations converged to " << maxR << endl;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// solve the heat equation with CG
|
// solve the heat equation with CG
|
||||||
@ -353,10 +368,15 @@ void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip)
|
|||||||
int x, y, z;
|
int x, y, z;
|
||||||
size_t index;
|
size_t index;
|
||||||
const float heatConst = _dt * _heatDiffusion / (_dx * _dx);
|
const float heatConst = _dt * _heatDiffusion / (_dx * _dx);
|
||||||
|
float *_q, *_residual, *_direction;
|
||||||
|
|
||||||
// i = 0
|
// i = 0
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
_residual = new float[_totalCells]; // set 0
|
||||||
|
_direction = new float[_totalCells]; // set 0
|
||||||
|
_q = new float[_totalCells]; // set 0
|
||||||
|
|
||||||
memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_residual, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_q, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
memset(_direction, 0, sizeof(float)*_xRes*_yRes*_zRes);
|
||||||
@ -496,5 +516,9 @@ void FLUID_3D::solveHeat(float* field, float* b, unsigned char* skip)
|
|||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
// cout << i << " iterations converged to " << maxR << endl;
|
// cout << i << " iterations converged to " << maxR << endl;
|
||||||
|
|
||||||
|
if (_residual) delete[] _residual;
|
||||||
|
if (_direction) delete[] _direction;
|
||||||
|
if (_q) delete[] _q;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,25 +81,9 @@ WTURBULENCE::WTURBULENCE(int xResSm, int yResSm, int zResSm, int amplify, int no
|
|||||||
_densityBig = new float[_totalCellsBig];
|
_densityBig = new float[_totalCellsBig];
|
||||||
_densityBigOld = new float[_totalCellsBig];
|
_densityBigOld = new float[_totalCellsBig];
|
||||||
|
|
||||||
// allocate high resolution velocity field. Note that this is only
|
|
||||||
// necessary because we use MacCormack advection. For semi-Lagrangian
|
|
||||||
// advection, these arrays are not necessary.
|
|
||||||
_tempBig1 = _tempBig2 =
|
|
||||||
_bigUx = _bigUy = _bigUz = NULL;
|
|
||||||
_tempBig1 = new float[_totalCellsBig];
|
|
||||||
_tempBig2 = new float[_totalCellsBig];
|
|
||||||
_bigUx = new float[_totalCellsBig];
|
|
||||||
_bigUy = new float[_totalCellsBig];
|
|
||||||
_bigUz = new float[_totalCellsBig];
|
|
||||||
|
|
||||||
for(int i = 0; i < _totalCellsBig; i++) {
|
for(int i = 0; i < _totalCellsBig; i++) {
|
||||||
_densityBig[i] =
|
_densityBig[i] =
|
||||||
_densityBigOld[i] =
|
_densityBigOld[i] = 0.;
|
||||||
_bigUx[i] =
|
|
||||||
_bigUy[i] =
|
|
||||||
_bigUz[i] =
|
|
||||||
_tempBig1[i] =
|
|
||||||
_tempBig2[i] = 0.;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// allocate & init texture coordinates
|
// allocate & init texture coordinates
|
||||||
@ -154,12 +138,6 @@ WTURBULENCE::~WTURBULENCE() {
|
|||||||
delete[] _densityBig;
|
delete[] _densityBig;
|
||||||
delete[] _densityBigOld;
|
delete[] _densityBigOld;
|
||||||
|
|
||||||
delete[] _bigUx;
|
|
||||||
delete[] _bigUy;
|
|
||||||
delete[] _bigUz;
|
|
||||||
delete[] _tempBig1;
|
|
||||||
delete[] _tempBig2;
|
|
||||||
|
|
||||||
delete[] _tcU;
|
delete[] _tcU;
|
||||||
delete[] _tcV;
|
delete[] _tcV;
|
||||||
delete[] _tcW;
|
delete[] _tcW;
|
||||||
@ -315,7 +293,7 @@ static float minDz(int x, int y, int z, float* input, Vec3Int res)
|
|||||||
// handle texture coordinates (advection, reset, eigenvalues),
|
// handle texture coordinates (advection, reset, eigenvalues),
|
||||||
// Beware -- uses big density maccormack as temporary arrays
|
// Beware -- uses big density maccormack as temporary arrays
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void WTURBULENCE::advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel) {
|
void WTURBULENCE::advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2) {
|
||||||
// advection
|
// advection
|
||||||
SWAP_POINTERS(_tcTemp, _tcU);
|
SWAP_POINTERS(_tcTemp, _tcU);
|
||||||
FLUID_3D::copyBorderX(_tcTemp, _resSm);
|
FLUID_3D::copyBorderX(_tcTemp, _resSm);
|
||||||
@ -602,12 +580,32 @@ Vec3 WTURBULENCE::WVelocityWithJacobian(Vec3 orgPos, float* xUnwarped, float* yU
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
|
void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
|
||||||
{
|
{
|
||||||
|
// big velocity macCormack fields
|
||||||
|
float* _bigUx;
|
||||||
|
float* _bigUy;
|
||||||
|
float* _bigUz;
|
||||||
|
|
||||||
|
// temp arrays for BFECC and MacCormack - they have more convenient
|
||||||
|
// names in the actual implementations
|
||||||
|
float* _tempBig1;
|
||||||
|
float* _tempBig2;
|
||||||
|
|
||||||
|
// allocate high resolution velocity field. Note that this is only
|
||||||
|
// necessary because we use MacCormack advection. For semi-Lagrangian
|
||||||
|
// advection, these arrays are not necessary.
|
||||||
|
_tempBig1 = new float[_totalCellsBig];
|
||||||
|
_tempBig2 = new float[_totalCellsBig];
|
||||||
|
|
||||||
// enlarge timestep to match grid
|
// enlarge timestep to match grid
|
||||||
const float dt = dtOrg * _amplify;
|
const float dt = dtOrg * _amplify;
|
||||||
const float invAmp = 1.0f / _amplify;
|
const float invAmp = 1.0f / _amplify;
|
||||||
|
|
||||||
|
_bigUx = new float[_totalCellsBig];
|
||||||
|
_bigUy = new float[_totalCellsBig];
|
||||||
|
_bigUz = new float[_totalCellsBig];
|
||||||
|
|
||||||
// prepare textures
|
// prepare textures
|
||||||
advectTextureCoordinates(dtOrg, xvel,yvel,zvel);
|
advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2);
|
||||||
|
|
||||||
// compute eigenvalues of the texture coordinates
|
// compute eigenvalues of the texture coordinates
|
||||||
computeEigenvalues();
|
computeEigenvalues();
|
||||||
@ -744,6 +742,13 @@ void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel,
|
|||||||
IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
||||||
*/
|
*/
|
||||||
_totalStepsBig++;
|
_totalStepsBig++;
|
||||||
|
|
||||||
|
delete[] _bigUx;
|
||||||
|
delete[] _bigUy;
|
||||||
|
delete[] _bigUz;
|
||||||
|
|
||||||
|
delete[] _tempBig1;
|
||||||
|
delete[] _tempBig2;
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
@ -752,225 +757,257 @@ void WTURBULENCE::stepTurbulenceReadable(float dtOrg, float* xvel, float* yvel,
|
|||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
void WTURBULENCE::stepTurbulenceFull(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
|
void WTURBULENCE::stepTurbulenceFull(float dtOrg, float* xvel, float* yvel, float* zvel, unsigned char *obstacles)
|
||||||
{
|
{
|
||||||
// enlarge timestep to match grid
|
// big velocity macCormack fields
|
||||||
const float dt = dtOrg * _amplify;
|
float* _bigUx;
|
||||||
const float invAmp = 1.0f / _amplify;
|
float* _bigUy;
|
||||||
|
float* _bigUz;
|
||||||
|
|
||||||
// prepare textures
|
// temp arrays for BFECC and MacCormack - they have more convenient
|
||||||
advectTextureCoordinates(dtOrg, xvel,yvel,zvel);
|
// names in the actual implementations
|
||||||
|
float* _tempBig1;
|
||||||
|
float* _tempBig2;
|
||||||
|
|
||||||
// do wavelet decomposition of energy
|
// allocate high resolution velocity field. Note that this is only
|
||||||
computeEnergy(xvel, yvel, zvel, obstacles);
|
// necessary because we use MacCormack advection. For semi-Lagrangian
|
||||||
decomposeEnergy();
|
// advection, these arrays are not necessary.
|
||||||
|
_tempBig1 = new float[_totalCellsBig];
|
||||||
|
_tempBig2 = new float[_totalCellsBig];
|
||||||
|
|
||||||
// zero out coefficients inside of the obstacle
|
// enlarge timestep to match grid
|
||||||
for (int x = 0; x < _totalCellsSm; x++)
|
const float dt = dtOrg * _amplify;
|
||||||
if (obstacles[x]) _energy[x] = 0.f;
|
const float invAmp = 1.0f / _amplify;
|
||||||
|
|
||||||
// parallel region setup
|
_bigUx = new float[_totalCellsBig];
|
||||||
float maxVelMagThreads[8] = { -1., -1., -1., -1., -1., -1., -1., -1. };
|
_bigUy = new float[_totalCellsBig];
|
||||||
#if PARALLEL==1
|
_bigUz = new float[_totalCellsBig];
|
||||||
#pragma omp parallel
|
|
||||||
#endif
|
|
||||||
{ float maxVelMag1 = 0.;
|
|
||||||
#if PARALLEL==1
|
|
||||||
const int id = omp_get_thread_num(); /*, num = omp_get_num_threads(); */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// vector noise main loop
|
// prepare textures
|
||||||
#if PARALLEL==1
|
advectTextureCoordinates(dtOrg, xvel,yvel,zvel, _tempBig1, _tempBig2);
|
||||||
#pragma omp for schedule(static)
|
|
||||||
#endif
|
|
||||||
for (int zSmall = 0; zSmall < _zResSm; zSmall++)
|
|
||||||
for (int ySmall = 0; ySmall < _yResSm; ySmall++)
|
|
||||||
for (int xSmall = 0; xSmall < _xResSm; xSmall++)
|
|
||||||
{
|
|
||||||
const int indexSmall = xSmall + ySmall * _xResSm + zSmall * _slabSizeSm;
|
|
||||||
|
|
||||||
// compute jacobian
|
// do wavelet decomposition of energy
|
||||||
float jacobian[3][3] = {
|
computeEnergy(xvel, yvel, zvel, obstacles);
|
||||||
{ minDx(xSmall, ySmall, zSmall, _tcU, _resSm), minDx(xSmall, ySmall, zSmall, _tcV, _resSm), minDx(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
|
decomposeEnergy();
|
||||||
{ minDy(xSmall, ySmall, zSmall, _tcU, _resSm), minDy(xSmall, ySmall, zSmall, _tcV, _resSm), minDy(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
|
|
||||||
{ minDz(xSmall, ySmall, zSmall, _tcU, _resSm), minDz(xSmall, ySmall, zSmall, _tcV, _resSm), minDz(xSmall, ySmall, zSmall, _tcW, _resSm) }
|
|
||||||
};
|
|
||||||
|
|
||||||
// get LU factorization of texture jacobian and apply
|
// zero out coefficients inside of the obstacle
|
||||||
// it to unit vectors
|
for (int x = 0; x < _totalCellsSm; x++)
|
||||||
JAMA::LU<float> LU = computeLU3x3(jacobian);
|
if (obstacles[x]) _energy[x] = 0.f;
|
||||||
float xUnwarped[] = {1.0f, 0.0f, 0.0f};
|
|
||||||
float yUnwarped[] = {0.0f, 1.0f, 0.0f};
|
|
||||||
float zUnwarped[] = {0.0f, 0.0f, 1.0f};
|
|
||||||
float xWarped[] = {1.0f, 0.0f, 0.0f};
|
|
||||||
float yWarped[] = {0.0f, 1.0f, 0.0f};
|
|
||||||
float zWarped[] = {0.0f, 0.0f, 1.0f};
|
|
||||||
bool nonSingular = LU.isNonsingular();
|
|
||||||
#if 0
|
|
||||||
// UNUSED
|
|
||||||
float eigMax = 10.0f;
|
|
||||||
float eigMin = 0.1f;
|
|
||||||
#endif
|
|
||||||
if (nonSingular)
|
|
||||||
{
|
|
||||||
solveLU3x3(LU, xUnwarped, xWarped);
|
|
||||||
solveLU3x3(LU, yUnwarped, yWarped);
|
|
||||||
solveLU3x3(LU, zUnwarped, zWarped);
|
|
||||||
|
|
||||||
// compute the eigenvalues while we have the Jacobian available
|
// parallel region setup
|
||||||
Vec3 eigenvalues = Vec3(1.);
|
float maxVelMagThreads[8] = { -1., -1., -1., -1., -1., -1., -1., -1. };
|
||||||
computeEigenvalues3x3( &eigenvalues[0], jacobian);
|
|
||||||
_eigMax[indexSmall] = MAX3V(eigenvalues);
|
|
||||||
_eigMin[indexSmall] = MIN3V(eigenvalues);
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure to skip one on the beginning and end
|
|
||||||
int xStart = (xSmall == 0) ? 1 : 0;
|
|
||||||
int xEnd = (xSmall == _xResSm - 1) ? _amplify - 1 : _amplify;
|
|
||||||
int yStart = (ySmall == 0) ? 1 : 0;
|
|
||||||
int yEnd = (ySmall == _yResSm - 1) ? _amplify - 1 : _amplify;
|
|
||||||
int zStart = (zSmall == 0) ? 1 : 0;
|
|
||||||
int zEnd = (zSmall == _zResSm - 1) ? _amplify - 1 : _amplify;
|
|
||||||
|
|
||||||
for (int zBig = zStart; zBig < zEnd; zBig++)
|
|
||||||
for (int yBig = yStart; yBig < yEnd; yBig++)
|
|
||||||
for (int xBig = xStart; xBig < xEnd; xBig++)
|
|
||||||
{
|
|
||||||
const int x = xSmall * _amplify + xBig;
|
|
||||||
const int y = ySmall * _amplify + yBig;
|
|
||||||
const int z = zSmall * _amplify + zBig;
|
|
||||||
|
|
||||||
// get unit position for both fine and coarse grid
|
|
||||||
const Vec3 pos = Vec3(x,y,z);
|
|
||||||
const Vec3 posSm = pos * invAmp;
|
|
||||||
|
|
||||||
// get grid index for both fine and coarse grid
|
|
||||||
const int index = x + y *_xResBig + z *_slabSizeBig;
|
|
||||||
|
|
||||||
// get a linearly interpolated velocity and texcoords
|
|
||||||
// from the coarse grid
|
|
||||||
Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel,
|
|
||||||
posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
|
|
||||||
Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW,
|
|
||||||
posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
|
|
||||||
|
|
||||||
// multiply the texture coordinate by _resSm so that turbulence
|
#if PARALLEL==1
|
||||||
// synthesis begins at the first octave that the coarse grid
|
#pragma omp parallel
|
||||||
// cannot capture
|
#endif
|
||||||
Vec3 texCoord = Vec3(uvw[0] * _resSm[0],
|
{ float maxVelMag1 = 0.;
|
||||||
uvw[1] * _resSm[1],
|
#if PARALLEL==1
|
||||||
uvw[2] * _resSm[2]);
|
const int id = omp_get_thread_num(); /*, num = omp_get_num_threads(); */
|
||||||
|
#endif
|
||||||
|
|
||||||
// retrieve wavelet energy at highest frequency
|
// vector noise main loop
|
||||||
float energy = INTERPOLATE::lerp3d(
|
#if PARALLEL==1
|
||||||
_highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm);
|
#pragma omp for schedule(static)
|
||||||
|
#endif
|
||||||
|
for (int zSmall = 0; zSmall < _zResSm; zSmall++)
|
||||||
|
for (int ySmall = 0; ySmall < _yResSm; ySmall++)
|
||||||
|
for (int xSmall = 0; xSmall < _xResSm; xSmall++)
|
||||||
|
{
|
||||||
|
const int indexSmall = xSmall + ySmall * _xResSm + zSmall * _slabSizeSm;
|
||||||
|
|
||||||
// base amplitude for octave 0
|
// compute jacobian
|
||||||
float coefficient = sqrtf(2.0f * fabs(energy));
|
float jacobian[3][3] = {
|
||||||
const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence;
|
{ minDx(xSmall, ySmall, zSmall, _tcU, _resSm), minDx(xSmall, ySmall, zSmall, _tcV, _resSm), minDx(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
|
||||||
|
{ minDy(xSmall, ySmall, zSmall, _tcU, _resSm), minDy(xSmall, ySmall, zSmall, _tcV, _resSm), minDy(xSmall, ySmall, zSmall, _tcW, _resSm) } ,
|
||||||
|
{ minDz(xSmall, ySmall, zSmall, _tcU, _resSm), minDz(xSmall, ySmall, zSmall, _tcV, _resSm), minDz(xSmall, ySmall, zSmall, _tcW, _resSm) }
|
||||||
|
};
|
||||||
|
|
||||||
// add noise to velocity, but only if the turbulence is
|
// get LU factorization of texture jacobian and apply
|
||||||
// sufficiently undeformed, and the energy is large enough
|
// it to unit vectors
|
||||||
// to make a difference
|
JAMA::LU<float> LU = computeLU3x3(jacobian);
|
||||||
const bool addNoise = _eigMax[indexSmall] < 2. &&
|
float xUnwarped[] = {1.0f, 0.0f, 0.0f};
|
||||||
_eigMin[indexSmall] > 0.5;
|
float yUnwarped[] = {0.0f, 1.0f, 0.0f};
|
||||||
if (addNoise && amplitude > _cullingThreshold) {
|
float zUnwarped[] = {0.0f, 0.0f, 1.0f};
|
||||||
// base amplitude for octave 0
|
float xWarped[] = {1.0f, 0.0f, 0.0f};
|
||||||
float amplitudeScaled = amplitude;
|
float yWarped[] = {0.0f, 1.0f, 0.0f};
|
||||||
|
float zWarped[] = {0.0f, 0.0f, 1.0f};
|
||||||
|
bool nonSingular = LU.isNonsingular();
|
||||||
|
|
||||||
for (int octave = 0; octave < _octaves; octave++)
|
#if 0
|
||||||
{
|
// UNUSED
|
||||||
// multiply the vector noise times the maximum allowed
|
float eigMax = 10.0f;
|
||||||
// noise amplitude at this octave, and add it to the total
|
float eigMin = 0.1f;
|
||||||
vel += WVelocityWithJacobian(texCoord, &xUnwarped[0], &yUnwarped[0], &zUnwarped[0]) * amplitudeScaled;
|
#endif
|
||||||
|
|
||||||
// scale coefficient for next octave
|
if (nonSingular)
|
||||||
amplitudeScaled *= persistence;
|
{
|
||||||
texCoord *= 2.0f;
|
solveLU3x3(LU, xUnwarped, xWarped);
|
||||||
}
|
solveLU3x3(LU, yUnwarped, yWarped);
|
||||||
}
|
solveLU3x3(LU, zUnwarped, zWarped);
|
||||||
|
|
||||||
// Store velocity + turbulence in big grid for maccormack step
|
// compute the eigenvalues while we have the Jacobian available
|
||||||
//
|
Vec3 eigenvalues = Vec3(1.);
|
||||||
// If you wanted to save memory, you would instead perform a
|
computeEigenvalues3x3( &eigenvalues[0], jacobian);
|
||||||
// semi-Lagrangian backtrace for the current grid cell here. Then
|
_eigMax[indexSmall] = MAX3V(eigenvalues);
|
||||||
// you could just throw the velocity away.
|
_eigMin[indexSmall] = MIN3V(eigenvalues);
|
||||||
_bigUx[index] = vel[0];
|
}
|
||||||
_bigUy[index] = vel[1];
|
|
||||||
_bigUz[index] = vel[2];
|
|
||||||
|
|
||||||
// compute the velocity magnitude for substepping later
|
// make sure to skip one on the beginning and end
|
||||||
const float velMag = _bigUx[index] * _bigUx[index] +
|
int xStart = (xSmall == 0) ? 1 : 0;
|
||||||
_bigUy[index] * _bigUy[index] +
|
int xEnd = (xSmall == _xResSm - 1) ? _amplify - 1 : _amplify;
|
||||||
_bigUz[index] * _bigUz[index];
|
int yStart = (ySmall == 0) ? 1 : 0;
|
||||||
if (velMag > maxVelMag1) maxVelMag1 = velMag;
|
int yEnd = (ySmall == _yResSm - 1) ? _amplify - 1 : _amplify;
|
||||||
|
int zStart = (zSmall == 0) ? 1 : 0;
|
||||||
|
int zEnd = (zSmall == _zResSm - 1) ? _amplify - 1 : _amplify;
|
||||||
|
|
||||||
|
for (int zBig = zStart; zBig < zEnd; zBig++)
|
||||||
|
for (int yBig = yStart; yBig < yEnd; yBig++)
|
||||||
|
for (int xBig = xStart; xBig < xEnd; xBig++)
|
||||||
|
{
|
||||||
|
const int x = xSmall * _amplify + xBig;
|
||||||
|
const int y = ySmall * _amplify + yBig;
|
||||||
|
const int z = zSmall * _amplify + zBig;
|
||||||
|
|
||||||
// zero out velocity inside obstacles
|
// get unit position for both fine and coarse grid
|
||||||
float obsCheck = INTERPOLATE::lerp3dToFloat(
|
const Vec3 pos = Vec3(x,y,z);
|
||||||
obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm);
|
const Vec3 posSm = pos * invAmp;
|
||||||
if (obsCheck > 0.95)
|
|
||||||
_bigUx[index] = _bigUy[index] = _bigUz[index] = 0.;
|
|
||||||
} // xyz
|
|
||||||
|
|
||||||
#if PARALLEL==1
|
// get grid index for both fine and coarse grid
|
||||||
maxVelMagThreads[id] = maxVelMag1;
|
const int index = x + y *_xResBig + z *_slabSizeBig;
|
||||||
#else
|
|
||||||
maxVelMagThreads[0] = maxVelMag1;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
} // omp
|
|
||||||
|
|
||||||
// compute maximum over threads
|
|
||||||
float maxVelMag = maxVelMagThreads[0];
|
|
||||||
#if PARALLEL==1
|
|
||||||
for (int i = 1; i < 8; i++)
|
|
||||||
if (maxVelMag < maxVelMagThreads[i])
|
|
||||||
maxVelMag = maxVelMagThreads[i];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// prepare density for an advection
|
// get a linearly interpolated velocity and texcoords
|
||||||
SWAP_POINTERS(_densityBig, _densityBigOld);
|
// from the coarse grid
|
||||||
|
Vec3 vel = INTERPOLATE::lerp3dVec( xvel,yvel,zvel,
|
||||||
|
posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
|
||||||
|
Vec3 uvw = INTERPOLATE::lerp3dVec( _tcU,_tcV,_tcW,
|
||||||
|
posSm[0], posSm[1], posSm[2], _xResSm,_yResSm,_zResSm);
|
||||||
|
|
||||||
// based on the maximum velocity present, see if we need to substep,
|
// multiply the texture coordinate by _resSm so that turbulence
|
||||||
// but cap the maximum number of substeps to 5
|
// synthesis begins at the first octave that the coarse grid
|
||||||
const int maxSubSteps = 25;
|
// cannot capture
|
||||||
const int maxVel = 5;
|
Vec3 texCoord = Vec3(uvw[0] * _resSm[0],
|
||||||
maxVelMag = sqrt(maxVelMag) * dt;
|
uvw[1] * _resSm[1],
|
||||||
int totalSubsteps = (int)(maxVelMag / (float)maxVel);
|
uvw[2] * _resSm[2]);
|
||||||
totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
|
|
||||||
// printf("totalSubsteps: %d\n", totalSubsteps);
|
|
||||||
totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
|
|
||||||
const float dtSubdiv = dt / (float)totalSubsteps;
|
|
||||||
|
|
||||||
// set boundaries of big velocity grid
|
// retrieve wavelet energy at highest frequency
|
||||||
FLUID_3D::setZeroX(_bigUx, _resBig);
|
float energy = INTERPOLATE::lerp3d(
|
||||||
FLUID_3D::setZeroY(_bigUy, _resBig);
|
_highFreqEnergy, posSm[0],posSm[1],posSm[2], _xResSm, _yResSm, _zResSm);
|
||||||
FLUID_3D::setZeroZ(_bigUz, _resBig);
|
|
||||||
|
|
||||||
// do the MacCormack advection, with substepping if necessary
|
// base amplitude for octave 0
|
||||||
for(int substep = 0; substep < totalSubsteps; substep++)
|
float coefficient = sqrtf(2.0f * fabs(energy));
|
||||||
{
|
const float amplitude = *_strength * fabs(0.5 * coefficient) * persistence;
|
||||||
FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz,
|
|
||||||
_densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL);
|
|
||||||
|
|
||||||
if (substep < totalSubsteps - 1)
|
// add noise to velocity, but only if the turbulence is
|
||||||
SWAP_POINTERS(_densityBig, _densityBigOld);
|
// sufficiently undeformed, and the energy is large enough
|
||||||
} // substep
|
// to make a difference
|
||||||
|
const bool addNoise = _eigMax[indexSmall] < 2. &&
|
||||||
// wipe the density borders
|
_eigMin[indexSmall] > 0.5;
|
||||||
FLUID_3D::setZeroBorder(_densityBig, _resBig);
|
|
||||||
|
if (addNoise && amplitude > _cullingThreshold) {
|
||||||
// reset texture coordinates now in preparation for next timestep
|
// base amplitude for octave 0
|
||||||
// Shouldn't do this before generating the noise because then the
|
float amplitudeScaled = amplitude;
|
||||||
// eigenvalues stored do not reflect the underlying texture coordinates
|
|
||||||
resetTextureCoordinates();
|
for (int octave = 0; octave < _octaves; octave++)
|
||||||
|
{
|
||||||
// output files
|
// multiply the vector noise times the maximum allowed
|
||||||
// string prefix = string("./amplified.preview/density_bigxy_");
|
// noise amplitude at this octave, and add it to the total
|
||||||
// FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f);
|
vel += WVelocityWithJacobian(texCoord, &xUnwarped[0], &yUnwarped[0], &zUnwarped[0]) * amplitudeScaled;
|
||||||
//string df3prefix = string("./df3/density_big_");
|
|
||||||
//IMAGE::dumpDF3(_totalStepsBig, df3prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
// scale coefficient for next octave
|
||||||
// string pbrtPrefix = string("./pbrt/density_big_");
|
amplitudeScaled *= persistence;
|
||||||
// IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
texCoord *= 2.0f;
|
||||||
|
}
|
||||||
_totalStepsBig++;
|
}
|
||||||
|
|
||||||
|
// Store velocity + turbulence in big grid for maccormack step
|
||||||
|
//
|
||||||
|
// If you wanted to save memory, you would instead perform a
|
||||||
|
// semi-Lagrangian backtrace for the current grid cell here. Then
|
||||||
|
// you could just throw the velocity away.
|
||||||
|
_bigUx[index] = vel[0];
|
||||||
|
_bigUy[index] = vel[1];
|
||||||
|
_bigUz[index] = vel[2];
|
||||||
|
|
||||||
|
// compute the velocity magnitude for substepping later
|
||||||
|
const float velMag = _bigUx[index] * _bigUx[index] +
|
||||||
|
_bigUy[index] * _bigUy[index] +
|
||||||
|
_bigUz[index] * _bigUz[index];
|
||||||
|
if (velMag > maxVelMag1) maxVelMag1 = velMag;
|
||||||
|
|
||||||
|
// zero out velocity inside obstacles
|
||||||
|
float obsCheck = INTERPOLATE::lerp3dToFloat(
|
||||||
|
obstacles, posSm[0], posSm[1], posSm[2], _xResSm, _yResSm, _zResSm);
|
||||||
|
|
||||||
|
if (obsCheck > 0.95)
|
||||||
|
_bigUx[index] = _bigUy[index] = _bigUz[index] = 0.;
|
||||||
|
} // xyz
|
||||||
|
|
||||||
|
#if PARALLEL==1
|
||||||
|
maxVelMagThreads[id] = maxVelMag1;
|
||||||
|
#else
|
||||||
|
maxVelMagThreads[0] = maxVelMag1;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
} // omp
|
||||||
|
|
||||||
|
// compute maximum over threads
|
||||||
|
float maxVelMag = maxVelMagThreads[0];
|
||||||
|
#if PARALLEL==1
|
||||||
|
for (int i = 1; i < 8; i++)
|
||||||
|
if (maxVelMag < maxVelMagThreads[i])
|
||||||
|
maxVelMag = maxVelMagThreads[i];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// prepare density for an advection
|
||||||
|
SWAP_POINTERS(_densityBig, _densityBigOld);
|
||||||
|
|
||||||
|
// based on the maximum velocity present, see if we need to substep,
|
||||||
|
// but cap the maximum number of substeps to 5
|
||||||
|
const int maxSubSteps = 25;
|
||||||
|
const int maxVel = 5;
|
||||||
|
maxVelMag = sqrt(maxVelMag) * dt;
|
||||||
|
int totalSubsteps = (int)(maxVelMag / (float)maxVel);
|
||||||
|
totalSubsteps = (totalSubsteps < 1) ? 1 : totalSubsteps;
|
||||||
|
// printf("totalSubsteps: %d\n", totalSubsteps);
|
||||||
|
totalSubsteps = (totalSubsteps > maxSubSteps) ? maxSubSteps : totalSubsteps;
|
||||||
|
const float dtSubdiv = dt / (float)totalSubsteps;
|
||||||
|
|
||||||
|
// set boundaries of big velocity grid
|
||||||
|
FLUID_3D::setZeroX(_bigUx, _resBig);
|
||||||
|
FLUID_3D::setZeroY(_bigUy, _resBig);
|
||||||
|
FLUID_3D::setZeroZ(_bigUz, _resBig);
|
||||||
|
|
||||||
|
// do the MacCormack advection, with substepping if necessary
|
||||||
|
for(int substep = 0; substep < totalSubsteps; substep++)
|
||||||
|
{
|
||||||
|
FLUID_3D::advectFieldMacCormack(dtSubdiv, _bigUx, _bigUy, _bigUz,
|
||||||
|
_densityBigOld, _densityBig, _tempBig1, _tempBig2, _resBig, NULL);
|
||||||
|
|
||||||
|
if (substep < totalSubsteps - 1)
|
||||||
|
SWAP_POINTERS(_densityBig, _densityBigOld);
|
||||||
|
} // substep
|
||||||
|
|
||||||
|
// wipe the density borders
|
||||||
|
FLUID_3D::setZeroBorder(_densityBig, _resBig);
|
||||||
|
|
||||||
|
// reset texture coordinates now in preparation for next timestep
|
||||||
|
// Shouldn't do this before generating the noise because then the
|
||||||
|
// eigenvalues stored do not reflect the underlying texture coordinates
|
||||||
|
resetTextureCoordinates();
|
||||||
|
|
||||||
|
// output files
|
||||||
|
// string prefix = string("./amplified.preview/density_bigxy_");
|
||||||
|
// FLUID_3D::writeImageSliceXY(_densityBig, _resBig, _resBig[2]/2, prefix, _totalStepsBig, 1.0f);
|
||||||
|
//string df3prefix = string("./df3/density_big_");
|
||||||
|
//IMAGE::dumpDF3(_totalStepsBig, df3prefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
||||||
|
// string pbrtPrefix = string("./pbrt/density_big_");
|
||||||
|
// IMAGE::dumpPBRT(_totalStepsBig, pbrtPrefix, _densityBig, _resBig[0],_resBig[1],_resBig[2]);
|
||||||
|
|
||||||
|
_totalStepsBig++;
|
||||||
|
|
||||||
|
delete[] _bigUx;
|
||||||
|
delete[] _bigUy;
|
||||||
|
delete[] _bigUz;
|
||||||
|
|
||||||
|
delete[] _tempBig1;
|
||||||
|
delete[] _tempBig2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ class WTURBULENCE
|
|||||||
void stepTurbulenceFull(float dt, float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
|
void stepTurbulenceFull(float dt, float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
|
||||||
|
|
||||||
// texcoord functions
|
// texcoord functions
|
||||||
void advectTextureCoordinates(float dtOrg, float* xvel, float* yvel, float* zvel);
|
void advectTextureCoordinates (float dtOrg, float* xvel, float* yvel, float* zvel, float *_tempBig1, float *_tempBig2);
|
||||||
void resetTextureCoordinates();
|
void resetTextureCoordinates();
|
||||||
|
|
||||||
void computeEnergy(float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
|
void computeEnergy(float* xvel, float* yvel, float* zvel, unsigned char *obstacles);
|
||||||
@ -73,7 +73,7 @@ class WTURBULENCE
|
|||||||
// is accessed on through rna gui
|
// is accessed on through rna gui
|
||||||
float *_strength;
|
float *_strength;
|
||||||
|
|
||||||
protected:
|
// protected:
|
||||||
// enlargement factor from original velocity field / simulation
|
// enlargement factor from original velocity field / simulation
|
||||||
// _Big = _amplify * _Sm
|
// _Big = _amplify * _Sm
|
||||||
int _amplify;
|
int _amplify;
|
||||||
@ -111,26 +111,17 @@ class WTURBULENCE
|
|||||||
float* _densityBig;
|
float* _densityBig;
|
||||||
float* _densityBigOld;
|
float* _densityBigOld;
|
||||||
|
|
||||||
// big velocity macCormack fields
|
|
||||||
float* _bigUx;
|
|
||||||
float* _bigUy;
|
|
||||||
float* _bigUz;
|
|
||||||
// temp arrays for BFECC and MacCormack - they have more convenient
|
|
||||||
// names in the actual implementations
|
|
||||||
float* _tempBig1;
|
|
||||||
float* _tempBig2;
|
|
||||||
|
|
||||||
// texture coordinates for noise
|
// texture coordinates for noise
|
||||||
float* _tcU;
|
float* _tcU;
|
||||||
float* _tcV;
|
float* _tcV;
|
||||||
float* _tcW;
|
float* _tcW;
|
||||||
float* _tcTemp;
|
float* _tcTemp;
|
||||||
|
|
||||||
float* _eigMin;
|
float* _eigMin; // no save -dg
|
||||||
float* _eigMax;
|
float* _eigMax; // no save -dg
|
||||||
|
|
||||||
// wavelet decomposition of velocity energies
|
// wavelet decomposition of velocity energies
|
||||||
float* _energy;
|
float* _energy; // no save -dg
|
||||||
|
|
||||||
// noise data
|
// noise data
|
||||||
float* _noiseTile;
|
float* _noiseTile;
|
||||||
@ -140,7 +131,7 @@ class WTURBULENCE
|
|||||||
int _totalStepsBig;
|
int _totalStepsBig;
|
||||||
|
|
||||||
// highest frequency component of wavelet decomposition
|
// highest frequency component of wavelet decomposition
|
||||||
float* _highFreqEnergy;
|
float* _highFreqEnergy; // no save -dg
|
||||||
|
|
||||||
void computeEigenvalues();
|
void computeEigenvalues();
|
||||||
void decomposeEnergy();
|
void decomposeEnergy();
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* The Original Code is Copyright (C) 2009 by Daniel Genrich
|
* The Original Code is Copyright (C) 2009 by Daniel Genrich
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Contributor(s): None
|
* Contributor(s): Daniel Genrich
|
||||||
*
|
*
|
||||||
* ***** END GPL LICENSE BLOCK *****
|
* ***** END GPL LICENSE BLOCK *****
|
||||||
*/
|
*/
|
||||||
@ -137,7 +137,7 @@ extern "C" void smoke_dissolve(FLUID_3D *fluid, int speed, int log)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log)
|
extern "C" void smoke_turbulence_dissolve(WTURBULENCE *wt, int speed, int log)
|
||||||
{
|
{
|
||||||
float *density = wt->getDensityBig();
|
float *density = wt->getDensityBig();
|
||||||
Vec3Int r = wt->getResBig();
|
Vec3Int r = wt->getResBig();
|
||||||
@ -172,7 +172,7 @@ extern "C" void smoke_dissolve_wavelet(WTURBULENCE *wt, int speed, int log)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void smoke_initWaveletBlenderRNA(WTURBULENCE *wt, float *strength)
|
extern "C" void smoke_turbulence_initBlenderRNA(WTURBULENCE *wt, float *strength)
|
||||||
{
|
{
|
||||||
wt->initBlenderRNA(strength);
|
wt->initBlenderRNA(strength);
|
||||||
}
|
}
|
||||||
@ -181,6 +181,36 @@ template < class T > inline T ABS( T a ) {
|
|||||||
return (0 < a) ? a : -a ;
|
return (0 < a) ? a : -a ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" void smoke_export(FLUID_3D *fluid, float *dt, float *dx, float **dens, float **densold, float **heat, float **heatold, float **vx, float **vy, float **vz, float **vxold, float **vyold, float **vzold, unsigned char **obstacles)
|
||||||
|
{
|
||||||
|
*dens = fluid->_density;
|
||||||
|
*densold = fluid->_densityOld;
|
||||||
|
*heat = fluid->_heat;
|
||||||
|
*heatold = fluid->_heatOld;
|
||||||
|
*vx = fluid->_xVelocity;
|
||||||
|
*vy = fluid->_yVelocity;
|
||||||
|
*vz = fluid->_zVelocity;
|
||||||
|
*vxold = fluid->_xVelocityOld;
|
||||||
|
*vyold = fluid->_yVelocityOld;
|
||||||
|
*vzold = fluid->_zVelocityOld;
|
||||||
|
*obstacles = fluid->_obstacles;
|
||||||
|
dt = &(fluid->_dt);
|
||||||
|
dx = &(fluid->_dx);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" void smoke_turbulence_export(WTURBULENCE *wt, float **dens, float **densold, float **tcu, float **tcv, float **tcw)
|
||||||
|
{
|
||||||
|
if(!wt)
|
||||||
|
return;
|
||||||
|
|
||||||
|
*dens = wt->_densityBig;
|
||||||
|
*densold = wt->_densityBigOld;
|
||||||
|
*tcu = wt->_tcU;
|
||||||
|
*tcv = wt->_tcV;
|
||||||
|
*tcw = wt->_tcW;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" float *smoke_get_density(FLUID_3D *fluid)
|
extern "C" float *smoke_get_density(FLUID_3D *fluid)
|
||||||
{
|
{
|
||||||
return fluid->_density;
|
return fluid->_density;
|
||||||
@ -193,17 +223,17 @@ extern "C" float *smoke_get_heat(FLUID_3D *fluid)
|
|||||||
|
|
||||||
extern "C" float *smoke_get_velocity_x(FLUID_3D *fluid)
|
extern "C" float *smoke_get_velocity_x(FLUID_3D *fluid)
|
||||||
{
|
{
|
||||||
return fluid->_xVorticity;
|
return fluid->_xVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" float *smoke_get_velocity_y(FLUID_3D *fluid)
|
extern "C" float *smoke_get_velocity_y(FLUID_3D *fluid)
|
||||||
{
|
{
|
||||||
return fluid->_yVorticity;
|
return fluid->_yVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" float *smoke_get_velocity_z(FLUID_3D *fluid)
|
extern "C" float *smoke_get_velocity_z(FLUID_3D *fluid)
|
||||||
{
|
{
|
||||||
return fluid->_zVorticity;
|
return fluid->_zVelocity;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt)
|
extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt)
|
||||||
@ -211,14 +241,13 @@ extern "C" float *smoke_turbulence_get_density(WTURBULENCE *wt)
|
|||||||
return wt ? wt->getDensityBig() : NULL;
|
return wt ? wt->getDensityBig() : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void smoke_turbulence_get_res(WTURBULENCE *wt, int *res)
|
extern "C" void smoke_turbulence_get_res(WTURBULENCE *wt, unsigned int *res)
|
||||||
{
|
{
|
||||||
if(wt)
|
if(wt)
|
||||||
{
|
{
|
||||||
Vec3Int r = wt->getResBig();
|
res[0] = wt->_resBig[0];
|
||||||
res[0] = r[0];
|
res[1] = wt->_resBig[1];
|
||||||
res[1] = r[1];
|
res[2] = wt->_resBig[2];
|
||||||
res[2] = r[2];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,6 +50,9 @@
|
|||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#ifdef WITH_CXX_GUARDEDALLOC
|
||||||
|
#include "MEM_guardedalloc.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
class STR_String;
|
class STR_String;
|
||||||
|
|
||||||
@ -191,6 +194,13 @@ protected:
|
|||||||
char *pData; // -> STR_String data
|
char *pData; // -> STR_String data
|
||||||
int Len; // Data length
|
int Len; // Data length
|
||||||
int Max; // Space in data buffer
|
int Max; // Space in data buffer
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef WITH_CXX_GUARDEDALLOC
|
||||||
|
public:
|
||||||
|
void *operator new( unsigned int num_bytes) { return MEM_mallocN(num_bytes, "CXX:STR_String"); }
|
||||||
|
void operator delete( void *mem ) { MEM_freeN(mem); }
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
|
inline STR_String operator+(rcSTR_String lhs, rcSTR_String rhs) { return STR_String(lhs.ReadPtr(), lhs.Length(), rhs.ReadPtr(), rhs.Length()); }
|
||||||
|
@ -10,6 +10,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
|
|||||||
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
|
{C66F722C-46BE-40C9-ABAE-2EAC7A697EB8} = {C66F722C-46BE-40C9-ABAE-2EAC7A697EB8}
|
||||||
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
|
{D1A9312F-4557-4982-A0F4-4D08508235F4} = {D1A9312F-4557-4982-A0F4-4D08508235F4}
|
||||||
{884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}
|
{884D8731-654C-4C7F-9A75-8F37A305BE1E} = {884D8731-654C-4C7F-9A75-8F37A305BE1E}
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602}
|
||||||
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
|
{E645CC32-4823-463E-82F0-46ADDE664018} = {E645CC32-4823-463E-82F0-46ADDE664018}
|
||||||
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
|
{7495FE37-933A-4AC1-BB2A-B3FDB4DE4284} = {7495FE37-933A-4AC1-BB2A-B3FDB4DE4284}
|
||||||
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
|
{51FB3D48-2467-4BFA-A321-D848252B437E} = {51FB3D48-2467-4BFA-A321-D848252B437E}
|
||||||
@ -24,6 +25,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "blender", "blender.vcproj",
|
|||||||
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
|
{415BFD6E-64CF-422B-AF88-C07F040A7292} = {415BFD6E-64CF-422B-AF88-C07F040A7292}
|
||||||
{106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}
|
{106AE171-0083-41D6-A949-20DB0E8DC251} = {106AE171-0083-41D6-A949-20DB0E8DC251}
|
||||||
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
|
{670EC17A-0548-4BBF-A27B-636C7C188139} = {670EC17A-0548-4BBF-A27B-636C7C188139}
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F}
|
||||||
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
|
{4C3AB78A-52CA-4276-A041-39776E52D8C8} = {4C3AB78A-52CA-4276-A041-39776E52D8C8}
|
||||||
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
|
{6B801390-5F95-4F07-81A7-97FBA046AACC} = {6B801390-5F95-4F07-81A7-97FBA046AACC}
|
||||||
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
|
{CAE37E91-6570-43AC-A4B4-7A37A4B0FC94} = {CAE37E91-6570-43AC-A4B4-7A37A4B0FC94}
|
||||||
@ -84,6 +86,7 @@ EndProject
|
|||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_makesdna", "makesdna\DNA_makesdna.vcproj", "{E013786A-9575-4F34-81B2-33290357EE87}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DNA_makesdna", "makesdna\DNA_makesdna.vcproj", "{E013786A-9575-4F34-81B2-33290357EE87}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
{31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
|
{31628053-825D-4C06-8A21-D13883489718} = {31628053-825D-4C06-8A21-D13883489718}
|
||||||
|
{1CC733F1-6AB5-4904-8F63-C08C46B79DD9} = {1CC733F1-6AB5-4904-8F63-C08C46B79DD9}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXP_expressions", "..\gameengine\expression\EXP_expressions.vcproj", "{EADC3C5A-6C51-4F03-8038-1553E7D7F740}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXP_expressions", "..\gameengine\expression\EXP_expressions.vcproj", "{EADC3C5A-6C51-4F03-8038-1553E7D7F740}"
|
||||||
@ -220,7 +223,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_glew", "..\..\extern\gl
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_build_install_all", "..\..\extern\make\msvc_9_0\build_install_all.vcproj", "{9C71A793-C177-4CAB-8EC5-923D500B39F8}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_build_install_all", "..\..\extern\make\msvc_9_0\build_install_all.vcproj", "{9C71A793-C177-4CAB-8EC5-923D500B39F8}"
|
||||||
ProjectSection(ProjectDependencies) = postProject
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602} = {79D0B232-208C-F208-DA71-79B4AC088602}
|
||||||
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
|
{FFD3C64A-30E2-4BC7-BC8F-51818C320400} = {FFD3C64A-30E2-4BC7-BC8F-51818C320400}
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F} = {8BFA4082-773B-D100-BC24-659083BA023F}
|
||||||
|
{BAC615B0-F1AF-418B-8D23-A10FD8870D6A} = {BAC615B0-F1AF-418B-8D23-A10FD8870D6A}
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_boolop", "..\..\intern\boolop\make\msvc_9_0\boolop.vcproj", "{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_boolop", "..\..\intern\boolop\make\msvc_9_0\boolop.vcproj", "{EB75F4D6-2970-4A3A-8D99-2BAD7201C0E9}"
|
||||||
@ -242,6 +248,9 @@ EndProject
|
|||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_elbeem", "..\..\intern\elbeem\make\msvc_9_0\elbeem.vcproj", "{A90C4918-4B21-4277-93BD-AF65F30951D9}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_elbeem", "..\..\intern\elbeem\make\msvc_9_0\elbeem.vcproj", "{A90C4918-4B21-4277-93BD-AF65F30951D9}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_ghost", "..\..\intern\ghost\make\msvc_9_0\ghost.vcproj", "{76D90B92-ECC7-409C-9F98-A8814B90F3C0}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_ghost", "..\..\intern\ghost\make\msvc_9_0\ghost.vcproj", "{76D90B92-ECC7-409C-9F98-A8814B90F3C0}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{B789C2F3-279E-4A85-8F0A-7F7AC068E598} = {B789C2F3-279E-4A85-8F0A-7F7AC068E598}
|
||||||
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_guardedalloc", "..\..\intern\guardedalloc\make\msvc_9_0\guardedalloc.vcproj", "{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_guardedalloc", "..\..\intern\guardedalloc\make\msvc_9_0\guardedalloc.vcproj", "{1CC733F1-6AB5-4904-8F63-C08C46B79DD9}"
|
||||||
EndProject
|
EndProject
|
||||||
@ -301,6 +310,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_smoke", "..\..\intern\s
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_audaspace", "..\..\intern\audaspace\make\msvc_9_0\audaspace.vcproj", "{87032FD2-9BA0-6B43-BE33-8902BA8F9172}"
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "INT_audaspace", "..\..\intern\audaspace\make\msvc_9_0\audaspace.vcproj", "{87032FD2-9BA0-6B43-BE33-8902BA8F9172}"
|
||||||
EndProject
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzma", "..\..\extern\lzma\make\msvc_9_0\lzma.vcproj", "{79D0B232-208C-F208-DA71-79B4AC088602}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "EXT_lzo", "..\..\extern\lzo\make\msvc_9_0\lzo.vcproj", "{8BFA4082-773B-D100-BC24-659083BA023F}"
|
||||||
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
3D Plugin Debug|Win32 = 3D Plugin Debug|Win32
|
3D Plugin Debug|Win32 = 3D Plugin Debug|Win32
|
||||||
@ -1443,6 +1456,46 @@ Global
|
|||||||
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
|
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Debug|Win32.Build.0 = 3DPlugin Debug|Win32
|
||||||
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
|
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.ActiveCfg = 3DPlugin Release|Win32
|
||||||
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.Build.0 = 3DPlugin Release|Win32
|
{87032FD2-9BA0-6B43-BE33-8902BA8F9172}.Release|Win32.Build.0 = 3DPlugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Blender Release|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{79D0B232-208C-F208-DA71-79B4AC088602}.Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Debug|Win32.Build.0 = 3D Plugin Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3D Plugin Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Debug|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.3DPlugin Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.ActiveCfg = Blender Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Debug|Win32.Build.0 = Blender Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Blender Release|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Debug|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.ActiveCfg = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.BlenderPlayer Release|Win32.Build.0 = Blender Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.ActiveCfg = 3D Plugin Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Debug|Win32.Build.0 = 3D Plugin Debug|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.ActiveCfg = 3D Plugin Release|Win32
|
||||||
|
{8BFA4082-773B-D100-BC24-659083BA023F}.Release|Win32.Build.0 = 3D Plugin Release|Win32
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
PreprocessorDefinitions="_DEBUG,WIN32,_LIB"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
@ -118,7 +118,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG"
|
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_OPENEXR;WITH_DDS;WITH_BULLET;WITH_FFMPEG"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@ -193,7 +193,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
|
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_OPENEXR;WITH_DDS;WITH_BULLET=1;WITH_FFMPEG"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
@ -268,7 +268,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
PreprocessorDefinitions="NDEBUG,WIN32,_LIB"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
@ -343,7 +343,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FFMPEG"
|
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;WITH_FFMPEG"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@ -418,7 +418,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern"
|
AdditionalIncludeDirectories="..\..\..\..\lib\windows\pthreads\include;..\..\..\..\lib\windows\python\include\python3.1;..\..\..\..\lib\windows\zlib\include;..\..\..\..\lib\windows\sdl\include;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\build\msvc_9\intern\decimation\include;..\..\..\..\build\msvc_9\intern\elbeem\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\memutil\include;..\..\..\..\build\msvc_9\intern\smoke\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\imbuf;..\..\..\source\blender\editors\include;..\..\..\source\blender\python;..\..\..\source\blender\blenlib;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\nodes;..\..\..\source\blender\blenloader;..\..\..\source\kernel\gen_system;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\verse\include;..\..\..\..\build\msvc_9\intern\opennl\include;..\..\..\..\build\msvc_9\extern\bullet\include;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\intern\audaspace\intern;..\..\..\extern\lzo\minilzo;..\..\..\extern\lzma;..\..\..\source\blender\blenfont"
|
||||||
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_FFMPEG"
|
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;UNWRAPPER;WITH_FFMPEG"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
@ -697,6 +697,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\blenkernel\intern\packedFile.c"
|
RelativePath="..\..\..\source\blender\blenkernel\intern\packedFile.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\blenkernel\intern\paint.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\blenkernel\intern\particle.c"
|
RelativePath="..\..\..\source\blender\blenkernel\intern\particle.c"
|
||||||
>
|
>
|
||||||
@ -757,6 +761,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\blenkernel\intern\smoke.c"
|
RelativePath="..\..\..\source\blender\blenkernel\intern\smoke.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\blenkernel\intern\smokehighres.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\blenkernel\intern\softbody.c"
|
RelativePath="..\..\..\source\blender\blenkernel\intern\softbody.c"
|
||||||
>
|
>
|
||||||
@ -1018,6 +1026,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\blenkernel\BKE_packedFile.h"
|
RelativePath="..\..\..\source\blender\blenkernel\BKE_packedFile.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\blenkernel\BKE_paint.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\blenkernel\BKE_particle.h"
|
RelativePath="..\..\..\source\blender\blenkernel\BKE_particle.h"
|
||||||
>
|
>
|
||||||
|
@ -217,6 +217,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\include\ED_image.h"
|
RelativePath="..\..\..\source\blender\editors\include\ED_image.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\include\ED_info.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\include\ED_interface.h"
|
RelativePath="..\..\..\source\blender\editors\include\ED_interface.h"
|
||||||
>
|
>
|
||||||
@ -458,6 +462,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\space_view3d\drawobject.c"
|
RelativePath="..\..\..\source\blender\editors\space_view3d\drawobject.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_view3d\drawvolume.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\space_view3d\space_view3d.c"
|
RelativePath="..\..\..\source\blender\editors\space_view3d\space_view3d.c"
|
||||||
>
|
>
|
||||||
@ -510,10 +518,6 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\space_time\space_time.c"
|
RelativePath="..\..\..\source\blender\editors\space_time\space_time.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
|
||||||
RelativePath="..\..\..\source\blender\editors\space_time\time_header.c"
|
|
||||||
>
|
|
||||||
</File>
|
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\space_time\time_intern.h"
|
RelativePath="..\..\..\source\blender\editors\space_time\time_intern.h"
|
||||||
>
|
>
|
||||||
@ -806,6 +810,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\space_info\info_ops.c"
|
RelativePath="..\..\..\source\blender\editors\space_info\info_ops.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_info\info_stats.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\space_info\space_info.c"
|
RelativePath="..\..\..\source\blender\editors\space_info\space_info.c"
|
||||||
>
|
>
|
||||||
@ -1274,6 +1282,10 @@
|
|||||||
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_ops.c"
|
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_ops.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_stroke.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_utils.c"
|
RelativePath="..\..\..\source\blender\editors\sculpt_paint\paint_utils.c"
|
||||||
>
|
>
|
||||||
@ -1467,6 +1479,22 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter
|
||||||
|
Name="space_userpref"
|
||||||
|
>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_userpref\space_userpref.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_userpref\userpref_intern.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\source\blender\editors\space_userpref\userpref_ops.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
</Filter>
|
||||||
</Files>
|
</Files>
|
||||||
<Globals>
|
<Globals>
|
||||||
</Globals>
|
</Globals>
|
||||||
|
@ -45,7 +45,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
|
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="3"
|
RuntimeLibrary="3"
|
||||||
@ -140,7 +140,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
@ -234,7 +234,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="2"
|
RuntimeLibrary="2"
|
||||||
@ -328,7 +328,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
|
PreprocessorDefinitions="_DEBUG;WIN32;_CONSOLE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@ -425,7 +425,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
Optimization="0"
|
Optimization="0"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
|
PreprocessorDefinitions="_DEBUG,WIN32,_CONSOLE"
|
||||||
BasicRuntimeChecks="3"
|
BasicRuntimeChecks="3"
|
||||||
RuntimeLibrary="1"
|
RuntimeLibrary="1"
|
||||||
@ -522,7 +522,7 @@
|
|||||||
<Tool
|
<Tool
|
||||||
Name="VCCLCompilerTool"
|
Name="VCCLCompilerTool"
|
||||||
InlineFunctionExpansion="1"
|
InlineFunctionExpansion="1"
|
||||||
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager"
|
AdditionalIncludeDirectories="..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\source\blender;..\..\..\source\blender\blenlib;..\..\..\source\blender\makesdna;..\..\..\source\blender\makesrna;..\..\..\source\blender\editors\include;..\..\..\source\blender\blenkernel;..\..\..\..\lib\windows\pthreads\include;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\windowmanager;..\..\..\source\blender\imbuf"
|
||||||
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
PreprocessorDefinitions="NDEBUG,WIN32,_CONSOLE"
|
||||||
StringPooling="true"
|
StringPooling="true"
|
||||||
RuntimeLibrary="0"
|
RuntimeLibrary="0"
|
||||||
|
@ -791,8 +791,8 @@ for member in dir(buttons_material):
|
|||||||
del buttons_material
|
del buttons_material
|
||||||
|
|
||||||
class RenderButtonsPanel(bpy.types.Panel):
|
class RenderButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "scene"
|
__context__ = "scene"
|
||||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||||
|
|
||||||
@ -801,9 +801,87 @@ class RenderButtonsPanel(bpy.types.Panel):
|
|||||||
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
|
return (rd.use_game_engine==False) and (rd.engine in self.COMPAT_ENGINES)
|
||||||
|
|
||||||
# Radiosity panel, use in the scene for now.
|
# Radiosity panel, use in the scene for now.
|
||||||
|
FloatProperty= bpy.types.Scene.FloatProperty
|
||||||
|
IntProperty= bpy.types.Scene.IntProperty
|
||||||
|
BoolProperty= bpy.types.Scene.BoolProperty
|
||||||
|
|
||||||
class SCENE_PT_povray_radiosity(RenderButtonsPanel):
|
class SCENE_PT_povray_radiosity(RenderButtonsPanel):
|
||||||
__label__ = "Radiosity"
|
__label__ = "Radiosity"
|
||||||
COMPAT_ENGINES = set(['POVRAY_RENDER'])
|
COMPAT_ENGINES = set(['POVRAY_RENDER'])
|
||||||
|
|
||||||
|
__props__ = [ \
|
||||||
|
# Not a real pov option, just to know if we should write
|
||||||
|
BoolProperty( attr="pov_radio_enable",
|
||||||
|
name="Enable Radiosity",
|
||||||
|
description="Enable povrays radiosity calculation.",
|
||||||
|
default= False),
|
||||||
|
BoolProperty( attr="pov_radio_display_advanced",
|
||||||
|
name="Advanced Options",
|
||||||
|
description="Show advanced options.",
|
||||||
|
default= False),
|
||||||
|
|
||||||
|
# Real pov options
|
||||||
|
FloatProperty( attr="pov_radio_adc_bailout",
|
||||||
|
name="ADC Bailout",
|
||||||
|
description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
|
||||||
|
min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01),
|
||||||
|
|
||||||
|
BoolProperty( attr="pov_radio_always_sample",
|
||||||
|
name="Always Sample",
|
||||||
|
description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
|
||||||
|
default= True),
|
||||||
|
|
||||||
|
FloatProperty( attr="pov_radio_brightness",
|
||||||
|
name="Brightness",
|
||||||
|
description="Ammount objects are brightened before being returned upwards to the rest of the system.",
|
||||||
|
min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0),
|
||||||
|
|
||||||
|
IntProperty( attr="pov_radio_count",
|
||||||
|
name="Ray Count",
|
||||||
|
description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
|
||||||
|
min=1, max=1600, default= 35),
|
||||||
|
|
||||||
|
FloatProperty( attr="pov_radio_error_bound",
|
||||||
|
name="Error Bound",
|
||||||
|
description="one of the two main speed/quality tuning values, lower values are more accurate.",
|
||||||
|
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8),
|
||||||
|
|
||||||
|
FloatProperty( attr="pov_radio_gray_threshold",
|
||||||
|
name="Gray Threshold",
|
||||||
|
description="one of the two main speed/quality tuning values, lower values are more accurate.",
|
||||||
|
min=0.0, max=1.0, soft_min=0, soft_max=1, default= 0.0),
|
||||||
|
|
||||||
|
FloatProperty( attr="pov_radio_low_error_factor",
|
||||||
|
name="Low Error Factor",
|
||||||
|
description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
|
||||||
|
min=0.0, max=1.0, soft_min=0.0, soft_max=1.0, default= 0.5),
|
||||||
|
|
||||||
|
# max_sample - not available yet
|
||||||
|
BoolProperty( attr="pov_radio_media",
|
||||||
|
name="Media",
|
||||||
|
description="Radiosity estimation can be affected by media.",
|
||||||
|
default= False),
|
||||||
|
|
||||||
|
FloatProperty( attr="pov_radio_minimum_reuse",
|
||||||
|
name="Minimum Reuse",
|
||||||
|
description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
|
||||||
|
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015),
|
||||||
|
|
||||||
|
IntProperty( attr="pov_radio_nearest_count",
|
||||||
|
name="Nearest Count",
|
||||||
|
description="Number of old ambient values blended together to create a new interpolated value.",
|
||||||
|
min=1, max=20, default= 5),
|
||||||
|
|
||||||
|
BoolProperty( attr="pov_radio_normal",
|
||||||
|
name="Normals",
|
||||||
|
description="Radiosity estimation can be affected by normals.",
|
||||||
|
default= False),
|
||||||
|
|
||||||
|
IntProperty( attr="pov_radio_recursion_limit",
|
||||||
|
name="Recursion Limit",
|
||||||
|
description="how many recursion levels are used to calculate the diffuse inter-reflection.",
|
||||||
|
min=1, max=20, default= 3),
|
||||||
|
]
|
||||||
|
|
||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@ -821,100 +899,38 @@ class SCENE_PT_povray_radiosity(RenderButtonsPanel):
|
|||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
|
|
||||||
col.itemR(scene, "pov_radio_count")
|
col.itemR(scene, "pov_radio_count", text="Rays")
|
||||||
col.itemR(scene, "pov_radio_recursion_limit")
|
col.itemR(scene, "pov_radio_recursion_limit", text="Recursions")
|
||||||
col.itemR(scene, "pov_radio_error_bound")
|
col = split.column()
|
||||||
|
col.itemR(scene, "pov_radio_error_bound", text="Error")
|
||||||
|
|
||||||
col.itemR(scene, "pov_radio_display_advanced")
|
layout.itemR(scene, "pov_radio_display_advanced")
|
||||||
|
|
||||||
if scene.pov_radio_display_advanced:
|
if scene.pov_radio_display_advanced:
|
||||||
col.itemR(scene, "pov_radio_adc_bailout")
|
split = layout.split()
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemR(scene, "pov_radio_adc_bailout", slider=True)
|
||||||
|
col.itemR(scene, "pov_radio_gray_threshold", slider=True)
|
||||||
|
col.itemR(scene, "pov_radio_low_error_factor", slider=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
col.itemR(scene, "pov_radio_brightness")
|
col.itemR(scene, "pov_radio_brightness")
|
||||||
col.itemR(scene, "pov_radio_gray_threshold")
|
col.itemR(scene, "pov_radio_minimum_reuse", text="Min Reuse")
|
||||||
col.itemR(scene, "pov_radio_low_error_factor")
|
|
||||||
col.itemR(scene, "pov_radio_minimum_reuse")
|
|
||||||
col.itemR(scene, "pov_radio_media")
|
|
||||||
col.itemR(scene, "pov_radio_nearest_count")
|
col.itemR(scene, "pov_radio_nearest_count")
|
||||||
|
|
||||||
|
|
||||||
|
split = layout.split()
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemL(text="Estimation Influence:")
|
||||||
|
col.itemR(scene, "pov_radio_media")
|
||||||
col.itemR(scene, "pov_radio_normal")
|
col.itemR(scene, "pov_radio_normal")
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
col.itemR(scene, "pov_radio_always_sample")
|
col.itemR(scene, "pov_radio_always_sample")
|
||||||
|
|
||||||
|
|
||||||
bpy.types.register(SCENE_PT_povray_radiosity)
|
bpy.types.register(SCENE_PT_povray_radiosity)
|
||||||
|
|
||||||
|
|
||||||
FloatProperty= bpy.types.Scene.FloatProperty
|
|
||||||
IntProperty= bpy.types.Scene.IntProperty
|
|
||||||
BoolProperty= bpy.types.Scene.BoolProperty
|
|
||||||
|
|
||||||
# Not a real pov option, just to know if we should write
|
|
||||||
BoolProperty( attr="pov_radio_enable",
|
|
||||||
name="Enable Radiosity",
|
|
||||||
description="Enable povrays radiosity calculation.",
|
|
||||||
default= False)
|
|
||||||
BoolProperty( attr="pov_radio_display_advanced",
|
|
||||||
name="Advanced Options",
|
|
||||||
description="Show advanced options.",
|
|
||||||
default= False)
|
|
||||||
|
|
||||||
# Real pov options
|
|
||||||
FloatProperty( attr="pov_radio_adc_bailout",
|
|
||||||
name="ADC Bailout",
|
|
||||||
description="The adc_bailout for radiosity rays. Use adc_bailout = 0.01 / brightest_ambient_object for good results.",
|
|
||||||
min=0.0, max=1000.0, soft_min=0.0, soft_max=1.0, default= 0.01)
|
|
||||||
|
|
||||||
BoolProperty( attr="pov_radio_always_sample",
|
|
||||||
name="Always Sample",
|
|
||||||
description="Only use the data from the pretrace step and not gather any new samples during the final radiosity pass..",
|
|
||||||
default= True)
|
|
||||||
|
|
||||||
FloatProperty( attr="pov_radio_brightness",
|
|
||||||
name="Brightness",
|
|
||||||
description="Ammount objects are brightened before being returned upwards to the rest of the system.",
|
|
||||||
min=0.0, max=1000.0, soft_min=0.0, soft_max=10.0, default= 1.0)
|
|
||||||
|
|
||||||
IntProperty( attr="pov_radio_count",
|
|
||||||
name="Ray Count",
|
|
||||||
description="number of rays that are sent out whenever a new radiosity value has to be calculated.",
|
|
||||||
min=1, max=1600, default= 35)
|
|
||||||
|
|
||||||
FloatProperty( attr="pov_radio_error_bound",
|
|
||||||
name="Error Bound",
|
|
||||||
description="one of the two main speed/quality tuning values, lower values are more accurate.",
|
|
||||||
min=0.0, max=1000.0, soft_min=0.1, soft_max=10.0, default= 1.8)
|
|
||||||
|
|
||||||
FloatProperty( attr="pov_radio_gray_threshold",
|
|
||||||
name="Gray Threshold",
|
|
||||||
description="one of the two main speed/quality tuning values, lower values are more accurate.",
|
|
||||||
min=0.0, max=1.0, default= 0.0)
|
|
||||||
|
|
||||||
FloatProperty( attr="pov_radio_low_error_factor",
|
|
||||||
name="Low Error Factor",
|
|
||||||
description="If you calculate just enough samples, but no more, you will get an image which has slightly blotchy lighting.",
|
|
||||||
min=0.0, max=1.0, default= 0.5)
|
|
||||||
|
|
||||||
# max_sample - not available yet
|
|
||||||
|
|
||||||
BoolProperty( attr="pov_radio_media",
|
|
||||||
name="Use Media",
|
|
||||||
description="Radiosity estimation can be affected by media.",
|
|
||||||
default= False)
|
|
||||||
|
|
||||||
FloatProperty( attr="pov_radio_minimum_reuse",
|
|
||||||
name="Minimum Reuse",
|
|
||||||
description="Fraction of the screen width which sets the minimum radius of reuse for each sample point (At values higher than 2% expect errors).",
|
|
||||||
min=0.0, max=1.0, soft_min=0.1, soft_max=0.1, default= 0.015)
|
|
||||||
|
|
||||||
IntProperty( attr="pov_radio_nearest_count",
|
|
||||||
name="Nearest Count",
|
|
||||||
description="Number of old ambient values blended together to create a new interpolated value.",
|
|
||||||
min=1, max=20, default= 5)
|
|
||||||
|
|
||||||
BoolProperty( attr="pov_radio_normal",
|
|
||||||
name="Normals",
|
|
||||||
description="Radiosity estimation can be affected by normals.",
|
|
||||||
default= False)
|
|
||||||
|
|
||||||
IntProperty( attr="pov_radio_recursion_limit",
|
|
||||||
name="Recursion Limit",
|
|
||||||
description="how many recursion levels are used to calculate the diffuse inter-reflection.",
|
|
||||||
min=1, max=20, default= 3)
|
|
||||||
|
@ -1,50 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
"""
|
|
||||||
Name: 'Getting Started'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'Help'
|
|
||||||
Tooltip: 'Help for new users'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"Getting Started" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# $Id$
|
|
||||||
#
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Getting Started Help Menu Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/education-help/tutorials/getting-started/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
||||||
|
|
||||||
|
|
@ -1,48 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
"""
|
|
||||||
Name: 'Manual'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'Help'
|
|
||||||
Tooltip: 'The Blender Wiki manual'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"Manual" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Manual Help Menu Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://wiki.blender.org/index.php/Manual')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
||||||
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
"""
|
|
||||||
Name: 'Release Logs'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'Help'
|
|
||||||
Tooltip: 'Information about the changes in this version of Blender'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"Release Logs" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Release Notes Help Menu Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/development/release-logs/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
|
|
||||||
"""
|
|
||||||
Name: 'Tutorials'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'Help'
|
|
||||||
Tooltip: 'Tutorials for learning to use Blender'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"Tutorials" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Tutorials Help Menu Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/education-help/tutorials/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
@ -1,48 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
|
|
||||||
"""
|
|
||||||
Name: 'Blender Website'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'HelpWebsites'
|
|
||||||
Tooltip: 'The official Blender website'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at Blender's main site,
|
|
||||||
www.blender.org.
|
|
||||||
"""
|
|
||||||
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Blender Website Help Menu -> Websites Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
@ -1,47 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
|
|
||||||
"""
|
|
||||||
Name: 'Developer Community'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'HelpWebsites'
|
|
||||||
Tooltip: 'Get involved with Blender development'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"Get Involved" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Blender Website Help Menu -> Websites Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/community/get-involved/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
@ -1,47 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
|
|
||||||
"""
|
|
||||||
Name: 'Blender E-Shop'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'HelpWebsites'
|
|
||||||
Tooltip: 'Buy official Blender resources and merchandise online'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"E-Shop" section.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Blender Website Help Menu -> Websites Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender3d.org/e-shop')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
@ -1,47 +0,0 @@
|
|||||||
#!BPY
|
|
||||||
|
|
||||||
"""
|
|
||||||
Name: 'User Community'
|
|
||||||
Blender: 248
|
|
||||||
Group: 'HelpWebsites'
|
|
||||||
Tooltip: 'Get involved with other Blender users'
|
|
||||||
"""
|
|
||||||
|
|
||||||
__author__ = "Matt Ebb"
|
|
||||||
__url__ = ("blender", "blenderartists.org")
|
|
||||||
__version__ = "1.0.1"
|
|
||||||
__bpydoc__ = """\
|
|
||||||
This script opens the user's default web browser at www.blender.org's
|
|
||||||
"User Community" page.
|
|
||||||
"""
|
|
||||||
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# Blender Website Help Menu -> Websites Item
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
# ***** 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
#
|
|
||||||
# ***** END GPL LICENCE BLOCK *****
|
|
||||||
# --------------------------------------------------------------------------
|
|
||||||
|
|
||||||
import Blender
|
|
||||||
try: import webbrowser
|
|
||||||
except: webbrowser = None
|
|
||||||
|
|
||||||
if webbrowser:
|
|
||||||
webbrowser.open('http://www.blender.org/community/user-community/')
|
|
||||||
else:
|
|
||||||
Blender.Draw.PupMenu("Error%t|This script requires a full python installation")
|
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -90,8 +90,8 @@ class DATA_PT_bone_groups(DataButtonsPanel):
|
|||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.active = (ob.proxy == None)
|
col.active = (ob.proxy == None)
|
||||||
col.itemO("pose.group_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("pose.group_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("pose.group_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("pose.group_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
group = pose.active_bone_group
|
group = pose.active_bone_group
|
||||||
if group:
|
if group:
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class BoneButtonsPanel(bpy.types.Panel):
|
class BoneButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "bone"
|
__context__ = "bone"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -20,7 +20,7 @@ class BONE_PT_context_bone(BoneButtonsPanel):
|
|||||||
bone = context.edit_bone
|
bone = context.edit_bone
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemL(text="", icon="ICON_BONE_DATA")
|
row.itemL(text="", icon='ICON_BONE_DATA')
|
||||||
row.itemR(bone, "name", text="")
|
row.itemR(bone, "name", text="")
|
||||||
|
|
||||||
class BONE_PT_transform(BoneButtonsPanel):
|
class BONE_PT_transform(BoneButtonsPanel):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -80,13 +80,13 @@ class DATA_PT_geometry_curve(DataButtonsPanel):
|
|||||||
sub.itemL(text="Modification:")
|
sub.itemL(text="Modification:")
|
||||||
sub.itemR(curve, "width")
|
sub.itemR(curve, "width")
|
||||||
sub.itemR(curve, "extrude")
|
sub.itemR(curve, "extrude")
|
||||||
sub.itemR(curve, "taper_object", icon="ICON_OUTLINER_OB_CURVE")
|
sub.itemR(curve, "taper_object", icon='ICON_OUTLINER_OB_CURVE')
|
||||||
|
|
||||||
sub = split.column()
|
sub = split.column()
|
||||||
sub.itemL(text="Bevel:")
|
sub.itemL(text="Bevel:")
|
||||||
sub.itemR(curve, "bevel_depth", text="Depth")
|
sub.itemR(curve, "bevel_depth", text="Depth")
|
||||||
sub.itemR(curve, "bevel_resolution", text="Resolution")
|
sub.itemR(curve, "bevel_resolution", text="Resolution")
|
||||||
sub.itemR(curve, "bevel_object", icon="ICON_OUTLINER_OB_CURVE")
|
sub.itemR(curve, "bevel_object", icon='ICON_OUTLINER_OB_CURVE')
|
||||||
|
|
||||||
class DATA_PT_pathanim(DataButtonsPanel):
|
class DATA_PT_pathanim(DataButtonsPanel):
|
||||||
__label__ = "Path Animation"
|
__label__ = "Path Animation"
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -48,36 +48,6 @@ class DATA_PT_normals(DataButtonsPanel):
|
|||||||
col.itemR(mesh, "vertex_normal_flip")
|
col.itemR(mesh, "vertex_normal_flip")
|
||||||
col.itemR(mesh, "double_sided")
|
col.itemR(mesh, "double_sided")
|
||||||
|
|
||||||
class DATA_PT_meshdraw(DataButtonsPanel):
|
|
||||||
__label__ = "Draw"
|
|
||||||
|
|
||||||
def draw(self, context):
|
|
||||||
layout = self.layout
|
|
||||||
|
|
||||||
mesh = context.mesh
|
|
||||||
|
|
||||||
layout.itemL(text="Edit Mode only, WIP")
|
|
||||||
|
|
||||||
split = layout.split()
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.itemR(mesh, "draw_edges", text="Edges")
|
|
||||||
col.itemR(mesh, "draw_faces", text="Faces")
|
|
||||||
col.itemR(mesh, "draw_creases", text="Creases")
|
|
||||||
col.itemR(mesh, "draw_bevel_weights", text="Bevel Weights")
|
|
||||||
col.itemR(mesh, "draw_seams", text="Seams")
|
|
||||||
col.itemR(mesh, "draw_sharp", text="Sharp")
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.itemR(mesh, "draw_normals", text="Face Normals")
|
|
||||||
col.itemR(mesh, "draw_vertex_normals", text="Vertex Normals")
|
|
||||||
|
|
||||||
col.itemS()
|
|
||||||
|
|
||||||
col.itemR(mesh, "draw_edge_lenght")
|
|
||||||
col.itemR(mesh, "draw_edge_angle")
|
|
||||||
col.itemR(mesh, "draw_face_area")
|
|
||||||
|
|
||||||
class DATA_PT_vertex_groups(DataButtonsPanel):
|
class DATA_PT_vertex_groups(DataButtonsPanel):
|
||||||
__label__ = "Vertex Groups"
|
__label__ = "Vertex Groups"
|
||||||
|
|
||||||
@ -93,19 +63,19 @@ class DATA_PT_vertex_groups(DataButtonsPanel):
|
|||||||
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index")
|
row.template_list(ob, "vertex_groups", ob, "active_vertex_group_index")
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("object.vertex_group_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("object.vertex_group_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("object.vertex_group_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("object.vertex_group_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
col.itemO("object.vertex_group_copy", icon="ICON_BLANK1", text="")
|
col.itemO("object.vertex_group_copy", icon='ICON_BLANK1', text="")
|
||||||
if ob.data.users > 1:
|
if ob.data.users > 1:
|
||||||
col.itemO("object.vertex_group_copy_to_linked", icon="ICON_BLANK1", text="")
|
col.itemO("object.vertex_group_copy_to_linked", icon='ICON_BLANK1', text="")
|
||||||
|
|
||||||
group = ob.active_vertex_group
|
group = ob.active_vertex_group
|
||||||
if group:
|
if group:
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemR(group, "name")
|
row.itemR(group, "name")
|
||||||
|
|
||||||
if context.edit_object:
|
if ob.mode == 'EDIT':
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|
||||||
sub = row.row(align=True)
|
sub = row.row(align=True)
|
||||||
@ -137,15 +107,15 @@ class DATA_PT_shape_keys(DataButtonsPanel):
|
|||||||
col = row.column()
|
col = row.column()
|
||||||
|
|
||||||
subcol = col.column(align=True)
|
subcol = col.column(align=True)
|
||||||
subcol.itemO("object.shape_key_add", icon="ICON_ZOOMIN", text="")
|
subcol.itemO("object.shape_key_add", icon='ICON_ZOOMIN', text="")
|
||||||
subcol.itemO("object.shape_key_remove", icon="ICON_ZOOMOUT", text="")
|
subcol.itemO("object.shape_key_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
if kb:
|
if kb:
|
||||||
col.itemS()
|
col.itemS()
|
||||||
|
|
||||||
subcol = col.column(align=True)
|
subcol = col.column(align=True)
|
||||||
subcol.itemR(ob, "shape_key_lock", icon="ICON_UNPINNED", text="")
|
subcol.itemR(ob, "shape_key_lock", icon='ICON_UNPINNED', text="")
|
||||||
subcol.itemR(kb, "mute", icon="ICON_MUTE_IPO_ON", text="")
|
subcol.itemR(kb, "mute", icon='ICON_MUTE_IPO_ON', text="")
|
||||||
|
|
||||||
if key.relative:
|
if key.relative:
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
@ -180,7 +150,7 @@ class DATA_PT_shape_keys(DataButtonsPanel):
|
|||||||
|
|
||||||
layout.itemR(kb, "name")
|
layout.itemR(kb, "name")
|
||||||
|
|
||||||
if context.edit_object:
|
if ob.mode == 'EDIT':
|
||||||
layout.enabled = False
|
layout.enabled = False
|
||||||
|
|
||||||
class DATA_PT_uv_texture(DataButtonsPanel):
|
class DATA_PT_uv_texture(DataButtonsPanel):
|
||||||
@ -197,8 +167,8 @@ class DATA_PT_uv_texture(DataButtonsPanel):
|
|||||||
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
|
col.template_list(me, "uv_textures", me, "active_uv_texture_index", rows=2)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("mesh.uv_texture_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("mesh.uv_texture_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("mesh.uv_texture_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("mesh.uv_texture_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
lay = me.active_uv_texture
|
lay = me.active_uv_texture
|
||||||
if lay:
|
if lay:
|
||||||
@ -218,8 +188,8 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
|
|||||||
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
|
col.template_list(me, "vertex_colors", me, "active_vertex_color_index", rows=2)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("mesh.vertex_color_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("mesh.vertex_color_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("mesh.vertex_color_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("mesh.vertex_color_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
lay = me.active_vertex_color
|
lay = me.active_vertex_color
|
||||||
if lay:
|
if lay:
|
||||||
@ -227,7 +197,6 @@ class DATA_PT_vertex_colors(DataButtonsPanel):
|
|||||||
|
|
||||||
bpy.types.register(DATA_PT_context_mesh)
|
bpy.types.register(DATA_PT_context_mesh)
|
||||||
bpy.types.register(DATA_PT_normals)
|
bpy.types.register(DATA_PT_normals)
|
||||||
bpy.types.register(DATA_PT_meshdraw)
|
|
||||||
bpy.types.register(DATA_PT_vertex_groups)
|
bpy.types.register(DATA_PT_vertex_groups)
|
||||||
bpy.types.register(DATA_PT_shape_keys)
|
bpy.types.register(DATA_PT_shape_keys)
|
||||||
bpy.types.register(DATA_PT_uv_texture)
|
bpy.types.register(DATA_PT_uv_texture)
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "modifier"
|
__context__ = "modifier"
|
||||||
|
|
||||||
class DATA_PT_modifiers(DataButtonsPanel):
|
class DATA_PT_modifiers(DataButtonsPanel):
|
||||||
@ -170,7 +170,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
|||||||
if md.texture_coordinates == 'OBJECT':
|
if md.texture_coordinates == 'OBJECT':
|
||||||
layout.itemR(md, "texture_coordinate_object", text="Object")
|
layout.itemR(md, "texture_coordinate_object", text="Object")
|
||||||
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
|
elif md.texture_coordinates == 'UV' and ob.type == 'MESH':
|
||||||
layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
|
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
|
||||||
|
|
||||||
def EDGE_SPLIT(self, layout, ob, md):
|
def EDGE_SPLIT(self, layout, ob, md):
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
@ -187,21 +187,40 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
|||||||
def EXPLODE(self, layout, ob, md):
|
def EXPLODE(self, layout, ob, md):
|
||||||
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
|
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
|
||||||
layout.itemR(md, "protect")
|
layout.itemR(md, "protect")
|
||||||
layout.itemR(md, "split_edges")
|
|
||||||
layout.itemR(md, "unborn")
|
flow = layout.column_flow(2)
|
||||||
layout.itemR(md, "alive")
|
flow.itemR(md, "split_edges")
|
||||||
layout.itemR(md, "dead")
|
flow.itemR(md, "unborn")
|
||||||
# Missing: "Refresh" and "Clear Vertex Group" Operator
|
flow.itemR(md, "alive")
|
||||||
|
flow.itemR(md, "dead")
|
||||||
|
|
||||||
|
layout.itemO("object.explode_refresh", text="Refresh");
|
||||||
|
|
||||||
def FLUID_SIMULATION(self, layout, ob, md):
|
def FLUID_SIMULATION(self, layout, ob, md):
|
||||||
layout.itemL(text="See Fluid panel.")
|
layout.itemL(text="See Fluid panel.")
|
||||||
|
|
||||||
def HOOK(self, layout, ob, md):
|
def HOOK(self, layout, ob, md):
|
||||||
layout.itemR(md, "falloff")
|
col = layout.column()
|
||||||
layout.itemR(md, "force", slider=True)
|
col.itemR(md, "object")
|
||||||
layout.itemR(md, "object")
|
if md.object and md.object.type == 'ARMATURE':
|
||||||
|
layout.item_pointerR(md, "subtarget", md.object.data, "bones", text="Bone")
|
||||||
|
|
||||||
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
|
layout.item_pointerR(md, "vertex_group", ob, "vertex_groups")
|
||||||
# Missing: "Reset" and "Recenter" Operator
|
|
||||||
|
split = layout.split()
|
||||||
|
split.itemR(md, "falloff")
|
||||||
|
split.itemR(md, "force", slider=True)
|
||||||
|
|
||||||
|
layout.itemS()
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemO("object.hook_reset", text="Reset")
|
||||||
|
row.itemO("object.hook_recenter", text="Recenter")
|
||||||
|
|
||||||
|
if ob.mode == 'EDIT':
|
||||||
|
row = layout.row()
|
||||||
|
row.itemO("object.hook_select", text="Select")
|
||||||
|
row.itemO("object.hook_assign", text="Assign")
|
||||||
|
|
||||||
def LATTICE(self, layout, ob, md):
|
def LATTICE(self, layout, ob, md):
|
||||||
layout.itemR(md, "object")
|
layout.itemR(md, "object")
|
||||||
@ -222,7 +241,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
|||||||
|
|
||||||
layout.itemS()
|
layout.itemS()
|
||||||
|
|
||||||
layout.itemO("object.modifier_mdef_bind", text="Bind")
|
layout.itemO("object.meshdeform_bind", text="Bind")
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemR(md, "precision")
|
row.itemR(md, "precision")
|
||||||
row.itemR(md, "dynamic")
|
row.itemR(md, "dynamic")
|
||||||
@ -346,16 +365,26 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
|||||||
|
|
||||||
def UV_PROJECT(self, layout, ob, md):
|
def UV_PROJECT(self, layout, ob, md):
|
||||||
if ob.type == 'MESH':
|
if ob.type == 'MESH':
|
||||||
layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
|
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
|
||||||
#layout.itemR(md, "projectors")
|
|
||||||
layout.itemR(md, "image")
|
layout.itemR(md, "image")
|
||||||
layout.itemR(md, "override_image")
|
layout.itemR(md, "override_image")
|
||||||
layout.itemL(text="Aspect Ratio:")
|
|
||||||
col = layout.column(align=True)
|
split = layout.split()
|
||||||
col.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
|
|
||||||
col.itemR(md, "vertical_aspect_ratio", text="Vertical")
|
col = split.column()
|
||||||
|
col.itemL(text="Aspect Ratio:")
|
||||||
#"Projectors" don't work.
|
|
||||||
|
sub = col.column(align=True)
|
||||||
|
sub.itemR(md, "horizontal_aspect_ratio", text="Horizontal")
|
||||||
|
sub.itemR(md, "vertical_aspect_ratio", text="Vertical")
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemL(text="Projectors:")
|
||||||
|
|
||||||
|
sub = col.column(align=True)
|
||||||
|
sub.itemR(md, "num_projectors", text="Number")
|
||||||
|
for proj in md.projectors:
|
||||||
|
sub.itemR(proj, "object", text="")
|
||||||
|
|
||||||
def WAVE(self, layout, ob, md):
|
def WAVE(self, layout, ob, md):
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
@ -387,7 +416,7 @@ class DATA_PT_modifiers(DataButtonsPanel):
|
|||||||
layout.itemR(md, "texture")
|
layout.itemR(md, "texture")
|
||||||
layout.itemR(md, "texture_coordinates")
|
layout.itemR(md, "texture_coordinates")
|
||||||
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
|
if md.texture_coordinates == 'MAP_UV' and ob.type == 'MESH':
|
||||||
layout.item_pointerR(md, "uv_layer", ob.data, "uv_layers")
|
layout.item_pointerR(md, "uv_layer", ob.data, "uv_textures")
|
||||||
elif md.texture_coordinates == 'OBJECT':
|
elif md.texture_coordinates == 'OBJECT':
|
||||||
layout.itemR(md, "texture_coordinates_object")
|
layout.itemR(md, "texture_coordinates_object")
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class DataButtonsPanel(bpy.types.Panel):
|
class DataButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "data"
|
__context__ = "data"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class PhysicsButtonsPanel(bpy.types.Panel):
|
class PhysicsButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -171,8 +171,8 @@ bpy.types.register(PHYSICS_PT_game_physics)
|
|||||||
bpy.types.register(PHYSICS_PT_game_collision_bounds)
|
bpy.types.register(PHYSICS_PT_game_collision_bounds)
|
||||||
|
|
||||||
class SceneButtonsPanel(bpy.types.Panel):
|
class SceneButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "scene"
|
__context__ = "scene"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -322,8 +322,8 @@ bpy.types.register(SCENE_PT_game_shading)
|
|||||||
bpy.types.register(SCENE_PT_game_performance)
|
bpy.types.register(SCENE_PT_game_performance)
|
||||||
|
|
||||||
class WorldButtonsPanel(bpy.types.Panel):
|
class WorldButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "world"
|
__context__ = "world"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class MaterialButtonsPanel(bpy.types.Panel):
|
class MaterialButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "material"
|
__context__ = "material"
|
||||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||||
|
|
||||||
@ -45,10 +45,10 @@ class MATERIAL_PT_context_material(MaterialButtonsPanel):
|
|||||||
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
|
row.template_list(ob, "materials", ob, "active_material_index", rows=2)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("object.material_slot_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("object.material_slot_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("object.material_slot_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("object.material_slot_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
if context.edit_object:
|
if ob.mode == 'EDIT':
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.itemO("object.material_slot_assign", text="Assign")
|
row.itemO("object.material_slot_assign", text="Assign")
|
||||||
row.itemO("object.material_slot_select", text="Select")
|
row.itemO("object.material_slot_select", text="Select")
|
||||||
@ -90,10 +90,12 @@ class MATERIAL_PT_shading(MaterialButtonsPanel):
|
|||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.active = not mat.shadeless
|
sub = col.column()
|
||||||
col.itemR(mat, "ambient")
|
sub.active = not mat.shadeless
|
||||||
col.itemR(mat, "emit")
|
sub.itemR(mat, "emit")
|
||||||
col.itemR(mat, "translucency")
|
sub.itemR(mat, "ambient")
|
||||||
|
sub = col.column()
|
||||||
|
sub.itemR(mat, "translucency")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemR(mat, "shadeless")
|
col.itemR(mat, "shadeless")
|
||||||
@ -125,7 +127,7 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
|
|||||||
|
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column(align=True)
|
||||||
col.itemL(text="Size:")
|
col.itemL(text="Size:")
|
||||||
col.itemR(tan, "start_size", text="Root")
|
col.itemR(tan, "start_size", text="Root")
|
||||||
col.itemR(tan, "end_size", text="Tip")
|
col.itemR(tan, "end_size", text="Tip")
|
||||||
@ -134,11 +136,13 @@ class MATERIAL_PT_strand(MaterialButtonsPanel):
|
|||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = (not mat.shadeless)
|
sub.active = (not mat.shadeless)
|
||||||
sub.itemR(tan, "tangent_shading")
|
sub.itemR(tan, "tangent_shading")
|
||||||
|
col.itemR(tan, "shape")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemR(tan, "shape")
|
col.itemL(text="Shading:")
|
||||||
col.itemR(tan, "width_fade")
|
col.itemR(tan, "width_fade")
|
||||||
col.itemR(tan, "uv_layer")
|
col.itemR(tan, "uv_layer")
|
||||||
|
col.itemS()
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = (not mat.shadeless)
|
sub.active = (not mat.shadeless)
|
||||||
sub.itemR(tan, "surface_diffuse")
|
sub.itemR(tan, "surface_diffuse")
|
||||||
@ -355,7 +359,9 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
|
|||||||
def draw_header(self, context):
|
def draw_header(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
sss = context.material.subsurface_scattering
|
sss = context.material.subsurface_scattering
|
||||||
|
mat = context.material
|
||||||
|
|
||||||
|
layout.active = (not mat.shadeless)
|
||||||
layout.itemR(sss, "enabled", text="")
|
layout.itemR(sss, "enabled", text="")
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
@ -369,21 +375,22 @@ class MATERIAL_PT_sss(MaterialButtonsPanel):
|
|||||||
split = layout.split()
|
split = layout.split()
|
||||||
split.active = (not mat.shadeless)
|
split.active = (not mat.shadeless)
|
||||||
|
|
||||||
col = split.column(align=True)
|
col = split.column()
|
||||||
|
col.itemR(sss, "ior")
|
||||||
|
col.itemR(sss, "scale")
|
||||||
col.itemR(sss, "color", text="")
|
col.itemR(sss, "color", text="")
|
||||||
col.itemL(text="Blend:")
|
col.itemR(sss, "radius", text="RGB Radius")
|
||||||
col.itemR(sss, "color_factor", text="Color")
|
|
||||||
col.itemR(sss, "texture_factor", text="Texture")
|
|
||||||
col.itemL(text="Scattering Weight:")
|
|
||||||
col.itemR(sss, "front")
|
|
||||||
col.itemR(sss, "back")
|
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
sub = col.column(align=True)
|
sub = col.column(align=True)
|
||||||
sub.itemR(sss, "ior")
|
sub.itemL(text="Blend:")
|
||||||
sub.itemR(sss, "scale")
|
sub.itemR(sss, "color_factor", text="Color")
|
||||||
col.itemR(sss, "radius", text="RGB Radius")
|
sub.itemR(sss, "texture_factor", text="Texture")
|
||||||
col.itemR(sss, "error_tolerance")
|
sub.itemL(text="Scattering Weight:")
|
||||||
|
sub.itemR(sss, "front")
|
||||||
|
sub.itemR(sss, "back")
|
||||||
|
col.itemS()
|
||||||
|
col.itemR(sss, "error_tolerance", text="Error")
|
||||||
|
|
||||||
class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
||||||
__label__ = "Mirror"
|
__label__ = "Mirror"
|
||||||
@ -414,20 +421,26 @@ class MATERIAL_PT_mirror(MaterialButtonsPanel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemR(raym, "reflect", text="Reflectivity")
|
col.itemR(raym, "reflect", text="Reflectivity")
|
||||||
col.itemR(mat, "mirror_color", text="")
|
col.itemR(mat, "mirror_color", text="")
|
||||||
col.itemL(text="Fresnel:")
|
|
||||||
col.itemR(raym, "fresnel", text="Amount")
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemR(raym, "fresnel")
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = raym.fresnel > 0
|
sub.active = raym.fresnel > 0
|
||||||
sub.itemR(raym, "fresnel_factor", text="Blend")
|
sub.itemR(raym, "fresnel_factor", text="Blend")
|
||||||
|
|
||||||
|
split = layout.split()
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
col.itemS()
|
col.itemS()
|
||||||
|
col.itemR(raym, "distance", text="Max Dist")
|
||||||
|
col.itemR(raym, "depth")
|
||||||
col.itemS()
|
col.itemS()
|
||||||
sub = col.split(percentage=0.4)
|
sub = col.split(percentage=0.4)
|
||||||
sub.itemL(text="Fade To:")
|
sub.itemL(text="Fade To:")
|
||||||
sub.itemR(raym, "fade_to", text="")
|
sub.itemR(raym, "fade_to", text="")
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemR(raym, "depth")
|
|
||||||
col.itemR(raym, "distance", text="Max Dist")
|
|
||||||
col.itemL(text="Gloss:")
|
col.itemL(text="Gloss:")
|
||||||
col.itemR(raym, "gloss", text="Amount")
|
col.itemR(raym, "gloss", text="Amount")
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
@ -465,25 +478,24 @@ class MATERIAL_PT_transp(MaterialButtonsPanel):
|
|||||||
split = layout.split()
|
split = layout.split()
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemL(text="Transparency:")
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(mat, "alpha")
|
row.itemR(mat, "alpha")
|
||||||
row.active = mat.transparency
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(mat, "specular_alpha", text="Specular")
|
|
||||||
row.active = mat.transparency and (not mat.shadeless)
|
row.active = mat.transparency and (not mat.shadeless)
|
||||||
|
row.itemR(mat, "specular_alpha", text="Specular")
|
||||||
|
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.active = mat.transparency and (not mat.shadeless)
|
col.active = (not mat.shadeless)
|
||||||
col.itemL(text="Fresnel:")
|
col.itemR(rayt, "fresnel")
|
||||||
col.itemR(rayt, "fresnel", text="Amount")
|
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = rayt.fresnel > 0
|
sub.active = rayt.fresnel > 0
|
||||||
sub.itemR(rayt, "fresnel_factor", text="Blend")
|
sub.itemR(rayt, "fresnel_factor", text="Blend")
|
||||||
|
|
||||||
if mat.transparency_method == 'RAYTRACE':
|
if mat.transparency_method == 'RAYTRACE':
|
||||||
|
layout.itemS()
|
||||||
split = layout.split()
|
split = layout.split()
|
||||||
split.active = mat.transparency and (not mat.shadeless)
|
split.active = mat.transparency
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemR(rayt, "ior")
|
col.itemR(rayt, "ior")
|
||||||
@ -653,23 +665,50 @@ class MATERIAL_PT_halo(MaterialButtonsPanel):
|
|||||||
sub.active = halo.ring
|
sub.active = halo.ring
|
||||||
sub.itemR(halo, "rings")
|
sub.itemR(halo, "rings")
|
||||||
sub.itemR(mat, "mirror_color", text="")
|
sub.itemR(mat, "mirror_color", text="")
|
||||||
|
col.itemS()
|
||||||
col.itemR(halo, "lines")
|
col.itemR(halo, "lines")
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = halo.lines
|
sub.active = halo.lines
|
||||||
sub.itemR(halo, "line_number", text="Lines")
|
sub.itemR(halo, "line_number", text="Lines")
|
||||||
sub.itemR(mat, "specular_color", text="")
|
sub.itemR(mat, "specular_color", text="")
|
||||||
|
col.itemS()
|
||||||
col.itemR(halo, "star")
|
col.itemR(halo, "star")
|
||||||
sub = col.column()
|
sub = col.column()
|
||||||
sub.active = halo.star
|
sub.active = halo.star
|
||||||
sub.itemR(halo, "star_tips")
|
sub.itemR(halo, "star_tips")
|
||||||
col.itemR(halo, "flare_mode")
|
|
||||||
sub = col.column()
|
class MATERIAL_PT_flare(MaterialButtonsPanel):
|
||||||
sub.active = halo.flare_mode
|
__label__= "Flare"
|
||||||
sub.itemR(halo, "flare_size", text="Size")
|
COMPAT_ENGINES = set(['BLENDER_RENDER'])
|
||||||
sub.itemR(halo, "flare_subsize", text="Subsize")
|
|
||||||
sub.itemR(halo, "flare_boost", text="Boost")
|
def poll(self, context):
|
||||||
sub.itemR(halo, "flare_seed", text="Seed")
|
mat = context.material
|
||||||
sub.itemR(halo, "flares_sub", text="Sub")
|
return mat and (mat.type == 'HALO') and (context.scene.render_data.engine in self.COMPAT_ENGINES)
|
||||||
|
|
||||||
|
def draw_header(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
mat = context.material
|
||||||
|
halo = mat.halo
|
||||||
|
layout.itemR(halo, "flare_mode", text="")
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
mat = context.material
|
||||||
|
halo = mat.halo
|
||||||
|
|
||||||
|
layout.active = halo.flare_mode
|
||||||
|
|
||||||
|
split = layout.split()
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemR(halo, "flare_size", text="Size")
|
||||||
|
col.itemR(halo, "flare_boost", text="Boost")
|
||||||
|
col.itemR(halo, "flare_seed", text="Seed")
|
||||||
|
col = split.column()
|
||||||
|
col.itemR(halo, "flares_sub", text="Subflares")
|
||||||
|
col.itemR(halo, "flare_subsize", text="Subsize")
|
||||||
|
|
||||||
bpy.types.register(MATERIAL_PT_context_material)
|
bpy.types.register(MATERIAL_PT_context_material)
|
||||||
bpy.types.register(MATERIAL_PT_preview)
|
bpy.types.register(MATERIAL_PT_preview)
|
||||||
@ -684,6 +723,7 @@ bpy.types.register(MATERIAL_PT_volume_scattering)
|
|||||||
bpy.types.register(MATERIAL_PT_volume_transp)
|
bpy.types.register(MATERIAL_PT_volume_transp)
|
||||||
bpy.types.register(MATERIAL_PT_volume_integration)
|
bpy.types.register(MATERIAL_PT_volume_integration)
|
||||||
bpy.types.register(MATERIAL_PT_halo)
|
bpy.types.register(MATERIAL_PT_halo)
|
||||||
|
bpy.types.register(MATERIAL_PT_flare)
|
||||||
bpy.types.register(MATERIAL_PT_physics)
|
bpy.types.register(MATERIAL_PT_physics)
|
||||||
bpy.types.register(MATERIAL_PT_strand)
|
bpy.types.register(MATERIAL_PT_strand)
|
||||||
bpy.types.register(MATERIAL_PT_options)
|
bpy.types.register(MATERIAL_PT_options)
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class ObjectButtonsPanel(bpy.types.Panel):
|
class ObjectButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "object"
|
__context__ = "object"
|
||||||
|
|
||||||
class OBJECT_PT_context_object(ObjectButtonsPanel):
|
class OBJECT_PT_context_object(ObjectButtonsPanel):
|
||||||
@ -15,7 +15,7 @@ class OBJECT_PT_context_object(ObjectButtonsPanel):
|
|||||||
ob = context.object
|
ob = context.object
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemL(text="", icon="ICON_OBJECT_DATA")
|
row.itemL(text="", icon='ICON_OBJECT_DATA')
|
||||||
row.itemR(ob, "name", text="")
|
row.itemR(ob, "name", text="")
|
||||||
|
|
||||||
class OBJECT_PT_transform(ObjectButtonsPanel):
|
class OBJECT_PT_transform(ObjectButtonsPanel):
|
||||||
@ -79,7 +79,7 @@ class OBJECT_PT_groups(ObjectButtonsPanel):
|
|||||||
|
|
||||||
row = col.box().row()
|
row = col.box().row()
|
||||||
row.itemR(group, "name", text="")
|
row.itemR(group, "name", text="")
|
||||||
row.itemO("object.group_remove", text="", icon="VICON_X")
|
row.itemO("object.group_remove", text="", icon='VICON_X')
|
||||||
|
|
||||||
split = col.box().split()
|
split = col.box().split()
|
||||||
split.column().itemR(group, "layer", text="Dupli")
|
split.column().itemR(group, "layer", text="Dupli")
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class ConstraintButtonsPanel(bpy.types.Panel):
|
class ConstraintButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "constraint"
|
__context__ = "constraint"
|
||||||
|
|
||||||
def draw_constraint(self, con):
|
def draw_constraint(self, con):
|
||||||
@ -39,7 +39,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
|||||||
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
|
layout.itemR(con, "target") # XXX limiting settings for only 'curves' or some type of object
|
||||||
|
|
||||||
if con.target and subtargets:
|
if con.target and subtargets:
|
||||||
if con.target.type == "ARMATURE":
|
if con.target.type == 'ARMATURE':
|
||||||
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
|
layout.item_pointerR(con, "subtarget", con.target.data, "bones", text="Bone")
|
||||||
|
|
||||||
if con.type == 'COPY_LOCATION':
|
if con.type == 'COPY_LOCATION':
|
||||||
@ -478,7 +478,7 @@ class ConstraintButtonsPanel(bpy.types.Panel):
|
|||||||
layout.itemR(con, "distance")
|
layout.itemR(con, "distance")
|
||||||
layout.itemR(con, "shrinkwrap_type")
|
layout.itemR(con, "shrinkwrap_type")
|
||||||
|
|
||||||
if con.shrinkwrap_type == "PROJECT":
|
if con.shrinkwrap_type == 'PROJECT':
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
row.itemR(con, "axis_x")
|
row.itemR(con, "axis_x")
|
||||||
row.itemR(con, "axis_y")
|
row.itemR(con, "axis_y")
|
||||||
|
@ -11,8 +11,8 @@ def particle_panel_poll(context):
|
|||||||
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
|
return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
|
||||||
|
|
||||||
class ParticleButtonsPanel(bpy.types.Panel):
|
class ParticleButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "particle"
|
__context__ = "particle"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -35,8 +35,8 @@ class PARTICLE_PT_particles(ParticleButtonsPanel):
|
|||||||
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
|
row.template_list(ob, "particle_systems", ob, "active_particle_system_index", rows=2)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("object.particle_system_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("object.particle_system_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("object.particle_system_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("object.particle_system_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
if psys:
|
if psys:
|
||||||
part = psys.settings
|
part = psys.settings
|
||||||
@ -156,8 +156,8 @@ class PARTICLE_PT_cache(ParticleButtonsPanel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index", rows=2 )
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemL(text="File Name:")
|
row.itemL(text="File Name:")
|
||||||
@ -400,12 +400,12 @@ class PARTICLE_PT_physics(ParticleButtonsPanel):
|
|||||||
col = row.column()
|
col = row.column()
|
||||||
subrow = col.row()
|
subrow = col.row()
|
||||||
subcol = subrow.column(align=True)
|
subcol = subrow.column(align=True)
|
||||||
subcol.itemO("particle.new_target", icon="ICON_ZOOMIN", text="")
|
subcol.itemO("particle.new_target", icon='ICON_ZOOMIN', text="")
|
||||||
subcol.itemO("particle.remove_target", icon="ICON_ZOOMOUT", text="")
|
subcol.itemO("particle.remove_target", icon='ICON_ZOOMOUT', text="")
|
||||||
subrow = col.row()
|
subrow = col.row()
|
||||||
subcol = subrow.column(align=True)
|
subcol = subrow.column(align=True)
|
||||||
subcol.itemO("particle.target_move_up", icon="VICON_MOVE_UP", text="")
|
subcol.itemO("particle.target_move_up", icon='VICON_MOVE_UP', text="")
|
||||||
subcol.itemO("particle.target_move_down", icon="VICON_MOVE_DOWN", text="")
|
subcol.itemO("particle.target_move_down", icon='VICON_MOVE_DOWN', text="")
|
||||||
|
|
||||||
key = psys.active_particle_target
|
key = psys.active_particle_target
|
||||||
if key:
|
if key:
|
||||||
@ -450,11 +450,11 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
|
|||||||
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
|
#row.template_list(boids, "states", boids, "active_boid_state_index", compact="True")
|
||||||
#col = row.row()
|
#col = row.row()
|
||||||
#subrow = col.row(align=True)
|
#subrow = col.row(align=True)
|
||||||
#subrow.itemO("boid.boidstate_add", icon="ICON_ZOOMIN", text="")
|
#subrow.itemO("boid.boidstate_add", icon='ICON_ZOOMIN', text="")
|
||||||
#subrow.itemO("boid.boidstate_del", icon="ICON_ZOOMOUT", text="")
|
#subrow.itemO("boid.boidstate_del", icon='ICON_ZOOMOUT', text="")
|
||||||
#subrow = row.row(align=True)
|
#subrow = row.row(align=True)
|
||||||
#subrow.itemO("boid.boidstate_move_up", icon="VICON_MOVE_UP", text="")
|
#subrow.itemO("boid.boidstate_move_up", icon='VICON_MOVE_UP', text="")
|
||||||
#subrow.itemO("boid.boidstate_move_down", icon="VICON_MOVE_DOWN", text="")
|
#subrow.itemO("boid.boidstate_move_down", icon='VICON_MOVE_DOWN', text="")
|
||||||
|
|
||||||
state = boids.active_boid_state
|
state = boids.active_boid_state
|
||||||
|
|
||||||
@ -473,12 +473,12 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
|
|||||||
col = row.column()
|
col = row.column()
|
||||||
subrow = col.row()
|
subrow = col.row()
|
||||||
subcol = subrow.column(align=True)
|
subcol = subrow.column(align=True)
|
||||||
subcol.item_menu_enumO("boid.boidrule_add", "type", icon="ICON_ZOOMIN", text="")
|
subcol.item_menu_enumO("boid.boidrule_add", "type", icon='ICON_ZOOMIN', text="")
|
||||||
subcol.itemO("boid.boidrule_del", icon="ICON_ZOOMOUT", text="")
|
subcol.itemO("boid.boidrule_del", icon='ICON_ZOOMOUT', text="")
|
||||||
subrow = col.row()
|
subrow = col.row()
|
||||||
subcol = subrow.column(align=True)
|
subcol = subrow.column(align=True)
|
||||||
subcol.itemO("boid.boidrule_move_up", icon="VICON_MOVE_UP", text="")
|
subcol.itemO("boid.boidrule_move_up", icon='VICON_MOVE_UP', text="")
|
||||||
subcol.itemO("boid.boidrule_move_down", icon="VICON_MOVE_DOWN", text="")
|
subcol.itemO("boid.boidrule_move_down", icon='VICON_MOVE_DOWN', text="")
|
||||||
|
|
||||||
rule = state.active_boid_rule
|
rule = state.active_boid_rule
|
||||||
|
|
||||||
@ -486,8 +486,8 @@ class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemR(rule, "name", text="")
|
row.itemR(rule, "name", text="")
|
||||||
#somebody make nice icons for boids here please! -jahka
|
#somebody make nice icons for boids here please! -jahka
|
||||||
row.itemR(rule, "in_air", icon="VICON_MOVE_UP", text="")
|
row.itemR(rule, "in_air", icon='VICON_MOVE_UP', text="")
|
||||||
row.itemR(rule, "on_land", icon="VICON_MOVE_DOWN", text="")
|
row.itemR(rule, "on_land", icon='VICON_MOVE_DOWN', text="")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class PhysicButtonsPanel(bpy.types.Panel):
|
class PhysicButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -93,8 +93,8 @@ class PHYSICS_PT_cloth_cache(PhysicButtonsPanel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemR(cache, "name")
|
row.itemR(cache, "name")
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class PhysicButtonsPanel(bpy.types.Panel):
|
class PhysicButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -146,15 +146,15 @@ class PHYSICS_PT_field(PhysicButtonsPanel):
|
|||||||
sub.active = field.use_radial_max
|
sub.active = field.use_radial_max
|
||||||
sub.itemR(field, "radial_maximum", text="Distance")
|
sub.itemR(field, "radial_maximum", text="Distance")
|
||||||
|
|
||||||
#if ob.type in "CURVE":
|
#if ob.type in 'CURVE':
|
||||||
#if field.type == "GUIDE":
|
#if field.type == 'GUIDE':
|
||||||
#colsub = col.column(align=True)
|
#colsub = col.column(align=True)
|
||||||
|
|
||||||
#if field.type != "NONE":
|
#if field.type != 'NONE':
|
||||||
#layout.itemR(field, "strength")
|
#layout.itemR(field, "strength")
|
||||||
|
|
||||||
#if field.type in ("HARMONIC", "SPHERICAL", "CHARGE", "LENNARDj"):
|
#if field.type in ('HARMONIC', 'SPHERICAL', 'CHARGE', "LENNARDj"):
|
||||||
#if ob.type in ("MESH", "SURFACE", "FONT", "CURVE"):
|
#if ob.type in ('MESH', 'SURFACE', 'FONT', 'CURVE'):
|
||||||
#layout.itemR(field, "surface")
|
#layout.itemR(field, "surface")
|
||||||
|
|
||||||
class PHYSICS_PT_collision(PhysicButtonsPanel):
|
class PHYSICS_PT_collision(PhysicButtonsPanel):
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class PhysicButtonsPanel(bpy.types.Panel):
|
class PhysicButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
@ -1,9 +1,14 @@
|
|||||||
|
|
||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
|
def smoke_panel_enabled_low(smd):
|
||||||
|
if smd.smoke_type == 'TYPE_DOMAIN':
|
||||||
|
return smd.domain.point_cache.baked==False
|
||||||
|
return True
|
||||||
|
|
||||||
class PhysicButtonsPanel(bpy.types.Panel):
|
class PhysicButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -38,6 +43,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
|||||||
split.itemL()
|
split.itemL()
|
||||||
|
|
||||||
if md:
|
if md:
|
||||||
|
|
||||||
|
# layout.enabled = smoke_panel_enabled(md)
|
||||||
layout.itemR(md, "smoke_type", expand=True)
|
layout.itemR(md, "smoke_type", expand=True)
|
||||||
|
|
||||||
if md.smoke_type == 'TYPE_DOMAIN':
|
if md.smoke_type == 'TYPE_DOMAIN':
|
||||||
@ -49,13 +56,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemL(text="Resolution:")
|
col.itemL(text="Resolution:")
|
||||||
col.itemR(domain, "maxres", text="Divisions")
|
col.itemR(domain, "maxres", text="Divisions")
|
||||||
|
|
||||||
col.itemL(text="Display:")
|
|
||||||
col.itemR(domain, "visibility", text="Resolution")
|
|
||||||
col.itemR(domain, "color", slider=True)
|
|
||||||
sub = col.column()
|
|
||||||
sub.active = domain.highres
|
|
||||||
sub.itemR(domain, "viewhighres")
|
|
||||||
|
|
||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemL(text="Behavior:")
|
col.itemL(text="Behavior:")
|
||||||
@ -88,43 +88,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel):
|
|||||||
|
|
||||||
#elif md.smoke_type == 'TYPE_COLL':
|
#elif md.smoke_type == 'TYPE_COLL':
|
||||||
# layout.itemS()
|
# layout.itemS()
|
||||||
|
|
||||||
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
|
||||||
__label__ = "Smoke High Resolution"
|
|
||||||
__default_closed__ = True
|
|
||||||
|
|
||||||
def poll(self, context):
|
|
||||||
md = context.smoke
|
|
||||||
if md:
|
|
||||||
return (md.smoke_type == 'TYPE_DOMAIN')
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
def draw_header(self, context):
|
|
||||||
layout = self.layout
|
|
||||||
|
|
||||||
high = context.smoke.domain_settings
|
|
||||||
|
|
||||||
layout.itemR(high, "highres", text="")
|
|
||||||
|
|
||||||
def draw(self, context):
|
|
||||||
layout = self.layout
|
|
||||||
|
|
||||||
high = context.smoke.domain_settings
|
|
||||||
|
|
||||||
layout.active = high.highres
|
|
||||||
|
|
||||||
split = layout.split()
|
|
||||||
|
|
||||||
col = split.column()
|
|
||||||
col.itemL(text="Resolution:")
|
|
||||||
col.itemR(high, "amplify", text="Divisions")
|
|
||||||
|
|
||||||
sub = split.column()
|
|
||||||
sub.itemL(text="Noise Method:")
|
|
||||||
sub.row().itemR(high, "noise_type", text="")
|
|
||||||
sub.itemR(high, "strength")
|
|
||||||
|
|
||||||
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
|
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
|
||||||
__label__ = "Smoke Groups"
|
__label__ = "Smoke Groups"
|
||||||
__default_closed__ = True
|
__default_closed__ = True
|
||||||
@ -153,7 +117,168 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel):
|
|||||||
col = split.column()
|
col = split.column()
|
||||||
col.itemL(text="Collision Group:")
|
col.itemL(text="Collision Group:")
|
||||||
col.itemR(group, "coll_group", text="")
|
col.itemR(group, "coll_group", text="")
|
||||||
|
|
||||||
|
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel):
|
||||||
|
__label__ = "Smoke Cache"
|
||||||
|
__default_closed__ = True
|
||||||
|
|
||||||
|
def poll(self, context):
|
||||||
|
md = context.smoke
|
||||||
|
if md:
|
||||||
|
return (md.smoke_type == 'TYPE_DOMAIN')
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
md = context.smoke
|
||||||
|
|
||||||
|
if md.smoke_type == 'TYPE_DOMAIN':
|
||||||
|
|
||||||
|
domain = md.domain_settings
|
||||||
|
cache = domain.point_cache
|
||||||
|
|
||||||
|
layout.set_context_pointer("PointCache", cache)
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
||||||
|
col = row.column(align=True)
|
||||||
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||||
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemR(cache, "name")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemR(cache, "start_frame")
|
||||||
|
row.itemR(cache, "end_frame")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
|
||||||
|
if cache.baked == True:
|
||||||
|
row.itemO("ptcache.free_bake", text="Free Bake")
|
||||||
|
else:
|
||||||
|
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
|
||||||
|
|
||||||
|
subrow = row.row()
|
||||||
|
subrow.enabled = cache.frames_skipped or cache.outdated
|
||||||
|
subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
#row.enabled = smoke_panel_enabled(psys)
|
||||||
|
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
#row.enabled = smoke_panel_enabled(psys)
|
||||||
|
|
||||||
|
layout.itemL(text=cache.info)
|
||||||
|
|
||||||
|
layout.itemS()
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
|
||||||
|
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
|
||||||
|
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
|
||||||
|
|
||||||
|
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel):
|
||||||
|
__label__ = "Smoke High Resolution"
|
||||||
|
__default_closed__ = True
|
||||||
|
|
||||||
|
def poll(self, context):
|
||||||
|
md = context.smoke
|
||||||
|
if md:
|
||||||
|
return (md.smoke_type == 'TYPE_DOMAIN')
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
|
def draw_header(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
high = context.smoke.domain_settings
|
||||||
|
|
||||||
|
layout.itemR(high, "highres", text="")
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
md = context.smoke_hr
|
||||||
|
|
||||||
|
if md:
|
||||||
|
|
||||||
|
split = layout.split()
|
||||||
|
|
||||||
|
col = split.column()
|
||||||
|
col.itemL(text="Resolution:")
|
||||||
|
col.itemR(md, "amplify", text="Divisions")
|
||||||
|
|
||||||
|
sub = split.column()
|
||||||
|
sub.itemL(text="Noise Method:")
|
||||||
|
sub.row().itemR(md, "noise_type", text="")
|
||||||
|
sub.itemR(md, "strength")
|
||||||
|
sub.itemR(md, "show_highres")
|
||||||
|
|
||||||
|
class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel):
|
||||||
|
__label__ = "Smoke Cache"
|
||||||
|
__default_closed__ = True
|
||||||
|
|
||||||
|
def poll(self, context):
|
||||||
|
return (context.smoke_hr != None)
|
||||||
|
|
||||||
|
def draw(self, context):
|
||||||
|
layout = self.layout
|
||||||
|
|
||||||
|
md = context.smoke_hr
|
||||||
|
|
||||||
|
if md:
|
||||||
|
|
||||||
|
cache = md.point_cache
|
||||||
|
|
||||||
|
layout.set_context_pointer("PointCache", cache)
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
||||||
|
col = row.column(align=True)
|
||||||
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||||
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemR(cache, "name")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemR(cache, "start_frame")
|
||||||
|
row.itemR(cache, "end_frame")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
|
||||||
|
if cache.baked == True:
|
||||||
|
row.itemO("ptcache.free_bake", text="Free Bake")
|
||||||
|
else:
|
||||||
|
row.item_booleanO("ptcache.bake", "bake", True, text="Bake")
|
||||||
|
|
||||||
|
subrow = row.row()
|
||||||
|
subrow.enabled = cache.frames_skipped or cache.outdated
|
||||||
|
subrow.itemO("ptcache.bake", "bake", False, text="Calculate to Current Frame")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
#row.enabled = smoke_panel_enabled(psys)
|
||||||
|
row.itemO("ptcache.bake_from_cache", text="Current Cache to Bake")
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
#row.enabled = smoke_panel_enabled(psys)
|
||||||
|
|
||||||
|
layout.itemL(text=cache.info)
|
||||||
|
|
||||||
|
layout.itemS()
|
||||||
|
|
||||||
|
row = layout.row()
|
||||||
|
row.itemO("ptcache.bake_all", "bake", True, text="Bake All Dynamics")
|
||||||
|
row.itemO("ptcache.free_bake_all", text="Free All Bakes")
|
||||||
|
layout.itemO("ptcache.bake_all", "bake", False, text="Update All Dynamics to current frame")
|
||||||
|
|
||||||
|
|
||||||
bpy.types.register(PHYSICS_PT_smoke)
|
bpy.types.register(PHYSICS_PT_smoke)
|
||||||
bpy.types.register(PHYSICS_PT_smoke_highres)
|
bpy.types.register(PHYSICS_PT_smoke_cache)
|
||||||
bpy.types.register(PHYSICS_PT_smoke_groups)
|
bpy.types.register(PHYSICS_PT_smoke_groups)
|
||||||
|
#bpy.types.register(PHYSICS_PT_smoke_highres)
|
||||||
|
#bpy.types.register(PHYSICS_PT_smoke_cache_highres)
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class PhysicButtonsPanel(bpy.types.Panel):
|
class PhysicButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "physics"
|
__context__ = "physics"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
@ -68,8 +68,8 @@ class PHYSICS_PT_softbody_cache(PhysicButtonsPanel):
|
|||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
row.template_list(cache, "point_cache_list", cache, "active_point_cache_index")
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("ptcache.add_new", icon="ICON_ZOOMIN", text="")
|
col.itemO("ptcache.add_new", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("ptcache.remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("ptcache.remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
row = layout.row()
|
row = layout.row()
|
||||||
row.itemR(cache, "name")
|
row.itemR(cache, "name")
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class RenderButtonsPanel(bpy.types.Panel):
|
class RenderButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "scene"
|
__context__ = "scene"
|
||||||
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here
|
||||||
|
|
||||||
@ -41,8 +41,8 @@ class SCENE_PT_layers(RenderButtonsPanel):
|
|||||||
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
|
row.template_list(rd, "layers", rd, "active_layer_index", rows=2)
|
||||||
|
|
||||||
col = row.column(align=True)
|
col = row.column(align=True)
|
||||||
col.itemO("scene.render_layer_add", icon="ICON_ZOOMIN", text="")
|
col.itemO("scene.render_layer_add", icon='ICON_ZOOMIN', text="")
|
||||||
col.itemO("scene.render_layer_remove", icon="ICON_ZOOMOUT", text="")
|
col.itemO("scene.render_layer_remove", icon='ICON_ZOOMOUT', text="")
|
||||||
|
|
||||||
rl = rd.layers[rd.active_layer_index]
|
rl = rd.layers[rd.active_layer_index]
|
||||||
|
|
||||||
@ -103,19 +103,19 @@ class SCENE_PT_layers(RenderButtonsPanel):
|
|||||||
col.itemR(rl, "pass_diffuse")
|
col.itemR(rl, "pass_diffuse")
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(rl, "pass_specular")
|
row.itemR(rl, "pass_specular")
|
||||||
row.itemR(rl, "pass_specular_exclude", text="", icon="ICON_X")
|
row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(rl, "pass_shadow")
|
row.itemR(rl, "pass_shadow")
|
||||||
row.itemR(rl, "pass_shadow_exclude", text="", icon="ICON_X")
|
row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(rl, "pass_ao")
|
row.itemR(rl, "pass_ao")
|
||||||
row.itemR(rl, "pass_ao_exclude", text="", icon="ICON_X")
|
row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(rl, "pass_reflection")
|
row.itemR(rl, "pass_reflection")
|
||||||
row.itemR(rl, "pass_reflection_exclude", text="", icon="ICON_X")
|
row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
|
||||||
row = col.row()
|
row = col.row()
|
||||||
row.itemR(rl, "pass_refraction")
|
row.itemR(rl, "pass_refraction")
|
||||||
row.itemR(rl, "pass_refraction_exclude", text="", icon="ICON_X")
|
row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
|
||||||
|
|
||||||
class SCENE_PT_shading(RenderButtonsPanel):
|
class SCENE_PT_shading(RenderButtonsPanel):
|
||||||
__label__ = "Shading"
|
__label__ = "Shading"
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
class TextureButtonsPanel(bpy.types.Panel):
|
class TextureButtonsPanel(bpy.types.Panel):
|
||||||
__space_type__ = "PROPERTIES"
|
__space_type__ = 'PROPERTIES'
|
||||||
__region_type__ = "WINDOW"
|
__region_type__ = 'WINDOW'
|
||||||
__context__ = "texture"
|
__context__ = "texture"
|
||||||
|
|
||||||
def poll(self, context):
|
def poll(self, context):
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user