28 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface); |
28 procedure DrawSprite (Sprite: TSprite; X, Y, Frame: LongInt; Surface: PSDL_Surface); |
29 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface); |
29 procedure DrawSprite2(Sprite: TSprite; X, Y, FrameX, FrameY: LongInt; Surface: PSDL_Surface); |
30 procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture; Surface: PSDL_Surface); |
30 procedure DrawSurfSprite(X, Y, Height, Frame: LongInt; Source: PTexture; Surface: PSDL_Surface); |
31 procedure DrawLand (X, Y: LongInt); |
31 procedure DrawLand (X, Y: LongInt); |
32 procedure DrawTexture(X, Y: LongInt; Texture: PTexture); |
32 procedure DrawTexture(X, Y: LongInt; Texture: PTexture); |
33 procedure DrawRotated(Sprite: TSprite; X, Y: LongInt; Angle: real); |
33 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); |
34 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); |
34 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); |
35 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y: LongInt; Angle: real); |
35 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); |
36 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface); |
36 procedure DXOutText(X, Y: LongInt; Font: THWFont; s: string; Surface: PSDL_Surface); |
37 procedure DrawCentered(X, Top: LongInt; Source: PTexture); |
37 procedure DrawCentered(X, Top: LongInt; Source: PTexture); |
38 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture; DestSurface: PSDL_Surface); |
38 procedure DrawFromRect(X, Y: LongInt; r: PSDL_Rect; SourceTexture: PTexture; DestSurface: PSDL_Surface); |
39 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real); |
39 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real); |
40 function RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture; |
40 function RenderStringTex(s: string; Color: Longword; font: THWFont): PTexture; |
356 glVertex2i(X, Texture^.h + Y); |
356 glVertex2i(X, Texture^.h + Y); |
357 |
357 |
358 glEnd() |
358 glEnd() |
359 end; |
359 end; |
360 |
360 |
361 procedure DrawRotated(Sprite: TSprite; X, Y: LongInt; Angle: real); |
361 procedure DrawRotated(Sprite: TSprite; X, Y, Dir: LongInt; Angle: real); |
362 begin |
362 begin |
363 DrawRotatedTex(SpritesData[Sprite].Texture, |
363 DrawRotatedTex(SpritesData[Sprite].Texture, |
364 SpritesData[Sprite].Width, |
364 SpritesData[Sprite].Width, |
365 SpritesData[Sprite].Height, |
365 SpritesData[Sprite].Height, |
366 X, Y, Angle) |
366 X, Y, Dir, Angle) |
367 end; |
367 end; |
368 |
368 |
369 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); |
369 procedure DrawRotatedF(Sprite: TSprite; X, Y, Frame: LongInt; Angle: real); |
370 begin |
370 begin |
371 glPushMatrix; |
371 glPushMatrix; |
375 DrawSprite(Sprite, -SpritesData[Sprite].Width div 2, -SpritesData[Sprite].Width div 2, Frame, nil); |
375 DrawSprite(Sprite, -SpritesData[Sprite].Width div 2, -SpritesData[Sprite].Width div 2, Frame, nil); |
376 |
376 |
377 glPopMatrix |
377 glPopMatrix |
378 end; |
378 end; |
379 |
379 |
380 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y: LongInt; Angle: real); |
380 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real); |
381 begin |
381 begin |
382 glPushMatrix; |
382 glPushMatrix; |
383 glTranslatef(X, Y, 0); |
383 glTranslatef(X, Y, 0); |
384 glRotatef(Angle, 0, 0, 1); |
384 |
|
385 if Dir < 0 then |
|
386 begin |
|
387 hw:= - hw; |
|
388 glRotatef(Angle, 0, 0, -1); |
|
389 end else |
|
390 glRotatef(Angle, 0, 0, 1); |
|
391 |
385 |
392 |
386 glBindTexture(GL_TEXTURE_2D, Tex^.id); |
393 glBindTexture(GL_TEXTURE_2D, Tex^.id); |
387 |
394 |
388 glBegin(GL_QUADS); |
395 glBegin(GL_QUADS); |
389 |
396 |