Git Product home page Git Product logo

jgabaut / sprites4curses Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 1.92 MB

Small C library to deal with simple sprites in ncurses, with a raylib extension to reuse assets. Includes python scripts to convert png sprites to a char representation.

License: GNU General Public License v3.0

Makefile 6.80% C 82.27% Python 0.66% M4 4.34% Shell 5.94%
converter ncurses raylib roguelikedev sprites spritesheet

sprites4curses's Introduction

Hi there ๐Ÿ‘‹

sprites4curses's People

Contributors

alishahabzadeh avatar dependabot[bot] avatar jgabaut avatar

Stargazers

 avatar  avatar

Watchers

 avatar

sprites4curses's Issues

[BUG] Colors encoded to "?" chars may cause trigraph conversion when building with --std=c(<23)

Describe the bug

For more basic details, refer to this issue.

To Reproduce
Steps to reproduce the behavior:

  1. Using one of the python scripts, try parsing a .png containing more than one ? pixel on the same row. (Hint: S4C_Color_Index may suggest it's S4C_LIGHT_YELLOW. I'mma count the off-by-ones later. :) )
  2. If the encoding forms a trigraph sequence, a compiler using --std=c(<23) may convert the tokens and corrupt the animation, sortening some lines for some unlucky frames.

Expected behavior
When in C generation mode, the script keeps track of how many ? chars are being put on the same row and breaks up the pattern while retaining the correct color encoding.

Screenshots

(From helapordo)
screen

  • Version >=0.3.2

Additional context

Wikipedia

[FEATURE] Deprecate direct s4c-script vendoring

As of version 0.4.3, the ./scripts directory contains some wrappers that should emulate previous behaviour.

This is sprites.py, for example:

#!/bin/python3

import sys
from s4c.core.sprites import main

if __name__ == "__main__":
    main(sys.argv)

The import works by leveraging a symlink for ./scripts/s4c:

./scripts/s4c -> ./s4c-scripts/s4c.

The old versions of the scripts are available under ./scripts-legacy.

Eventually, these will be removed. The patch needed in any Makefile using the scripts directly would be something like this:

< 	python3 ./sprites4curses/scripts/palette.py C-impl $(PALETTE_PATH) .. > ./src/palette.c
< 	python3 ./sprites4curses/scripts/palette.py C-header $(PALETTE_PATH) .. > ./src/palette.h
---
> 	python3 -m sprites4curses.s4c-scripts.s4c.core.palette C-impl $(PALETTE_PATH) .. > ./src/palette.c
> 	python3 -m sprites4curses.s4c-scripts.s4c.core.palette C-header $(PALETTE_PATH) .. > ./src/palette.h

I need help with compilation

Not able to generate demo executable
I cloned this repository then i installed pillow using pip. I followed the steps in README to compile for demo project.
make command is returning errors.

To Reproduce
Steps to reproduce the behavior:

  1. Clone Repo
  2. cd Repo
  3. Clone scripts repo
  4. Compile using recommended steps in README
# EDIT: I used following steps to compile from README
autoreconf; automake --add-missing; autoreconf; automake --add-missing autoreconf; ./configure make; ./demo demofile.txt

Executable file: demo
Program should compile. What am i missing?

Screenshot

I tried ./configure and make as separate commands in resulted in following error.
image

then, i rechecked README they are not separate commands so joined them then this error.
image

then, i modified the Makefile and removed -Wpedantic .. tried to make. still error
image

Desktop

  • OS: [Arch Linux]
  • Version [Latest]

I am new to all this.
Can you help me compile this?

[BUG] 0.4.3 Build fails on clang

When trying to build 0.4.3 with clang an error occurs (given we have -Werror):

./s4c-animate/animate.c:245:25: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int s4c_check_has_colors() {
                        ^
                         void
./s4c-animate/animate.c:252:31: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
int s4c_check_can_change_color() {
                              ^
                               void
2 warnings generated.

[FEATURE] Add color weight factor option

ATM the new colors' components are weighted to a max of 680, but ncurses uses 1000 as its 255 component max.

This is due to standard colors being weighted to 680, but using 1000 could mean brighter shades are possible.

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.