Giter Site home page Giter Site logo

speak2erase / osfm-core-public Goto Github PK

View Code? Open in Web Editor NEW

This project forked from astrabit-st/modshot-core

2.0 2.0 0.0 135.24 MB

A fork of mkxp, forked for OneShot, forked for OneShot mods, forked for OSFM.

Home Page: https://nowaffles.com

License: GNU General Public License v2.0

CMake 0.88% C++ 49.93% C 3.73% QMake 0.10% Ruby 41.57% GLSL 1.19% Shell 0.84% Python 0.55% Batchfile 0.05% Meson 0.67% Makefile 0.50%

osfm-core-public's Introduction

OSFM-Core-Public

Build ModShot UbuntuBuild ModShot Windows

This is a even more MORE specialized fork of a specialized fork of OSFM-Public-Core by Speak2Erase (mkxp by Ancurio designed for OneShot) for OneShot mods.

Thanks to hunternet93 for starting the reimplementation of the journal program!

Thanks to rkevin-arch for the docker build!

Thanks to somedevfox for helping ModShot ditch conan!

Thanks to hat_kid for fixing username problem, introducing Notifications API and fixing wallpapers!

mkxp is a project that seeks to provide a fully open source implementation of the Ruby Game Scripting System (RGSS) interface used in the popular game creation software "RPG Maker XP", "RPG Maker VX" and "RPG Maker VX Ace" (trademark by Enterbrain, Inc.), with focus on Linux. The goal is to be able to run games created with the above software natively without changing a single file.

It is licensed under the GNU General Public License v2+.

ModShot also makes use of steamshim for GPL compliance while making use of Steamworks features. See LICENSE.steamshim.txt for details. You can compile ModShot with steam without compiling steamshim, but you will need to source the steamshim binary yourself.

Building

Conan is no longer supported. Long live conan. Instead, ModShot now makes use of meson, bash, and make, in a fairly simple setup. You only need to compile dependencies once.

Because of this, compiling with Visual Studio as was standard before is no longer supported, and instead compiling using the msys2 toolset is required. The main upshot of this, of course, is remaining on par with ruby in terms of gem support. (at least for windows)

Previously, C extensions were very jank with ModShot, however now you can use a C extension right from your own Ruby install! (Provided the version is the same, and the msys2 evironment is the same. I'll get back to this later.)

Build options

Unfortunately because of the way ModShot is set up, you will need to pass build options to Make and Meson, if it pertains to dependencies. (ruby ver, opt level, etc.)

Options

RUBY_VER && -Dmri_version (default 3.1) sets the ruby version.
-Dsteam (default false) sets the build to use steam.
--build-type (default Release) sets the build type.
-Dbuild_static (default true) sets the build to be static. (True is faster, but with longer startup times.)

Building on Windows

First, you'll need to download msys2 and install it. Then, you'll want to determine what Ruby version you're using, as this will determine what build environment you'll be using. As is, ModShot is set up to use Ruby 3.1, so keep that in mind. Please refer to this table to determine the environment. (You can use the wrong environment and it will work fine, just not with C extensions.)

Ruby >3.1 UCRT64 (Default)
Ruby 3.0-2.0 MINGW64
Ruby <1.9 MINGW32 (NOT SUPPORTED!)

Once you've figured out the environment you need to use, pull up an msys2 shell of it. (You can search the environment name in the Windows search box to open it) From there, it's pretty much identical to the Linux setup.

# Install dependencies from package manager
sh setup.sh

# Build extra dependencies (like ruby)
cd windows; make
source vars.sh

cd ..; meson build --prefix="$PWD/build.out" --bindir=.
cd build && ninja install

Building on Linux

Building on Linux is fairly easy, as long as you're using one of the supported distros. (Manjaro, Debian/Ubuntu, Fedora/Red Hat) Unlike Windows, you don't have to worry about msys2 environments. Just use gcc and you'll be good to go. If you're not, fear not, as you can usually just install all the dependencies right from your package manager. See setup.sh.

# Install dependencies from package manager
sh setup.sh

# Build extra dependencies (like ruby)
cd linux; make
source vars.sh

cd ..; meson build --prefix="$PWD/build.out" --bindir=.
cd build && ninja install

This should create a folder called out with your build of ModShot all ready to go!

Configuration

ModShot reads configuration data from the file "oneshot.conf". The format is ini-style. Do not use quotes around file paths (spaces won't break). Lines starting with '#' are comments. See 'oneshot.conf.sample' for a list of accepted entries. Note that this feature appears to be brpken for the moment until we get around to fixing it. Using command line options does work, however.

All option entries can alternatively be specified as command line options. Any options that are not arrays (eg. preloaded scripts) specified as command line options will override entries in oneshot.conf. Note that you will have to wrap values containing spaces in quotes (unlike in oneshot.conf).

The syntax is: --<option>=<value>

Example: ./oneshot --gameFolder="oneshot" --vsync=true

External gems

Modshot builds come pre-packaged with the ruby standard library in /lib/ruby/. You can require gems from this folder at any point by using require '<gem>'.

You can ship your own gems by finding the gem install location (Typically C:\Ruby27-x64\lib\ruby\gems\2.7.0\gems), going inside the gem, and copying over all the files inside lib.

osfm-core-public's People

Contributors

ancurio avatar blacklotus avatar carstene1ns avatar cremno avatar daverball avatar elizagamedev avatar girakacheezer avatar iandavid123 avatar kockaadmiralac avatar lacc97 avatar mathewv avatar mook avatar mshirt avatar popkirby avatar queengooborg avatar reinuseslisp avatar rkevin-arch avatar somedevfox avatar speak2erase avatar taedixon avatar thehatkid avatar urkle avatar virmskvll avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

osfm-core-public's Issues

Todo: Port over mkxp-z features

Right now mkxp-z is set up so that (A) graphics functions always make sure that the current thread is the one that the GL context is set to, so you can call them from things other than the main thread, (B) all graphics functions themselves are synced to their own lock so that they don't trample over each other, and (C) Graphics.update and any other non-graphics-related functions that take a lot of time are taken off the GVL so that other threads aren't blocked by them

Window Resizing & Fullscreen
Graphics.scale is a property that gets and sets the scale of the window based on its rendering resolution. (between 0.5 and 2)Graphics.fullscreen is a property that gets and sets the current fullscreen state (true or false)Graphics.center places the window in the center of the screen.Graphics.resize_screen is available from VX regardless of RGSS version, along with the other functions introduced in VX and VX Ace.
Taking Screenshots
Graphics.screenshot(path) will take a screenshot and save it to path in BMP format.
Telling Time
Graphics.delta returns the amount of time passed since the last call to Graphics.update (in microseconds).
Graphics.average_frame_rate gives the "real" framerate -- how long it took for the past several calls to Graphics.update to complete, including all the time taken running code in between calls. This is the same number shown by pressing F2, as a float.

GIF Playback
If a Bitmap is created from a gif that contains multiple frames, it is automatically converted into an animated bitmap. Framerate and loop information are set automatically. All you should need to do is:
spr = Sprite.newspr.bitmap = Bitmap.new("some.gif")spr.bitmap.play if spr.bitmap.animated?
Or, if you want to do something more complicated, read about animation below.
Animation
All non-megasurface bitmaps support multiple frames of animation. Animated bitmaps are primarily meant to be played and not changed, and do not support most editing operations.
Individual frames given and returned by these functions are 0-indexed.
Accessing animation information
animated? returns true if the bitmap is animated (possesses more than one frame).playing is a property that gets and sets whether or not the bitmap is currently playing. It automatically returns false if looping is also false and the bitmap has reached its last frame of animation. All Bitmaps begin stopped.looping is a property that gets and sets whether or not the bitmap should loop indefinitely. true by default.current_frame returns the frame that the bitmap currently depicts.frame_count returns the total number of frames contained in the bitmap.frame_rate is a property that gets and sets the intended playback speed of the bitmap. This is a float, so it can be as precise as you like (e.g. 29.97 or 59.94). Defaults to 0.
Automatic Playback
play will begin asynchronous playback of the bitmap.stop will pause playback of the bitmap.
Manual Control
goto_and_stop(position) will move to the frame specified with position. goto_and_play(position) Will do the same, and begin playback from there.next_frame advances the bitmap to its next frame. This will cycle from beginning to end if looping is set to true. Returns the index of the frame that the bitmap has moved to. Stops the bitmap if it is playing.previous_frame moves the bitmap back one frame. This will cycle from end to beginning if looping is set to true. Returns the index of the frame that the bitmap has moved to. Stops the bitmap if it is playing.
Timeline Editing
add_frame(source[, position]) adds a new frame using the Bitmap specified at source. By default, the new frame will be appended to the end of the animation, but the destination index can be specified with position. This converts the bitmap into an animated bitmap if it was not one already -- if frame_rate is currently 0 in this case, it is changed to match Graphics.frame_rate.remove_frame([position]) removes the frame at the index specified with the optional position. Defaults to removing the last frame in the timeline. Only works on animated bitmaps, and changes them back into a normal bitmap if there is only one frame left after the operation.
Manipulating Frame Data
These functions require the bitmap to be stopped. They operate on whatever frame the bitmap is currently displaying. Animated bitmaps are not currently cached for reading, so functions that read from an animated bitmap are just as expensive as functions that write to one.
snap_to_bitmap([position]) captures the currently displayed frame (or the frame specified by position if it's provided), and returns a new Bitmap created from it. (This is compared to using something like dup to copy the bitmap, which also copies all frames)Blitting, using the raw_data property, and saving the bitmap to a file should also work on animated bitmaps.
Accessing Bitmap Data
To access bitmap data directly, Bitmap.raw_data is a property that will get and set a string containing the Bitmap's data in RGBA8 format.
When setting bitmap data, the string's byte size must be equal to the bitmap's width * height * 4. If this isn't the case, an MKXPError will raise.
Saving to File
To save a bitmap directly to a file, to_file(path) has been added. It will save a Bitmap to wherever path specifies in BMP, PNG or JPEG format, depending on the extension given

desensitize(path) uses MKXP's internal path cache to find the correct case for a filename. Useful for scripting filesystem operations on platforms with case-sensitive filesystems, like macOS and Linux.
reload_cache causes MKXP to regenerate its path cache, reflecting changes made in the mounted filesystem since it was last called.
mount(path[, mountpoint]) will mount path to mountpoint. Multiple locations can be mounted to the same mount point, and any archive formats you can use with the RTPs option in mkxp's json configuration can also be mounted as directories (e.g. zip, rgssad, iso). If mountpoint is not provided, it will default to the game's root, not the same path specified in path. Automatically reloads the path cache.
unmount(path) removes path from MKXP's search path. This is the same path given to the first argument of mount, not the mount point. Automatically reloads the path cac

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.