Ultimate Amiga

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: help! Graphic re-colouring!  (Read 6231 times)

0 Members and 1 Guest are viewing this topic.

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
help! Graphic re-colouring!
« on: May 01, 2014, 09:24:46 PM »

ok, so this post is aimed at the AMOS part of the forum, but those in the Bloodwych part will understand why!!

I have stumbled across an excellent bit of data from the game Bloodwych, and i need to reproduce the way it work in AMOS for my game editor. The problem is, i've neve approached graphics in the this way, and i have no idea how to achieve the effect i want!!

I think i need to do some clever stuff with bitplanes, so It may require the AMCAF commands, but i really dont know.

Let me explain the scenario....

We have various characters to make up for the minimum amount of graphics / data possible.

- Each one consists of 4 body parts:  Legs, Arms, Torso, Head.
- There is also a 5th "part" which shows the entire body from a distance.
- Each of these parts can be re-coloured separately and combined together to produce a complete character.

- The game uses a complete palette of 16.
- The background (colour 0) is black and colour 15 is usually reserved for copper effects.
- During the re-colouring, if colour 15 is referred to, it is transparent.

- Each part has been stored on an IFF file in a "raw" form, ready for recolouring
- The colours used which get re-coloured are colours $0,$4,$8,$C
- Each of these four can be recoloured as any of the ull 16 colour palette.


I would like to know what is the best way to approach this, and/or if anyone has already amde code which will do this! There are some clever looking bitplane commands and some palette commands in AMCAF, but i confess i dont really understand them. I also have no idea, using the bitplane method, how i go about getting the colours to actually change (i have used it only to copy 1 plane at a time it seems) OR how to reposition my output at a different point of the screen.

This code doesnt need to be as fast as the original (although that would be great as i might re-use it later) so any solution is welcome!!

I have attached a zip file containing a graphics file for testing and short AMOS program that simply rips the 'raw' graphics out into a bob bank.

Cheers!!

Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: help! Graphic re-colouring!
« Reply #1 on: May 03, 2014, 02:45:21 PM »

The easiest way to do it would be to use the P2C command from AMCAF to convert the image to chunky format.  Then you can renumber the entries at will and then use the C2P function to change it back.

Sent from my Prism II using Tapatalk

Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: help! Graphic re-colouring!
« Reply #2 on: May 04, 2014, 05:32:00 PM »

At the moment I am using a turbo point  ->turbo plot routine to "re draw" the image pixel by pixel but it's very slow as you can imagine.

I have looked through all the AMCAF commands but I can't find any chunky/planar commands at all?
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: help! Graphic re-colouring!
« Reply #3 on: May 05, 2014, 03:19:13 AM »

Look at the flame example.  It uses the C2P and P2C is similar.

The Turbo Draw commands in AMCAF should be safer than the F Draw commands in Turbo Plus.

Sent from my Prism II using Tapatalk

Logged

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: help! Graphic re-colouring!
« Reply #4 on: May 05, 2014, 03:21:44 AM »

Whoops I just read your post again and I see you aren't using Turbo Plus.  Sorry.

Sent from my Prism II using Tapatalk

Logged

Hungry Horace

  • Amorphous Blue-Blob Man
  • Site Admin
  • A4000T
  • ******
  • Karma: 307
  • Offline Offline
  • Gender: Male
  • Posts: 3,364
  • Don't forget... Ameboid's need love too!
    • AUW
Re: help! Graphic re-colouring!
« Reply #5 on: May 10, 2014, 08:06:58 AM »

I looked at the flame example and while very impressive it sadly means nothing to me without any context.

Is anyone able to provide a breakdown of how it works (re numbering individual pixels?) and how it would be implemented in this context.... The game I am trying to replicate is from 1991 and I can't image they use anything like that?
Logged
Quote from: KillerGorilla
because winuae is made of code and your amiga is made of stuff

SamuraiCrow

  • compile-time wierdo
  • Forum Mod
  • A1200
  • *****
  • Karma: 5
  • Offline Offline
  • Gender: Male
  • Posts: 946
  • Compile-time wierdo
Re: help! Graphic re-colouring!
« Reply #6 on: May 13, 2014, 06:50:05 AM »

There are two work banks in fire.amos which are the manual double-buffering.  The need for those is that you can Peek and Poke color numbers into the bytes using manual row-and-column manipulations.  In this case WX and WY are the window's maximum x and y coordinates.  There doesn't seem to be a planar to chunky batch conversion but at least "C2p Convert WORKBANKSTART, WIDTH, HEIGHT To SCREENNUMBER, X, Y" will batch convert the bank of pixel colors to planar screen pixels for you.

Given some additional thought, you'll have to create your own mask since 15 is the transparency key color instead of color 0.  The second-quickest way is to use custom minterms to logically OR the last 3 bitplanes together with the a copy of the first using the Blitter Copy command in a loop.  See the comments in the Mask Copy example for how to do this.

(The quickest way is to save the logical OR of the first 3 bitplanes in the mask with Blitter Copy, then or the 4th bitplane with the mask storing the result back in the mask with another Blitter Copy.  Just 2 blitter passes this way!  Unfortunately you have to use different minterms for each pass.)
Logged
Pages: [1]   Go Up
 

TinyPortal 2.2.2 © 2005-2022