From: Michael H. <mh...@us...> - 2000-10-21 12:30:02
|
Update of /cvsroot/pythianproject/PythianProject/Source/Units In directory slayer.i.sourceforge.net:/tmp/cvs-serv13585 Modified Files: glfd.pas Log Message: added code to glf lib -mike Index: glfd.pas =================================================================== RCS file: /cvsroot/pythianproject/PythianProject/Source/Units/glfd.pas,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** glfd.pas 2000/10/17 06:05:28 1.3 --- glfd.pas 2000/10/21 12:29:58 1.4 *************** *** 22,26 **** Translation to Delphi: - Kamil Krauspe (main guy) ! - Michael Hearn (minor changes) - Darryl Long (teeny little changes) --- 22,26 ---- Translation to Delphi: - Kamil Krauspe (main guy) ! - Michael Hearn (minor changes), added console commands + console bug fixes - Darryl Long (teeny little changes) *************** *** 117,120 **** --- 117,123 ---- procedure glfSetCursorBlinkRate(Rate: Integer); + // @@added mike - 20th October 2000 + procedure glfConsoleBackspace(c:integer); + implementation *************** *** 222,225 **** --- 225,229 ---- glfSetSpaceSize(2.0); glfSetSymbolDepth(0.2); + glfSetConsoleParam(40, 20); glfConsoleClear; *************** *** 1028,1032 **** procedure glfPrint(const s: string; lenght: Integer); var ! i{, e}: Integer; begin for i := 1 to lenght do --- 1032,1037 ---- procedure glfPrint(const s: string; lenght: Integer); var ! i,c{, e}: Integer; ! str2:string; begin for i := 1 to lenght do *************** *** 1048,1053 **** if cony >= conHeight then begin //* Shift all console contents up */ ! Move(conData[conWidth], conData, conWidth * (conHeight - 1)); //* Fill bottom line by spaces */ FillChar(conData[conWidth * (conHeight - 1)], conWidth, 0); --- 1053,1060 ---- if cony >= conHeight then begin + // @@mike - modified here to fix bug //* Shift all console contents up */ ! conData := Copy(conData,conWidth,conWidth* (conHeight-1)); ! SetLength(conData,conWidth*conHeight); //* Fill bottom line by spaces */ FillChar(conData[conWidth * (conHeight - 1)], conWidth, 0); *************** *** 1110,1113 **** --- 1117,1132 ---- conCursorCount := Rate; conCursorMode := GLF_YES; + end; + end; + + procedure glfConsoleBackspace(c:integer); + var a:integer; + begin + // just replace the character at the current location with a space, + // then move back a character. do this once for each c + for a := 1 to c do + begin + conData[cony * conWidth + (conx-1)] := #0; + if conx > 0 then dec(conX); end; end; |