stratagus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Stratagus-CVS] stratagus/src stratagus/script.c video/linedraw...


From: address@hidden
Subject: [Stratagus-CVS] stratagus/src stratagus/script.c video/linedraw...
Date: 24 Jan 2004 02:03:38 +1100

CVSROOT:        /home/strat
Module name:    stratagus
Changes by:      <address@hidden>       04/01/24 02:03:37

Modified files:
        src/stratagus  : script.c 
        src/video      : linedraw.c sprite.c 

Log message:
        Fixed circle drawing for magnant.

Patches:
Index: stratagus/src/stratagus/script.c
diff -u stratagus/src/stratagus/script.c:1.167 
stratagus/src/stratagus/script.c:1.168
--- stratagus/src/stratagus/script.c:1.167      Fri Jan 23 05:12:26 2004
+++ stratagus/src/stratagus/script.c    Sat Jan 24 02:03:36 2004
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: script.c,v 1.167 2004/01/22 18:12:26 nobody_ Exp $
+//      $Id: script.c,v 1.168 2004/01/23 15:03:36 nobody_ Exp $
 
 //@{
 
@@ -229,7 +229,8 @@
        }
        LibraryFileName(LuaToString(l, 1), buf);
        if (LuaLoadFile(buf) == -1) {
-               printf("Load failed: %s", LuaToString(l, 1));
+               lua_pushfstring(l, "Load failed: %s", LuaToString(l, 1));
+               lua_error(l);
        }
        return 0;
 }
@@ -1363,7 +1364,7 @@
        }
 
        fprintf(fd, "--- -----------------------------------------\n");
-       fprintf(fd, "--- $Id: script.c,v 1.167 2004/01/22 18:12:26 nobody_ Exp 
$\n");
+       fprintf(fd, "--- $Id: script.c,v 1.168 2004/01/23 15:03:36 nobody_ Exp 
$\n");
 
        fprintf(fd, "SetVideoResolution(%d, %d)\n", VideoWidth, VideoHeight);
 
@@ -1387,7 +1388,7 @@
        }
 
        fprintf(fd, "--- -----------------------------------------\n");
-       fprintf(fd, "--- $Id: script.c,v 1.167 2004/01/22 18:12:26 nobody_ Exp 
$\n");
+       fprintf(fd, "--- $Id: script.c,v 1.168 2004/01/23 15:03:36 nobody_ Exp 
$\n");
 
        // Global options
        if (OriginalFogOfWar) {
Index: stratagus/src/video/linedraw.c
diff -u stratagus/src/video/linedraw.c:1.70 stratagus/src/video/linedraw.c:1.71
--- stratagus/src/video/linedraw.c:1.70 Wed Jan 21 07:36:44 2004
+++ stratagus/src/video/linedraw.c      Sat Jan 24 02:03:36 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: linedraw.c,v 1.70 2004/01/20 20:36:44 nobody_ Exp $
+//      $Id: linedraw.c,v 1.71 2004/01/23 15:03:36 nobody_ Exp $
 
 //@{
 
@@ -853,8 +853,6 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
                                VideoDrawVLine(color, x + py + 1, y, px + 1);
@@ -862,6 +860,7 @@
                                VideoDrawVLine(color, x - py - 1, y, px + 1);
                                VideoDrawVLine(color, x - py - 1, y - px,  px);
                        }
+                       py -= 1;
                }
        }
 }
@@ -893,8 +892,6 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
                                VideoDrawTransVLine(color, x + py + 2, y, px + 
1, alpha);
@@ -902,6 +899,7 @@
                                VideoDrawTransVLine(color, x - py - 2, y, px + 
1, alpha);
                                VideoDrawTransVLine(color, x - py - 2, y - px,  
px, alpha);
                        }
+                       py -= 1;
                }
        }
 }
@@ -932,8 +930,6 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
                                VideoDrawVLineClip(color, x + py + 1, y, px + 
1);
@@ -941,6 +937,7 @@
                                VideoDrawVLineClip(color, x - py - 1, y, px + 
1);
                                VideoDrawVLineClip(color, x - py - 1, y - px,  
px);
                        }
+                       py -= 1;
                }
        }
 }
@@ -972,15 +969,14 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
-                               VideoDrawTransVLineClip(color, x + py + 2, y, 
px + 1, alpha);
-                               VideoDrawTransVLineClip(color, x + py + 2, y - 
px, px, alpha);
-                               VideoDrawTransVLineClip(color, x - py - 2, y, 
px + 1, alpha);
-                               VideoDrawTransVLineClip(color, x - py - 2, y - 
px,  px, alpha);
+                               VideoDrawTransVLineClip(color, x + py + 1, y, 
px + 1, alpha);
+                               VideoDrawTransVLineClip(color, x + py + 1, y - 
px, px, alpha);
+                               VideoDrawTransVLineClip(color, x - py - 1, y, 
px + 1, alpha);
+                               VideoDrawTransVLineClip(color, x - py - 1, y - 
px,  px, alpha);
                        }
+                       py -= 1;
                }
        }
 }
@@ -1768,15 +1764,14 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
-/*                             VideoDrawTransVLine(color, x + py + 1, y, px + 
1, alpha);
-                               VideoDrawTransVLine(color, x + py + 1, y - px, 
px, alpha);*/
+                               VideoDrawTransVLine(color, x + py + 1, y, px + 
1, alpha);
+                               VideoDrawTransVLine(color, x + py + 1, y - px, 
px, alpha);
                                VideoDrawTransVLine(color, x - py - 1, y, px + 
1, alpha);
                                VideoDrawTransVLine(color, x - py - 1, y - px,  
px, alpha);
                        }
+                       py -= 1;
                }
        }
 }
@@ -1805,15 +1800,14 @@
                        p += 2 * px + 3;
                } else {
                        p += 2 * (px - py) + 5;
-                       py -= 1;
-
                        // Fill up the left/right half of the circle
                        if (py >= px) {
-/*                             VideoDrawTransVLineClip(color, x + py + 1, y, 
px + 1, alpha);
-                               VideoDrawTransVLineClip(color, x + py + 1, y - 
px, px, alpha);*/
+                               VideoDrawTransVLineClip(color, x + py + 1, y, 
px + 1, alpha);
+                               VideoDrawTransVLineClip(color, x + py + 1, y - 
px, px, alpha);
                                VideoDrawTransVLineClip(color, x - py - 1, y, 
px + 1, alpha);
                                VideoDrawTransVLineClip(color, x - py - 1, y - 
px,  px, alpha);
                        }
+                       py -= 1;
                }
        }
 }
Index: stratagus/src/video/sprite.c
diff -u stratagus/src/video/sprite.c:1.67 stratagus/src/video/sprite.c:1.68
--- stratagus/src/video/sprite.c:1.67   Thu Jan 22 07:01:31 2004
+++ stratagus/src/video/sprite.c        Sat Jan 24 02:03:37 2004
@@ -27,7 +27,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//      $Id: sprite.c,v 1.67 2004/01/21 20:01:31 jsalmon3 Exp $
+//      $Id: sprite.c,v 1.68 2004/01/23 15:03:37 nobody_ Exp $
 
 //@{
 
@@ -509,7 +509,7 @@
 
        DebugCheck(width > graphic->Width || height > graphic->Height);
 
-       if (((graphic->Width / width) * width != graphic->Width) ||
+       if ((!width) || (!height) || ((graphic->Width / width) * width != 
graphic->Width) ||
                        ((graphic->Height / height) * height != 
graphic->Height)) {
                fprintf(stderr, "Invalid graphic (width, height) %s\n", name);
                fprintf(stderr, "Expected: (%d,%d)  Found: (%d,%d)\n",




reply via email to

[Prev in Thread] Current Thread [Next in Thread]