merge with master

This commit is contained in:
KockaAdmiralac 2018-04-29 19:54:04 +02:00
commit 4c7342eebb
13 changed files with 53 additions and 19 deletions

2
.gitignore vendored
View file

@ -34,3 +34,5 @@ OneShot
.qmake.stash
CMakeCache.txt
CMakeFiles/
oclint/

BIN
CommonEvents.rxdata Normal file

Binary file not shown.

View file

@ -8,7 +8,7 @@ Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimple
>
> It is licensed under the GNU General Public License v2+.
*OneShot* and *OneShot: Fragments of Providence* also make use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details.
*SyngleChance* also makes use of [steamshim](https://hg.icculus.org/icculus/steamshim/) for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details.
## Dependencies / Building
@ -26,9 +26,8 @@ Thanks to [hunternet93](https://github.com/hunternet93) for starting the reimple
* [Ancurio's SDL_sound fork](https://github.com/Ancurio/SDL_sound)
* vorbisfile
* pixman
* zlib (only ruby bindings)
* OpenGL header (alternatively GLES2 with `DEFINES+=GLES2_HEADER`)
* Ruby (make sure to use 2.3 on macOS due to a save formatting bug in newer versions -- @Yummychickenblue reports this may not be an issue anymore)
* Ruby
* Python 3 (journal reimplementation only)
* PyQt5 for Python 3 (journal reimplementation only)

View file

@ -72,12 +72,15 @@ int server_thread(void *data)
}
CloseHandle(pipe);
#else
if (FILE *file = fopen(PIPE_PATH, "r")) {
fclose(file);
out_pipe = open(PIPE_PATH, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
active = true;
SDL_LockMutex(mutex);
active = true;
if (message_len > 0)
write(out_pipe, (char*)message_buffer, message_len);
SDL_UnlockMutex(mutex);
}
return 0;
#endif
}

View file

@ -1,3 +1,5 @@
#include <iostream>
#include "etc.h"
#include "sharedstate.h"
#include "binding-util.h"
@ -85,6 +87,7 @@ RB_METHOD(wallpaperSet)
std::string path;
#ifdef _WIN32
path = shState->config().gameFolder + "\\Wallpaper\\" + name + ".bmp";
std::cout << "Setting wallpaper to " << path << std::endl;
// Crapify the slashes
size_t index = 0;
for (;;) {
@ -159,6 +162,8 @@ end:
}
path = "/Wallpaper/" + nameFix + ".png";
std::cout << "Setting wallpaper to " << path << std::endl;
#ifdef __APPLE__
if (!isCached) {
MacDesktop::CacheCurrentBackground();

View file

@ -21,10 +21,13 @@ rm -f "$ONESHOT_PATH/Data/xScripts.rxdata"
echo "-> ${cyan}Install OneShot apps to Steam directory...${color_reset}"
cp -f "./xScripts.rxdata" "$ONESHOT_PATH/Data/xScripts.rxdata"
cp -f "./CommonEvents.rxdata" "$ONESHOT_PATH/Data/CommonEvents.rxdata"
cp -rf "./OneShot.app" "$ONESHOT_PATH"
cp -rf "./_______.app" "$ONESHOT_PATH"
cp -R "./Graphics/" "$ONESHOT_PATH/Wallpaper"
ln -sfh "$ONESHOT_PATH/OneShot.app" "$HOME/Applications/OneShot.app"
rm -f /tmp/oneshot-pipe # Important for pre-release version cleanup
echo "\n${green}Complete! ${white}Please report any issues to https://github.com/vinyldarkscratch/synglechance/issues${color_reset}"
open "$ONESHOT_PATH"

View file

@ -75,6 +75,7 @@ class Journal(QWidget):
self.setMinimumSize(800, 600)
self.setMaximumSize(800, 600)
self.setGeometry(0, 0, 800, 600)
self.show()
def mousePressEvent(self, event):
@ -162,12 +163,20 @@ if __name__ == '__main__':
save.seek(-8, os.SEEK_END)
lang = save.read().decode('utf-8')
lang = lang[lang.find('[') + 1:lang.find(']')]
if lang == 'en_US':
lang = 'en'
if lang == 'en_US': lang = 'en'
journal.change_image('save_' + lang)
else:
thread = WatchPipe()
thread.change_image.connect(journal.change_image)
thread.start()
pipe_file = open(pipe_path, "w+")
pipe_file.close()
app.exec_()
try:
os.remove(pipe_path)
except:
# Most likely due to the file being in use. Ignore.
pass

View file

@ -22,7 +22,8 @@ exe = EXE(pyz,
debug=False,
strip=False,
upx=True,
console=False )
console=False,
icon='assets/icon_journal.ico')
coll = COLLECT(exe,
a.binaries,
a.zipfiles,

View file

@ -4,7 +4,7 @@ set -e
cd `dirname $0`
# User-configurable variables
mac_version="0.8.0"
mac_version="1.0.0"
make_threads=8
ONESHOT_PATH=$HOME/Library/Application\ Support/Steam/steamapps/common/OneShot
@ -19,7 +19,7 @@ echo "${white}Compiling ${bold}SyngleChance v${mac_version} ${white}engine for m
# Generate makefile and build main + journal
echo "-> ${cyan}Generate makefile...${color_reset}"
qmake MRIVERSION=2.3
qmake MRIVERSION=2.5
echo "-> ${cyan}Compile engine...${color_reset}"
make -j${make_threads}
echo "-> ${cyan}Compile journal...${color_reset}"

View file

@ -42,7 +42,7 @@ unix {
macx: {
INCLUDEPATH += $$QMAKE_MAC_SDK_PATH/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers
LIBS += -framework OpenAL -framework AppKit
QMAKE_LFLAGS += -L/usr/local/opt/ruby@2.3/lib -L/usr/local/opt/openal-soft/lib
QMAKE_LFLAGS += -L/usr/local/opt/ruby/lib -L/usr/local/opt/openal-soft/lib
HEADERS += src/mac-desktop.h
SOURCES += src/mac-desktop.mm
}

8
oclint.sh Executable file
View file

@ -0,0 +1,8 @@
#!/bin/sh
set -e
cd `dirname $0`
cd oclint
oclint -report-type html -o report.html ../src/alstream.cpp ../src/audio.cpp ../src/audiostream.cpp ../src/autotiles.cpp ../src/bitmap.cpp ../src/config.cpp ../src/etc.cpp ../src/eventthread.cpp ../src/filesystem.cpp ../src/font.cpp ../src/gl-debug.cpp ../src/gl-fun.cpp ../src/gl-meta.cpp ../src/glstate.cpp ../src/graphics.cpp ../src/i18n.cpp ../src/input.cpp ../src/keybindings.cpp ../src/mac-desktop.mm ../src/main.cpp ../src/oneshot.cpp ../src/plane.cpp ../src/rgssad.cpp ../src/scene.cpp ../src/screen.cpp ../src/sdlsoundsource.cpp ../src/settingsmenu.cpp ../src/shader.cpp ../src/sharedstate.cpp ../src/soundemitter.cpp ../src/sprite.cpp ../src/steam.cpp ../src/table.cpp ../src/texpool.cpp ../src/tileatlas.cpp ../src/tilemap.cpp ../src/tilequad.cpp ../src/vertex.cpp ../src/viewport.cpp ../src/vorbissource.cpp ../src/window.cpp ../binding-mri/audio-binding.cpp ../binding-mri/binding-mri.cpp ../binding-mri/binding-util.cpp ../binding-mri/bitmap-binding.cpp ../binding-mri/chroma-binding.cpp ../binding-mri/etc-binding.cpp ../binding-mri/filesystem-binding.cpp ../binding-mri/font-binding.cpp ../binding-mri/graphics-binding.cpp ../binding-mri/input-binding.cpp ../binding-mri/journal-binding.cpp ../binding-mri/module_rpg.cpp ../binding-mri/niko-binding.cpp ../binding-mri/oneshot-binding.cpp ../binding-mri/plane-binding.cpp ../binding-mri/screen-binding.cpp ../binding-mri/sprite-binding.cpp ../binding-mri/steam-binding.cpp ../binding-mri/table-binding.cpp ../binding-mri/tilemap-binding.cpp ../binding-mri/viewport-binding.cpp ../binding-mri/wallpaper-binding.cpp ../binding-mri/window-binding.cpp -- -c -pipe -stdlib=libc++ -O2 -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DNDEBUG -DBINDING_MRI -D_THREAD_SAFE -I. -I. -Isrc -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks/OpenAL.framework/Versions/A/Headers -I/usr/local/Cellar/libsigc++/2.10.0/include/sigc++-2.0 -I/usr/local/Cellar/libsigc++/2.10.0/lib/sigc++-2.0/include -I/usr/local/Cellar/pixman/0.34.0_1/include/pixman-1 -I/usr/local/include/SDL2 -I/usr/local/include -I/usr/local/include/AL -I/usr/local/Cellar/libvorbis/1.3.6/include -I/usr/local/Cellar/libogg/1.3.3/include -I/usr/local/Cellar/physfs/3.0.1/include -I/usr/local/Cellar/ruby/2.5.0_2/include/ruby-2.5.0/x86_64-darwin17 -I/usr/local/Cellar/ruby/2.5.0_2/include/ruby-2.5.0 -I/usr/local/Cellar/qt/5.10.1/mkspecs/macx-clang

View file

@ -389,6 +389,8 @@ module Script
end
rescue Errno::EACCES => e
#this probably means the clover.exe already exists and is running, so no need to create it again
rescue Errno::EEXIST => e
#this means that the journal file already exists, so no need to create it again
end
if File.exists?("README.txt")
File.open("README.txt", "rb") do |input|
@ -448,6 +450,8 @@ module Script
end
rescue Errno::EACCES => e
#this probably means the file already exists and is open, so no need to create it again
rescue Errno::EEXIST => e
#this probably means the file already exists, so no need to create it again
end
end

View file

@ -264,11 +264,11 @@ Oneshot::Oneshot(RGSSThreadData &threadData) :
}
// Get documents path
std::string path = std::string(getenv("HOME")) + std::string("/Documents"); //xdg_user_dir_lookup_with_fallback("Documents", getenv("HOME"));
std::string path = std::string(getenv("HOME")) + std::string("/Documents");
p->docsPath = path.c_str();
p->gamePath = path.c_str();
#ifdef OS_OSX
p->journal = "_______.app/Contents/MacOS/_______";
p->journal = "_______.app";
#elif defined OS_LINUX
p->journal = "_______";
#endif