Jump to content



Photo

Lua Picture Converter


  • Please log in to reply
5 replies to this topic

#1 Kilburn

Kilburn

    Casio Technician

  • Members
  • PipPipPipPipPipPip
  • 491 posts
  • Gender:Male
  • Location:France
  • Interests:Blah

  • Calculators:
    FX-7500 G
    ClassPad 300

Posted 16 November 2005 - 06:31 PM

I made a picture converter for CPLua. It converts a picture into a Lua file you can use with require(). But there is a BIG problem. On the PC, it works normally, but on the ClassPad I get a Fatal Error!
Here is the source code : Lua Pict Conv

#2 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 16 November 2005 - 07:31 PM

Hmmm... I gave you the possible source of errors on MSN (you're deleting arrays on the stack).
But as it is now, CPLua won't accept those files... There is a supplementary trick to do ;)

This is a good idea, but I think that we can do better than that: the generated code is rather long for big images, and the drawing operation will take a lot of time <_<
I will have CPLua support the use of PICT data files, as well as general data files: it will be possible to read/write a binary file manually, but it will also be possible to create some files containing a collection of byte arrays, to load those arrays at once and access them easily and individually later. Those could then be used as sprites, maps, etc :)

Edited by Orwell, 16 November 2005 - 07:35 PM.


#3 PAP

PAP

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 681 posts
  • Gender:Male
  • Location:Somewhere in Europe.
  • Interests:Computer Algebra, Numerical Analysis.

  • Calculators:
    ClassPad 300 (plus an old Casio model, with only a few Kb ram).

Posted 16 November 2005 - 08:28 PM

I will have CPLua support the use of PICT data files, as well as general data files: it will be possible to read/write a binary file manually, but it will also be possible to create some files containing a collection of byte arrays, to load those arrays at once and access them easily and individually later. Those could then be used as sprites, maps, etc :)

Interesting, but sprites will cause additional work to be needed: functions for detecting sprite-sprite collision, or sprite-background collision. I think that implementing the "io" package should have a much higher priority.

#4 Orwell

Orwell

    Casio Overlord

  • Members
  • PipPipPipPipPipPipPip
  • 777 posts
  • Gender:Male
  • Location:Paris - France

  • Calculators:
    Casio AFX 1.02 / Casio ClassPad 300

Posted 16 November 2005 - 08:34 PM

That's right, the 'io' package will naturally come before the sprite facilities.
This should be a nice opportunity to use the tool 'tolua' btw :lol:

#5 Gaumerie

Gaumerie

    Newbie

  • Members
  • Pip
  • 28 posts

Posted 17 November 2005 - 06:44 PM

If you need faster function to draw bitmaps or function to draw spirites without taking more time...
Ask me, I've made such functions in ASM...
This is vary faster and the function to draw spirites draw the bitmaps in a only loop...

Alexandre

(ps: I leave my discoveries in ASM etc....because I don't have much time to work on CP)

#6 MicroPro

MicroPro

    Casio Overlord

  • Deputy
  • PipPipPipPipPipPipPip
  • 640 posts
  • Gender:Male
  • Location:Iran

  • Calculators:
    Casio ClassPad 300

Posted 27 January 2006 - 03:08 PM

Hi... PictConv works on my PC but not on my CP...
Anyway I'll not need it when Lua supports sprites.
Thanks, Goodbye.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users