Source file: /~heha/ewa/Kram/Solarpaneel.zip/C-Programm/graphics.c

/*
Projekt: Photovoltaik-Präsentation "solar" mit MSP430
Detail: BorlandC-ähnliche Kopfdatei für Vollgrafikfunktionen

070522	erstellt (unausgegoren!)
*/
#include "solar.h"

void lineto(int x, int y){
 GrafInternalLine(GrafDC.pos.x,GrafDC.pos.y,x,y);
 moveto(x,y);
}

//=== Begrenzung für ein Polygon zeichnen ===
// Siehe BC3.1 DOS graphics.h
void drawpoly(int numpt, const struct pointtype*pt) {
 const POINT *p0=pt, *pn;
 if (numpt<=0) return;	// darf nicht sein
 do{
  pn=p0;
  if (numpt!=1) pn=pt+1;	// nächster Punkt
  GrafInternalLine(pt->x,pt->y,pn->x,pn->y);
  pt=pn;
 }while(--numpt);
}

void fillpoly(int numpt, const struct pointtype*pt) {
 fillpolypoly(1,&numpt,pt);
}

/************************************************************************
 * Rechteck mit Füllmuster füllen, ohne Rand
 ************************************************************************/
void bar(int left, int top, int right, int bottom){
 while (top<bottom){
  OutScanline(left,right,top,GrafDC.pattern[top&7],NULL);
  top++;
 }
}

// Siehe BC3.1 DOS graphics.h
void rectangle(int left, int top, int right, int bottom){
 TPoint points[5]={
  {left,top},
  {right,top},
  {right,bottom},
  {left,bottom},
  {left,top}};
 GrafPolyline(points,5);
}

void cleardevice(void) {
 DispDataFill(GrafDC.ba,0,TEXT_X*GRAF_Y);
}

Detected encoding: UTF-80