Delphi & Pascal (česká wiki)
Přejít na: navigace, hledání
Procedure WriteSymbol(x,y:Word; Symbol:Byte; Color:Boolean; Up,Down:Byte;BufferTo:Word);
Var A,B: Word;
Begin
  Case Symbol of
    1: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,0,A,31,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,0,A,31,B,Buffer[2],BufferTo);
                            End;
       End;
    2: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,32,A,63,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,32,A,63,B,Buffer[2],BufferTo);
                            End;
       End;
    3: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,64,A,95,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,64,A,95,B,Buffer[2],BufferTo);
                            End;
       End;
    4: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,96,A,127,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,96,A,127,B,Buffer[2],BufferTo);
                            End;
       End;
    5: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,128,A,159,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,128,A,159,B,Buffer[2],BufferTo);
                            End;
       End;
    6: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,160,A,191,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,160,A,191,B,Buffer[2],BufferTo);
                            End;
       End;
    7: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,192,A,223,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,192,A,223,B,Buffer[2],BufferTo);
                            End;
       End;
    8: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,224,A,255,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,224,A,255,B,Buffer[2],BufferTo);
                            End;
       End;
    9: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,256,A,287,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,256,A,287,B,Buffer[2],BufferTo);
                            End;
       End;
    0: Begin
         If Color=True then Begin
                              A:=24+Up;
                              B:=47-Down;
                              If B>A then
                              WriteBlok(x,y,288,A,319,B,Buffer[2],BufferTo)
                            End
                       else Begin
                              A:=0+Up;
                              B:=23-Down;
                              If B>A then
                              WriteBlok(x,y,288,A,319,B,Buffer[2],BufferTo);
                            End;
       End;
  End; {Case End}
End;
 
 
Procedure KresliValce2;
Begin
  HideMouse;
  WriteSymbol(108,54,Valec[0].Symbol[0],False,24-Valec[0].Scroll,0,Buffer[4]);
  WriteSymbol(108,54+Valec[0].Scroll,Valec[0].Symbol[1],False,0,0,Buffer[4]);
  WriteSymbol(108,54+Valec[0].Scroll+24,Valec[0].Symbol[2],False,0,0,Buffer[4]);
  WriteSymbol(108,54+Valec[0].Scroll+48,Valec[0].Symbol[3],False,0,Valec[0].Scroll,Buffer[4]);
 
  WriteSymbol(144,54,Valec[1].Symbol[0],False,24-Valec[1].Scroll,0,Buffer[4]);
  WriteSymbol(144,54+Valec[1].Scroll,Valec[1].Symbol[1],False,0,0,Buffer[4]);
  WriteSymbol(144,54+Valec[1].Scroll+24,Valec[1].Symbol[2],False,0,0,Buffer[4]);
  WriteSymbol(144,54+Valec[1].Scroll+48,Valec[1].Symbol[3],False,0,Valec[1].Scroll,Buffer[4]);
 
  WriteSymbol(180,54,Valec[2].Symbol[0],False,24-Valec[2].Scroll,0,Buffer[4]);
  WriteSymbol(180,54+Valec[2].Scroll,Valec[2].Symbol[1],False,0,0,Buffer[4]);
  WriteSymbol(180,54+Valec[2].Scroll+24,Valec[2].Symbol[2],False,0,0,Buffer[4]);
  WriteSymbol(180,54+Valec[2].Scroll+48,Valec[2].Symbol[3],False,0,Valec[2].Scroll,Buffer[4]);
  ShowMouse;
End;
 
 
Procedure KresliValce;
Begin
  WriteSymbol(108,54,Valec[0].Symbol[0],False,24-Valec[0].Scroll,0,Buffer[3]);
  WriteSymbol(108,54+Valec[0].Scroll,Valec[0].Symbol[1],False,0,0,Buffer[3]);
  WriteSymbol(108,54+Valec[0].Scroll+24,Valec[0].Symbol[2],False,0,0,Buffer[3]);
  WriteSymbol(108,54+Valec[0].Scroll+48,Valec[0].Symbol[3],False,0,Valec[0].Scroll,Buffer[3]);
 
  WriteSymbol(144,54,Valec[1].Symbol[0],False,24-Valec[1].Scroll,0,Buffer[3]);
  WriteSymbol(144,54+Valec[1].Scroll,Valec[1].Symbol[1],False,0,0,Buffer[3]);
  WriteSymbol(144,54+Valec[1].Scroll+24,Valec[1].Symbol[2],False,0,0,Buffer[3]);
  WriteSymbol(144,54+Valec[1].Scroll+48,Valec[1].Symbol[3],False,0,Valec[1].Scroll,Buffer[3]);
 
  WriteSymbol(180,54,Valec[2].Symbol[0],False,24-Valec[2].Scroll,0,Buffer[3]);
  WriteSymbol(180,54+Valec[2].Scroll,Valec[2].Symbol[1],False,0,0,Buffer[3]);
  WriteSymbol(180,54+Valec[2].Scroll+24,Valec[2].Symbol[2],False,0,0,Buffer[3]);
  WriteSymbol(180,54+Valec[2].Scroll+48,Valec[2].Symbol[3],False,0,Valec[2].Scroll,Buffer[3]);
End;