123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|544|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz -> Images inside Blitz Code

Sun, 07 May 2023, 13:37
spinal
Was there ever a good way in blitz to store an image in the source code?

-=-=-
Check out my excellent homepage!
Sun, 07 May 2023, 13:37
Jayenkai
Convert pixels to data, then convert them back again? It'd be slow, plotting all those points, though.
Alternatively, convert the file's data to a stream of some sort, then undo that, save the data to the disk, load the image. That'd be quicker, I think, because you're only working with data, not having to plot pixels.. .. Maybe.. Plus you'd have the png/jpeg compression working in your favour.

-=-=-
''Load, Next List!''
Sun, 07 May 2023, 15:49
spinal
My first attempt failed, I copied the data directly from a bmp file and manually drew it. Weirdly *some* of the colours were wrong, but most were correct. Odd that.

-=-=-
Check out my excellent homepage!
Mon, 08 May 2023, 00:27
Jayenkai
Of course, if you were using BlitzMax, it'd be as easy as IncBin, but I've searched the B3D help file, and there's nothing of the sort in there, I'm afraid.

-=-=-
''Load, Next List!''
Mon, 08 May 2023, 00:49
Afr0
If this is about Blitz3D, it’s open source now so you can make it do whatever the hell you want!
Here is a version that’ll actually build using a modern version VS rather than the ancient VS 6.0 (man, I remember getting that for Christmas from my dad as a kid - good times!)
If you don’t know C++, just ask ChatGPT to help!

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Mon, 08 May 2023, 01:27
Jayenkai
Yeah, but I think that's one of those "If you're already using C++, why not just keep on using C++" things.

I think I'd probably just stick to C++, myself. But then, I also had a half-assed C++ engine up and running back in 2018, so maybe I'm not the best person to suggest that. It's certainly a more .. .. let's say, easy to break, language!

Honestly, it seems way more complicated trying to wrangle the source of Blitz to include a file than it would just to get C++ to do it, but then you'd have to rewrite everything else in C++, too.
I guess it depends on what Spinal's doing in C++.

Given he's already coded a ton of the MaxFPS stuff using Python, maybe that might be something to stick with, instead of using Blitz in the first place?

-=-=-
''Load, Next List!''
Mon, 08 May 2023, 02:45
Pakz
Could you just save strings of data as a filestream and load it as a image or other data file?
Mon, 08 May 2023, 04:48
Afr0
Yeah, except you should save them as binary data as that makes them faster to work with.
And you should save them as COMPRESSED binary data. To that end, here's a variation of LZ compression that I managed to get ChatGPT to wrangle from C++ into a Blitz++ hybrid. It obviously won't compile out of the box, but it should be close enough that you won't have too much trouble with it.



Here's the CRC table that it started converting:






The original CRC table:



-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!