Giter VIP home page Giter VIP logo

Comments (20)

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024 1

In its current state it's still a huge mess of spaghetti code. DirectDraw and DirectInput are sprinkled everywhere. And many types used are Windows related.

Once I'm done refactoring the mess, it should be fully based on SFML and as such work cross-platform .

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

Also there are some files that look like they are used for C++ code generation. That's probably an issue as well.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

Are you currently working on that?

And do you have simple work items, that I could help with?

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

Not exactly. I'd like to pick up again.

Everything is interleaved so there's really no way to cut things down into smaller piece, plus to make it work, you pretty much after to use Visual Studio and Windows.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

I have a Windows 10 VM with VS 2017 Community and (since I didn't manage to compile Schiffbruch with that) also VS 2015 Community. I didn't try to compile it with VS 2015 yet.

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

VS 2017 works fine (just compiled it), you just have to update the project solution and update the SFML libs.

I've once started to extract the whole initialization of all the different images, so they wouldn't be hard coded but loaded from a JSON file at start up. But since it's hundreds of different variables, I gave up at oen point.

If you want to, you could try and extract all the information, here's what I got so far. The init.txt contains all the other variables that I haven't yet added to the JSON structure: variables.zip

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

Do I understand you correctly that you want the Bmp, Wav etc. arrays in JSON form?

(your JSON example is not valid JSON btw.)

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

The easiest way to do that would probably be to execute the code and write C++ code that prints this information as JSON from memory.

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

Yes, that's the idea. Currently the initialization code alone is multiple hundred lines of code, making things quite messy, being able to cut those hard coded out into its own config JSON file, already makes the whole code base lighter.

Running the code to dump it, might be a good idea. Is this something you'd like to look into?

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

Yes, I can do that.

What JSON library do you intend to use in the end? If you have decided already I can use that and maybe even write the code to load the JSON back in.

Otherwise I would just export it using cJSON since I'm the maintainer of that library so I'm familiar with it.

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

I quite like https://github.com/nlohmann/json and I'd rather stick to a C++ library than C.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

I meant to use cJSON just for exporting, if there was no JSON library decided upon for later importing the JSON.

How do you handle dependencies? For now I would just copy paste the source code or install the package on my Linux system or something like that.

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

nlohmann's JSON lib is a header-only lib, so you can just add the header to the source and include it.

For you export program you can easily just use cJSON you're familiar with it.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

There's just a slight problem with JSON: Some values are calculated, even dependent on the screen resolution. I don't know how this can be represented using JSON (other than parsing strings and evaluating the result).

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

Well dependencies between different entities isn't really an issue. That was mostly done to "simplify" the calculation, but we could just save the complete values to JSON.

Which values depend on the screen resolution? If you mean the Guy's position and the camera, then that's no a problem. Those don't need to be saved to the JSON file, but can be set at the start of the game.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

Looks like mostly text output and the credits.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

I'll just ignore that then.

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

I will probably finish it some time this week.

from schiffbruch.

eXpl0it3r avatar eXpl0it3r commented on May 20, 2024

Good to hear! 😊

from schiffbruch.

FSMaxB avatar FSMaxB commented on May 20, 2024

This takes longer than anticipated, especially because some unexpected tasks with higher priority came up.

My current plan:

  • Make pairs of to_json, from_json for every struct
  • Use these to generate JSON
  • Hook up loading from JSON

from schiffbruch.

Related Issues (10)

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.