Revert previous merge commit, we need compilable blender in the studio
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 24 Aug 2012 13:17:08 +0000 (13:17 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 24 Aug 2012 13:17:08 +0000 (13:17 +0000)
source/blender/compositor/nodes/COM_BlurNode.cpp
source/blender/compositor/operations/COM_BlurBaseOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaXBlurOperation.cpp
source/blender/compositor/operations/COM_GaussianAlphaYBlurOperation.cpp
source/blender/imbuf/intern/openexr/CMakeLists.txt
source/blender/imbuf/intern/openexr/SConscript
source/blender/imbuf/intern/openexr/openexr_api.cpp
source/blender/windowmanager/intern/wm_playanim.c
source/blender/windowmanager/intern/wm_window.c

index e39ef2b3f23c4d405bd499117e9c87fc125e5eef..93ef002c8d7456b3c9053ab7a3c3f7cbb2a62f1f 100644 (file)
@@ -74,18 +74,14 @@ void BlurNode::convertToOperations(ExecutionSystem *graph, CompositorContext *co
                operationx->setbNode(editorNode);
                operationx->setQuality(quality);
                operationx->setSize(1.0f);
-               operationx->setFalloff(PROP_SMOOTH);
-               operationx->setSubtract(false);
                addLink(graph, clamp->getOutputSocket(), operationx->getInputSocket(0));
                graph->addOperation(operationx);
 
-               GaussianAlphaYBlurOperation *operationy = new GaussianAlphaYBlurOperation();
+               GaussianYBlurOperation *operationy = new GaussianYBlurOperation();
                operationy->setData(data);
                operationy->setbNode(editorNode);
                operationy->setQuality(quality);
                operationy->setSize(1.0f);
-               operationy->setFalloff(PROP_SMOOTH);
-               operationy->setSubtract(false);
                addLink(graph, operationx->getOutputSocket(), operationy->getInputSocket(0));
                graph->addOperation(operationy);
 
index 39a0014ac411b9c88533ec395fc77acf6cd73d62..c527807f8394bd0b0581838a4e417d5fa8282005 100644 (file)
@@ -121,11 +121,6 @@ float *BlurBaseOperation::make_dist_fac_inverse(int rad, int falloff)
                                val = val * val;
                                break;
                        case PROP_LIN:
-#ifndef NDEBUG
-                       /* uninitialized! */
-                       case -1:
-                               BLI_assert(0);
-#endif
                        default:
                                /* nothing */
                                break;
index 8c5e5faf12a3253587f9e394be55abda37c008e3..82f38556e823dd1d79b0c9db90fea18d9e14f04f 100644 (file)
@@ -33,7 +33,6 @@ GaussianAlphaXBlurOperation::GaussianAlphaXBlurOperation() : BlurBaseOperation(C
 {
        this->m_gausstab = NULL;
        this->m_rad = 0;
-       this->m_falloff = -1;  /* intentionally invalid, so we can detect uninitialized values */
 }
 
 void *GaussianAlphaXBlurOperation::initializeTileData(rcti *rect)
index 197715595ed2c566f54d9608bd659723675085f6..bfd9564817e4223a291c43541e396ebc0ddc55cf 100644 (file)
@@ -33,7 +33,6 @@ GaussianAlphaYBlurOperation::GaussianAlphaYBlurOperation() : BlurBaseOperation(C
 {
        this->m_gausstab = NULL;
        this->m_rad = 0;
-       this->m_falloff = -1;  /* intentionally invalid, so we can detect uninitialized values */
 }
 
 void *GaussianAlphaYBlurOperation::initializeTileData(rcti *rect)
index a5afc1abdc66816cc21280a2911bde2a0680e827..4ee2ff4cc4764117f9b3fc055f20d8f45b4ff2ff 100644 (file)
@@ -31,7 +31,6 @@ set(INC
        ../../../blenlib
        ../../../makesdna
        ../../../../../intern/guardedalloc
-       ../../../../../intern/utfconv
 )
 
 set(INC_SYS
index a6c5ad984e2f14b644bcb6caf01d89a82ce03eaa..e590077db2bf400ddd2f04ef67ff711ff7365117 100644 (file)
@@ -10,9 +10,7 @@ incs = ['.',
     '../../../blenlib',
     'intern/include',
     '#/intern/guardedalloc',
-    '../../../makesdna',
-    '#/intern/utfconv']
-
+    '../../../makesdna']
 incs += Split(env['BF_OPENEXR_INC'])
 
 defs = ['WITH_OPENEXR']
index 1b99a3040a8827cb8b1ac37ba0a6b0d8281e9de6..91876249bf604eb3cff3f77d969143481907964c 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 #include <stddef.h>
-#include <fstream>
 #include <string>
 #include <set>
 
 
 #include <openexr_api.h>
 
-#if defined (WIN32) && !defined(FREE_WINDOWS)
-#include "utfconv.h"
-#endif
-
 extern "C"
 {
 
@@ -81,7 +76,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
 #include <IlmImf/ImfCompression.h>
 #include <IlmImf/ImfCompressionAttribute.h>
 #include <IlmImf/ImfStringAttribute.h>
-#include <IlmImf/ImfStdIO.h>
 #include <Imath/ImathBox.h>
 #else
 #include <half.h>
@@ -96,7 +90,6 @@ _CRTIMP void __cdecl _invalid_parameter_noinfo(void)
 #include <ImfCompression.h>
 #include <ImfCompressionAttribute.h>
 #include <ImfStringAttribute.h>
-#include <ImfStdIO.h>
 #endif
 
 using namespace Imf;
@@ -199,28 +192,6 @@ static void openexr_header_metadata(Header *header, struct ImBuf *ibuf)
                header->insert(info->key, StringAttribute(info->value));
 }
 
-static void openexr_ofstream_open(std::ofstream& ofs, const char *name)
-{
-#if defined (WIN32) && !defined(FREE_WINDOWS)
-       wchar_t *wname = alloc_utf16_from_8(name, 0);
-       ofs.open(wname, std::ios_base::binary);
-       free(wname);
-#else
-       ofs.open(name, std::ios_base::binary);
-#endif
-}
-
-static void openexr_ifstream_open(std::ifstream& ifs, const char *name)
-{
-#if defined (WIN32) && !defined(FREE_WINDOWS)
-       wchar_t *wname = alloc_utf16_from_8(name, 0);
-       ifs.open(wname, std::ios_base::binary);
-       free(wname);
-#else
-       ifs.open(name, std::ios_base::binary);
-#endif
-}
-
 static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags)
 {
        const int channels = ibuf->channels;
@@ -245,13 +216,7 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
                        header.channels().insert("Z", Channel(Imf::FLOAT));
 
                FrameBuffer frameBuffer;
-
-               /* manually create ofstream, so we can handle utf-8 filepaths on windows */
-               std::ofstream std_ostream;
-               openexr_ofstream_open(std_ostream, name);
-               StdOFStream exr_ostream(std_ostream, name);
-
-               OutputFile file(exr_ostream, header);
+               OutputFile *file = new OutputFile(name, header);
 
                /* we store first everything in half array */
                RGBAZ *pixels = new RGBAZ[height * width];
@@ -316,9 +281,9 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
 
 //             printf("OpenEXR-save: Writing OpenEXR file of height %d.\n", height);
 
-               file.setFrameBuffer(frameBuffer);
-               file.writePixels(height);
-
+               file->setFrameBuffer(frameBuffer);
+               file->writePixels(height);
+               delete file;
                delete[] pixels;
        }
        catch (const std::exception &exc)
@@ -356,14 +321,7 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
                        header.channels().insert("Z", Channel(Imf::FLOAT));
 
                FrameBuffer frameBuffer;
-
-               /* manually create ofstream, so we can handle utf-8 filepaths on windows */
-               std::ofstream std_ostream;
-               openexr_ofstream_open(std_ostream, name);
-               StdOFStream exr_ostream(std_ostream, name);
-
-               OutputFile file(exr_ostream, header);
-
+               OutputFile *file = new OutputFile(name, header);
                int xstride = sizeof(float) * channels;
                int ystride = -xstride * width;
                float *rect[4] = {NULL, NULL, NULL, NULL};
@@ -382,8 +340,9 @@ static int imb_save_openexr_float(struct ImBuf *ibuf, const char *name, int flag
                if (is_zbuf)
                        frameBuffer.insert("Z", Slice(Imf::FLOAT, (char *) (ibuf->zbuf_float + (height - 1) * width),
                                                      sizeof(float), sizeof(float) * -width));
-               file.setFrameBuffer(frameBuffer);
-               file.writePixels(height);
+               file->setFrameBuffer(frameBuffer);
+               file->writePixels(height);
+               delete file;
        }
        catch (const std::exception &exc)
        {
@@ -432,15 +391,9 @@ static ListBase exrhandles = {NULL, NULL};
 typedef struct ExrHandle {
        struct ExrHandle *next, *prev;
 
-       std::ifstream *std_istream;
-       StdIFStream *exr_istream;
        InputFile *ifile;
-
-       std::ofstream *std_ostream;
-       StdOFStream *exr_ostream;
        TiledOutputFile *tofile;
        OutputFile *ofile;
-
        int tilex, tiley;
        int width, height;
        int mipmap;
@@ -533,24 +486,12 @@ int IMB_exr_begin_write(void *handle, const char *filename, int width, int heigh
        header.insert("BlenderMultiChannel", StringAttribute("Blender V2.55.1 and newer"));
 
        /* avoid crash/abort when we don't have permission to write here */
-       /* manually create ofstream, so we can handle utf-8 filepaths on windows */
        try {
-               data->std_ostream = new std::ofstream();
-               openexr_ofstream_open(*(data->std_ostream), filename);
-
-               data->exr_ostream = new StdOFStream(*(data->std_ostream), filename);
-               data->ofile = new OutputFile(*(data->exr_ostream), header);
+               data->ofile = new OutputFile(filename, header);
        }
        catch (const std::exception &exc) {
                std::cerr << "IMB_exr_begin_write: ERROR: " << exc.what() << std::endl;
-
-               delete data->ofile;
-               delete data->exr_ostream;
-               delete data->std_ostream;
-
                data->ofile = NULL;
-               data->exr_ostream = NULL;
-               data->std_ostream = NULL;
        }
 
        return (data->ofile != NULL);
@@ -577,24 +518,7 @@ void IMB_exrtile_begin_write(void *handle, const char *filename, int mipmap, int
 
        header.insert("BlenderMultiChannel", StringAttribute("Blender V2.43"));
 
-       /* avoid crash/abort when we don't have permission to write here */
-       /* manually create ofstream, so we can handle utf-8 filepaths on windows */
-       try {
-               data->std_ostream = new std::ofstream();
-               openexr_ofstream_open(*(data->std_ostream), filename);
-
-               data->exr_ostream = new StdOFStream(*(data->std_ostream), filename);
-               data->tofile = new TiledOutputFile(*(data->exr_ostream), header);
-       }
-       catch (const std::exception &exc) {
-               delete data->tofile;
-               delete data->exr_ostream;
-               delete data->std_ostream;
-
-               data->tofile = NULL;
-               data->exr_ostream = NULL;
-               data->std_ostream = NULL;
-       }
+       data->tofile = new TiledOutputFile(filename, header);
 }
 
 /* read from file */
@@ -603,25 +527,7 @@ int IMB_exr_begin_read(void *handle, const char *filename, int *width, int *heig
        ExrHandle *data = (ExrHandle *)handle;
 
        if (BLI_exists(filename) && BLI_file_size(filename) > 32) {   /* 32 is arbitrary, but zero length files crashes exr */
-               /* avoid crash/abort when we don't have permission to write here */
-               /* manually create ofstream, so we can handle utf-8 filepaths on windows */
-               try {
-                       data->std_istream = new std::ifstream();
-                       openexr_ifstream_open(*(data->std_istream), filename);
-
-                       data->exr_istream = new StdIFStream(*(data->std_istream), filename);
-                       data->ifile = new InputFile(*(data->exr_istream));
-               }
-               catch (const std::exception &exc) {
-                       delete data->ifile;
-                       delete data->exr_istream;
-                       delete data->std_istream;
-
-                       data->ifile = NULL;
-                       data->exr_istream = NULL;
-                       data->std_istream = NULL;
-               }
-
+               data->ifile = new InputFile(filename);
                if (data->ifile) {
                        Box2i dw = data->ifile->header().dataWindow();
                        data->width = *width  = dw.max.x - dw.min.x + 1;
@@ -790,23 +696,16 @@ void IMB_exr_close(void *handle)
        ExrLayer *lay;
        ExrPass *pass;
 
-       delete data->ifile;
-       delete data->exr_istream;
-       delete data->std_istream;
-
-       delete data->ofile;
-       delete data->tofile;
-       delete data->exr_ostream;
-       delete data->std_ostream;
+       if (data->ifile)
+               delete data->ifile;
+       else if (data->ofile)
+               delete data->ofile;
+       else if (data->tofile)
+               delete data->tofile;
 
        data->ifile = NULL;
-       data->exr_istream = NULL;
-       data->std_istream = NULL;
-
        data->ofile = NULL;
        data->tofile = NULL;
-       data->exr_ostream = NULL;
-       data->std_ostream = NULL;
 
        BLI_freelistN(&data->channels);
 
index 0074d6236dbb005262983d0c3c77f35f27870b37..9fc3bf9cecee7d903dfce36706a85e97b4cf5e28 100644 (file)
@@ -699,6 +699,12 @@ void playanim_window_open(const char *title, int posx, int posy, int sizex, int
                inital_state = start_maximized ? GHOST_kWindowStateFullScreen : GHOST_kWindowStateNormal;
        else
                inital_state = start_maximized ? GHOST_kWindowStateMaximized : GHOST_kWindowStateNormal;
+#if defined(__APPLE__) && !defined(GHOST_COCOA)
+       {
+               extern int macPrefState; /* creator.c */
+               initial_state += macPrefState;
+       }
+#endif
 
        g_WS.ghost_window = GHOST_CreateWindow(g_WS.ghost_system,
                                      title,
index 363d04b8433c81b90bb92f201d5892a5a2074499..ad1b80ed6510a64c65c0063447937a4b3ba431a1 100644 (file)
@@ -341,6 +341,12 @@ static void wm_window_add_ghostwindow(const char *title, wmWindow *win)
        wm_get_screensize(&scr_w, &scr_h);
        posy = (scr_h - win->posy - win->sizey);
        
+#if defined(__APPLE__) && !defined(GHOST_COCOA)
+       {
+               extern int macPrefState; /* creator.c */
+               initial_state += macPrefState;
+       }
+#endif
        /* Disable AA for now, as GL_SELECT (used for border, lasso, ... select)
         * doesn't work well when AA is initialized, even if not used. */
        ghostwin = GHOST_CreateWindow(g_system, title,