From OniGalore
(Redirected from PSpc)
Jump to: navigation, search
PNTA << Other file types >> PSpL
PSpc : Part Specification
switch to XML:PSpc page
Struct def for OUP
Overview @ Oni Stuff

Pspc all.gif

Offset Type Raw Hex Value Description
0x00 res_id 01 39 00 00 57 00057-level_3_part.PSpc
0x04 lev_id 01 00 00 06 3 level 3
0x08 int16 00 00 0 x-coordinate of top left corner of top left rectangle
... ... ... ... ...
0x4E int16 00 00 0 y-coordinate of bottom right corner of bottom right rectangle
0x50 link 01 38 00 00 0 link to 00056-h_03.TXMP
0x54 char[12] AD DE dead unused

For more info on nine-grid rendering, see HERE
What is stored
There are 9 rectangles stored in PSpc: 4 corners, 4 sides and one interior rectangle. Typically all 9 are used (to draw buttons for example) or only one is used (the top left corner, to draw checkboxes for example). There are cases where the top left corner and the interior rectangle are present which indicates that the code can choose what part to draw.
The reason for using 9 rectangles is to allow drawing of buttons (and anything else that has a border) in various sizes without distorting the image.
  • the corners are never rescaled
  • horizontal sides can be stretched horizontally
  • vertical sides can be stretched vertically
  • the interior can be stretched both ways
Of course that means that the sides and the interior must be "special" images that can be stretched without visible distortion.
How it is stored
Every 2 int16 fields make a texture coordinate. The former 9 texture coordinates (18 bytes) are the top left corners of the 9 rectangles. The latter 9 coordinates are the bottom right corners of the 9 rectangles. When both coordinates are 0 then the rectangle is not used. The order of the coordinates is top to bottom and left to right. The order of the 9 rectangles is: top left, top, top right, left, center, right, bottom left, bottom, bottom right.

PNTA << Other file types >> PSpL
PSpc : Part Specification
Message file