aliens

Author Topic: Graphic problems  (Read 6771 times)

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Graphic problems
« on: September 30, 2014, 08:10:51 pm »
Hi there,

I've been trying do some simple graphics work. To start with, I figured I'd update one of the mods I can't get to run on my Mac to use PNG instead of GIF. So, starting with SolariusScorch's Dart Rifle Mod, I converted the graphics to a spritesheet and PNG using Falco's tools and updated the ruleset. It doesn't crash on start anymore, but the graphics are wonky. I've tried converting it in Photoshop using the battlescape palette, converting it different times and ways using Falco's tools (fix palette, convert, etc), but I'm still getting noise when it renders. I know I'm missing something that must be fairly straight forward, but I'm not sure what else to try.

Environment:
Mac OS 10.9.5
OXC version: 1.0

Any help would be appreciated.

Thanks!

Offline Solarius Scorch

  • Global Moderator
  • Commander
  • *****
  • Posts: 11408
  • WE MUST DISSENT
    • View Profile
    • Nocturmal Productions modding studio website
Re: Graphic problems
« Reply #1 on: September 30, 2014, 09:22:09 pm »
Hmmm, tough question, if you say you've tried all this.

I can't speak about Macs, since I've never seen one from up close in my life, but I guess taking a sprite that you know works in the game and editing it in Photoshop by pasting in the new graphics should work.

O-T: apparently, there are much more Mac gamers than I estimated. Before Openxcom, I never thought they existed at all. :)

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Graphic problems
« Reply #2 on: September 30, 2014, 09:30:01 pm »
O-T: apparently, there are much more Mac gamers than I estimated. Before Openxcom, I never thought they existed at all. :)

There are a few of us. :)

I've created mods for OpenTTD with similar palette restrictions without any problems. I've read a few things about Mac specific graphic issues in OXC that makes me wonder if the steps I've taken don't match up for some specific reason. I posted the full mod in the first post to see if anyone else has similar issues. I think I can try it on Windows tonight, assuming the tiny humans infesting my house fall asleep at a decent time.

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Graphic problems
« Reply #3 on: October 01, 2014, 01:51:43 am »
your mod works fine on windows
i took a look at the bigobs images and they were fine
it seems its a macos issue
perhaps try saving as gif?

Offline NoelBuddy

  • Colonel
  • ****
  • Posts: 142
    • View Profile
Re: Graphic problems
« Reply #4 on: October 01, 2014, 01:55:22 am »
... I can't get to run on my Mac to use PNG instead of GIF...

Wait, gifs don't work on Mac?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Graphic problems
« Reply #5 on: October 01, 2014, 02:05:46 am »
it's a known issue with macos and sdl_image. SDL defers to the native OSX loading methods and some revisions give us different results than sdl would. as i recall, mac assumes there's no alpha channel even if one exists, and the data becomes garbled as a result. i'd recommend using the projectile or pathfinding preview arrow image metadata as a reference point for what's "correct".
« Last Edit: October 01, 2014, 02:38:30 am by Warboy1982 »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Graphic problems
« Reply #6 on: October 01, 2014, 02:29:56 am »
how would that explain that the ammo has a garbled weapon image as bigob in the screenshot?
could you try and test the 4 mods i made in the zip and say if one of them works?

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: Graphic problems
« Reply #7 on: October 01, 2014, 03:17:31 am »
simple: it's reading three bytes per pixel when there are four. the first pixel will be correct, then the second pixel will use the first pixel's alpha channel as its red channel, the red value will end up in the green channel, and so on. (this may not be 1000% accurate, but it illustrates the problem)

expected:

RGB, RGB, RGB, RGB

received:

RGB, ARG, BAR, GBA
« Last Edit: October 01, 2014, 03:21:53 am by Warboy1982 »

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Graphic problems
« Reply #8 on: October 01, 2014, 05:26:58 am »
how would that explain that the ammo has a garbled weapon image as bigob in the screenshot?
could you try and test the 4 mods i made in the zip and say if one of them works?

Harpoon-1 and Harpoon-2 are both the same result (see images below).
Harpoon-3 and Harpoon-4 both cause the game to crash on launch. Harpoon-3 likely because of the GIF images, not sure about Harpoon-4.
« Last Edit: October 01, 2014, 05:41:21 am by oftcrash »

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Graphic problems
« Reply #9 on: October 01, 2014, 06:00:13 am »
3 and 4 work for me perhaps replace the rulesets with these

Offline oftcrash

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Graphic problems
« Reply #10 on: October 01, 2014, 06:03:08 am »
Ok, I FINALLY got it working!

I had tried the full-green (00FF00 in RGB) color to replace the transparency before, but I missed the fact that photoshop wasn't properly putting it into the image. Once I unselected the transparent block from the palette in the index color conversion it showed up green and the conversion worked. (I'm not explaining it well at all, I know).