Skip to content

Commit a85e03c

Browse files
authored
Merge pull request #341 from libretro/dev
v0.29.1
2 parents 14e0a09 + 47a48a3 commit a85e03c

File tree

19 files changed

+100
-96
lines changed

19 files changed

+100
-96
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ node_modules
77
/package.json
88
/.bsv
99
/*.mkv
10+
*.d

.gitmodules

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313
url = https://github.com/ChaiScript/ChaiScript.git
1414
ignore = dirty
1515
branch = develop
16-
[submodule "vendor/filesystem"]
17-
path = vendor/filesystem
18-
url = https://github.com/wjakob/filesystem.git
19-
ignore = dirty
20-
branch = master
2116
[submodule "vendor/SDL_tty"]
2217
path = vendor/SDL_tty
2318
url = https://github.com/Grumbel/SDL_tty.git

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## 0.29.1 - 2018-11-05
8+
### Chores
9+
- Moved String Methods to [ChaiScript_Extras](https://github.com/ChaiScript/ChaiScript_Extras)
10+
- Replaced use of `filesystem/path.h` with internal functions
11+
- Updated ChaiScript/ChaiScript_Extras
12+
- Updated libretro/libretro-common
13+
- Updated effolkronium/random
14+
715
## 0.29.0 - 2018-10-13
816
### Fixes
917
- Fixed `/libretro/saves` mounting

Makefile.common

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ SOURCES_C := $(CORE_DIR)/vendor/semver/semver.c
1717
# random
1818
FLAGS += -I$(CORE_DIR)/vendor/random/include
1919

20-
# filesystem
21-
FLAGS += -I$(CORE_DIR)/vendor/filesystem
22-
2320
# libretro-common
2421
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
2522
# Only compile libretro-common when not STATIC_LINKING
@@ -49,7 +46,7 @@ ifneq ($(STATIC_LINKING), 1)
4946
)
5047
# Ensure the sinc_resampler_neon is available for ARM NEON devices.
5148
OBJECTS += $(CORE_DIR)/vendor/libretro-common/audio/resampler/drivers/sinc_resampler_neon.o
52-
49+
5350
# MD5
5451
FLAGS += -I$(CORE_DIR)/vendor/libretro-common/include
5552
SOURCES_C += $(CORE_DIR)/vendor/libretro-common/utils/md5.c
@@ -190,6 +187,7 @@ ifeq ($(HAVE_CHAISCRIPT),)
190187
FLAGS += -I$(CORE_DIR)/vendor/ChaiScript_Extras/include
191188
FLAGS += -D__HAVE_CHAISCRIPT__
192189
FLAGS += -DCHAISCRIPT_NO_THREADS -DCHAISCRIPT_NO_THREADS_WARNING -DCHAISCRIPT_NO_DYNLOAD
190+
FLAGS += -DCHAISCRIPT_EXTRAS_MATH_SKIP_ADVANCED
193191
endif
194192

195193
# SDL

Makefile.libretro

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -277,19 +277,23 @@ else ifeq ($(platform), switch)
277277

278278
# Nintendo Switch (libnx)
279279
else ifeq ($(platform), libnx)
280-
include $(DEVKITPRO)/libnx/switch_rules
281-
EXT=a
282-
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
283-
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL
284-
CFLAGS := $(DEFINES) -g \
285-
-O2 \
280+
export DEPSDIR := $(CURDIR)/
281+
include $(DEVKITPRO)/libnx/switch_rules
282+
EXT=a
283+
TARGET := $(TARGET_NAME)_libretro_$(platform).$(EXT)
284+
DEFINES := -DSWITCH=1 -U__linux__ -U__linux -DRARCH_INTERNAL
285+
CFLAGS := $(DEFINES) -g \
286+
-O2 \
286287
-fPIE -I$(LIBNX)/include/ -ffunction-sections -fdata-sections -ftls-model=local-exec -Wl,--allow-multiple-definition -specs=$(LIBNX)/switch.specs
287-
CFLAGS += $(INCDIRS)
288-
CFLAGS += $(INCLUDE) -D__SWITCH__ -DHAVE_LIBNX
289-
CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fno-rtti -fno-exceptions -std=gnu++11
290-
CFLAGS += -std=gnu11
291-
PLATFORM_DEFINES += -DARM -march=armv8-a -mtune=cortex-a57 -mtp=soft
292-
STATIC_LINKING = 1
288+
CFLAGS += $(INCDIRS)
289+
CFLAGS += $(INCLUDE) -D__SWITCH__ -DHAVE_LIBNX
290+
# Replaced -fno-rtti -fno-exceptions with -fexceptions, using C++14
291+
CXXFLAGS := $(ASFLAGS) $(CFLAGS) -fexceptions -std=c++14
292+
CFLAGS += -std=gnu11
293+
PLATFORM_DEFINES += -DARM -march=armv8-a -mtune=cortex-a57 -mtp=soft
294+
STATIC_LINKING = 1
295+
#PLATFORM_DEFINES += -D_INCL_PHYSFS_PLATFORMS -DPHYSFS_PLATFORM_UNIX=1 -DPHYSFS_PLATFORM_POSIX=1
296+
#PLATFORM_DEFINES += -Dpthread_t=Thread -Dpthread_mutex_t=Mutex -Dpthread_mutexattr_t='void*' -Dpthread_attr_t=int -Dpthread_cond_t=CondVar -Dpthread_condattr_t='int' -D_SYS__PTHREADTYPES_H_
293297

294298
# ARM
295299
else ifneq (,$(findstring armv,$(platform)))

docs/Doxyfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ PROJECT_NAME = "ChaiLove API"
2323
# This could be handy for archiving the generated documentation or
2424
# if some version control system is used.
2525

26-
PROJECT_NUMBER = "0.29.0"
26+
PROJECT_NUMBER = "0.29.1"
2727

2828
# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
2929
# base path where the generated documentation will be put.

src/ChaiLove.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848

4949
#define CHAILOVE_VERSION_MAJOR 0
5050
#define CHAILOVE_VERSION_MINOR 29
51-
#define CHAILOVE_VERSION_PATCH 0
52-
#define CHAILOVE_VERSION_STRING "0.29.0"
51+
#define CHAILOVE_VERSION_PATCH 1
52+
#define CHAILOVE_VERSION_STRING "0.29.1"
5353

5454
#include "SDL.h"
5555
#include "libretro.h"

src/love/Types/FileSystem/FileData.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
#include <stdio.h>
66
#include <stdlib.h>
7-
#include "filesystem/path.h"
87

98
#include "../../../ChaiLove.h"
109

@@ -38,9 +37,8 @@ std::string FileData::getString() {
3837
}
3938

4039
std::string FileData::getExtension() {
41-
::filesystem::path p(m_filepath.c_str());
42-
std::string extension(p.extension());
43-
return extension;
40+
ChaiLove* app = ChaiLove::getInstance();
41+
return app->filesystem.getFileExtension(m_filepath);
4442
}
4543

4644
} // namespace FileSystem

src/love/audio.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "Types/Audio/SoundData.h"
44
#include "../ChaiLove.h"
55
#include "sound.h"
6-
#include "physfs.h"
76
#include "audio/conversion/float_to_s16.h"
87

98
using love::Types::Audio::SoundData;

src/love/filesystem.cpp

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include "physfs.h"
66
#include "filesystem.h"
77
#include "physfsrwops.h"
8-
#include "filesystem/path.h"
98
#include "../ChaiLove.h"
109
#include "Types/FileSystem/FileInfo.h"
1110

@@ -32,17 +31,15 @@ bool filesystem::init(const std::string& file, const void* data) {
3231
}
3332

3433
// Find the parent and extension of the given file.
35-
::filesystem::path p(file.c_str());
36-
std::string extension(p.extension());
34+
std::string extension(getFileExtension(file));
3735

3836
// Allow loading from an Archive.
3937
if (extension == "chaigame" || extension == "chailove" || extension == "zip") {
4038
return mount(file.c_str(), "/", false);
4139
}
4240

4341
// If we are just running the core, load the base path.
44-
::filesystem::path parent(p.parent_path());
45-
std::string parentPath(parent.str());
42+
std::string parentPath(getParentDirectory(file));
4643
if (parentPath.empty()) {
4744
return mount(".", "/", false);
4845
}
@@ -51,6 +48,36 @@ bool filesystem::init(const std::string& file, const void* data) {
5148
return mount(parentPath.c_str(), "/", false);
5249
}
5350

51+
std::string filesystem::getParentDirectory(const std::string& filepath) {
52+
size_t last = filepath.find_last_of("/\\");
53+
if (last != std::string::npos) {
54+
return filepath.substr(0, last);
55+
}
56+
return "";
57+
}
58+
59+
std::string filesystem::getFileExtension(const std::string& filepath) {
60+
size_t i = filepath.rfind('.', filepath.length());
61+
if (i != std::string::npos) {
62+
return filepath.substr(i + 1, filepath.length() - i);
63+
}
64+
return "";
65+
}
66+
67+
std::string filesystem::getBasename(const std::string& filepath) {
68+
char sep = '/';
69+
if (filepath.find('\\') != std::string::npos) {
70+
sep = '\\';
71+
}
72+
73+
size_t i = filepath.rfind(sep, filepath.length());
74+
if (i != std::string::npos) {
75+
return filepath.substr(i + 1, filepath.length() - i);
76+
}
77+
78+
return filepath;
79+
}
80+
5481
void filesystem::mountlibretro() {
5582
// Mount some of the libretro directories.
5683
const char *system_dir = NULL;
@@ -60,8 +87,8 @@ void filesystem::mountlibretro() {
6087

6188
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_LIBRETRO_PATH, &core_dir) && core_dir) {
6289
// Make sure to get the directory of the core.
63-
::filesystem::path p(core_dir);
64-
mount(p.parent_path().str(), "/libretro/core", false);
90+
std::string parentPath(getParentDirectory(core_dir));
91+
mount(parentPath, "/libretro/core", false);
6592
}
6693
if (ChaiLove::environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &system_dir) && system_dir) {
6794
mount(system_dir, "/libretro/system", false);

0 commit comments

Comments
 (0)