View previous topic :: View next topic |
Author |
Message |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Mon Mar 29, 2004 7:52 pm Post subject: update_palette utility |
|
|
i wrote this quite a while ago but couldn't post it before.
i haven't compiled it under dos, hopefully there is someone here who can.
this utility scans through an rpg file, updating graphics, palettes, and master-palette in-place to convert from an old master palette to a new one.
no libraries required, no os-isms.
dithering is implemented but disabled. why? it produces unsatisfactory results in a few cases, and often makes tiles look too rough. pass non-zero as the last parameter to mxs_and_til() to enable dithering.
color quantization is substantially superior to OHRRPGCE's in my tests. it is fairly small, possibly james could use the algorithm in OHRRPGCE.
testcase: converting snowy.rpg to the standard OHRRPGCE palette. most colors were preserved well, snow color was dulled to light grey.
it's like 'import new master palette', but more useful
EDIT: ugh, i have somehow acquired double line spacing. (?)
EDIT2: fixed cosmetic issues (indentation)
EDIT3: fixed minor issue that index #0 wasn't used in the remapping. this was because Allegro interprets it specially. OHRRPGCE doesn't.
EDIT4: fixed horrendous! bug that should have prevented it from working at all, but strangely only showed itself in fyre's binary. it would only run if input and output filenames were identical!! instead of the opposite, which is the only sensible behaviour for it: they must be different!
EDIT5: fixed silly typo. robustified.
EDIT6: De-inlined and uploaded here, with the assistance of Inferior Minion.
Last edited by NeoTA on Tue Sep 28, 2004 2:28 am; edited 7 times in total |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Tue Mar 30, 2004 2:05 am Post subject: |
|
|
Whoa, that is most awesome, a truly useful program.
However, could you please not post the entire source code for your program on a thread - instead, why not provide a link to it?
Code: | Try using the code tag.
No mucking around with fonts, and all the 8)'s don't get converted to smileys. Thats a really annoying one. |
_________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Tue Mar 30, 2004 7:34 pm Post subject: |
|
|
i don't have anywhere to upload it currently, so that is not an option. i have changed it to use the code tag. |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Tue Mar 30, 2004 7:58 pm Post subject: |
|
|
Give me a while, I'll have this compiled. _________________
 |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Tue Mar 30, 2004 9:06 pm Post subject: |
|
|
Compiled. Keep an eye on your inbox, James.
Neo, if you update the code again, just send me a PM/email and I'll recompile for you.
Edit: run without arguments gives the usual error, but I also threw in the last compile time to help me keep track of it. _________________
 |
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Wed Mar 31, 2004 5:45 am Post subject: |
|
|
i've emailed the code and readme.txt to you, james.
fyre: if you read this before my PM: there is a minor update that
usually improves the mapping of pure black. changes are in the
bestfit_color function. |
|
Back to top |
|
 |
RPGCreations E Pluribus Unum

Joined: 18 May 2003 Posts: 345
|
Posted: Thu Apr 01, 2004 10:06 pm Post subject: |
|
|
I recompiled it.
James, once again, keep an eye on your inbox. _________________
 |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Apr 03, 2004 1:52 pm Post subject: |
|
|
What was the problem with compiling? I just stuck it into my C compiler, and aside from some warnings it compiled fine... _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Sat Apr 03, 2004 4:32 pm Post subject: |
|
|
"what was the problem with compiling?"
nothing. i can compile it fine on linux. i can't compile it under dos because i don't have dos or windows installed. |
|
Back to top |
|
 |
TMC On the Verge of Insanity
Joined: 05 Apr 2003 Posts: 3240 Location: Matakana
|
Posted: Sat Apr 03, 2004 4:38 pm Post subject: |
|
|
Ah, ok, everything clear. _________________ "It is so great it is insanely great." |
|
Back to top |
|
 |
Bob the Hamster OHRRPGCE Developer

Joined: 22 Feb 2003 Posts: 2526 Location: Hamster Republic (Southern California Enclave)
|
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Sun Apr 04, 2004 6:34 am Post subject: |
|
|
thanks for the promotion. it reminds me that i actually do have programming ability, just that i must make a plan for longterm projects to get things done. all of my released software have only taken a few days to create. this MUST change. |
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Sun Apr 04, 2004 10:08 pm Post subject: |
|
|
just fixed a HUGE bug that ought to have completely prevented correct operation: instead of bailing out if input/output filenames are identical, it bails out if they are different. i don't know how that managed to still work in my compilation. |
|
Back to top |
|
 |
NeoTA Idiomatic Nomenclature

Joined: 15 Mar 2004 Posts: 165
|
Posted: Tue Apr 06, 2004 2:10 am Post subject: |
|
|
removed a 1character typo that was preventing compilation. robustified. |
|
Back to top |
|
 |
|