Castle Paradox Forum Index Castle Paradox

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 Gamelist   Review List   Song List   All Journals   Site Stats   Search Gamelist   IRC Chat Room

update_palette utility
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Arcade
View previous topic :: View next topic  
Author Message
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Mon Mar 29, 2004 7:52 pm    Post subject: update_palette utility Reply with quote

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 Happy

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
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Tue Mar 30, 2004 2:05 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Tue Mar 30, 2004 7:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
RPGCreations
E Pluribus Unum




Joined: 18 May 2003
Posts: 345

PostPosted: Tue Mar 30, 2004 7:58 pm    Post subject: Reply with quote

Give me a while, I'll have this compiled.
_________________
Back to top
View user's profile Send private message
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Tue Mar 30, 2004 8:38 pm    Post subject: Wow Reply with quote

How very, very cool!
I would be happy to host both source and binaries at http://HamsterRepublic.com/ohrrpgce/thirdparty/

Just package them as you see fit and mail them to me
Back to top
View user's profile Send private message Send e-mail Visit poster's website
RPGCreations
E Pluribus Unum




Joined: 18 May 2003
Posts: 345

PostPosted: Tue Mar 30, 2004 9:06 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Wed Mar 31, 2004 5:45 am    Post subject: Reply with quote

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
View user's profile Send private message
RPGCreations
E Pluribus Unum




Joined: 18 May 2003
Posts: 345

PostPosted: Thu Apr 01, 2004 10:06 pm    Post subject: Reply with quote

I recompiled it.

James, once again, keep an eye on your inbox.
_________________
Back to top
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Apr 03, 2004 1:52 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Sat Apr 03, 2004 4:32 pm    Post subject: Reply with quote

"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
View user's profile Send private message
TMC
On the Verge of Insanity




Joined: 05 Apr 2003
Posts: 3240
Location: Matakana

PostPosted: Sat Apr 03, 2004 4:38 pm    Post subject: Reply with quote

Ah, ok, everything clear.
_________________
"It is so great it is insanely great."
Back to top
View user's profile Send private message Send e-mail
Bob the Hamster
OHRRPGCE Developer




Joined: 22 Feb 2003
Posts: 2526
Location: Hamster Republic (Southern California Enclave)

PostPosted: Sat Apr 03, 2004 11:42 pm    Post subject: uploaded Reply with quote

Okay! It is now available at http://hamsterrepublic.com/ohrrpgce/thirdparty/chgpal.zip

Thanks, Neo! You rock.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Sun Apr 04, 2004 6:34 am    Post subject: Reply with quote

Happy

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
View user's profile Send private message
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Sun Apr 04, 2004 10:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
NeoTA
Idiomatic Nomenclature




Joined: 15 Mar 2004
Posts: 165

PostPosted: Tue Apr 06, 2004 2:10 am    Post subject: Reply with quote

removed a 1character typo that was preventing compilation. robustified.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Castle Paradox Forum Index -> The Arcade All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group