home *** CD-ROM | disk | FTP | other *** search
/ CD-X 1 / cdx_01.iso / demodisc / basq / source / texture / texture.doc < prev    next >
Encoding:
Text File  |  1993-10-18  |  2.0 KB  |  65 lines

  1. Full screen texturing:
  2. It runs full screen (320x200) at 70 frames/second on a 486DX-66 Local Bus or
  3. even larger areas.
  4. It runs at about half screen (200x120 or so) on a 486DX-33 without Local Bus
  5. or at 35 frames/second full screen.
  6. (and looks alot better than in 2nd Reality =)
  7. BTW, this was coded quite a time before that; but couldn't be released
  8. earlier due to upload problems (fuck the sysops!)
  9.  
  10.                                        coded by »The Faker« / AARDVARK
  11.  
  12. Feel free to use this in your productions - Feel free to credit me  =)
  13.  
  14. Notes: This is the same routine as in TEXTURE.PAS except that the 'db 66h'
  15. (386er opcodes) are replaced. That may be also useful for ASM-only programmers.
  16.  
  17. PROCEDURE PutTexture(IncX,IncY:Integer; P:Pointer);
  18. VAR
  19.    Y,PosX,PosY,PX,PY:Integer;
  20. BEGIN
  21.      PosX:=-(ScreenX SHR 1)*IncX;   { ScreenX,-Y are size of screen; PosX,-Y }
  22.      PosY:=-(ScreenY SHR 1)*IncY;   { are set so rotation is around middle }
  23.      FOR Y:=0 TO ScreenY-1 DO
  24.      BEGIN
  25.           PX:=PosX;   { PosX,-Y is updated every line, PX,-Y taken from those }
  26.           PY:=PosY;
  27.           ASM
  28.              push ds
  29.              mov ax,0a000h
  30.              mov es,ax
  31.              mov ax,y
  32.              xchg al,ah
  33.              mov di,ax
  34.              shr di,2
  35.              add di,ax
  36.              lds si,p   { in P there should be a 256x256 bitmap }
  37.              mov cx,screenx shr 1
  38.              cld
  39.              mov ax,incx
  40.              shl eax,16
  41.              mov ax,incy
  42.              mov esi,eax
  43.              mov dx,px
  44.              shl edx,16
  45.              mov dx,py
  46. @1:          add edx,esi
  47.              mov ebx,edx
  48.              shr ebx,16
  49.              mov bl,dh
  50.              mov al,[bx]
  51.              add edx,esi
  52.              mov ebx,edx
  53.              shr ebx,16
  54.              mov bl,dh
  55.              mov ah,[bx]
  56.              stosw
  57.              dec cx
  58.              jnz @1
  59.              pop ds
  60.           END;
  61.           Inc(PosX,IncY);
  62.           Inc(PosY,-IncX);
  63.      END;
  64. END;
  65.