Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 27, 2024, 11:15:48 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 199 200 [201] 202 203 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 738878 times)
Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #4000 on: April 02, 2013, 01:18:10 PM »

snip

I'm pretty sure I've done the same thing with no trouble. Maybe you need to save your PNGs in a non-paletted format (or vice versa if they're currently RGB)?

Hm, I wouldn't know (GraphicsGale doesn't have that option). When embedding it works ok, but loading it seems to clear the least significant bit on each color (bd_color = png_color & 0xfefefe). Visually it's hard to spot, but if 0x000000 and 0x000001 means something completly different for the map generation, you notice.

This was the image in question:


Code:
var loader:Loader = new Loader;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaderComplete);
loader.load(new URLRequest("level_skills.png"));
...

private function onLoaderComplete(event:Event):void
{
var bm:Bitmap = Bitmap(LoaderInfo(event.target).content);
...
}

And I'm not the only one with this issue:
(most relevant) http://designgard.com/topic/831768/loader-png-wrong-color-values-in-bitmapdata/
http://www.solveerrors.com/forums/flex-weird-behaviour-with-loader-load-and-png-131094.asp
http://forums.adobe.com/thread/506904
Logged

Working on HeliBrawl
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #4001 on: April 02, 2013, 01:44:50 PM »

This was the image in question:


That image does appear to be RGB, but it also has a PLTE chunk in it. I dunno if it would make a difference, but here's the image with everything except IHDR and IDAT removed:


If that loads correctly, you could run your PNGs through a tool like pngcrush to strip out extra headers and get Flash to behave itself better when loading. If it doesn't work...hmm, maybe store your data only in the high bits of each color component or something?
Logged

Belimoth
Level 10
*****


high-heeled cyberbully


View Profile
« Reply #4002 on: April 02, 2013, 01:49:18 PM »

Oh dang that pngcrush thing is nifty, I needed that a few months ago.
Logged

Martin 2BAM
Level 10
*****


@iam2bam


View Profile WWW
« Reply #4003 on: April 02, 2013, 01:50:23 PM »

Thanks man! I'll try it Smiley

If it doesn't work...hmm, maybe store your data only in the high bits of each color component or something?
Yeah, or I could trash it altogether and use a real map editor Cheesy
Logged

Working on HeliBrawl
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #4004 on: April 02, 2013, 02:50:40 PM »

It's a neat idea though if you can make it work. I think that is what Monaco is doing so that the preview image and the map data are in the same file
Logged

Think happy thoughts.
zacaj
Level 3
***


void main()


View Profile WWW
« Reply #4005 on: April 02, 2013, 02:54:30 PM »

It's a neat idea though if you can make it work. I think that is what Monaco is doing so that the preview image and the map data are in the same file
Unless it's changed from when he first implemented it, they just use the highest bit of 2 (4 bpp) pixels to store a byte.  (discussed w/ them at the time)
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #4006 on: April 02, 2013, 02:58:25 PM »

It's a neat idea though if you can make it work. I think that is what Monaco is doing so that the preview image and the map data are in the same file
Unless it's changed from when he first implemented it, they just use the highest bit of 2 (4 bpp) pixels to store a byte.  (discussed w/ them at the time)

That's what I meant (pretty much what ThemsAllTook suggested unless I read it wrong). I think it's the same now but I am not certain. If true it's a neat idea methinks  Smiley
Logged

Think happy thoughts.
zacaj
Level 3
***


void main()


View Profile WWW
« Reply #4007 on: April 02, 2013, 03:01:19 PM »

I wrote up a little command line utility that would hide any monochrome image in another using that method a while ago.  If I remember correctly World of Warcraft stores debug/user information encoded in screenshots like that so they can track you down via your screenshot if they see you doing something wrong
Logged

My twitter: @zacaj_

Quote from: mcc
Well let's just take a look at this "getting started" page and see--
Quote
Download and install cmake
Noooooooo
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #4008 on: April 02, 2013, 03:04:55 PM »

I wrote up a little command line utility that would hide any monochrome image in another using that method a while ago.  If I remember correctly World of Warcraft stores debug/user information encoded in screenshots like that so they can track you down via your screenshot if they see you doing something wrong

First part of post: that's cool, I have always been interested in steganography but have never really gotten around to writing any code to try it.

Second part of post: you are correct, I really wish you were not
Logged

Think happy thoughts.
Geti
Level 10
*****



View Profile WWW
« Reply #4009 on: April 02, 2013, 08:23:29 PM »

Have to implement DES for Uni, and have to do it in Java.
Java doesn't make this kind of programming particularly fun :/ I've ended up writing code that looks a lot like it would in C/++ anyway, just with more bullshit casting and wishing I had unsigned types.
Logged

rivon
Level 10
*****



View Profile
« Reply #4010 on: April 04, 2013, 12:37:59 PM »

Woah, didn't know Java doesn't have unsigned types :D

But still, you only need XOR so where's the problem?
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #4011 on: April 04, 2013, 04:18:15 PM »

Nowhere really, of course, it's all do-able Smiley All operations on bytes end up as ints though, so there's a lot of explicit casting.

Also required me to remember about the logical rather than signed shift (>>> vs >>) but obviously that was a 30 second "wtf?... oh" resolution (hence preferring to work on unsigned types for stuff like this and save the bullshit)
Logged

InfiniteStateMachine
Level 10
*****



View Profile
« Reply #4012 on: April 04, 2013, 05:50:04 PM »

Woah, didn't know Java doesn't have unsigned types :D

But still, you only need XOR so where's the problem?

I remember once doing some sort of image decoding where the values I was getting was unsigned but I couldnt store them because Java didn't have those types.

At the end I ended up doing bitwise manipulation but damn I still couldnt believe Java was missing the type.
Logged

Muz
Level 10
*****


View Profile
« Reply #4013 on: April 04, 2013, 08:20:39 PM »

Somewhere out there, there is a lecturer who is teaching a one hour class on how to change the color of the buttons in Android.
Logged
rosholger
Level 1
*



View Profile
« Reply #4014 on: April 05, 2013, 11:14:05 AM »

Somewhere out there, there is a lecturer who is teaching a one hour class on how to change the color of the buttons in Android.
dear god that must be boring
Logged
George Michaels
Level 0
***


I like big butts and I can not lie


View Profile
« Reply #4015 on: April 05, 2013, 02:44:45 PM »

dear god that must be boring
A couple of my mates are doing a uni course on game design & development. One of their classes is "Critical Thinking and Problem Solving" which can be summed up as "how to not be a dumbass about solving stupid peoples problems" or "how to kiss your boss's ass if something goes wrong." Plus they have a boring lecturer. He's so boring one of my friends can't even get distracted and draw things..
Logged

Yeah, that.
rosholger
Level 1
*



View Profile
« Reply #4016 on: April 05, 2013, 02:54:10 PM »

dear god that must be boring
A couple of my mates are doing a uni course on game design & development. One of their classes is "Critical Thinking and Problem Solving" which can be summed up as "how to not be a dumbass about solving stupid peoples problems" or "how to kiss your boss's ass if something goes wrong." Plus they have a boring lecturer. He's so boring one of my friends can't even get distracted and draw things..
hate when you have to go to a class and there is nothing important at all to learn. blah!
Logged
rivon
Level 10
*****



View Profile
« Reply #4017 on: April 05, 2013, 03:00:30 PM »

You have to go to the lectures? Here, we can just skip the lectures and learn the needed stuff from PDF slides for the exams :D
Logged
Eraser
Guest
« Reply #4018 on: April 05, 2013, 03:15:46 PM »

You have to go to the lectures? Here, we can just skip the lectures and learn the needed stuff from PDF slides for the exams :D
I've had a professor take attendance and drop people's final grade if they had a lot of absences.

Also one of my profs right now gives us quizzes every single day to make sure we come to class.  Screamy
Logged
rosholger
Level 1
*



View Profile
« Reply #4019 on: April 05, 2013, 03:33:03 PM »

You have to go to the lectures? Here, we can just skip the lectures and learn the needed stuff from PDF slides for the exams :D
i actually dont know since im going to the swedish equivalent of high school, and we have to go to classes at least to get our money

Edit: paged
Logged
Pages: 1 ... 199 200 [201] 202 203 ... 295
Print
Jump to:  

Theme orange-lt created by panic