Browse Source

Merge af839b0c59 into f6b4c90e55

pull/8/merge
Filipe Coelho GitHub 7 years ago
parent
commit
cf263fdb3a
4 changed files with 21 additions and 7 deletions
  1. +5
    -4
      Makefile
  2. +2
    -2
      include/math.hpp
  3. +8
    -0
      src/gui.cpp
  4. +6
    -1
      src/plugin.cpp

+ 5
- 4
Makefile View File

@@ -10,11 +10,12 @@ include arch.mk

ifeq ($(ARCH), lin)
SOURCES += ext/osdialog/osdialog_gtk2.c
CFLAGS += $(shell pkg-config --cflags gtk+-2.0)
CFLAGS += $(shell pkg-config --cflags gtk+-2.0 gl glew glfw3 jansson libzip portaudio-2.0 samplerate)
CXXFLAGS += $(shell pkg-config --cflags gl glew glfw3 jansson libzip portaudio-2.0 samplerate)
LDFLAGS += -rdynamic \
-lpthread -lGL -ldl \
$(shell pkg-config --libs gtk+-2.0) \
-Ldep/lib -lGLEW -lglfw -ljansson -lsamplerate -lcurl -lzip -lportaudio -lportmidi
-lpthread -ldl \
$(shell pkg-config --libs gtk+-2.0 gl glew glfw3 jansson libzip portaudio-2.0 samplerate) \
-Ldep/lib -lcurl -lportmidi
TARGET = Rack
endif



+ 2
- 2
include/math.hpp View File

@@ -1,6 +1,6 @@
#pragma once

#include <math.h>
#include <cmath>


namespace rack {
@@ -182,7 +182,7 @@ struct Vec {
return Vec(roundf(x), roundf(y));
}
bool isFinite() {
return isfinite(x) && isfinite(y);
return std::isfinite(x) && std::isfinite(y);
}
bool isZero() {
return x == 0.0 && y == 0.0;


+ 8
- 0
src/gui.cpp View File

@@ -22,6 +22,10 @@
#include <ApplicationServices/ApplicationServices.h>
#endif

#if GLFW_VERSION_MINOR == 0 && GLFW_VERSION_REVISION <= 4
#define OLD_GLFW_VERSION
#endif

namespace rack {

static GLFWwindow *window = NULL;
@@ -235,7 +239,9 @@ void guiInit() {
// glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
// glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
// glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
#ifndef OLD_GLFW_VERSION
glfwWindowHint(GLFW_MAXIMIZED, GLFW_TRUE);
#endif
std::string title = gApplicationName + " " + gApplicationVersion;
window = glfwCreateWindow(1000, 750, title.c_str(), NULL, NULL);
assert(window);
@@ -262,7 +268,9 @@ void guiInit() {
// GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here.
glGetError();

#ifndef OLD_GLFW_VERSION
glfwSetWindowSizeLimits(window, 640, 480, GLFW_DONT_CARE, GLFW_DONT_CARE);
#endif

// Set up NanoVG
gVg = nvgCreateGL2(NVG_ANTIALIAS);


+ 6
- 1
src/plugin.cpp View File

@@ -23,6 +23,11 @@
#include "plugin.hpp"
#include "util/request.hpp"

#if LIBZIP_VERSION_MAJOR == 0 && LIBZIP_VERSION_MINOR <= 10
typedef zip zip_t;
typedef zip_file zip_file_t;
typedef struct zip_stat zip_stat_t;
#endif

namespace rack {

@@ -131,7 +136,7 @@ static void extractZip(const char *filename, const char *dir) {
if (!za) return;
if (err) goto cleanup;

for (int i = 0; i < zip_get_num_entries(za, 0); i++) {
for (zip_uint64_t i = 0; i < zip_get_num_entries(za, 0); i++) {
zip_stat_t zs;
err = zip_stat_index(za, i, 0, &zs);
if (err) goto cleanup;


Loading…
Cancel
Save