Coder Social home page Coder Social logo

ericoporto / agsjoy Goto Github PK

View Code? Open in Web Editor NEW
1.0 3.0 1.0 2.1 MB

[reverse engineered edition] Joystick for Adventure Game Studio in Linux. libagsjoy written by qptain_Nemo, for Linux, compatible with Wyz agsjoy.

License: MIT License

Makefile 1.12% C++ 96.53% Shell 0.46% C 1.89%
ags adventure-game-studio joystick sdl2

agsjoy's Introduction

agsjoy (reverse engineered edition)

Linux/OSX : Build Status | Windows : AppVeyor

Joystick for Adventure Game Studio Engine in Linux. libagsjoy written by qptain_Nemo, for Linux, compatible with Wyz agsjoy.

I saw this plugin used in Linux version of Until I Have You, Dualnames told me to ask qptain Nemo for source. He sent me the source and told me I could share and stamp a MIT license on it, so here it is.

This is NOT the original agsjoy, this is a reverse engineered version of the plugin! go here for official releases of the agsjoy plugin

Unfortunately I HAVE to use the same name to guarantee ags to connect it to the agsjoy stubs. This pugin doesn't have feature parity with the original plugin but should be ok for most single player games.

This code uses SDL2 and it makes your game depend on SDL2.

how to buid agsjoy for Linux

Install dependencies sdl2, g++, libc6-dev .

Attention right now, the Makefile is not working yet. Use the build.sh script in the folder. Tested only in Ubuntu 16.04.

If you want to make in Ubuntu 16.04:

sudo apt install libsdl2-dev g++ libc6-dev libc6-dev-i386 git make wget
git clone [email protected]:ericoporto/agsjoy.git
cd agsjoy/agsjoy/
wget https://raw.githubusercontent.com/adventuregamestudio/ags/v.3.4.1.12/Engine/plugin/agsplugin.h
make

It should work with regular ags linux port.

about 32-bit linux For now, the solution is to use a 32 bit Ubuntu VM until I can findout how to solve the dependencies for multiarch in Ubuntu 16.04

If you want to build for 32-bit systems and you are on amd64 install, additionally, install libc6-dev-i386, lib32stdc++-5-dev.

Go here to grab the latest release!

how to build agsjoy for Windows

Extract Developent.zip in C:/ - you should end up with a C:/Development/ directory. This will give you the dependencies for SDL2.

Install Visual Studio 2017 Community, install the C++ stuff.

Open the agsjoy.sln here in Visual Studio 2017. Press build Release, select win32 when building the .dll since the shipped SDL2 is x86.

how to build agsjoy for MAC OSX

you need to get SDL2 first

more information here...

  1. Download the OS X development libraries from the SDL website, go into Development Libraries-> Mac OS X-> SDL2-2.0.X.dmg .

  2. Next open the dmg and copy the SDL2.framework to /Library/Frameworks. To go directly to a path in finder, press command+shift+g.

  3. The framework may need to be resigned. To sign the framework, open up a terminal to:

    /Library/Frameworks/SDL2.framework/

and sign the framework using the command:

codesign -f -s - SDL2

building a .dylib

In the same folder as agsjoy.cpp .

clang++ agsjoy.cpp -Wall -framework SDL2 -F /Library/Frameworks/ -dynamiclib -o libagsjoy.dylib

Now you can use it in your project.

agsjoy's People

Contributors

ericoporto avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

agsjoy's Issues

Problems with amd64 build?

Is there a particular reason why you only support i386 for now?

I was able to build libagsjoy.so successfully on amd64 by just installing libsdl2-dev:

$ file libagsjoy.so 
libagsjoy.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=a8ad0fb065e6572a7c72c71588639c1c0cb26edc, not stripped

This was on Debian buster (testing), however, not Ubuntu 16.04.

Pass enums, constants and other information for AGS Editor

Use something like below to pass needed enumerators and constants to the AGS Editor using something like below for the Windows DLL.

const char* scriptHeader =
  "//------------------------;\r\n"
  "//add enum for ePOV here;\r\n"
  "//------------------------;\r\n"
  ;

int  AGS_EditorStartup(IAGSEditor* lpEditor)
{
  // User has checked the plugin to use it in their game

  // If it's an earlier version than what we need, abort.
  if (lpEditor->version < 1)
    return -1;

  editor = lpEditor;
  editor->RegisterScriptHeader(scriptHeader);

  // Return 0 to indicate success
  return 0;
}

simplify windows and linux code to one

Use ifdefs to make the builds for Windows and Linux (something like below):

#ifdef __linux__ 
    //linux code goes here
#elif _WIN32
    // windows code goes here
#else

#endif

Do an OSX port

Apparently OSX is compatible with SDL2: https://wiki.libsdl.org/FAQMacOSX

Onitake suggested me to try using clang to build.

clang++ agsjoy.cpp -Wall -framework SDL2 -dynamiclib -o libagsjoy.dylib

SDL2 has to be shipped with the application (the game) - I still need to findout how.

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.