Differences
This shows you the differences between two versions of the page.
|
demos:glass_in_pascal [2010/06/08 08:48] 127.0.0.1 external edit |
demos:glass_in_pascal [2010/06/09 20:49] (current) steve |
||
|---|---|---|---|
| Line 15: | Line 15: | ||
| brick, ctypes; | brick, ctypes; | ||
| - | { some useful constants } | ||
| const | const | ||
| + | { screen width and height } | ||
| SCREEN_W = 256; | SCREEN_W = 256; | ||
| SCREEN_H = 180; | SCREEN_H = 180; | ||
| + | { displacement map dimensions, used in the stained glass panel } | ||
| DISPL_W = 80; | DISPL_W = 80; | ||
| DISPL_H = 100; | DISPL_H = 100; | ||
| - | |||
| Line 28: | Line 28: | ||
| i, j, k : integer; | i, j, k : integer; | ||
| - | { our active layer } | + | { our graphics layer } |
| layer : integer; | layer : integer; | ||
| - | { the sprite variables - stained glass and bear } | + | { the sprite variables - a stained glass panel and a bear } |
| - | sg, bear : Pbr_sprite; | + | panel, bear : Pbr_sprite; |
| { a color key for the bear sprite } | { a color key for the bear sprite } | ||
| key : Tbr_color; | key : Tbr_color; | ||
| - | { a buffer to hold the pixel displacement data for the pane of glass } | + | { a buffer to hold the pixel displacement data for the stained glass panel } |
| displ : array[1..DISPL_W, 1..DISPL_H, 1..2] of cshort; | displ : array[1..DISPL_W, 1..DISPL_H, 1..2] of cshort; | ||
| Line 67: | Line 67: | ||
| - | { Next, we'll load the pane of glass. } | + | { Next, we'll load the stained glass. } |
| - | sg := SpriteCreate; | + | panel := SpriteCreate; |
| - | SpriteAddFrame(sg, FrameConvert(FrameFromDisk('window.png', Nil), FRAME_LT, Nil)); | + | SpriteAddFrame(panel, FrameConvert(FrameFromDisk('window.png', Nil), FRAME_LT, Nil)); |
| - | SpriteAddSubframe(sg, 0, FrameCreate(FRAME_DISPL, DISPL_W, DISPL_H, @displ, Nil)); | + | SpriteAddSubframe(panel, 0, FrameCreate(FRAME_DISPL, DISPL_W, DISPL_H, @displ, Nil)); |
| - | { Position the pane of glass sprite and add it to the list. } | + | { Position the stained glass panel and add it to the sprite list. } |
| - | SpriteSetPosition(sg, 100, 20); | + | SpriteSetPosition(panel, 100, 20); |
| - | SpriteSetZHint(sg, 10); | + | SpriteSetZHint(panel, 10); |
| - | ListAdd(LayerGetSpriteList(layer), sg); | + | ListAdd(LayerGetSpriteList(layer), panel); |