Commit b9985535 authored by Gerard Gascón's avatar Gerard Gascón
Browse files

init

parents
Loading
Loading
Loading
Loading

.gitattributes

0 → 100644
+57 −0
Original line number Diff line number Diff line
# Auto detect text files and perform LF normalization
* text=auto
# 3D models
*.3dm filter=lfs diff=lfs merge=lfs -text
*.3ds filter=lfs diff=lfs merge=lfs -text
*.blend filter=lfs diff=lfs merge=lfs -text
*.c4d filter=lfs diff=lfs merge=lfs -text
*.collada filter=lfs diff=lfs merge=lfs -text
*.dae filter=lfs diff=lfs merge=lfs -text
*.dxf filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.jas filter=lfs diff=lfs merge=lfs -text
*.lws filter=lfs diff=lfs merge=lfs -text
*.lxo filter=lfs diff=lfs merge=lfs -text
*.ma filter=lfs diff=lfs merge=lfs -text
*.max filter=lfs diff=lfs merge=lfs -text
*.mb filter=lfs diff=lfs merge=lfs -text
*.obj filter=lfs diff=lfs merge=lfs -text
*.ply filter=lfs diff=lfs merge=lfs -text
*.skp filter=lfs diff=lfs merge=lfs -text
*.stl filter=lfs diff=lfs merge=lfs -text
*.ztl filter=lfs diff=lfs merge=lfs -text
*.glb filter=lfs diff=lfs merge=lfs -text
# Audio
*.aif filter=lfs diff=lfs merge=lfs -text
*.aiff filter=lfs diff=lfs merge=lfs -text
*.it filter=lfs diff=lfs merge=lfs -text
*.mod filter=lfs diff=lfs merge=lfs -text
*.mp3 filter=lfs diff=lfs merge=lfs -text
*.ogg filter=lfs diff=lfs merge=lfs -text
*.s3m filter=lfs diff=lfs merge=lfs -text
*.wav filter=lfs diff=lfs merge=lfs -text
*.xm filter=lfs diff=lfs merge=lfs -text
*.bank filter=lfs diff=lfs merge=lfs -text
# Fonts
*.otf filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
# Images
*.bmp filter=lfs diff=lfs merge=lfs -text
*.exr filter=lfs diff=lfs merge=lfs -text
*.gif filter=lfs diff=lfs merge=lfs -text
*.hdr filter=lfs diff=lfs merge=lfs -text
*.iff filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
*.svg filter=lfs diff=lfs merge=lfs -text
*.pict filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.tga filter=lfs diff=lfs merge=lfs -text
*.tif filter=lfs diff=lfs merge=lfs -text
*.tiff filter=lfs diff=lfs merge=lfs -text
Assets/Fonts/Pangolin-Regular_SDF.asset filter=lfs diff=lfs merge=lfs -text
Assets/Fonts/LiberationSans_SDF.asset filter=lfs diff=lfs merge=lfs -text
*.dll filter=lfs diff=lfs merge=lfs -text
*.so filter=lfs diff=lfs merge=lfs -text
*.dylib filter=lfs diff=lfs merge=lfs -text

.gitignore

0 → 100644
+2 −0
Original line number Diff line number Diff line
# Godot 4+ specific ignores
.godot/

README.md

0 → 100644
+32 −0
Original line number Diff line number Diff line
# Figments of the Night

## Description

You wake up on a deserted island with no memory of who you are or what you are doing there. You will have to explore its landscapes, meet its other visitors and find clues in order to discover the truth behind this mysterious place…

or

you can simply relax in this paradise in the middle of the ocean and accept ignorance… whatever you do, do it before you have to go to sleep… to sleep…

## Honors

Indie Spain Jam 2023 — Top 25 Finalist

## The Team

> Gerard Gascón - Programming\
> Marc Batlle - Character Design, 3D Modeling & Narrative\
> Oriol Jaumot - Level Design & Environment Art\
> Pedro Astasio - SFXs & Music

## Game Jam

Indie Spain Jam 2023 — September 18th - 25th 2023 (1 week)

## Theme

The night falls

## Languages

Spanish

addons/inkgd/LICENSE

0 → 100644
+24 −0
Original line number Diff line number Diff line
The MIT License (MIT)

Copyright (c) 2015-2021 inkle Ltd.
Copyright (c) 2018-2021 Paul Joannon
Copyright (c) 2019-2022 Frédéric Maquin <fred@ephread.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
 No newline at end of file
+146 −0
Original line number Diff line number Diff line
# ############################################################################ #
# Copyright © 2019-2022 Frédéric Maquin <fred@ephread.com>
# Licensed under the MIT License.
# See LICENSE in the project root for license information.
# ############################################################################ #

extends InkExternalCommandExecutor

class_name InkCompiler

# ############################################################################ #
# Imports
# ############################################################################ #

var InkExecutionResult = load("res://addons/inkgd/editor/common/executors/structures/ink_execution_result.gd")

# ############################################################################ #
# Private Properties
# ############################################################################ #

## Ink Configuration
var _configuration: InkCompilationConfiguration

# ############################################################################ #
# Signals
# ############################################################################ #

## Emitted when a compilation completed. Note that this doesn't imply that
## the compulation was successful. Check the content of result
## (InkCompiler.Result) for more information.
signal story_compiled(result)

# ############################################################################ #
# Overrides
# ############################################################################ #

func _init(configuration: InkCompilationConfiguration):
	_configuration = configuration

	if _configuration.use_threads:
		_thread = Thread.new()

# ############################################################################ #
# Methods
# ############################################################################ #

## Compile the story, based on the compilation configuration provided
## by this object. If `configuration.use_thread` is set to `false`,
## this method will return `true` if the compilation succeeded and `false`
## otherwise. If `configuration.use_thread` is set to `true`, this method
## always returns `true`.
func compile_story() -> bool:
	if _configuration.use_threads:
		var error = _thread.start(Callable(self, "_compile_story").bind(_configuration), Thread.PRIORITY_HIGH)

		if error != OK:
			var result = InkExecutionResult.new(
				self.identifier,
				_configuration.use_threads,
				_configuration.user_triggered,
				false,
				""
			)

			call_deferred("emit_signal", "story_compiled", result)

		return true
	else:
		return _compile_story(_configuration)

# ############################################################################ #
# Private Helpers
# ############################################################################ #

## Compile the story, based on the given compilation configuration
## If `configuration.use_thread` is set to `false`, this method will
## return `true` if the compilation succeeded and `false` otherwise.
## If `configuration.use_thread` is set to `false`, this method always
## returns `true`.
func _compile_story(config: InkCompilationConfiguration) -> bool:
	print("[inkgd] [INFO] Executing compilation command…")
	var return_code = 0
	var output = []

	var start_time = Time.get_ticks_msec()

	if config.use_mono:
		var args = [config.inklecate_path, '-o', config.target_file_path, config.source_file_path]
		return_code = OS.execute(config.mono_path, args, output, true, false)
	else:
		var args = ['-o', config.target_file_path, config.source_file_path]
		return_code = OS.execute(config.inklecate_path, args, output, true, false)

	var end_time = Time.get_ticks_msec()

	print("[inkgd] [INFO] Command executed in %dms." % (end_time - start_time))

	var string_output = PackedStringArray(output)
	if _configuration.use_threads:
		call_deferred("_handle_compilation_result", config, return_code, string_output)
		return true
	else:
		var result = _process_compilation_result(config, return_code, string_output)
		return result.success


## Handles the compilation results when exectuted in a different thread.
##
## This method should always be executed on the main thread.
func _handle_compilation_result(
	config: InkCompilationConfiguration,
	return_code: int,
	output: Array
):
	_thread.wait_to_finish()

	var result = _process_compilation_result(config, return_code, output)
	emit_signal("story_compiled", result)


## Process the compilation results turning them into an instance of `Result`.
##
## This method will also print to the editor's output panel.
func _process_compilation_result(
	config: InkCompilationConfiguration,
	return_code: int,
	output: PackedStringArray
) -> InkExecutionResult:
	var success: bool = (return_code == 0)
	var output_text: String = "\n".join(output).replace(BOM, "").strip_edges()

	if success:
		print("[inkgd] [INFO] %s was successfully compiled." % config.source_file_path)
		if output_text.length() > 0:
			print(output_text)
	else:
		printerr("[inkgd] [ERROR] Could not compile %s." % config.source_file_path)
		printerr(output_text)

	return InkExecutionResult.new(
			self.identifier,
			config.use_threads,
			config.user_triggered,
			success,
			output_text
	)