Author Topic: [Ndless] n2DLib  (Read 27280 times)

0 Members and 1 Guest are viewing this topic.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] n2DLib
« Reply #30 on: July 05, 2014, 07:17:55 am »
Coding style eh ?
* Streetwalrus mumbles something about having harassed aeTIos about that. :P

Offline aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: [Ndless] n2DLib
« Reply #31 on: July 06, 2014, 07:36:49 pm »
I don't know what you're talking about. ???

 :trollface:
I'm not a nerd but I pretend:

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] n2DLib
« Reply #32 on: July 11, 2014, 10:39:12 am »
So since I hated that C# + GUI utility to convert sprites (yuck) which required manual intervention after the conversion, I made a very quick thingy in Python. Requires Python 3 (maybe it can work on version 2, no idea), and Pillow.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #33 on: July 11, 2014, 10:40:01 am »
Well thanks for that, but I don't like asking users to have Python installed to run things - for example I don't have Python installed.

EDIT : wait I do have it, but I don't have that Pillow thing
« Last Edit: July 11, 2014, 10:43:16 am by Matrefeytontias »

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] n2DLib
« Reply #34 on: July 11, 2014, 10:42:32 am »
I'm not forcing you to install/use it. It's just that it's more handy and is scriptable. Also I realize I forgot to tell you how to use it. :P So just call the script, passing it your sprite (can be any format as long as Pillow recognizes it). It uses the color in the top left corner for transparency.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #35 on: July 11, 2014, 10:43:43 am »
I mean, I certainly want to use it, but I don't want to install extra stuff. That's why a simple .exe is better.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: [Ndless] n2DLib
« Reply #36 on: July 11, 2014, 10:44:16 am »
Erm, I'm not on Windows so I can't make it. :P

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #37 on: July 11, 2014, 10:45:29 am »
Well I'll take care of that then. A quick C + SDL program will do it (have to do things first though).

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] n2DLib
« Reply #38 on: July 11, 2014, 11:08:49 am »
I could integrate support for the SDL/n2dlib format in my ConvertImg tool, I'd have to include better transparency support anyway and an option "-format=ngl" or "-format=sdl" wouldn't hurt.

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #39 on: July 11, 2014, 11:10:41 am »
Yeah that would be cool, moreover having a single conversion tool would be easier =] so I leave it to you ?

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] n2DLib
« Reply #40 on: July 11, 2014, 11:16:34 am »
Just to be sure: The format is a uint16_t array with width, height and transparent color as the first 3 16bit values and every pixel from top left to bottom right appended?

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #41 on: July 11, 2014, 11:17:58 am »
Exactly.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: [Ndless] n2DLib
« Reply #42 on: July 11, 2014, 11:18:53 am »
For n2DL, yes.
And for nSDL support, just stick a "0x2a01" at the beginning of the array generated with the n2DL format.
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline Matrefeytontias

  • Axe roxxor (kinda)
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1982
  • Rating: +310/-12
  • Axe roxxor
    • View Profile
    • RMV Pixel Engineers
Re: [Ndless] n2DLib
« Reply #43 on: July 11, 2014, 11:19:53 am »
And the now-4th byte must be 0x0000 (in place of the transparent color).

Offline Vogtinator

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1193
  • Rating: +108/-5
  • Instruction counter
    • View Profile
Re: [Ndless] n2DLib
« Reply #44 on: July 11, 2014, 12:17:15 pm »
So 0x0000 as transparent color means no transparency?