Skip to content

Instantly share code, notes, and snippets.

Avatar
🎮
making

Érico Vieira Porto ericoporto

🎮
making
View GitHub Profile
View build_ags3_sdl2.bat
echo
set BUILD_CONFIG=Release
set AGS_SDL_SOUND_LIB=C:\Lib\SDL_sound\build\Release
set AGS_SDL_SOUND_INCLUDE=C:\Lib\SDL_sound\src
set AGS_SDL_LIB=C:\Lib\SDL2\lib\x86
set AGS_SDL_INCLUDE=C:\Lib\SDL2\include
set AGS_LIBVORBIS_LIB=C:\Lib\Xiph
set AGS_LIBTHEORA_LIB=C:\Lib\Xiph
set AGS_LIBOGG_LIB=C:\Lib\Xiph
set AGS_DIRECTX_LIB=C:\Lib\DirectX
@ericoporto
ericoporto / vcpkg_2020_12_02.log
Last active Dec 2, 2020
build on Windows 10 Home
View vcpkg_2020_12_02.log
cmd /S /C pushd %TEMP% && git clone https://github.com/Microsoft/vcpkg.git && pushd vcpkg && if not exist vcpkg.exe call bootstrap-vcpkg.bat && vcpkg install libogg:x86-windows-static libtheora:x86-windows-static libvorbis:x86-windows-static && popd && popd && mkdir Lib\Xiph && copy %TEMP%\vcpkg\installed\x86-windows-static\lib\ogg.lib Lib\Xiph\libogg_static.lib && copy %TEMP%\vcpkg\installed\x86-windows-static\lib\theora.lib Lib\Xiph\libtheora_static.lib && copy %TEMP%\vcpkg\installed\x86-windows-static\lib\vorbis.lib Lib\Xiph\libvorbis_static.lib && copy %TEMP%\vcpkg\installed\x86-windows-static\lib\vorbisfile.lib Lib\Xiph\libvorbisfile_static.lib
Cloning into 'vcpkg'...
remote: Enumerating objects: 65, done.
remote: Counting objects: 100% (65/65), done.
remote: Compressing objects: 100% (61/61), done.
remote: Total 95587 (delta 24), reused 20 (delta 4), pack-reused 95522
Receiving objects: 100% (95587/95587), 28.92 MiB | 5.56 MiB/s, done.
Resolving deltas: 100% (59207/59207), done.
Ch
@ericoporto
ericoporto / touchapi.md
Last active Nov 21, 2020
Sketch for analysis blogpost in ericonotes.blogspot.com/2020/11/a-quick-look-at-touch-handling-apis-in.html
View touchapi.md

A quick look at Touch Handling APIs in Game Engines

Since the iPhone happened in 2007, touch input has been at the forefront of human interaction with machines. But Game Engines have existed for a reasonable long life, preceding the mobile boom. Touch as a means of interaction with the game world in engines is provided in many ways. Below, we are going to look at different touch APIs to see how they have been provided to enable gaming on our phones. Tilt, camera, and other sensors are going to be ignored so we can focus on touch.


Browser Touch API

@ericoporto
ericoporto / 1.Instructions.md
Created Oct 19, 2020 — forked from WesThorburn/1.Instructions.md
Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake
View 1.Instructions.md

Linux: Compile C++ to WebAssembly and JavaScript using Emscripten and CMake

Download and Install Emscripten

  • My preferred installation location is /home/user
  • Get the latest sdk: git clone https://github.com/emscripten-core/emsdk.git
  • Enter the cloned directory: cd emsdk
  • Install the lastest sdk tools: ./emsdk install latest
  • Activate the latest sdk tools: ./emsdk activate latest
  • Activate path variables: source ./emsdk_env.sh
  • Configure emsdk in your bash profile by running: echo 'source "/home/user/emsdk/emsdk_env.sh"' >> $HOME/.bash_profile
@ericoporto
ericoporto / sdlkey_to_agskey.cpp
Last active Oct 16, 2020
AGS Keycode equivalents in SDL Keycodes
View sdlkey_to_agskey.cpp
SDL_Keysym SDLKeysymFromAgsKey (int key)
{
SDL_Keysym sk;
sk.scancode = SDL_SCANCODE_UNKNOWN;
sk.sym = SDLK_UNKNOWN;
switch (key) {
// ctrl-[A-Z] keys are numbered 1-26 for A-Z
case eAGSKeyCodeCtrlA: { sk.scancode = SDL_SCANCODE_A; sk.sym = SDLK_a; sk.mod = KMOD_CTRL; } break;
case eAGSKeyCodeCtrlB: { sk.scancode = SDL_SCANCODE_B; sk.sym = SDLK_b; sk.mod = KMOD_CTRL; } break;
View rellax.asc
// Rellax
// 0.1.5~
// A module to provide smooth scrolling and parallax!
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
// Before starting, you must create the following Custom Properties
// in AGS Editor, for usage with Objects.
// Just click on Properties [...] and on the Edit Custom Properties screen,
// click on Edit Schema ... button, and add the two properties below:
//
// PxPos:
@ericoporto
ericoporto / theoricalproblem.md
Last active Jul 18, 2020
Theoretical problem
View theoricalproblem.md

When resolving script imports, the code doesn't deals with empty string imports, and relies on nullptr :

https://github.com/adventuregamestudio/ags/blob/c52217180969576717173777d8ac195dd4347047/Engine/script/cc_instance.cpp#L1591

This works because when reading script objects, empty strings (a single \0 character) are replaced by a nullptr :

https://github.com/adventuregamestudio/ags/blob/c52217180969576717173777d8ac195dd4347047/Common/script/cc_script.cpp#L39

But when writing a script object, we don't treat the nullptr case, so if you read a script object, and want to write it back to a file, this will break here :

@ericoporto
ericoporto / remember.txt
Created Jul 15, 2020
need to add a install target to ags executable cmakelists.txt
View remember.txt
add_executable(ags)
if(NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
install(TARGETS ags
DESTINATION "${CMAKE_INSTALL_PREFIX}/bin"
)
endif()
@ericoporto
ericoporto / extract-subtitles.sh
Last active Jul 27, 2020
bash script to extract all subtitles from mp4 files and remove html tags
View extract-subtitles.sh
#!/bin/bash
for file in *.mp4;
do
filename=$(basename -s .mp4 "$file")
ffmpeg -i "${filename}.mp4" "${filename}.srt"
done
sed -i 's/<[^>]*>//g' *.srt
@ericoporto
ericoporto / README.md
Last active Jul 3, 2020
Building an AGS game
View README.md

Building an AGS game

Ideally, while the project files holds the game information in the form that is the most convenient by the Editor used by the game developer, the game data represents this information in the most convenient form for the Engine.

Building a game is to transform information that describes the game to the form convenient for the Engine. This document describes how a platform agnostic AGS game is built.

You can’t perform that action at this time.