Browse Source

OSX fixing

tags/1.9.4
falkTX 10 years ago
parent
commit
428d6da406
5 changed files with 30 additions and 23 deletions
  1. +5
    -5
      data/macos/build-deps.sh
  2. +5
    -0
      data/macos/build.sh
  3. +12
    -8
      source/modules/dgl/Makefile
  4. +0
    -2
      source/modules/dgl/src/Window.cpp
  5. +8
    -8
      source/modules/dgl/src/nanovg/stb_image.c

+ 5
- 5
data/macos/build-deps.sh View File

@@ -149,8 +149,8 @@ export CXX=clang
# qt5-base download # qt5-base download


if [ ! -d qtbase-opensource-src-5.3.0 ]; then if [ ! -d qtbase-opensource-src-5.3.0 ]; then
curl -O http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtbase-opensource-src-5.3.0.tar.xz
tar -xf qtbase-opensource-src-5.3.0.tar.xz
curl -L http://download.qt-project.org/official_releases/qt/5.3/5.3.0/submodules/qtbase-opensource-src-5.3.0.tar.gz -o qtbase-opensource-src-5.3.0.tar.gz
tar -xf qtbase-opensource-src-5.3.0.tar.gz
fi fi


# ------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------
@@ -227,7 +227,7 @@ export QMAKESPEC=macx-clang
# qt5-base download (5.2.1 for now) # qt5-base download (5.2.1 for now)


if [ ! -d qtbase-opensource-src-5.2.1 ]; then if [ ! -d qtbase-opensource-src-5.2.1 ]; then
curl -O http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.tar.gz
curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtbase-opensource-src-5.2.1.tar.gz -o qtbase-opensource-src-5.2.1.tar.gz
tar -xf qtbase-opensource-src-5.2.1.tar.gz tar -xf qtbase-opensource-src-5.2.1.tar.gz
fi fi


@@ -257,7 +257,7 @@ fi
# qt5-mac-extras # qt5-mac-extras


if [ ! -d qtmacextras-opensource-src-5.2.1 ]; then if [ ! -d qtmacextras-opensource-src-5.2.1 ]; then
curl -O http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtmacextras-opensource-src-5.2.1.tar.gz
curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtmacextras-opensource-src-5.2.1.tar.gz -o qtmacextras-opensource-src-5.2.1.tar.gz
tar -xf qtmacextras-opensource-src-5.2.1.tar.gz tar -xf qtmacextras-opensource-src-5.2.1.tar.gz
fi fi


@@ -274,7 +274,7 @@ fi
# qt5-svg # qt5-svg


if [ ! -d qtsvg-opensource-src-5.2.1 ]; then if [ ! -d qtsvg-opensource-src-5.2.1 ]; then
curl -O http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtsvg-opensource-src-5.2.1.tar.gz
curl -L http://download.qt-project.org/official_releases/qt/5.2/5.2.1/submodules/qtsvg-opensource-src-5.2.1.tar.gz -o qtsvg-opensource-src-5.2.1.tar.gz
tar -xf qtsvg-opensource-src-5.2.1.tar.gz tar -xf qtsvg-opensource-src-5.2.1.tar.gz
fi fi




+ 5
- 0
data/macos/build.sh View File

@@ -16,6 +16,11 @@ export CXFREEZE=/opt/carla/bin/cxfreeze
# Build python stuff # Build python stuff
export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin export PATH=/opt/carla/bin:/opt/carla64/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin
export PKG_CONFIG_PATH=/opt/carla/lib/pkgconfig:/opt/carla64/lib/pkgconfig export PKG_CONFIG_PATH=/opt/carla/lib/pkgconfig:/opt/carla64/lib/pkgconfig

# clean?
# make clean

# Build Py UI stuff
make $JOBS UI RES WIDGETS make $JOBS UI RES WIDGETS


# Build theme # Build theme


+ 12
- 8
source/modules/dgl/Makefile View File

@@ -20,8 +20,15 @@ OBJS = \
src/ImageButton.cpp.o \ src/ImageButton.cpp.o \
src/ImageKnob.cpp.o \ src/ImageKnob.cpp.o \
src/ImageSlider.cpp.o \ src/ImageSlider.cpp.o \
src/Widget.cpp.o \
src/Window.cpp.o
src/ImageSwitch.cpp.o \
src/NanoVG.cpp.o \
src/Widget.cpp.o

ifeq ($(MACOS),true)
OBJS += src/Window.mm.o
else
OBJS += src/Window.cpp.o
endif


OBJS_posix32 = \ OBJS_posix32 = \
src/App.cpp.posix32.o \ src/App.cpp.posix32.o \
@@ -67,12 +74,6 @@ OBJS_win64 = \
src/Widget.cpp.win64.o \ src/Widget.cpp.win64.o \
src/Window.cpp.win64.o src/Window.cpp.win64.o


ifeq ($(MACOS),true)
OBJS += src/pugl/pugl_osx_extended.m.o
OBJS_posix32 += src/pugl/pugl_osx_extended.m.posix32.o
OBJS_posix64 += src/pugl/pugl_osx_extended.m.posix64.o
endif

# -------------------------------------------------------------- # --------------------------------------------------------------


all: ../dgl.a all: ../dgl.a
@@ -133,6 +134,9 @@ win64: ../dgl.win64.a
%.m.o: %.m %.m.o: %.m
$(CC) $< $(BUILD_C_FLAGS) -ObjC -c -o $@ $(CC) $< $(BUILD_C_FLAGS) -ObjC -c -o $@


%.mm.o: %.mm
$(CXX) $< $(BUILD_CXX_FLAGS) -ObjC++ -c -o $@

# -------------------------------------------------------------- # --------------------------------------------------------------


clean: clean:


+ 0
- 2
source/modules/dgl/src/Window.cpp View File

@@ -26,9 +26,7 @@
#if defined(DISTRHO_OS_WINDOWS) #if defined(DISTRHO_OS_WINDOWS)
# include "pugl/pugl_win.cpp" # include "pugl/pugl_win.cpp"
#elif defined(DISTRHO_OS_MAC) #elif defined(DISTRHO_OS_MAC)
extern "C" {
# include "pugl/pugl_osx.m" # include "pugl/pugl_osx.m"
}
#elif defined(DISTRHO_OS_LINUX) #elif defined(DISTRHO_OS_LINUX)
# include <sys/types.h> # include <sys/types.h>
# include <unistd.h> # include <unistd.h>


+ 8
- 8
source/modules/dgl/src/nanovg/stb_image.c View File

@@ -2261,13 +2261,13 @@ static void init_defaults(void)
int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead int stbi_png_partial; // a quick hack to only allow decoding some of a PNG... I should implement real streaming support instead
static int parse_zlib(zbuf *a, int parse_header) static int parse_zlib(zbuf *a, int parse_header)
{ {
int final, type;
int final_, type;
if (parse_header) if (parse_header)
if (!parse_zlib_header(a)) return 0; if (!parse_zlib_header(a)) return 0;
a->num_bits = 0; a->num_bits = 0;
a->code_buffer = 0; a->code_buffer = 0;
do { do {
final = zreceive(a,1);
final_ = zreceive(a,1);
type = zreceive(a,2); type = zreceive(a,2);
if (type == 0) { if (type == 0) {
if (!parse_uncompressed_block(a)) return 0; if (!parse_uncompressed_block(a)) return 0;
@@ -2286,7 +2286,7 @@ static int parse_zlib(zbuf *a, int parse_header)
} }
if (stbi_png_partial && a->zout - a->zout_start > 65536) if (stbi_png_partial && a->zout - a->zout_start > 65536)
break; break;
} while (!final);
} while (!final_);
return 1; return 1;
} }
@@ -2519,7 +2519,7 @@ static int create_png_image_raw(png *a, uint8 *raw, uint32 raw_len, int out_n, u
static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int interlaced) static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int interlaced)
{ {
uint8 *final;
uint8 *final_;
int p; int p;
int save; int save;
if (!interlaced) if (!interlaced)
@@ -2528,7 +2528,7 @@ static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int i
stbi_png_partial = 0; stbi_png_partial = 0;
// de-interlacing // de-interlacing
final = (uint8 *) malloc(a->s->img_x * a->s->img_y * out_n);
final_ = (uint8 *) malloc(a->s->img_x * a->s->img_y * out_n);
for (p=0; p < 7; ++p) { for (p=0; p < 7; ++p) {
int xorig[] = { 0,4,0,2,0,1,0 }; int xorig[] = { 0,4,0,2,0,1,0 };
int yorig[] = { 0,0,4,0,2,0,1 }; int yorig[] = { 0,0,4,0,2,0,1 };
@@ -2540,19 +2540,19 @@ static int create_png_image(png *a, uint8 *raw, uint32 raw_len, int out_n, int i
y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p]; y = (a->s->img_y - yorig[p] + yspc[p]-1) / yspc[p];
if (x && y) { if (x && y) {
if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) { if (!create_png_image_raw(a, raw, raw_len, out_n, x, y)) {
free(final);
free(final_);
return 0; return 0;
} }
for (j=0; j < y; ++j) for (j=0; j < y; ++j)
for (i=0; i < x; ++i) for (i=0; i < x; ++i)
memcpy(final + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
memcpy(final_ + (j*yspc[p]+yorig[p])*a->s->img_x*out_n + (i*xspc[p]+xorig[p])*out_n,
a->out + (j*x+i)*out_n, out_n); a->out + (j*x+i)*out_n, out_n);
free(a->out); free(a->out);
raw += (x*out_n+1)*y; raw += (x*out_n+1)*y;
raw_len -= (x*out_n+1)*y; raw_len -= (x*out_n+1)*y;
} }
} }
a->out = final;
a->out = final_;
stbi_png_partial = save; stbi_png_partial = save;
return 1; return 1;


Loading…
Cancel
Save