Skip to content

Commit f754498

Browse files
committed
Merge branch 'master' into update/log-and-docs-cleanup
2 parents c8ae67f + ab26718 commit f754498

File tree

16 files changed

+183
-116
lines changed

16 files changed

+183
-116
lines changed

addons/ofxAssimpModelLoader/src/ofxAssimpMeshHelper.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include "ofxAssimpTexture.h"
1313
#include "ofVbo.h"
1414
#include "ofMesh.h"
15-
#define GLM_FORCE_CTOR_INIT
16-
#define GLM_ENABLE_EXPERIMENTAL
1715
#include "glm/mat4x4.hpp"
1816

1917
struct aiMesh;

addons/ofxOsc/src/ofxOscReceiver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,11 @@ void ofxOscReceiver::stop() {
104104
if (listenSocket) {
105105
listenSocket->AsynchronousBreak();
106106
} else {
107-
ofLogNotice("socket already torn down ");
107+
ofLogVerbose("socket already torn down ");
108108
}
109109

110110
if (!listenThread.joinable()) {
111-
ofLogNotice("not joinable");
111+
ofLogVerbose("not joinable");
112112
} else {
113113
listenThread.join();
114114
}

libs/openFrameworks/3d/ofNode.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
#pragma once
33

44
#include "ofParameter.h"
5-
6-
#define GLM_FORCE_CTOR_INIT
7-
#define GLM_ENABLE_EXPERIMENTAL
85
#include <glm/gtc/quaternion.hpp>
96

107
#include <array>

libs/openFrameworks/gl/ofCubeMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ void ofCubeMap::_createIrradianceMap(GLuint aSrcCubeFid, bool aBMakeCache, const
855855
std::vector<glm::mat4> views = _getViewMatrices( glm::vec3(0,0,0) );
856856

857857
if( !shaderIrradianceMap.isLoaded() ) {
858-
auto isource = ofCubeMapShaders::irriadianceCubeMap();
858+
auto isource = ofCubeMapShaders::irradianceCubeMap();
859859
shaderIrradianceMap.setupShaderFromSource(GL_VERTEX_SHADER, isource.vertShader );
860860
shaderIrradianceMap.setupShaderFromSource(GL_FRAGMENT_SHADER, isource.fragShader );
861861
shaderIrradianceMap.bindDefaults();

libs/openFrameworks/gl/ofCubeMap.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ class ofCubeMap {
6363
static bool hasActiveCubeMap();
6464
static std::shared_ptr<ofCubeMap::Data> getActiveData();
6565
static void clearTextureData(std::shared_ptr<ofCubeMap::Data> adata);
66+
#ifdef TARGET_ANDROID
6667
static void regenerateAllTextures();
68+
#endif
6769
static const ofTexture & getBrdfLutTexture();
6870

6971
ofCubeMap();

libs/openFrameworks/gl/ofCubeMapShaders.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ class ofCubeMapShaders {
103103
return rsource;
104104
}
105105

106-
static ShaderSource irriadianceCubeMap() {
106+
static ShaderSource irradianceCubeMap() {
107107
ShaderSource rsource;
108108
rsource.vertShader = defaultVertShader();
109109

libs/openFrameworks/graphics/ofImage.cpp

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,10 +228,23 @@ static bool loadImage(ofPixels_<PixelType> & pix, const of::filesystem::path & _
228228
return ofLoadImage(pix, ofLoadURL(ofPathToString(_fileName)).data);
229229
}
230230

231+
232+
ofFile file(_fileName);
233+
if (!file.exists()) {
234+
ofLogError("loadImage") << "File not found: " << _fileName;
235+
return false;
236+
}
237+
238+
std::uint64_t fileSize = file.getSize();
239+
if (fileSize == 0) {
240+
ofLogError("loadImage") << "File is empty: " << _fileName;
241+
return false;
242+
}
231243

232244
bool bLoaded = false;
233245
FIBITMAP * bmp = nullptr;
234246

247+
try {
235248
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
236249
#ifdef OF_OS_WINDOWS
237250
fif = FreeImage_GetFileTypeU(_fileName.c_str(), 0);
@@ -251,8 +264,12 @@ static bool loadImage(ofPixels_<PixelType> & pix, const of::filesystem::path & _
251264
if(fif == FIF_JPEG) {
252265
option = getJpegOptionFromImageLoadSetting(settings);
253266
}
267+
if (!FreeImage_FIFSupportsReading(fif)) {
268+
std::cerr << "Error: FreeImage does not support reading this format." << std::endl;
269+
}
254270
auto fileName = ofToDataPathFS(_fileName);
255271

272+
256273
#ifdef OF_OS_WINDOWS
257274
bmp = FreeImage_LoadU(fif, fileName.c_str(), option | settings.freeImageFlags);
258275
#else
@@ -264,6 +281,16 @@ static bool loadImage(ofPixels_<PixelType> & pix, const of::filesystem::path & _
264281
}
265282
}
266283

284+
}
285+
catch (const std::exception & e) {
286+
std::cerr << "Exception caught in FreeImage_Load: " << e.what() << std::endl;
287+
return false;
288+
}
289+
catch (...) {
290+
std::cerr << "Unknown exception caught in FreeImage_Load." << std::endl;
291+
return false;
292+
}
293+
267294
//-----------------------------
268295

269296
if ( bLoaded ){

libs/openFrameworks/sound/ofRtAudioSoundStream.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ void ofRtAudioSoundStream::start() {
204204
if (audio == nullptr) return;
205205

206206
try {
207-
audio->startStream();
207+
if (!audio->isStreamRunning()) {
208+
audio->startStream();
209+
}
208210
}
209211
catch (std::exception &error) {
210212
ofLogError() << error.what();

libs/openFrameworks/utils/ofTimerFps.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ void ofTimerFps::setFps(int fps) {
2424

2525
void ofTimerFps::waitNext() {
2626
// Lazy wakeup
27-
std::this_thread::sleep_until(wakeTime - 36ms); //4ms
27+
std::this_thread::sleep_until(wakeTime - 8ms); //4ms
2828

2929
// Processor Coffee
3030
while(steady_clock::now() < (wakeTime)) { // 0.05ms 0.5us // - 0.5us - 1ns
31-
std::this_thread::yield();
31+
// std::this_thread::yield();
32+
std::this_thread::sleep_for(5us);
3233
}
3334

3435
lastWakeTime = wakeTime;

0 commit comments

Comments
 (0)