Skip to content

Commit 3790a35

Browse files
authored
Merge branch 'openframeworks:master' into altcore
2 parents 3ab651f + 41acbd1 commit 3790a35

File tree

15 files changed

+42
-34
lines changed

15 files changed

+42
-34
lines changed

libs/openFrameworks/communication/ofArduino.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1517,7 +1517,9 @@ void ofArduino::sendOneWireRequest(int pin, unsigned char subcommand, vector<un
15171517

15181518
if (correlationId) {
15191519
bytes[10] = correlationId & 0xFF;
1520-
bytes[11] = (correlationId >> 8) & 0xFF;
1520+
// Doesn't make sense. uint8_t >> 8 will always be zero.
1521+
// bytes[11] = (correlationId >> 8) & 0xFF;
1522+
bytes[11] = 0;
15211523
}
15221524

15231525
if (delay > 0) {

libs/openFrameworks/graphics/ofGraphicsCairo.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ static void ofEndSaveScreen(){
2727

2828
}
2929

30-
static void ofBeginSaveScreen(const of::filesystem::path & filename, ofCairoRenderer::Type type, bool bMultipage, bool b3D, ofRectangle outputsize){
30+
static void ofBeginSaveScreen(const of::filesystem::path & fileName, ofCairoRenderer::Type type, bool bMultipage, bool b3D, ofRectangle outputsize){
3131
if( bScreenShotStarted ) ofEndSaveScreen();
3232

3333
storedRenderer = ofGetCurrentRenderer();
3434

3535
cairoScreenshot = std::make_unique<ofCairoRenderer>();
36-
cairoScreenshot->setup(filename, type, bMultipage, b3D, outputsize);
36+
cairoScreenshot->setup(fileName, type, bMultipage, b3D, outputsize);
3737

3838
rendererCollection = std::make_shared<ofRendererCollection>();
3939
rendererCollection->renderers.push_back(storedRenderer);
@@ -45,8 +45,8 @@ static void ofBeginSaveScreen(const of::filesystem::path & filename, ofCairoRend
4545
}
4646

4747
//-----------------------------------------------------------------------------------
48-
void ofBeginSaveScreenAsPDF(const of::filesystem::path & filename, bool bMultipage, bool b3D, ofRectangle outputsize){
49-
ofBeginSaveScreen(filename, ofCairoRenderer::PDF, bMultipage, b3D, outputsize);
48+
void ofBeginSaveScreenAsPDF(const of::filesystem::path & fileName, bool bMultipage, bool b3D, ofRectangle outputsize){
49+
ofBeginSaveScreen(fileName, ofCairoRenderer::PDF, bMultipage, b3D, outputsize);
5050
}
5151

5252
//-----------------------------------------------------------------------------------
@@ -55,8 +55,8 @@ void ofEndSaveScreenAsPDF(){
5555
}
5656

5757
//-----------------------------------------------------------------------------------
58-
void ofBeginSaveScreenAsSVG(const of::filesystem::path & filename, bool bMultipage, bool b3D, ofRectangle outputsize){
59-
ofBeginSaveScreen(filename, ofCairoRenderer::SVG, bMultipage, b3D, outputsize);
58+
void ofBeginSaveScreenAsSVG(const of::filesystem::path & fileName, bool bMultipage, bool b3D, ofRectangle outputsize){
59+
ofBeginSaveScreen(fileName, ofCairoRenderer::SVG, bMultipage, b3D, outputsize);
6060
}
6161

6262
//-----------------------------------------------------------------------------------

libs/openFrameworks/graphics/ofGraphicsCairo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
/// ~~~~
2525
/// \sa End drawing with ofEndSaveScreenAsPDF()
2626
///
27-
void ofBeginSaveScreenAsPDF(const of::filesystem::path & filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
27+
void ofBeginSaveScreenAsPDF(const of::filesystem::path & fileName, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
2828

2929
/// \brief Terminates draw to PDF through ofCairoRenderer and outputs the file.
3030
/// \sa ofBeginSaveScreenAsPDF()
3131
void ofEndSaveScreenAsPDF();
3232

3333
/// \brief Begin rendering to a SVG file.
3434
/// \sa ofEndSaveScreenAsSVG(), ofBeginSaveScreenAsPDF()
35-
void ofBeginSaveScreenAsSVG(const of::filesystem::path & filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
35+
void ofBeginSaveScreenAsSVG(const of::filesystem::path & fileName, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
3636

3737
/// \brief Terminates draw to SVG and outputs the file.
3838
/// \sa ofBeginSaveScreenAsSVG()

libs/openFrameworks/graphics/ofTrueTypeFont.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ static of::filesystem::path winFontPathByName(const string & fontname) {
330330
#ifdef TARGET_LINUX
331331
//------------------------------------------------------------------
332332
static of::filesystem::path linuxFontPathByName(const string & fontname) {
333-
string filename;
333+
of::filesystem::path fontPath;
334334
FcPattern * pattern = FcNameParse((const FcChar8*)fontname.c_str());
335335
FcBool ret = FcConfigSubstitute(0,pattern,FcMatchPattern);
336336
if(!ret){
@@ -346,20 +346,19 @@ static of::filesystem::path linuxFontPathByName(const string & fontname) {
346346
ofLogError() << "linuxFontPathByName(): couldn't match font file or system font with name \"" << fontname << "\"";
347347
FcPatternDestroy(fontMatch);
348348
FcPatternDestroy(pattern);
349-
return "";
349+
return {};
350350
}
351351
FcChar8 *file;
352352
if (FcPatternGetString (fontMatch, FC_FILE, 0, &file) == FcResultMatch){
353-
filename = (const char*)file;
353+
fontPath = (const char*)file;
354354
}else{
355355
ofLogError() << "linuxFontPathByName(): couldn't find font match for \"" << fontname << "\"";
356356
FcPatternDestroy(fontMatch);
357357
FcPatternDestroy(pattern);
358-
return "";
358+
return {};
359359
}
360360
FcPatternDestroy(fontMatch);
361361
FcPatternDestroy(pattern);
362-
of::filesystem::path fontPath = { filename };
363362
return fontPath;
364363
}
365364
#endif

libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ - (float)soundDurationSeconds{
10131013
unload();
10141014
}
10151015

1016-
bool ofAVEngineSoundPlayer::load(const of::filesystem::path& fileName, bool stream) {
1016+
bool ofAVEngineSoundPlayer::load(const of::filesystem::path & fileName, bool stream) {
10171017
if(soundPlayer != NULL) {
10181018
unload();
10191019
}

libs/openFrameworks/sound/ofMediaFoundationSoundPlayer.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -187,24 +187,22 @@ ofMediaFoundationSoundPlayer::~ofMediaFoundationSoundPlayer() {
187187
}
188188

189189
//--------------------
190-
bool ofMediaFoundationSoundPlayer::load(const of::filesystem::path& fileName, bool stream) {
190+
bool ofMediaFoundationSoundPlayer::load(const of::filesystem::path & fileName, bool stream) {
191191
unload();
192192

193-
// FIXME: wstring?
193+
auto filePath = fileName;
194194
std::string fileStr = ofPathToString(fileName);
195195
bool bStream = false;
196196
bStream = bStream || ofIsStringInString(fileStr, "http://");
197197
bStream = bStream || ofIsStringInString(fileStr, "https://");
198198
bStream = bStream || ofIsStringInString(fileStr, "rtsp://");
199199
bStream = bStream || ofIsStringInString(fileStr, "rtmp://");
200200

201-
of::filesystem::path absPath{ fileStr };
202-
203201
if (!bStream) {
204-
if (ofFile::doesFileExist(absPath)) {
205-
absPath = ofFilePath::getAbsolutePath(absPath, true);
202+
if (ofFile::doesFileExist(filePath)) {
203+
filePath = ofFilePath::getAbsolutePath(filePath, true);
206204
} else {
207-
ofLogError("ofMediaFoundationSoundPlayer") << " file does not exist! " << absPath;
205+
ofLogError("ofMediaFoundationSoundPlayer") << " file does not exist! " << filePath;
208206
return false;
209207
}
210208
}
@@ -224,7 +222,7 @@ bool ofMediaFoundationSoundPlayer::load(const of::filesystem::path& fileName, bo
224222
}
225223

226224

227-
LPCWSTR path = absPath.c_str();
225+
LPCWSTR path = filePath.c_str();
228226

229227

230228
hr = MFCreateSourceReaderFromURL(
@@ -233,12 +231,12 @@ bool ofMediaFoundationSoundPlayer::load(const of::filesystem::path& fileName, bo
233231
mSrcReader.GetAddressOf());
234232

235233
if (hr != S_OK) {
236-
ofLogError("ofMediaFoundationSoundPlayer::load") << " unable to load from: " << absPath;
234+
ofLogError("ofMediaFoundationSoundPlayer::load") << " unable to load from: " << filePath;
237235
unload();
238236
return false;
239237
}
240238

241-
ofLogVerbose("ofMediaFoundationSoundPlayer::load") << " created the source reader " << absPath;
239+
ofLogVerbose("ofMediaFoundationSoundPlayer::load") << " created the source reader " << filePath;
242240
// Select only the audio stream
243241
hr = mSrcReader->SetStreamSelection(MF_SOURCE_READER_ALL_STREAMS, false);
244242
if (hr == S_OK) {

libs/openFrameworks/sound/ofSoundPlayer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ std::shared_ptr<ofBaseSoundPlayer> ofSoundPlayer::getPlayer(){
113113
}
114114

115115
//--------------------------------------------------------------------
116-
bool ofSoundPlayer::load(const of::filesystem::path& fileName, bool stream){
116+
bool ofSoundPlayer::load(const of::filesystem::path & fileName, bool stream){
117117
if( player ){
118118
return player->load(fileName, stream);
119119
}

libs/openFrameworks/utils/ofUtils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,18 +1020,18 @@ std::string ofGetVersionPreRelease() {
10201020
//from the forums http://www.openframeworks.cc/forum/viewtopic.php?t=1413
10211021

10221022
//--------------------------------------------------
1023-
void ofSaveScreen(const of::filesystem::path & filename) {
1023+
void ofSaveScreen(const of::filesystem::path & fileName) {
10241024
/*ofImage screen;
10251025
screen.allocate(ofGetWidth(), ofGetHeight(), OF_IMAGE_COLOR);
10261026
screen.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
10271027
screen.save(filename);*/
10281028
ofPixels pixels;
10291029
ofGetGLRenderer()->saveFullViewport(pixels);
1030-
ofSaveImage(pixels, filename);
1030+
ofSaveImage(pixels, fileName);
10311031
}
10321032

10331033
//--------------------------------------------------
1034-
void ofSaveViewport(const of::filesystem::path & filename) {
1034+
void ofSaveViewport(const of::filesystem::path & fileName) {
10351035
// because ofSaveScreen doesn't related to viewports
10361036
/*ofImage screen;
10371037
ofRectangle view = ofGetCurrentViewport();
@@ -1041,13 +1041,13 @@ void ofSaveViewport(const of::filesystem::path & filename) {
10411041

10421042
ofPixels pixels;
10431043
ofGetGLRenderer()->saveFullViewport(pixels);
1044-
ofSaveImage(pixels, filename);
1044+
ofSaveImage(pixels, fileName);
10451045
}
10461046

10471047
//--------------------------------------------------
10481048
int saveImageCounter = 0;
10491049
void ofSaveFrame(bool bUseViewport) {
1050-
string fileName = ofToString(saveImageCounter) + ".png";
1050+
of::filesystem::path fileName = ofToString(saveImageCounter) + ".png";
10511051
if (bUseViewport) {
10521052
ofSaveViewport(fileName);
10531053
} else {

libs/openFrameworks/utils/ofUtils.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,7 +1235,7 @@ std::string ofGetVersionPreRelease();
12351235
/// The output file type will be deduced from the given file name.
12361236
///
12371237
/// \param filename The image output file.
1238-
void ofSaveScreen(const of::filesystem::path & filename);
1238+
void ofSaveScreen(const of::filesystem::path & fileName);
12391239

12401240
/// \brief Saves the current frame as a PNG image.
12411241
///

libs/openFrameworksCompiled/project/macos/config.macos.default.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ifndef MAC_OS_C_VER
8282
endif
8383

8484
ifndef MAC_OS_CPP_VER
85-
MAC_OS_CPP_VER = -std=c++20
85+
MAC_OS_CPP_VER = -std=c++2b
8686
endif
8787

8888
# Link against libstdc++ to silence tr1/memory errors on latest versions of osx

libs/openFrameworksCompiled/project/osx/config.osx.default.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ ifndef MAC_OS_C_VER
8282
endif
8383

8484
ifndef MAC_OS_CPP_VER
85-
MAC_OS_CPP_VER = -std=c++20
85+
MAC_OS_CPP_VER = -std=c++2b
8686
endif
8787

8888
# Link against libstdc++ to silence tr1/memory errors on latest versions of osx

scripts/templates/macos/config.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
# PROJECT_CXX =
142142
# PROJECT_CC =
143143

144+
# macos template
145+
144146
# Uncomment/comment below to switch between C++11 and C++17 ( or newer ). On macOS C++17 needs 10.15 or above.
145147
# export MAC_OS_MIN_VERSION = 10.15
146148
# export MAC_OS_CPP_VER = -std=c++17

scripts/templates/msys2/config.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,3 +150,5 @@
150150
################################################################################
151151
# PROJECT_CXX =
152152
# PROJECT_CC =
153+
154+
# msys2 template

scripts/templates/osx/config.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
# PROJECT_CXX =
142142
# PROJECT_CC =
143143

144+
# osx template
145+
144146
# Uncomment/comment below to switch between C++11 and C++17 ( or newer ). On macOS C++17 needs 10.15 or above.
145147
# export MAC_OS_MIN_VERSION = 10.15
146148
# export MAC_OS_CPP_VER = -std=c++17

scripts/templates/vscode/config.make

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,6 @@
140140
################################################################################
141141
# PROJECT_CXX =
142142
# PROJECT_CC =
143+
144+
# vscode template
145+

0 commit comments

Comments
 (0)