{ unit for loading raw 320*200 picture data, no palette
  used for the bumpmap }
unit map;

interface
const maxpoints = 255;
      maxfaces = 127;

var point : array[0..maxpoints,1..3] of integer;
    face  : array[0..maxfaces,1..3] of word;

const vidseg = $a000;

var scrpos : word;
    x,y : word;

procedure loadPOV(filename:string);

implementation

procedure loadPOV(filename:string); { needs to be FAST! }
var fromf : text;
    buf : byte;
    bufStr : string;
    pstart : byte;
    intti : integer;
    ppos : word;
    fpos : word;
    loop : word;
    pasca : integer;

begin
  Assign(FromF, filename); { Open input file }
  Reset(FromF);  { Record size = 1 }
  ppos:=0;
  fpos:=0;
  repeat readln(FromF,bufstr) until pos('mesh {',bufstr)>0; { mesh begin }
  repeat
    readln(FromF,bufstr);
    if pos('<',bufstr)>0 then begin { point begin }
      pstart:=pos('<',bufstr)+1;
      for loop:=1 to 3 do begin
        val(bufstr[pstart],intti,pasca);
        point[ppos,1]:=intti;
      end;
    end;
  until EOF(FromF);
  close(fromf);
end;

end.