stratagus-cvs
[Top][All Lists]
Advanced

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

[Stratagus-CVS] stratagus/src unit/ccl_unittype.c unit/unittype...


From: Crestez Leonard
Subject: [Stratagus-CVS] stratagus/src unit/ccl_unittype.c unit/unittype...
Date: Thu, 18 Sep 2003 13:59:02 -0400

CVSROOT:        /cvsroot/stratagus
Module name:    stratagus
Branch:         
Changes by:     Crestez Leonard <address@hidden>        03/09/18 13:59:01

Modified files:
        src/unit       : ccl_unittype.c unittype.c 
        src/video      : cursor.c font.c 

Log message:
        Somehow cvs failed, sorry, here is the rest.

Patches:
Index: stratagus/src/unit/ccl_unittype.c
diff -u stratagus/src/unit/ccl_unittype.c:1.83 
stratagus/src/unit/ccl_unittype.c:1.84
--- stratagus/src/unit/ccl_unittype.c:1.83      Fri Sep 12 13:44:38 2003
+++ stratagus/src/unit/ccl_unittype.c   Thu Sep 18 13:59:01 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: ccl_unittype.c,v 1.83 2003/09/12 17:44:38 n0body Exp $
+//     $Id: ccl_unittype.c,v 1.84 2003/09/18 17:59:01 n0body Exp $
 
 //@{
 
@@ -431,6 +431,8 @@
        } else if( gh_eq_p(value,gh_symbol2scm("clicks-to-explode")) ) {
            type->ClicksToExplode=gh_scm2int(gh_car(list));
            list=gh_cdr(list);
+       } else if( gh_eq_p(value,gh_symbol2scm("sniper")) ) {
+           type->Sniper=1;
        } else if( gh_eq_p(value,gh_symbol2scm("permanent-cloak")) ) {
            type->PermanentCloak=1;
        } else if( gh_eq_p(value,gh_symbol2scm("detect-cloak")) ) {
Index: stratagus/src/unit/unittype.c
diff -u stratagus/src/unit/unittype.c:1.96 stratagus/src/unit/unittype.c:1.97
--- stratagus/src/unit/unittype.c:1.96  Fri Sep 12 13:44:38 2003
+++ stratagus/src/unit/unittype.c       Thu Sep 18 13:59:01 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: unittype.c,v 1.96 2003/09/12 17:44:38 n0body Exp $
+//     $Id: unittype.c,v 1.97 2003/09/18 17:59:01 n0body Exp $
 
 //@{
 
@@ -900,6 +900,9 @@
     if( type->ClicksToExplode ) {
        CLprintf(file,"  'clicks-to-explode %d\n",type->ClicksToExplode);
     }
+    if( type->Sniper ) {
+       CLprintf(file,"  'sniper \n");
+    }
     if( type->Revealer ) {
        CLprintf(file,"  'revealer\n");
     }
@@ -1096,7 +1099,7 @@
     char **sp;
 
     CLprintf(file,"\n;;; -----------------------------------------\n");
-    CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.96 2003/09/12 
17:44:38 n0body Exp $\n\n");
+    CLprintf(file,";;; MODULE: unittypes $Id: unittype.c,v 1.97 2003/09/18 
17:59:01 n0body Exp $\n\n");
 
     // Original number to internal unit-type name.
 
@@ -1342,6 +1345,10 @@
        //      Lookup icons.
        //
        type->Icon.Icon=IconByIdent(type->Icon.Name);
+       if (!type->Icon.Icon) {
+           printf("Can't find icon %s\n",type->Icon.Name);
+           ExitFatal(-1);
+       }
        //
        //      Lookup missiles.
        //
Index: stratagus/src/video/cursor.c
diff -u stratagus/src/video/cursor.c:1.66 stratagus/src/video/cursor.c:1.67
--- stratagus/src/video/cursor.c:1.66   Wed Sep 17 05:59:05 2003
+++ stratagus/src/video/cursor.c        Thu Sep 18 13:59:01 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: cursor.c,v 1.66 2003/09/17 09:59:05 mr-russ Exp $
+//     $Id: cursor.c,v 1.67 2003/09/18 17:59:01 n0body Exp $
 
 //@{
 
@@ -653,6 +653,7 @@
     int spritex;
     int spritey;
 
+    DebugCheck(!type);
     //
     // Save cursor position and size, for faster cursor redraw.
     //
@@ -1120,7 +1121,7 @@
     int i;
 
     CLprintf(file,"\n;;; -----------------------------------------\n");
-    CLprintf(file,";;; MODULE: cursors $Id: cursor.c,v 1.66 2003/09/17 
09:59:05 mr-russ Exp $\n\n");
+    CLprintf(file,";;; MODULE: cursors $Id: cursor.c,v 1.67 2003/09/18 
17:59:01 n0body Exp $\n\n");
 
     for( i=0; Cursors[i].OType; ++i ) {
        CLprintf(file,"(define-cursor '%s '%s\n",
Index: stratagus/src/video/font.c
diff -u stratagus/src/video/font.c:1.53 stratagus/src/video/font.c:1.54
--- stratagus/src/video/font.c:1.53     Tue Jul 22 10:32:22 2003
+++ stratagus/src/video/font.c  Thu Sep 18 13:59:01 2003
@@ -26,7 +26,7 @@
 //      Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 //      02111-1307, USA.
 //
-//     $Id: font.c,v 1.53 2003/07/22 14:32:22 n0body Exp $
+//     $Id: font.c,v 1.54 2003/09/18 17:59:01 n0body Exp $
 
 //@{
 
@@ -152,31 +152,31 @@
     dp=VideoMemory8+x+y*VideoWidth-1;
     da=VideoWidth-w;
     --w;
+    
+#define UNROLL \
+    ++dp; \
+    p=*++sp; \
+    if (p!=255) { \
+       if( p<NumFontColors ) { \
+           *dp=FontPixels8[p]; \
+       } else { \
+           *dp=((VMemType8*)sprite->Pixels)[p]; \
+       } \
+    }
 
     while( sp<gp ) {
        lp=sp+w;
        while( sp<lp ) {                // loop with unroll
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels8[p];
-           }
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels8[p];
-           }
+           UNROLL;
+           UNROLL;
        }
        if( sp<=lp ) {
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels8[p];
-           }
+           UNROLL;
        }
        sp+=sa;
        dp+=da;
     }
+#undef UNROLL
 }
 
 /**
@@ -208,30 +208,30 @@
     da=VideoWidth-w;
     --w;
 
+#define UNROLL \
+    ++dp; \
+    p=*++sp; \
+    if (p!=255) { \
+       if( p<NumFontColors ) { \
+           *dp=FontPixels16[p]; \
+       } else { \
+           *dp=((VMemType16*)sprite->Pixels)[p]; \
+       } \
+    }
+
     while( sp<gp ) {
        lp=sp+w;
        while( sp<lp ) {                // loop with unroll
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels16[p];
-           }
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels16[p];
-           }
+           UNROLL;
+           UNROLL;
        }
        if( sp<=lp ) {
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels16[p];
-           }
+           UNROLL;
        }
        sp+=sa;
        dp+=da;
     }
+#undef UNROLL
 }
 
 /**
@@ -263,30 +263,30 @@
     da=VideoWidth-w;
     --w;
 
+#define UNROLL \
+    ++dp; \
+    p=*++sp; \
+    if (p!=255) { \
+       if( p<NumFontColors ) { \
+           *dp=FontPixels24[p]; \
+       } else { \
+           *dp=((VMemType24*)sprite->Pixels)[p]; \
+       } \
+    }
+
     while( sp<gp ) {
        lp=sp+w;
        while( sp<lp ) {                // loop with unroll
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels24[p];
-           }
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels24[p];
-           }
+           UNROLL;
+           UNROLL;
        }
        if( sp<=lp ) {
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels24[p];
-           }
+           UNROLL;
        }
        sp+=sa;
        dp+=da;
     }
+#undef UNROLL
 }
 
 /**
@@ -318,30 +318,30 @@
     da=VideoWidth-w;
     --w;
 
+#define UNROLL \
+    ++dp; \
+    p=*++sp; \
+    if (p!=255) { \
+       if( p<NumFontColors ) { \
+           *dp=FontPixels32[p]; \
+       } else { \
+           *dp=((VMemType32*)sprite->Pixels)[p]; \
+       } \
+    }
+
     while( sp<gp ) {
        lp=sp+w;
        while( sp<lp ) {                // loop with unroll
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels32[p];
-           }
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels32[p];
-           }
+           UNROLL;
+           UNROLL;
        }
        if( sp<=lp ) {
-           ++dp;
-           p=*++sp;
-           if( p!=255 ) {
-               *dp=FontPixels32[p];
-           }
+           UNROLL;
        }
        sp+=sa;
        dp+=da;
     }
+#undef UNROLL
 }
 
 #ifdef USE_OPENGL
@@ -834,6 +834,9 @@
     int v;
     char* vp;
 
+    //
+    // First select the font drawing procedure.
+    //
 #ifdef USE_OPENGL
     VideoDrawChar=VideoDrawCharOpenGL;
 #else




reply via email to

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