[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11052] trunk/blender: This commit is a modified version of patch #6860
Kent Mein
mein at cs.umn.edu
Mon Jun 25 21:50:25 CEST 2007
Revision: 11052
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11052
Author: sirdude
Date: 2007-06-25 21:50:25 +0200 (Mon, 25 Jun 2007)
Log Message:
-----------
This commit is a modified version of patch #6860
It adds read only dds support. (Writing will come later)
Kent
Modified Paths:
--------------
trunk/blender/config/darwin-config.py
trunk/blender/config/linux2-config.py
trunk/blender/config/linuxcross-config.py
trunk/blender/config/openbsd3-config.py
trunk/blender/config/sunos5-config.py
trunk/blender/config/win32-mingw-config.py
trunk/blender/config/win32-vc-config.py
trunk/blender/source/Makefile
trunk/blender/source/blender/SConscript
trunk/blender/source/blender/blenkernel/SConscript
trunk/blender/source/blender/blenkernel/intern/Makefile
trunk/blender/source/blender/blenkernel/intern/image.c
trunk/blender/source/blender/imbuf/IMB_imbuf_types.h
trunk/blender/source/blender/imbuf/SConscript
trunk/blender/source/blender/imbuf/intern/Makefile
trunk/blender/source/blender/imbuf/intern/readimage.c
trunk/blender/source/blender/imbuf/intern/util.c
trunk/blender/source/blender/imbuf/intern/writeimage.c
trunk/blender/source/blender/makesdna/DNA_scene_types.h
trunk/blender/source/blender/src/Makefile
trunk/blender/source/blender/src/SConscript
trunk/blender/source/blender/src/buttons_scene.c
trunk/blender/source/blender/src/filesel.c
trunk/blender/source/blender/src/writeimage.c
trunk/blender/source/nan_definitions.mk
trunk/blender/tools/btools.py
Added Paths:
-----------
trunk/blender/source/blender/imbuf/intern/dds/
trunk/blender/source/blender/imbuf/intern/dds/BlockDXT.cpp
trunk/blender/source/blender/imbuf/intern/dds/BlockDXT.h
trunk/blender/source/blender/imbuf/intern/dds/Color.h
trunk/blender/source/blender/imbuf/intern/dds/ColorBlock.cpp
trunk/blender/source/blender/imbuf/intern/dds/ColorBlock.h
trunk/blender/source/blender/imbuf/intern/dds/Common.h
trunk/blender/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp
trunk/blender/source/blender/imbuf/intern/dds/DirectDrawSurface.h
trunk/blender/source/blender/imbuf/intern/dds/Image.cpp
trunk/blender/source/blender/imbuf/intern/dds/Image.h
trunk/blender/source/blender/imbuf/intern/dds/Makefile
trunk/blender/source/blender/imbuf/intern/dds/SConscript
trunk/blender/source/blender/imbuf/intern/dds/Stream.cpp
trunk/blender/source/blender/imbuf/intern/dds/Stream.h
trunk/blender/source/blender/imbuf/intern/dds/dds_api.cpp
trunk/blender/source/blender/imbuf/intern/dds/dds_api.h
Modified: trunk/blender/config/darwin-config.py
===================================================================
--- trunk/blender/config/darwin-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/darwin-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -52,6 +52,7 @@
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread'
+WITH_BF_DDS = 'true'
WITH_BF_JPEG = 'true'
BF_JPEG = LIBDIR + '/jpeg'
Modified: trunk/blender/config/linux2-config.py
===================================================================
--- trunk/blender/config/linux2-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/linux2-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -32,6 +32,8 @@
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = '/usr'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/config/linuxcross-config.py
===================================================================
--- trunk/blender/config/linuxcross-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/linuxcross-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -39,6 +39,8 @@
BF_OPENEXR_LIB = ' Half IlmImf Iex '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/config/openbsd3-config.py
===================================================================
--- trunk/blender/config/openbsd3-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/openbsd3-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -28,6 +28,8 @@
BF_OPENEXR_INC = '${BF_OPENEXR}/include/OpenEXR'
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = '/usr/local'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/config/sunos5-config.py
===================================================================
--- trunk/blender/config/sunos5-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/sunos5-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -29,6 +29,8 @@
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
BF_OPENEXR_LIB = 'Half IlmImf Iex Imath '
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = '/usr/local'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/config/win32-mingw-config.py
===================================================================
--- trunk/blender/config/win32-mingw-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/win32-mingw-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -42,6 +42,8 @@
BF_OPENEXR_LIB = ' Half IlmImf Iex '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib'
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/config/win32-vc-config.py
===================================================================
--- trunk/blender/config/win32-vc-config.py 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/config/win32-vc-config.py 2007-06-25 19:50:25 UTC (rev 11052)
@@ -50,6 +50,8 @@
BF_OPENEXR_LIB = ' Iex Half IlmImf Imath IlmThread '
BF_OPENEXR_LIBPATH = '${BF_OPENEXR}/lib_msvc'
+WITH_BF_DDS = 'true'
+
WITH_BF_JPEG = 'true'
BF_JPEG = LIBDIR + '/jpeg'
BF_JPEG_INC = '${BF_JPEG}/include'
Modified: trunk/blender/source/Makefile
===================================================================
--- trunk/blender/source/Makefile 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/Makefile 2007-06-25 19:50:25 UTC (rev 11052)
@@ -169,6 +169,10 @@
COMLIB += $(OCGDIR)/blender/imbuf/cineon/$(DEBUG_DIR)libcineon.a
+ifeq ($(WITH_DDS), true)
+ COMLIB += $(OCGDIR)/blender/imbuf/dds/$(DEBUG_DIR)libdds.a
+endif
+
ifeq ($(WITH_FREETYPE2), true)
ifeq ($(OS), windows)
ifeq ($(FREE_WINDOWS), true)
Modified: trunk/blender/source/blender/SConscript
===================================================================
--- trunk/blender/source/blender/SConscript 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/SConscript 2007-06-25 19:50:25 UTC (rev 11052)
@@ -23,6 +23,9 @@
if env['WITH_BF_INTERNATIONAL'] == 1:
SConscript (['ftfont/SConscript'])
+if env['WITH_BF_DDS'] == 1:
+ SConscript (['imbuf/intern/dds/SConscript'])
+
if env['WITH_BF_OPENEXR'] == 1:
SConscript (['imbuf/intern/openexr/SConscript'])
Modified: trunk/blender/source/blender/blenkernel/SConscript
===================================================================
--- trunk/blender/source/blender/blenkernel/SConscript 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/blenkernel/SConscript 2007-06-25 19:50:25 UTC (rev 11052)
@@ -27,6 +27,9 @@
if env['WITH_BF_OPENEXR'] == 1:
defs += ' WITH_OPENEXR'
+if env['WITH_BF_DDS'] == 1:
+ defs += ' WITH_DDS'
+
if env['WITH_BF_FFMPEG'] == 1:
defs += ' WITH_FFMPEG'
incs += ' ' + env['BF_FFMPEG_INC']
Modified: trunk/blender/source/blender/blenkernel/intern/Makefile
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/Makefile 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/blenkernel/intern/Makefile 2007-06-25 19:50:25 UTC (rev 11052)
@@ -101,6 +101,10 @@
CPPFLAGS += -DWITH_OPENEXR
endif
+ifeq ($(WITH_DDS), true)
+ CPPFLAGS += -DWITH_DDS
+endif
+
ifeq ($(WITH_QUICKTIME), true)
CPPFLAGS += -I../../quicktime
CPPFLAGS += -DWITH_QUICKTIME
Modified: trunk/blender/source/blender/blenkernel/intern/image.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/image.c 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/blenkernel/intern/image.c 2007-06-25 19:50:25 UTC (rev 11052)
@@ -633,6 +633,10 @@
return RADHDR;
else if (imtype==R_PNG)
return PNG;
+#ifdef WITH_DDS
+ else if (imtype==R_DDS)
+ return DDS;
+#endif
else if (imtype==R_BMP)
return BMP;
else if (imtype==R_TIFF)
@@ -663,6 +667,10 @@
return R_RADHDR;
else if (ftype & PNG)
return R_PNG;
+#ifdef WITH_DDS
+ else if (ftype & DDS)
+ return R_DDS;
+#endif
else if (ftype & BMP)
return R_BMP;
else if (ftype & TIF)
@@ -719,6 +727,12 @@
if(!BLI_testextensie(string, ".png"))
extension= ".png";
}
+#ifdef WITH_DDS
+ else if(imtype==R_DDS) {
+ if(!BLI_testextensie(string, ".dds"))
+ extension= ".dds";
+ }
+#endif
else if(imtype==R_RAWTGA) {
if(!BLI_testextensie(string, ".tga"))
extension= ".tga";
@@ -771,6 +785,11 @@
else if ((imtype==R_PNG)) {
ibuf->ftype= PNG;
}
+#ifdef WITH_DDS
+ else if ((imtype==R_DDS)) {
+ ibuf->ftype= DDS;
+ }
+#endif
else if ((imtype==R_BMP)) {
ibuf->ftype= BMP;
}
Modified: trunk/blender/source/blender/imbuf/IMB_imbuf_types.h
===================================================================
--- trunk/blender/source/blender/imbuf/IMB_imbuf_types.h 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/imbuf/IMB_imbuf_types.h 2007-06-25 19:50:25 UTC (rev 11052)
@@ -174,6 +174,10 @@
#define CINEON (1 << 21)
#define DPX (1 << 20)
+#ifdef WITH_DDS
+#define DDS (1 << 19)
+#endif
+
#define RAWTGA (TGA | 1)
#define JPG_STD (JPG | (0 << 8))
@@ -216,6 +220,10 @@
#define IS_tiff(x) (x->ftype & TIF)
#define IS_radhdr(x) (x->ftype & RADHDR)
+#ifdef WITH_DDS
+#define IS_dds(x) (x->ftype & DDS)
+#endif
+
#define IMAGIC 0732
#define IS_iris(x) (x->ftype == IMAGIC)
Modified: trunk/blender/source/blender/imbuf/SConscript
===================================================================
--- trunk/blender/source/blender/imbuf/SConscript 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/imbuf/SConscript 2007-06-25 19:50:25 UTC (rev 11052)
@@ -20,6 +20,9 @@
if env['WITH_BF_OPENEXR'] == 1:
defs.append('WITH_OPENEXR')
+if env['WITH_BF_DDS'] == 1:
+ defs.append('WITH_DDS')
+
if env['WITH_BF_FFMPEG'] == 1:
defs.append('WITH_FFMPEG')
incs += ' ' + env['BF_FFMPEG_INC']
Modified: trunk/blender/source/blender/imbuf/intern/Makefile
===================================================================
--- trunk/blender/source/blender/imbuf/intern/Makefile 2007-06-25 18:44:31 UTC (rev 11051)
+++ trunk/blender/source/blender/imbuf/intern/Makefile 2007-06-25 19:50:25 UTC (rev 11052)
@@ -46,6 +46,10 @@
CFLAGS += -DWITH_OPENEXR
endif
+ifeq ($(WITH_DDS), true)
+ DIRS += dds
+ CPPFLAGS += -DWITH_DDS
+endif
ifeq ($(OS),$(findstring $(OS), "beos darwin freebsd linux openbsd solaris windows"))
CFLAGS += -funsigned-char
@@ -80,4 +84,3 @@
CPPFLAGS += -DWITH_FFMPEG
CPPFLAGS += $(NAN_FFMPEGCFLAGS)
endif
-
Added: trunk/blender/source/blender/imbuf/intern/dds/BlockDXT.cpp
===================================================================
--- trunk/blender/source/blender/imbuf/intern/dds/BlockDXT.cpp (rev 0)
+++ trunk/blender/source/blender/imbuf/intern/dds/BlockDXT.cpp 2007-06-25 19:50:25 UTC (rev 11052)
@@ -0,0 +1,523 @@
+/**
+ * $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.
+ *
+ * Contributors: Amorilia (amorilia at gamebox.net)
+ *
+ * ***** END GPL/BL DUAL LICENSE BLOCK *****
+ */
+
+/*
+ * This file is based on a similar file from the NVIDIA texture tools
+ * (http://nvidia-texture-tools.googlecode.com/)
+ *
+ * Original license from NVIDIA follows.
+ */
+
+// Copyright NVIDIA Corporation 2007 -- Ignacio Castano <icastano at nvidia.com>
+//
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list