last fixes
authorhackbard <hackbard>
Thu, 4 Nov 2004 16:43:50 +0000 (16:43 +0000)
committerhackbard <hackbard>
Thu, 4 Nov 2004 16:43:50 +0000 (16:43 +0000)
display/display.c
display/display.h
input/input.h

index bb9d707..b7612d6 100644 (file)
@@ -124,9 +124,10 @@ int display_line(t_display *display,int X,int Y,int X_,int Y_,char sym) {
 
   m=(Y_-Y)/(X_-X);
 
-  for(y=0;y<display->max_y;y++)
-    for(x=0;x<display->max_x;x++)
-      if((int)((x-X)*m+Y)==y) *(display->screen+y*display->max_x+x)=sym;
+  for(x=X;x<=X_;x++) {
+    y=(x-X)*m+Y;
+    *(display->screen+y*display->max_x+x)=sym;
+  }
 
   return D_SUCCESS;
 }
index dfc8195..d8bd546 100644 (file)
@@ -1,6 +1,7 @@
 /* display.h -- display headers */
 
 /* includes */
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index d7ceb4a..c464354 100644 (file)
@@ -4,6 +4,7 @@
 #define INPUT_H
 
 /* includes */
+#define _GNU_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -26,6 +27,7 @@
 
 /* input specific variables */
 typedef struct s_input {
+  int outfd;
   char *content;
   int c_count;
   unsigned char mode;