Basepalette (DEF): Difference between revisions

From EDukeWiki
Jump to navigation Jump to search
Fox (talk | contribs)
No edit summary
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Under construction}}
{{Under construction}}


'''basepalette''' <basepal> { [...] }
<span {{code}}>'''basepalette''' <basepal> { [...] }</span>


Loads a [[palette|base palette]] from a raw image file.
Loads a [[palette|base palette]] from a [[raw image file]].


The image file must NOT contain a 256 color table of its own. Each pixel from the image will be converted to a color in the base palette.
The image file must NOT contain a 256 color table of its own. Each pixel from the image will be converted to a color in the base palette.
Line 13: Line 13:
== Tokens ==
== Tokens ==


'''raw''' { [...] }
<span {{code}}>'''raw''' { [...] }</span>


Description.
DESCRIPTION


:: '''file''' <filename>
:: <span {{code}}>'''file''' <filename></span>


:: Description.
:: DESCRIPTION


:: '''offset''' <value>
:: <span {{code}}>'''offset''' <value></span>


:: Description.
:: DESCRIPTION


:: '''shiftleft''' <>
:: <span {{code}}>'''shiftleft''' <value></span>


:: Description.
:: DESCRIPTION


'''copy''' <palnum>
<span {{code}}>'''copy''' <basepal></span>


Description.
DESCRIPTION


'''undef''' <>
<span {{code}}>'''undef'''</span>


Description.
DESCRIPTION


== Examples ==
== Examples ==
Line 43: Line 43:
[[File:Duke3d basepal.png]]
[[File:Duke3d basepal.png]]


This example will load 3 base palettes in the same file:
This example will load them:


  basepalette 1 { raw { file "basepal.raw" } }
basepalette 0 { raw { file "basepal.raw" } }
  basepalette 2 { raw { file "basepal.raw" offset 768 } }
  basepalette 1 { raw { file "basepal.raw" offset 768 } }
  basepalette 3 { raw { file "basepal.raw" offset 1536 } }
  basepalette 2 { raw { file "basepal.raw" offset 1536 } }
  basepalette 3 { raw { file "basepal.raw" offset 2304 } }
basepalette 4 { raw { file "basepal.raw" offset 3072 } }
basepalette 5 { raw { file "basepal.raw" offset 3840 } }


[[Category:DEF commands]]
[[Category:DEF commands]]

Latest revision as of 10:59, 22 October 2021

This page is under construction.
Please help review and edit this page.

basepalette <basepal> { [...] }

Loads a base palette from a raw image file.

The image file must NOT contain a 256 color table of its own. Each pixel from the image will be converted to a color in the base palette.

A single image file may contain multiple base palettes, and offset can used to locate it.

Not to be confused with lookup palette. See also palette listing.

Tokens

raw { [...] }

DESCRIPTION

file <filename>
DESCRIPTION
offset <value>
DESCRIPTION
shiftleft <value>
DESCRIPTION

copy <basepal>

DESCRIPTION

undef

DESCRIPTION

Examples

The following PNG image contains all base palettes in Duke Nukem 3D v1.5:

This example will load them:

basepalette 0 { raw { file "basepal.raw" } }
basepalette 1 { raw { file "basepal.raw" offset 768 } }
basepalette 2 { raw { file "basepal.raw" offset 1536 } }
basepalette 3 { raw { file "basepal.raw" offset 2304 } }
basepalette 4 { raw { file "basepal.raw" offset 3072 } }
basepalette 5 { raw { file "basepal.raw" offset 3840 } }