Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5750 in orxonox.OLD


Ignore:
Timestamp:
Nov 24, 2005, 12:13:22 AM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the WorldEntities into the Trunk.
Merged with command:
svn merge branches/world_entities/ trunk/ -r5516:HEAD

conflics from world_entities changed in favor of branches/world_entity
all other conflict in favor of the trunk

Location:
trunk
Files:
4 deleted
47 edited
17 copied

Legend:

Unmodified
Added
Removed
  • trunk/config.guess

    r5479 r5750  
    44#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    55
    6 timestamp='2005-05-27'
     6timestamp='2005-02-10'
    77
    88# This file is free software; you can redistribute it and/or modify it
     
    1818# You should have received a copy of the GNU General Public License
    1919# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    21 # 02110-1301, USA.
     20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
    2221#
    2322# As a special exception to the GNU General Public License, if you
     
    2524# configuration script generated by Autoconf, you may include it under
    2625# the same distribution terms that you use for the rest of that program.
    27 
    2826
    2927# Originally written by Per Bothner <per@bothner.com>.
     
    6967  case $1 in
    7068    --time-stamp | --time* | -t )
    71        echo "$timestamp" ; exit ;;
     69       echo "$timestamp" ; exit 0 ;;
    7270    --version | -v )
    73        echo "$version" ; exit ;;
     71       echo "$version" ; exit 0 ;;
    7472    --help | --h* | -h )
    75        echo "$usage"; exit ;;
     73       echo "$usage"; exit 0 ;;
    7674    -- )     # Stop option processing
    7775       shift; break ;;
     
    138136UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
    139137UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
    140 
    141 if [ "${UNAME_SYSTEM}" = "Linux" ] ; then
    142         eval $set_cc_for_build
    143         cat << EOF > $dummy.c
    144         #include <features.h>
    145         #ifdef __UCLIBC__
    146         # ifdef __UCLIBC_CONFIG_VERSION__
    147         LIBC=uclibc __UCLIBC_CONFIG_VERSION__
    148         # else
    149         LIBC=uclibc
    150         # endif
    151         #else
    152         LIBC=gnu
    153         #endif
    154 EOF
    155         eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'`
    156 fi
    157138
    158139# Note: order is significant - the case branches are not exclusive.
     
    216197        # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
    217198        echo "${machine}-${os}${release}"
    218         exit ;;
     199        exit 0 ;;
    219200    amd64:OpenBSD:*:*)
    220201        echo x86_64-unknown-openbsd${UNAME_RELEASE}
    221         exit ;;
     202        exit 0 ;;
    222203    amiga:OpenBSD:*:*)
    223204        echo m68k-unknown-openbsd${UNAME_RELEASE}
    224         exit ;;
     205        exit 0 ;;
    225206    cats:OpenBSD:*:*)
    226207        echo arm-unknown-openbsd${UNAME_RELEASE}
    227         exit ;;
     208        exit 0 ;;
    228209    hp300:OpenBSD:*:*)
    229210        echo m68k-unknown-openbsd${UNAME_RELEASE}
    230         exit ;;
     211        exit 0 ;;
    231212    luna88k:OpenBSD:*:*)
    232213        echo m88k-unknown-openbsd${UNAME_RELEASE}
    233         exit ;;
     214        exit 0 ;;
    234215    mac68k:OpenBSD:*:*)
    235216        echo m68k-unknown-openbsd${UNAME_RELEASE}
    236         exit ;;
     217        exit 0 ;;
    237218    macppc:OpenBSD:*:*)
    238219        echo powerpc-unknown-openbsd${UNAME_RELEASE}
    239         exit ;;
     220        exit 0 ;;
    240221    mvme68k:OpenBSD:*:*)
    241222        echo m68k-unknown-openbsd${UNAME_RELEASE}
    242         exit ;;
     223        exit 0 ;;
    243224    mvme88k:OpenBSD:*:*)
    244225        echo m88k-unknown-openbsd${UNAME_RELEASE}
    245         exit ;;
     226        exit 0 ;;
    246227    mvmeppc:OpenBSD:*:*)
    247228        echo powerpc-unknown-openbsd${UNAME_RELEASE}
    248         exit ;;
     229        exit 0 ;;
    249230    sgi:OpenBSD:*:*)
    250231        echo mips64-unknown-openbsd${UNAME_RELEASE}
    251         exit ;;
     232        exit 0 ;;
    252233    sun3:OpenBSD:*:*)
    253234        echo m68k-unknown-openbsd${UNAME_RELEASE}
    254         exit ;;
     235        exit 0 ;;
    255236    *:OpenBSD:*:*)
    256237        echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
    257         exit ;;
     238        exit 0 ;;
    258239    *:ekkoBSD:*:*)
    259240        echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
    260         exit ;;
     241        exit 0 ;;
    261242    macppc:MirBSD:*:*)
    262243        echo powerppc-unknown-mirbsd${UNAME_RELEASE}
    263         exit ;;
     244        exit 0 ;;
    264245    *:MirBSD:*:*)
    265246        echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
    266         exit ;;
     247        exit 0 ;;
    267248    alpha:OSF1:*:*)
    268249        case $UNAME_RELEASE in
     
    317298        # 1.2 uses "1.2" for uname -r.
    318299        echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
    319         exit ;;
     300        exit 0 ;;
    320301    Alpha\ *:Windows_NT*:*)
    321302        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    323304        # of the specific Alpha model?
    324305        echo alpha-pc-interix
    325         exit ;;
     306        exit 0 ;;
    326307    21064:Windows_NT:50:3)
    327308        echo alpha-dec-winnt3.5
    328         exit ;;
     309        exit 0 ;;
    329310    Amiga*:UNIX_System_V:4.0:*)
    330311        echo m68k-unknown-sysv4
    331         exit ;;
     312        exit 0;;
    332313    *:[Aa]miga[Oo][Ss]:*:*)
    333314        echo ${UNAME_MACHINE}-unknown-amigaos
    334         exit ;;
     315        exit 0 ;;
    335316    *:[Mm]orph[Oo][Ss]:*:*)
    336317        echo ${UNAME_MACHINE}-unknown-morphos
    337         exit ;;
     318        exit 0 ;;
    338319    *:OS/390:*:*)
    339320        echo i370-ibm-openedition
    340         exit ;;
     321        exit 0 ;;
    341322    *:z/VM:*:*)
    342323        echo s390-ibm-zvmoe
    343         exit ;;
     324        exit 0 ;;
    344325    *:OS400:*:*)
    345326        echo powerpc-ibm-os400
    346         exit ;;
     327        exit 0 ;;
    347328    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
    348329        echo arm-acorn-riscix${UNAME_RELEASE}
    349         exit ;;
    350     arm:riscos:*:*|arm:RISCOS:*:*)
    351         echo arm-unknown-riscos
    352         exit ;;
     330        exit 0;;
    353331    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
    354332        echo hppa1.1-hitachi-hiuxmpp
    355         exit ;;
     333        exit 0;;
    356334    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
    357335        # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
     
    361339                echo pyramid-pyramid-bsd
    362340        fi
    363         exit ;;
     341        exit 0 ;;
    364342    NILE*:*:*:dcosx)
    365343        echo pyramid-pyramid-svr4
    366         exit ;;
     344        exit 0 ;;
    367345    DRS?6000:unix:4.0:6*)
    368346        echo sparc-icl-nx6
    369         exit ;;
     347        exit 0 ;;
    370348    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
    371349        case `/usr/bin/uname -p` in
    372             sparc) echo sparc-icl-nx7; exit ;;
     350            sparc) echo sparc-icl-nx7 && exit 0 ;;
    373351        esac ;;
    374352    sun4H:SunOS:5.*:*)
    375353        echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    376         exit ;;
     354        exit 0 ;;
    377355    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
    378356        echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    379         exit ;;
     357        exit 0 ;;
    380358    i86pc:SunOS:5.*:*)
    381359        echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    382         exit ;;
     360        exit 0 ;;
    383361    sun4*:SunOS:6*:*)
    384362        # According to config.sub, this is the proper way to canonicalize
     
    386364        # it's likely to be more like Solaris than SunOS4.
    387365        echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    388         exit ;;
     366        exit 0 ;;
    389367    sun4*:SunOS:*:*)
    390368        case "`/usr/bin/arch -k`" in
     
    395373        # Japanese Language versions have a version number like `4.1.3-JL'.
    396374        echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
    397         exit ;;
     375        exit 0 ;;
    398376    sun3*:SunOS:*:*)
    399377        echo m68k-sun-sunos${UNAME_RELEASE}
    400         exit ;;
     378        exit 0 ;;
    401379    sun*:*:4.2BSD:*)
    402380        UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
     
    410388                ;;
    411389        esac
    412         exit ;;
     390        exit 0 ;;
    413391    aushp:SunOS:*:*)
    414392        echo sparc-auspex-sunos${UNAME_RELEASE}
    415         exit ;;
     393        exit 0 ;;
    416394    # The situation for MiNT is a little confusing.  The machine name
    417395    # can be virtually everything (everything which is not
     
    424402    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
    425403        echo m68k-atari-mint${UNAME_RELEASE}
    426         exit ;;
     404        exit 0 ;;
    427405    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
    428406        echo m68k-atari-mint${UNAME_RELEASE}
    429         exit ;;
     407        exit 0 ;;
    430408    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
    431409        echo m68k-atari-mint${UNAME_RELEASE}
    432         exit ;;
     410        exit 0 ;;
    433411    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
    434412        echo m68k-milan-mint${UNAME_RELEASE}
    435         exit ;;
     413        exit 0 ;;
    436414    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
    437415        echo m68k-hades-mint${UNAME_RELEASE}
    438         exit ;;
     416        exit 0 ;;
    439417    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
    440418        echo m68k-unknown-mint${UNAME_RELEASE}
    441         exit ;;
     419        exit 0 ;;
    442420    m68k:machten:*:*)
    443421        echo m68k-apple-machten${UNAME_RELEASE}
    444         exit ;;
     422        exit 0 ;;
    445423    powerpc:machten:*:*)
    446424        echo powerpc-apple-machten${UNAME_RELEASE}
    447         exit ;;
     425        exit 0 ;;
    448426    RISC*:Mach:*:*)
    449427        echo mips-dec-mach_bsd4.3
    450         exit ;;
     428        exit 0 ;;
    451429    RISC*:ULTRIX:*:*)
    452430        echo mips-dec-ultrix${UNAME_RELEASE}
    453         exit ;;
     431        exit 0 ;;
    454432    VAX*:ULTRIX*:*:*)
    455433        echo vax-dec-ultrix${UNAME_RELEASE}
    456         exit ;;
     434        exit 0 ;;
    457435    2020:CLIX:*:* | 2430:CLIX:*:*)
    458436        echo clipper-intergraph-clix${UNAME_RELEASE}
    459         exit ;;
     437        exit 0 ;;
    460438    mips:*:*:UMIPS | mips:*:*:RISCos)
    461439        eval $set_cc_for_build
     
    481459        }
    482460EOF
    483         $CC_FOR_BUILD -o $dummy $dummy.c &&
    484           dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
    485           SYSTEM_NAME=`$dummy $dummyarg` &&
    486             { echo "$SYSTEM_NAME"; exit; }
     461        $CC_FOR_BUILD -o $dummy $dummy.c \
     462          && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
     463          && exit 0
    487464        echo mips-mips-riscos${UNAME_RELEASE}
    488         exit ;;
     465        exit 0 ;;
    489466    Motorola:PowerMAX_OS:*:*)
    490467        echo powerpc-motorola-powermax
    491         exit ;;
     468        exit 0 ;;
    492469    Motorola:*:4.3:PL8-*)
    493470        echo powerpc-harris-powermax
    494         exit ;;
     471        exit 0 ;;
    495472    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
    496473        echo powerpc-harris-powermax
    497         exit ;;
     474        exit 0 ;;
    498475    Night_Hawk:Power_UNIX:*:*)
    499476        echo powerpc-harris-powerunix
    500         exit ;;
     477        exit 0 ;;
    501478    m88k:CX/UX:7*:*)
    502479        echo m88k-harris-cxux7
    503         exit ;;
     480        exit 0 ;;
    504481    m88k:*:4*:R4*)
    505482        echo m88k-motorola-sysv4
    506         exit ;;
     483        exit 0 ;;
    507484    m88k:*:3*:R3*)
    508485        echo m88k-motorola-sysv3
    509         exit ;;
     486        exit 0 ;;
    510487    AViiON:dgux:*:*)
    511488        # DG/UX returns AViiON for all architectures
     
    523500            echo i586-dg-dgux${UNAME_RELEASE}
    524501        fi
    525         exit ;;
     502        exit 0 ;;
    526503    M88*:DolphinOS:*:*) # DolphinOS (SVR3)
    527504        echo m88k-dolphin-sysv3
    528         exit ;;
     505        exit 0 ;;
    529506    M88*:*:R3*:*)
    530507        # Delta 88k system running SVR3
    531508        echo m88k-motorola-sysv3
    532         exit ;;
     509        exit 0 ;;
    533510    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
    534511        echo m88k-tektronix-sysv3
    535         exit ;;
     512        exit 0 ;;
    536513    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
    537514        echo m68k-tektronix-bsd
    538         exit ;;
     515        exit 0 ;;
    539516    *:IRIX*:*:*)
    540517        echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
    541         exit ;;
     518        exit 0 ;;
    542519    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
    543         echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
    544         exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
     520        echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
     521        exit 0 ;;              # Note that: echo "'`uname -s`'" gives 'AIX '
    545522    i*86:AIX:*:*)
    546523        echo i386-ibm-aix
    547         exit ;;
     524        exit 0 ;;
    548525    ia64:AIX:*:*)
    549526        if [ -x /usr/bin/oslevel ] ; then
     
    553530        fi
    554531        echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
    555         exit ;;
     532        exit 0 ;;
    556533    *:AIX:2:3)
    557534        if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
     
    568545                        }
    569546EOF
    570                 if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
    571                 then
    572                         echo "$SYSTEM_NAME"
    573                 else
    574                         echo rs6000-ibm-aix3.2.5
    575                 fi
     547                $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
     548                echo rs6000-ibm-aix3.2.5
    576549        elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
    577550                echo rs6000-ibm-aix3.2.4
     
    579552                echo rs6000-ibm-aix3.2
    580553        fi
    581         exit ;;
     554        exit 0 ;;
    582555    *:AIX:*:[45])
    583556        IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
     
    593566        fi
    594567        echo ${IBM_ARCH}-ibm-aix${IBM_REV}
    595         exit ;;
     568        exit 0 ;;
    596569    *:AIX:*:*)
    597570        echo rs6000-ibm-aix
    598         exit ;;
     571        exit 0 ;;
    599572    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
    600573        echo romp-ibm-bsd4.4
    601         exit ;;
     574        exit 0 ;;
    602575    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
    603576        echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
    604         exit ;;                             # report: romp-ibm BSD 4.3
     577        exit 0 ;;                           # report: romp-ibm BSD 4.3
    605578    *:BOSX:*:*)
    606579        echo rs6000-bull-bosx
    607         exit ;;
     580        exit 0 ;;
    608581    DPX/2?00:B.O.S.:*:*)
    609582        echo m68k-bull-sysv3
    610         exit ;;
     583        exit 0 ;;
    611584    9000/[34]??:4.3bsd:1.*:*)
    612585        echo m68k-hp-bsd
    613         exit ;;
     586        exit 0 ;;
    614587    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
    615588        echo m68k-hp-bsd4.4
    616         exit ;;
     589        exit 0 ;;
    617590    9000/[34678]??:HP-UX:*:*)
    618591        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
     
    678651            # avoid double evaluation of $set_cc_for_build
    679652            test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
    680 
    681             # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
    682             # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
    683             # generating 64-bit code.  GNU and HP use different nomenclature:
    684             #
    685             # $ CC_FOR_BUILD=cc ./config.guess
    686             # => hppa2.0w-hp-hpux11.23
    687             # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
    688             # => hppa64-hp-hpux11.23
    689 
    690             if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
    691                 grep __LP64__ >/dev/null
     653            if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
    692654            then
    693655                HP_ARCH="hppa2.0w"
     
    697659        fi
    698660        echo ${HP_ARCH}-hp-hpux${HPUX_REV}
    699         exit ;;
     661        exit 0 ;;
    700662    ia64:HP-UX:*:*)
    701663        HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
    702664        echo ia64-hp-hpux${HPUX_REV}
    703         exit ;;
     665        exit 0 ;;
    704666    3050*:HI-UX:*:*)
    705667        eval $set_cc_for_build
     
    729691        }
    730692EOF
    731         $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
    732                 { echo "$SYSTEM_NAME"; exit; }
     693        $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
    733694        echo unknown-hitachi-hiuxwe2
    734         exit ;;
     695        exit 0 ;;
    735696    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
    736697        echo hppa1.1-hp-bsd
    737         exit ;;
     698        exit 0 ;;
    738699    9000/8??:4.3bsd:*:*)
    739700        echo hppa1.0-hp-bsd
    740         exit ;;
     701        exit 0 ;;
    741702    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
    742703        echo hppa1.0-hp-mpeix
    743         exit ;;
     704        exit 0 ;;
    744705    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
    745706        echo hppa1.1-hp-osf
    746         exit ;;
     707        exit 0 ;;
    747708    hp8??:OSF1:*:*)
    748709        echo hppa1.0-hp-osf
    749         exit ;;
     710        exit 0 ;;
    750711    i*86:OSF1:*:*)
    751712        if [ -x /usr/sbin/sysversion ] ; then
     
    754715            echo ${UNAME_MACHINE}-unknown-osf1
    755716        fi
    756         exit ;;
     717        exit 0 ;;
    757718    parisc*:Lites*:*:*)
    758719        echo hppa1.1-hp-lites
    759         exit ;;
     720        exit 0 ;;
    760721    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
    761722        echo c1-convex-bsd
    762         exit ;;
     723        exit 0 ;;
    763724    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
    764725        if getsysinfo -f scalar_acc
     
    766727        else echo c2-convex-bsd
    767728        fi
    768         exit ;;
     729        exit 0 ;;
    769730    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
    770731        echo c34-convex-bsd
    771         exit ;;
     732        exit 0 ;;
    772733    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
    773734        echo c38-convex-bsd
    774         exit ;;
     735        exit 0 ;;
    775736    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
    776737        echo c4-convex-bsd
    777         exit ;;
     738        exit 0 ;;
    778739    CRAY*Y-MP:*:*:*)
    779740        echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    780         exit ;;
     741        exit 0 ;;
    781742    CRAY*[A-Z]90:*:*:*)
    782743        echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
     
    784745              -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
    785746              -e 's/\.[^.]*$/.X/'
    786         exit ;;
     747        exit 0 ;;
    787748    CRAY*TS:*:*:*)
    788749        echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    789         exit ;;
     750        exit 0 ;;
    790751    CRAY*T3E:*:*:*)
    791752        echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    792         exit ;;
     753        exit 0 ;;
    793754    CRAY*SV1:*:*:*)
    794755        echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    795         exit ;;
     756        exit 0 ;;
    796757    *:UNICOS/mp:*:*)
    797758        echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
    798         exit ;;
     759        exit 0 ;;
    799760    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
    800761        FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
     
    802763        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
    803764        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    804         exit ;;
     765        exit 0 ;;
    805766    5000:UNIX_System_V:4.*:*)
    806767        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
    807768        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
    808769        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
    809         exit ;;
     770        exit 0 ;;
    810771    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
    811772        echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
    812         exit ;;
     773        exit 0 ;;
    813774    sparc*:BSD/OS:*:*)
    814775        echo sparc-unknown-bsdi${UNAME_RELEASE}
    815         exit ;;
     776        exit 0 ;;
    816777    *:BSD/OS:*:*)
    817778        echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
    818         exit ;;
     779        exit 0 ;;
    819780    *:FreeBSD:*:*)
    820781        echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    821         exit ;;
     782        exit 0 ;;
    822783    i*:CYGWIN*:*)
    823784        echo ${UNAME_MACHINE}-pc-cygwin
    824         exit ;;
     785        exit 0 ;;
    825786    i*:MINGW*:*)
    826787        echo ${UNAME_MACHINE}-pc-mingw32
    827         exit ;;
    828     i*:windows32*:*)
    829         # uname -m includes "-pc" on this system.
    830         echo ${UNAME_MACHINE}-mingw32
    831         exit ;;
     788        exit 0 ;;
    832789    i*:PW*:*)
    833790        echo ${UNAME_MACHINE}-pc-pw32
    834         exit ;;
     791        exit 0 ;;
    835792    x86:Interix*:[34]*)
    836793        echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
    837         exit ;;
     794        exit 0 ;;
    838795    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
    839796        echo i${UNAME_MACHINE}-pc-mks
    840         exit ;;
     797        exit 0 ;;
    841798    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
    842799        # How do we know it's Interix rather than the generic POSIX subsystem?
     
    844801        # UNAME_MACHINE based on the output of uname instead of i386?
    845802        echo i586-pc-interix
    846         exit ;;
     803        exit 0 ;;
    847804    i*:UWIN*:*)
    848805        echo ${UNAME_MACHINE}-pc-uwin
    849         exit ;;
     806        exit 0 ;;
    850807    amd64:CYGWIN*:*:*)
    851808        echo x86_64-unknown-cygwin
    852         exit ;;
     809        exit 0 ;;
    853810    p*:CYGWIN*:*)
    854811        echo powerpcle-unknown-cygwin
    855         exit ;;
     812        exit 0 ;;
    856813    prep*:SunOS:5.*:*)
    857814        echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
    858         exit ;;
     815        exit 0 ;;
    859816    *:GNU:*:*)
    860817        # the GNU system
    861818        echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
    862         exit ;;
     819        exit 0 ;;
    863820    *:GNU/*:*:*)
    864821        # other systems with GNU libc and userland
    865822        echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
    866         exit ;;
     823        exit 0 ;;
    867824    i*86:Minix:*:*)
    868825        echo ${UNAME_MACHINE}-pc-minix
    869         exit ;;
     826        exit 0 ;;
    870827    arm*:Linux:*:*)
    871         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    872         exit ;;
     828        echo ${UNAME_MACHINE}-unknown-linux-gnu
     829        exit 0 ;;
    873830    cris:Linux:*:*)
    874         echo cris-axis-linux-${LIBC}
    875         exit ;;
     831        echo cris-axis-linux-gnu
     832        exit 0 ;;
    876833    crisv32:Linux:*:*)
    877         echo crisv32-axis-linux-${LIBC}
    878         exit ;;
     834        echo crisv32-axis-linux-gnu
     835        exit 0 ;;
    879836    frv:Linux:*:*)
    880         echo frv-unknown-linux-${LIBC}
    881         exit ;;
     837        echo frv-unknown-linux-gnu
     838        exit 0 ;;
    882839    ia64:Linux:*:*)
    883         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    884         exit ;;
     840        echo ${UNAME_MACHINE}-unknown-linux-gnu
     841        exit 0 ;;
    885842    m32r*:Linux:*:*)
    886         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    887         exit ;;
     843        echo ${UNAME_MACHINE}-unknown-linux-gnu
     844        exit 0 ;;
    888845    m68*:Linux:*:*)
    889         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    890         exit ;;
     846        echo ${UNAME_MACHINE}-unknown-linux-gnu
     847        exit 0 ;;
    891848    mips:Linux:*:*)
    892849        eval $set_cc_for_build
     
    906863EOF
    907864        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    908         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
     865        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
    909866        ;;
    910867    mips64:Linux:*:*)
     
    925882EOF
    926883        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
    927         test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
     884        test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
    928885        ;;
    929886    ppc:Linux:*:*)
    930         echo powerpc-unknown-linux-${LIBC}
    931         exit ;;
     887        echo powerpc-unknown-linux-gnu
     888        exit 0 ;;
    932889    ppc64:Linux:*:*)
    933         echo powerpc64-unknown-linux-${LIBC}
    934         exit ;;
     890        echo powerpc64-unknown-linux-gnu
     891        exit 0 ;;
    935892    alpha:Linux:*:*)
    936893        case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
     
    944901        esac
    945902        objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
    946         if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
    947         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    948         exit ;;
     903        if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
     904        echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
     905        exit 0 ;;
    949906    parisc:Linux:*:* | hppa:Linux:*:*)
    950907        # Look for CPU level
    951908        case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
    952           PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
    953           PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
    954           *)    echo hppa-unknown-linux-${LIBC} ;;
     909          PA7*) echo hppa1.1-unknown-linux-gnu ;;
     910          PA8*) echo hppa2.0-unknown-linux-gnu ;;
     911          *)    echo hppa-unknown-linux-gnu ;;
    955912        esac
    956         exit ;;
     913        exit 0 ;;
    957914    parisc64:Linux:*:* | hppa64:Linux:*:*)
    958         echo hppa64-unknown-linux-${LIBC}
    959         exit ;;
     915        echo hppa64-unknown-linux-gnu
     916        exit 0 ;;
    960917    s390:Linux:*:* | s390x:Linux:*:*)
    961918        echo ${UNAME_MACHINE}-ibm-linux
    962         exit ;;
     919        exit 0 ;;
    963920    sh64*:Linux:*:*)
    964         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    965         exit ;;
     921        echo ${UNAME_MACHINE}-unknown-linux-gnu
     922        exit 0 ;;
    966923    sh*:Linux:*:*)
    967         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    968         exit ;;
     924        echo ${UNAME_MACHINE}-unknown-linux-gnu
     925        exit 0 ;;
    969926    sparc:Linux:*:* | sparc64:Linux:*:*)
    970         echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
    971         exit ;;
     927        echo ${UNAME_MACHINE}-unknown-linux-gnu
     928        exit 0 ;;
    972929    x86_64:Linux:*:*)
    973         echo x86_64-unknown-linux-${LIBC}
    974         exit ;;
     930        echo x86_64-unknown-linux-gnu
     931        exit 0 ;;
    975932    i*86:Linux:*:*)
    976933        # The BFD linker knows what the default object file format is, so
     
    986943        case "$ld_supported_targets" in
    987944          elf32-i386)
    988                 TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}"
     945                TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu"
    989946                ;;
    990947          a.out-i386-linux)
    991                 echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout"
    992                 exit ;;
     948                echo "${UNAME_MACHINE}-pc-linux-gnuaout"
     949                exit 0 ;;
    993950          coff-i386)
    994                 echo "${UNAME_MACHINE}-pc-linux-${LIBC}coff"
    995                 exit ;;
     951                echo "${UNAME_MACHINE}-pc-linux-gnucoff"
     952                exit 0 ;;
    996953          "")
    997954                # Either a pre-BFD a.out linker (linux-gnuoldld) or
    998955                # one that does not give us useful --help.
    999                 echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld"
    1000                 exit ;;
     956                echo "${UNAME_MACHINE}-pc-linux-gnuoldld"
     957                exit 0 ;;
    1001958        esac
    1002         if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi
    1003959        # Determine whether the default compiler is a.out or elf
    1004960        eval $set_cc_for_build
     
    1027983EOF
    1028984        eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
    1029         test x"${LIBC}" != x && {
    1030                 echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
    1031                 exit
    1032         }
    1033         test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; }
     985        test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
     986        test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
    1034987        ;;
    1035988    i*86:DYNIX/ptx:4*:*)
     
    1038991        # sysname and nodename.
    1039992        echo i386-sequent-sysv4
    1040         exit ;;
     993        exit 0 ;;
    1041994    i*86:UNIX_SV:4.2MP:2.*)
    1042995        # Unixware is an offshoot of SVR4, but it has its own version
     
    1046999        # Use sysv4.2uw... so that sysv4* matches it.
    10471000        echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
    1048         exit ;;
     1001        exit 0 ;;
    10491002    i*86:OS/2:*:*)
    10501003        # If we were able to find `uname', then EMX Unix compatibility
    10511004        # is probably installed.
    10521005        echo ${UNAME_MACHINE}-pc-os2-emx
    1053         exit ;;
     1006        exit 0 ;;
    10541007    i*86:XTS-300:*:STOP)
    10551008        echo ${UNAME_MACHINE}-unknown-stop
    1056         exit ;;
     1009        exit 0 ;;
    10571010    i*86:atheos:*:*)
    10581011        echo ${UNAME_MACHINE}-unknown-atheos
    1059         exit ;;
    1060     i*86:syllable:*:*)
     1012        exit 0 ;;
     1013        i*86:syllable:*:*)
    10611014        echo ${UNAME_MACHINE}-pc-syllable
    1062         exit ;;
     1015        exit 0 ;;
    10631016    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
    10641017        echo i386-unknown-lynxos${UNAME_RELEASE}
    1065         exit ;;
     1018        exit 0 ;;
    10661019    i*86:*DOS:*:*)
    10671020        echo ${UNAME_MACHINE}-pc-msdosdjgpp
    1068         exit ;;
     1021        exit 0 ;;
    10691022    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
    10701023        UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
     
    10741027                echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
    10751028        fi
    1076         exit ;;
    1077     i*86:*:5:[678]*)
    1078         # UnixWare 7.x, OpenUNIX and OpenServer 6.
     1029        exit 0 ;;
     1030    i*86:*:5:[78]*)
    10791031        case `/bin/uname -X | grep "^Machine"` in
    10801032            *486*)           UNAME_MACHINE=i486 ;;
     
    10831035        esac
    10841036        echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
    1085         exit ;;
     1037        exit 0 ;;
    10861038    i*86:*:3.2:*)
    10871039        if test -f /usr/options/cb.name; then
     
    11011053                echo ${UNAME_MACHINE}-pc-sysv32
    11021054        fi
    1103         exit ;;
     1055        exit 0 ;;
    11041056    pc:*:*:*)
    11051057        # Left here for compatibility:
     
    11071059        # the processor, so we play safe by assuming i386.
    11081060        echo i386-pc-msdosdjgpp
    1109         exit ;;
     1061        exit 0 ;;
    11101062    Intel:Mach:3*:*)
    11111063        echo i386-pc-mach3
    1112         exit ;;
     1064        exit 0 ;;
    11131065    paragon:*:*:*)
    11141066        echo i860-intel-osf1
    1115         exit ;;
     1067        exit 0 ;;
    11161068    i860:*:4.*:*) # i860-SVR4
    11171069        if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
     
    11201072          echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
    11211073        fi
    1122         exit ;;
     1074        exit 0 ;;
    11231075    mini*:CTIX:SYS*5:*)
    11241076        # "miniframe"
    11251077        echo m68010-convergent-sysv
    1126         exit ;;
     1078        exit 0 ;;
    11271079    mc68k:UNIX:SYSTEM5:3.51m)
    11281080        echo m68k-convergent-sysv
    1129         exit ;;
     1081        exit 0 ;;
    11301082    M680?0:D-NIX:5.3:*)
    11311083        echo m68k-diab-dnix
    1132         exit ;;
     1084        exit 0 ;;
    11331085    M68*:*:R3V[5678]*:*)
    1134         test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
     1086        test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
    11351087    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
    11361088        OS_REL=''
     
    11381090        && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
    11391091        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1140           && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
     1092          && echo i486-ncr-sysv4.3${OS_REL} && exit 0
    11411093        /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
    1142           && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
     1094          && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
    11431095    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
    11441096        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
    1145           && { echo i486-ncr-sysv4; exit; } ;;
     1097          && echo i486-ncr-sysv4 && exit 0 ;;
    11461098    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
    11471099        echo m68k-unknown-lynxos${UNAME_RELEASE}
    1148         exit ;;
     1100        exit 0 ;;
    11491101    mc68030:UNIX_System_V:4.*:*)
    11501102        echo m68k-atari-sysv4
    1151         exit ;;
     1103        exit 0 ;;
    11521104    TSUNAMI:LynxOS:2.*:*)
    11531105        echo sparc-unknown-lynxos${UNAME_RELEASE}
    1154         exit ;;
     1106        exit 0 ;;
    11551107    rs6000:LynxOS:2.*:*)
    11561108        echo rs6000-unknown-lynxos${UNAME_RELEASE}
    1157         exit ;;
     1109        exit 0 ;;
    11581110    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
    11591111        echo powerpc-unknown-lynxos${UNAME_RELEASE}
    1160         exit ;;
     1112        exit 0 ;;
    11611113    SM[BE]S:UNIX_SV:*:*)
    11621114        echo mips-dde-sysv${UNAME_RELEASE}
    1163         exit ;;
     1115        exit 0 ;;
    11641116    RM*:ReliantUNIX-*:*:*)
    11651117        echo mips-sni-sysv4
    1166         exit ;;
     1118        exit 0 ;;
    11671119    RM*:SINIX-*:*:*)
    11681120        echo mips-sni-sysv4
    1169         exit ;;
     1121        exit 0 ;;
    11701122    *:SINIX-*:*:*)
    11711123        if uname -p 2>/dev/null >/dev/null ; then
     
    11751127                echo ns32k-sni-sysv
    11761128        fi
    1177         exit ;;
     1129        exit 0 ;;
    11781130    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
    11791131                      # says <Richard.M.Bartel@ccMail.Census.GOV>
    11801132        echo i586-unisys-sysv4
    1181         exit ;;
     1133        exit 0 ;;
    11821134    *:UNIX_System_V:4*:FTX*)
    11831135        # From Gerald Hewes <hewes@openmarket.com>.
    11841136        # How about differentiating between stratus architectures? -djm
    11851137        echo hppa1.1-stratus-sysv4
    1186         exit ;;
     1138        exit 0 ;;
    11871139    *:*:*:FTX*)
    11881140        # From seanf@swdc.stratus.com.
    11891141        echo i860-stratus-sysv4
    1190         exit ;;
    1191     i*86:VOS:*:*)
    1192         # From Paul.Green@stratus.com.
    1193         echo ${UNAME_MACHINE}-stratus-vos
    1194         exit ;;
     1142        exit 0 ;;
    11951143    *:VOS:*:*)
    11961144        # From Paul.Green@stratus.com.
    11971145        echo hppa1.1-stratus-vos
    1198         exit ;;
     1146        exit 0 ;;
    11991147    mc68*:A/UX:*:*)
    12001148        echo m68k-apple-aux${UNAME_RELEASE}
    1201         exit ;;
     1149        exit 0 ;;
    12021150    news*:NEWS-OS:6*:*)
    12031151        echo mips-sony-newsos6
    1204         exit ;;
     1152        exit 0 ;;
    12051153    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
    12061154        if [ -d /usr/nec ]; then
     
    12091157                echo mips-unknown-sysv${UNAME_RELEASE}
    12101158        fi
    1211         exit ;;
     1159        exit 0 ;;
    12121160    BeBox:BeOS:*:*)     # BeOS running on hardware made by Be, PPC only.
    12131161        echo powerpc-be-beos
    1214         exit ;;
     1162        exit 0 ;;
    12151163    BeMac:BeOS:*:*)     # BeOS running on Mac or Mac clone, PPC only.
    12161164        echo powerpc-apple-beos
    1217         exit ;;
     1165        exit 0 ;;
    12181166    BePC:BeOS:*:*)      # BeOS running on Intel PC compatible.
    12191167        echo i586-pc-beos
    1220         exit ;;
     1168        exit 0 ;;
    12211169    SX-4:SUPER-UX:*:*)
    12221170        echo sx4-nec-superux${UNAME_RELEASE}
    1223         exit ;;
     1171        exit 0 ;;
    12241172    SX-5:SUPER-UX:*:*)
    12251173        echo sx5-nec-superux${UNAME_RELEASE}
    1226         exit ;;
     1174        exit 0 ;;
    12271175    SX-6:SUPER-UX:*:*)
    12281176        echo sx6-nec-superux${UNAME_RELEASE}
    1229         exit ;;
     1177        exit 0 ;;
    12301178    Power*:Rhapsody:*:*)
    12311179        echo powerpc-apple-rhapsody${UNAME_RELEASE}
    1232         exit ;;
     1180        exit 0 ;;
    12331181    *:Rhapsody:*:*)
    12341182        echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
    1235         exit ;;
     1183        exit 0 ;;
    12361184    *:Darwin:*:*)
    12371185        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
     
    12411189        esac
    12421190        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
    1243         exit ;;
     1191        exit 0 ;;
    12441192    *:procnto*:*:* | *:QNX:[0123456789]*:*)
    12451193        UNAME_PROCESSOR=`uname -p`
     
    12491197        fi
    12501198        echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
    1251         exit ;;
     1199        exit 0 ;;
    12521200    *:QNX:*:4*)
    12531201        echo i386-pc-qnx
    1254         exit ;;
     1202        exit 0 ;;
    12551203    NSE-?:NONSTOP_KERNEL:*:*)
    12561204        echo nse-tandem-nsk${UNAME_RELEASE}
    1257         exit ;;
     1205        exit 0 ;;
    12581206    NSR-?:NONSTOP_KERNEL:*:*)
    12591207        echo nsr-tandem-nsk${UNAME_RELEASE}
    1260         exit ;;
     1208        exit 0 ;;
    12611209    *:NonStop-UX:*:*)
    12621210        echo mips-compaq-nonstopux
    1263         exit ;;
     1211        exit 0 ;;
    12641212    BS2000:POSIX*:*:*)
    12651213        echo bs2000-siemens-sysv
    1266         exit ;;
     1214        exit 0 ;;
    12671215    DS/*:UNIX_System_V:*:*)
    12681216        echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
    1269         exit ;;
     1217        exit 0 ;;
    12701218    *:Plan9:*:*)
    12711219        # "uname -m" is not consistent, so use $cputype instead. 386
     
    12781226        fi
    12791227        echo ${UNAME_MACHINE}-unknown-plan9
    1280         exit ;;
     1228        exit 0 ;;
    12811229    *:TOPS-10:*:*)
    12821230        echo pdp10-unknown-tops10
    1283         exit ;;
     1231        exit 0 ;;
    12841232    *:TENEX:*:*)
    12851233        echo pdp10-unknown-tenex
    1286         exit ;;
     1234        exit 0 ;;
    12871235    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
    12881236        echo pdp10-dec-tops20
    1289         exit ;;
     1237        exit 0 ;;
    12901238    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
    12911239        echo pdp10-xkl-tops20
    1292         exit ;;
     1240        exit 0 ;;
    12931241    *:TOPS-20:*:*)
    12941242        echo pdp10-unknown-tops20
    1295         exit ;;
     1243        exit 0 ;;
    12961244    *:ITS:*:*)
    12971245        echo pdp10-unknown-its
    1298         exit ;;
     1246        exit 0 ;;
    12991247    SEI:*:*:SEIUX)
    13001248        echo mips-sei-seiux${UNAME_RELEASE}
    1301         exit ;;
     1249        exit 0 ;;
    13021250    *:DragonFly:*:*)
    13031251        echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
    1304         exit ;;
     1252        exit 0 ;;
    13051253    *:*VMS:*:*)
    13061254        UNAME_MACHINE=`(uname -p) 2>/dev/null`
    13071255        case "${UNAME_MACHINE}" in
    1308             A*) echo alpha-dec-vms ; exit ;;
    1309             I*) echo ia64-dec-vms ; exit ;;
    1310             V*) echo vax-dec-vms ; exit ;;
     1256            A*) echo alpha-dec-vms && exit 0 ;;
     1257            I*) echo ia64-dec-vms && exit 0 ;;
     1258            V*) echo vax-dec-vms && exit 0 ;;
    13111259        esac ;;
    13121260    *:XENIX:*:SysV)
    13131261        echo i386-pc-xenix
    1314         exit ;;
    1315     i*86:skyos:*:*)
    1316         echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
    1317         exit ;;
     1262        exit 0 ;;
    13181263esac
    13191264
     
    13471292
    13481293#if defined (__arm) && defined (__acorn) && defined (__unix)
    1349   printf ("arm-acorn-riscix\n"); exit (0);
     1294  printf ("arm-acorn-riscix"); exit (0);
    13501295#endif
    13511296
     
    14361381EOF
    14371382
    1438 $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
    1439         { echo "$SYSTEM_NAME"; exit; }
     1383$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
    14401384
    14411385# Apollos put the system type in the environment.
    14421386
    1443 test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
     1387test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
    14441388
    14451389# Convex versions that predate uname can use getsysinfo(1)
     
    14501394    c1*)
    14511395        echo c1-convex-bsd
    1452         exit ;;
     1396        exit 0 ;;
    14531397    c2*)
    14541398        if getsysinfo -f scalar_acc
     
    14561400        else echo c2-convex-bsd
    14571401        fi
    1458         exit ;;
     1402        exit 0 ;;
    14591403    c34*)
    14601404        echo c34-convex-bsd
    1461         exit ;;
     1405        exit 0 ;;
    14621406    c38*)
    14631407        echo c38-convex-bsd
    1464         exit ;;
     1408        exit 0 ;;
    14651409    c4*)
    14661410        echo c4-convex-bsd
    1467         exit ;;
     1411        exit 0 ;;
    14681412    esac
    14691413fi
     
    14761420download the most up to date version of the config scripts from
    14771421
    1478   http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
    1479 and
    1480   http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
     1422    ftp://ftp.gnu.org/pub/gnu/config/
    14811423
    14821424If the version you run ($0) is already up to date, please
  • trunk/config.sub

    r5479 r5750  
    44#   2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
    55
    6 timestamp='2005-06-02'
     6timestamp='2005-02-10'
    77
    88# This file is (in principle) common to ALL GNU software.
     
    2222# You should have received a copy of the GNU General Public License
    2323# along with this program; if not, write to the Free Software
    24 # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
    25 # 02110-1301, USA.
    26 #
     24# Foundation, Inc., 59 Temple Place - Suite 330,
     25# Boston, MA 02111-1307, USA.
     26
    2727# As a special exception to the GNU General Public License, if you
    2828# distribute this file as part of a program that contains a
    2929# configuration script generated by Autoconf, you may include it under
    3030# the same distribution terms that you use for the rest of that program.
    31 
    3231
    3332# Please send patches to <config-patches@gnu.org>.  Submit a context
     
    8584  case $1 in
    8685    --time-stamp | --time* | -t )
    87        echo "$timestamp" ; exit ;;
     86       echo "$timestamp" ; exit 0 ;;
    8887    --version | -v )
    89        echo "$version" ; exit ;;
     88       echo "$version" ; exit 0 ;;
    9089    --help | --h* | -h )
    91        echo "$usage"; exit ;;
     90       echo "$usage"; exit 0 ;;
    9291    -- )     # Stop option processing
    9392       shift; break ;;
     
    101100       # First pass through any local machine types.
    102101       echo $1
    103        exit ;;
     102       exit 0;;
    104103
    105104    * )
     
    233232        | am33_2.0 \
    234233        | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
    235         | bfin \
    236234        | c4x | clipper \
    237         | d10v | d30v | dlx | dsp16xx | dvp \
     235        | d10v | d30v | dlx | dsp16xx \
    238236        | fr30 | frv \
    239237        | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
     
    249247        | mips64vr4300 | mips64vr4300el \
    250248        | mips64vr5000 | mips64vr5000el \
    251         | mips64r5900 | mips64r5900el \
    252249        | mipsisa32 | mipsisa32el \
    253250        | mipsisa32r2 | mipsisa32r2el \
     
    258255        | mipstx39 | mipstx39el \
    259256        | mn10200 | mn10300 \
    260         | ms1 \
    261257        | msp430 \
    262258        | ns16k | ns32k \
     
    267263        | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
    268264        | sh64 | sh64le \
    269         | sparc | sparc64 | sparc64b | sparc86x | sparclet | sparclite \
    270         | sparcv8 | sparcv9 | sparcv9b \
     265        | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv8 | sparcv9 | sparcv9b \
    271266        | strongarm \
    272267        | tahoe | thumb | tic4x | tic80 | tron \
     
    275270        | x86 | xscale | xscalee[bl] | xstormy16 | xtensa \
    276271        | z8k)
    277                 basic_machine=$basic_machine-unknown
    278                 ;;
    279         m32c)
    280272                basic_machine=$basic_machine-unknown
    281273                ;;
     
    307299        | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
    308300        | avr-* \
    309         | bfin-* | bs2000-* \
     301        | bs2000-* \
    310302        | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
    311303        | clipper-* | craynv-* | cydra-* \
     
    328320        | mips64vr4300-* | mips64vr4300el-* \
    329321        | mips64vr5000-* | mips64vr5000el-* \
    330         | mips64r5900-* | mips64r5900el-* \
    331322        | mipsisa32-* | mipsisa32el-* \
    332323        | mipsisa32r2-* | mipsisa32r2el-* \
     
    337328        | mipstx39-* | mipstx39el-* \
    338329        | mmix-* \
    339         | ms1-* \
    340330        | msp430-* \
    341331        | none-* | np1-* | ns16k-* | ns32k-* \
     
    347337        | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
    348338        | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
    349         | sparc-* | sparc64-* | sparc64b-* | sparc86x-* | sparclet-* \
    350         | sparclite-* \
     339        | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
    351340        | sparcv8-* | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
    352341        | tahoe-* | thumb-* \
     
    360349        | z8k-*)
    361350                ;;
    362         m32c-*)
    363                 ;;
    364351        # Recognize the various machine names and aliases which stand
    365352        # for a CPU type and a company and sometimes even an OS.
     
    678665                basic_machine=m68k-atari
    679666                os=-mint
    680                 ;;
    681         mipsEE* | ee | ps2)
    682                 basic_machine=mips64r5900el-scei
    683                 case $os in
    684                     -linux*)
    685                         ;;
    686                     *)
    687                         os=-elf
    688                         ;;
    689                 esac
    690                 ;;
    691         iop)
    692                 basic_machine=mipsel-scei
    693                 os=-irx
    694                 ;;
    695         dvp)
    696                 basic_machine=dvp-scei
    697                 os=-elf
    698667                ;;
    699668        mips3*-*)
     
    12101179              | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
    12111180              | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
    1212               | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* | -skyos* \
    1213               | -irx* )
     1181              | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly*)
    12141182        # Remember, each alternative MUST END IN *, to match a version number.
    12151183                ;;
     
    15891557
    15901558echo $basic_machine$os
    1591 exit
     1559exit 0
    15921560
    15931561# Local variables:
  • trunk/configure

    r5502 r5750  
    274274PACKAGE_BUGREPORT='orxonox-dev at mail.datacore.ch'
    275275
    276 ac_unique_file="."
     276ac_unique_file="src"
    277277# Factoring default headers for most tests.
    278278ac_includes_default="\
  • trunk/configure.ac

    r5502 r5750  
    2525#########################
    2626AC_PREREQ(2.59)
    27 AC_INIT([orxonox],[0.3.2_alpha],[orxonox-dev at mail.datacore.ch])
     27AC_INIT([orxonox], [0.3.2_alpha], [orxonox-dev at mail.datacore.ch])
    2828
    2929## Detect the canonical host and target build environment.
     
    3434AM_INIT_AUTOMAKE
    3535
    36 AC_CONFIG_SRCDIR([.])
     36AC_CONFIG_SRCDIR([src])
    3737AC_CONFIG_HEADER([config.h])
    3838
  • trunk/depcomp

    r5479 r5750  
    22# depcomp - compile a program generating dependencies as side-effects
    33
    4 scriptversion=2005-07-09.11
     4scriptversion=2005-02-09.22
    55
    66# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc.
     
    1818# You should have received a copy of the GNU General Public License
    1919# along with this program; if not, write to the Free Software
    20 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    21 # 02110-1301, USA.
     20# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     21# 02111-1307, USA.
    2222
    2323# As a special exception to the GNU General Public License, if you
     
    468468
    469469  "$@" -E |
    470     sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
    471        -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
     470    sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
    472471    sed '$ s: \\$::' > "$tmpdepfile"
    473472  rm -f "$depfile"
  • trunk/install-sh

    r5479 r5750  
    22# install - install a program, script, or datafile
    33
    4 scriptversion=2005-05-14.22
     4scriptversion=2005-02-02.21
    55
    66# This originates from X11R5 (mit/util/scripts/install.sh), which was
  • trunk/missing

    r5479 r5750  
    22# Common stub for a few missing GNU programs while installing.
    33
    4 scriptversion=2005-06-08.21
     4scriptversion=2005-02-08.22
    55
    66# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
     
    2020# You should have received a copy of the GNU General Public License
    2121# along with this program; if not, write to the Free Software
    22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    23 # 02110-1301, USA.
     22# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
     23# 02111-1307, USA.
    2424
    2525# As a special exception to the GNU General Public License, if you
     
    298298      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
    299299    fi
    300     # If the file does not exist, the user really needs makeinfo;
    301     # let's fail without touching anything.
    302     test -f $file || exit 1
    303300    touch $file
    304301    ;;
  • trunk/mkinstalldirs

    r5479 r5750  
    22# mkinstalldirs --- make directory hierarchy
    33
    4 scriptversion=2005-06-29.22
     4scriptversion=2005-02-02.21
    55
    66# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
     
    1313
    1414errstatus=0
    15 dirmode=
     15dirmode=""
    1616
    1717usage="\
     
    104104for file
    105105do
    106   case $file in
    107     /*) pathcomp=/ ;;
    108     *)  pathcomp= ;;
    109   esac
    110   oIFS=$IFS
    111   IFS=/
    112   set fnord $file
     106  set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
    113107  shift
    114   IFS=$oIFS
    115108
     109  pathcomp=
    116110  for d
    117111  do
    118     test "x$d" = x && continue
    119 
    120     pathcomp=$pathcomp$d
     112    pathcomp="$pathcomp$d"
    121113    case $pathcomp in
    122114      -*) pathcomp=./$pathcomp ;;
     
    133125        if test ! -z "$dirmode"; then
    134126          echo "chmod $dirmode $pathcomp"
    135           lasterr=
     127          lasterr=""
    136128          chmod "$dirmode" "$pathcomp" || lasterr=$?
    137129
     
    143135    fi
    144136
    145     pathcomp=$pathcomp/
     137    pathcomp="$pathcomp/"
    146138  done
    147139done
  • trunk/src/Makefile.am

    r5691 r5750  
    4848                  world_entities/camera.cc \
    4949                  world_entities/player.cc \
    50                   world_entities/npc.cc \
    51                   world_entities/npc2.cc \
     50                  world_entities/npcs/npc.cc \
     51                  world_entities/npcs/npc_test1.cc \
     52                  world_entities/npcs/npc_test.cc \
    5253                  world_entities/environment.cc \
    5354                  world_entities/skysphere.cc \
     
    6263                  world_entities/weapons/test_gun.cc \
    6364                  world_entities/weapons/turret.cc \
     65                  world_entities/weapons/ground_turret.cc \
     66                  world_entities/weapons/aiming_turret.cc \
     67                  world_entities/weapons/cannon.cc \
    6468                  world_entities/weapons/test_bullet.cc \
    6569                  world_entities/weapons/rocket.cc \
    6670                  world_entities/weapons/laser.cc \
    6771                  world_entities/weapons/aim.cc \
     72                  world_entities/weapons/bomb.cc \
    6873                  world_entities/weapons/crosshair.cc \
    6974                  world_entities/power_ups/power_up.cc \
     
    8287                 world_entities/camera.h \
    8388                 world_entities/player.h \
    84                  world_entities/npc.h \
    85                  world_entities/npc2.h \
     89                 world_entities/npcs/npc.h \
     90                 world_entities/npcs/npc_test.h \
     91                 world_entities/npcs/npc_test1.h \
    8692                 world_entities/environment.h \
    8793                 world_entities/skysphere.h \
     
    95101                 world_entities/weapons/projectile.h \
    96102                 world_entities/weapons/test_gun.h \
     103                 world_entities/weapons/cannon.h \
    97104                 world_entities/weapons/turret.h \
     105                 world_entities/weapons/aiming_turret.h \
    98106                 world_entities/weapons/test_bullet.h \
    99107                 world_entities/weapons/rocket.h \
    100108                 world_entities/weapons/laser.h \
    101109                 world_entities/weapons/aim.h \
     110                 world_entities/weapons/bomb.h \
    102111                 world_entities/weapons/crosshair.h \
    103112                 world_entities/power_ups/power_up.h \
  • trunk/src/defs/class_id.h

    r5634 r5750  
    135135  CL_TEST_GUN                   =    0x00000230,
    136136  CL_TURRET                     =    0x00000231,
    137 
     137  CL_AIMING_TURRET              =    0x00000232,
     138  CL_CANNON                     =    0x00000233,
    138139
    139140  CL_TEST_BULLET                =    0x00000240,
    140141  CL_ROCKET                     =    0x00000241,
    141142  CL_LASER                      =    0x00000242,
    142 
     143  CL_BOMB                       =    0x00000243,
     144  CL_GROUND_TURRET              =    0x00000244,
    143145
    144146  // gamePlay (range from 0x00000500 0x000005ff)
  • trunk/src/lib/collision_detection/Makefile.am

    r5687 r5750  
    66libORXcd_a_SOURCES = cd_engine.cc \
    77                     collision.cc \
    8                      obb.cc \
     8                     obb.cc \
    99                     obb_tree.cc \
    10                      obb_tree_node.cc \
     10                     obb_tree_node.cc \
    1111                     bv_tree.cc \
    12                      bv_tree_node.cc \
    13                      bounding_volume.cc \
    14                      bounding_sphere.cc
     12                     bv_tree_node.cc \
     13                     bounding_volume.cc \
     14                     bounding_sphere.cc
    1515
    1616
    1717noinst_HEADERS =     cd_engine.h \
    18                      collision_defs.h \
     18                     collision_defs.h \
    1919                     collision.h \
    20                      obb.h \
     20                     obb.h \
    2121                     obb_tree.h \
    22                      obb_tree_node.h \
     22                     obb_tree_node.h \
    2323                     bv_tree.h \
    24                      bv_tree_node.h \
    25                      bounding_volume.h \
    26                      bounding_sphere.h
     24                     bv_tree_node.h \
     25                     bounding_volume.h \
     26                     bounding_sphere.h
    2727
  • trunk/src/lib/coord/p_node.h

    r5414 r5750  
    7070  inline const Vector& getAbsCoor () const { return this->absCoordinate; };
    7171  void shiftCoor (const Vector& shift);
     72  void shiftCoor (float x, float y, float z) { this->shiftCoor(Vector(x, y, z)); };
    7273
    7374  void setRelDir (const Quaternion& relDir);
     
    127128  static const char* parentingModeToChar(int parentingMode);
    128129  static PARENT_MODE charToParentingMode(const char* parentingMode);
     130
     131
    129132 private:
    130133  void init(PNode* parent);
  • trunk/src/lib/graphics/light.cc

    r5671 r5750  
    2929using namespace std;
    3030
    31 CREATE_FACTORY(Light);
     31CREATE_FACTORY(Light, CL_LIGHT);
    3232
    3333//! Definition of the Lights and their Names
  • trunk/src/lib/gui/gl_gui/glmenu/glmenu_imagescreen.cc

    r5671 r5750  
    2525#include "load_param.h"
    2626
    27 CREATE_FACTORY(GLMenuImageScreen);
     27CREATE_FACTORY(GLMenuImageScreen, CL_GLMENU_IMAGE_SCREEN);
    2828
    2929using namespace std;
  • trunk/src/lib/particles/particle_emitter.cc

    r5671 r5750  
    2929
    3030
    31 CREATE_FACTORY(ParticleEmitter);
     31CREATE_FACTORY(ParticleEmitter, CL_PARTICLE_EMITTER);
    3232
    3333/**
  • trunk/src/lib/particles/particle_system.cc

    r5671 r5750  
    3232#include "tinyxml.h"
    3333
    34 CREATE_FACTORY(ParticleSystem);
     34CREATE_FACTORY(ParticleSystem, CL_PARTICLE_SYSTEM);
    3535SHELL_COMMAND(texture, ParticleSystem, setMaterialTexture)
    3636    ->defaultValues(1, "maps/evil-flower.png");
  • trunk/src/lib/physics/fields/gravity.cc

    r5357 r5750  
    2323using namespace std;
    2424
    25 CREATE_FACTORY(Gravity);
     25CREATE_FACTORY(Gravity, CL_FIELD_GRAVITY);
    2626
    2727Gravity::Gravity(const TiXmlElement* root)
  • trunk/src/lib/physics/physics_connection.cc

    r5671 r5750  
    2929using namespace std;
    3030
    31 CREATE_FACTORY(PhysicsConnection);
     31CREATE_FACTORY(PhysicsConnection, CL_PHYSICS_CONNECTION);
    3232
    3333/**
  • trunk/src/story_entities/world.cc

    r5671 r5750  
    7070
    7171#include "cd_engine.h"
    72 #include "npc.h"
    73 #include "npc2.h"
     72#include "npcs/npc_test1.h"
    7473#include "shader.h"
    7574
     
    8180
    8281//! This creates a Factory to fabricate a World
    83 CREATE_FACTORY(World);
     82CREATE_FACTORY(World, CL_WORLD);
    8483
    8584World::World(const TiXmlElement* root)
     
    469468  for(int i = 0; i < 100; i++)
    470469  {
    471     WorldEntity* tmp = new NPC();
     470    WorldEntity* tmp = new NPCTest1();
    472471    char npcChar[10];
    473472    sprintf (npcChar, "NPC_%d", i);
  • trunk/src/subprojects/benchmark.cc

    r5427 r5750  
    3636#include <stdlib.h>
    3737#include <asm/msr.h>
    38 #include <linux/timex.h>
     38//#include <linux/timex.h>
    3939
    4040
  • trunk/src/subprojects/collision_detection/Makefile.am

    r5687 r5750  
    66
    77collision_LDADD = $(MAINSRCDIR)/util/libORXutils.a \
     8                  $(MAINSRCDIR)/lib/physics/libORXphysics.a \
    89                  $(MAINSRCDIR)/lib/collision_detection/libORXcd.a \
    910                  $(MAINSRCDIR)/lib/libORXlibs.a \
  • trunk/src/subprojects/collision_detection/collision_test_entity.cc

    r5687 r5750  
    2626
    2727using namespace std;
    28 CREATE_FACTORY(CollisionTestEntity);
     28CREATE_FACTORY(CollisionTestEntity, CL_ENVIRONMENT);
    2929
    3030/**
  • trunk/src/subprojects/importer/Makefile.am

    r5546 r5750  
    3131                  $(MAINSRCDIR)/lib/util/substring.cc \
    3232                  $(MAINSRCDIR)/lib/util/color.cc \
     33                  $(MAINSRCDIR)/lib/util/multi_type.cc \
    3334                  $(MAINSRCDIR)/util/loading/factory.cc
  • trunk/src/util/Makefile.am

    r5546 r5750  
    55
    66libORXutils_a_SOURCES = fast_factory.cc \
     7                        object_manager.cc \
    78                        loading/factory.cc \
    89                        garbage_collector.cc \
     
    1819                        track/pilot_node.cc \
    1920                        track/track_manager.cc \
    20                         track/track_node.cc
     21                        track/track_node.cc 
    2122
    2223noinst_HEADERS =        fast_factory.h \
     24                        object_manager.h \
    2325                        garbage_collector.h \
    2426                        state.h \
  • trunk/src/util/fast_factory.cc

    r5041 r5750  
    1313*/
    1414
    15 #define DEBUG_SPECIAL_MODULE DEBUG_MODULE_OBJECT_MANAGER
     15#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_LOAD
    1616
    1717#include "fast_factory.h"
  • trunk/src/util/loading/factory.cc

    r5298 r5750  
    3434   set everything to zero and define factoryName
    3535*/
    36 Factory::Factory (const char* factoryName)
     36Factory::Factory (const char* factoryName, ClassID classID)
    3737{
    3838  this->setClassID(CL_FACTORY, "Factory");
     
    4040
    4141  this->next = NULL;
     42  this->classID = classID;
    4243
    4344  Factory::registerFactory(this);
  • trunk/src/util/loading/factory.h

    r5357 r5750  
    3333 * this should be used at the beginning of all the Classes that should be loadable (in the cc-file)
    3434*/
    35 #define CREATE_FACTORY(CLASS_NAME) \
    36     tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME)
     35#define CREATE_FACTORY(CLASS_NAME, CLASS_ID) \
     36    tFactory<CLASS_NAME>* global_##CLASS_NAME##_Factory = new tFactory<CLASS_NAME>(#CLASS_NAME, CLASS_ID)
    3737
    3838//! The Factory is a loadable object handler
     
    4040
    4141 public:
    42   Factory (const char* factoryName = NULL);
     42  Factory (const char* factoryName = NULL, ClassID classID = CL_NULL);
    4343  virtual ~Factory ();
    4444
    4545  void fabricate(const char* className, const char* entityName);
     46  virtual BaseObject* fabricate(ClassID classID) = NULL;
    4647  virtual BaseObject* fabricate(const TiXmlElement* root) = NULL;
    4748  virtual BaseObject* fabricateDirect() = NULL;
     
    5758    Factory* getNext() const { return this->next; };
    5859
     60
     61  protected:
     62    ClassID           classID;              //!< The CLass-Identifyer of the Factory.
     63
    5964  private:
    6065    Factory*          next;                 //!< pointer to the next factory.
     
    6469/**
    6570 *  a factory that is able to load any kind of Object
    66    (this is a Functor)
    67 */
     71 * (this is a Functor)
     72 */
    6873template<class T> class tFactory : public Factory
    6974{
    70  public:
    71   tFactory(const char* factoryName);
    72   virtual ~tFactory();
     75  public:
     76    tFactory(const char* factoryName, ClassID classID);
     77    virtual ~tFactory();
    7378
    7479  private:
    75   virtual BaseObject* fabricate(const TiXmlElement* root);
    76   virtual BaseObject* fabricateDirect();
     80    virtual BaseObject* fabricate(ClassID classID);
     81    virtual BaseObject* fabricate(const TiXmlElement* root);
     82    virtual BaseObject* fabricateDirect();
    7783};
    7884
     
    8288*/
    8389template<class T>
    84 tFactory<T>::tFactory(const char* factoryName) : Factory(factoryName)
     90    tFactory<T>::tFactory(const char* factoryName, ClassID classID) : Factory(factoryName, classID)
    8591{
    8692  PRINTF(4)("Class: %s loadable\n", this->getName());
    8793}
    8894
    89 
     95/**
     96 * destructs the type-Factory
     97 */
    9098template<class T>
    91 tFactory<T>::~tFactory()
     99    tFactory<T>::~tFactory()
    92100{}
    93101
     102/**
     103 * fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
     104 * @param root the TiXmlElement T should load parameters from.
     105 * @return the newly fabricated T, NULL otherwise.
     106 */
    94107template<class T>
    95 BaseObject* tFactory<T>::fabricate(const TiXmlElement* root)
     108    BaseObject* tFactory<T>::fabricate(const TiXmlElement* root)
    96109{
    97110  if (root == NULL)
     
    106119}
    107120
     121
     122/**
     123 * fabricates an Object of type T, with the constructor T::T(const TiXmlElemnt*)
     124 * @param classID the ClassID of T that should be created.
     125 * @return the newly fabricated T if fabricated NULL otherwise.
     126 */
     127template<class T>
     128    BaseObject* tFactory<T>::fabricate(ClassID classID)
     129{
     130  if(classID == this->classID)
     131    return this->fabricateDirect();
     132  else if( getNext() != NULL)
     133    return getNext()->fabricate( classID);
     134  else
     135    return NULL;
     136}
     137
     138/**
     139 * directly fabricate an Entity of this factory.
     140 */
    108141template<class T>
    109142    BaseObject* tFactory<T>::fabricateDirect()
  • trunk/src/world_entities/Makefile.am

    r5463 r5750  
    2525                  weapons/rocket.cc \
    2626                  weapons/laser.cc \
     27                  weapons/ground_turret.cc \
    2728                  weapons/crosshair.cc \
     29                  weapons/ground_turret.cc \
    2830                  power_ups/power_up.cc \
    2931                  power_ups/turret_power_up.cc \
  • trunk/src/world_entities/environment.cc

    r5500 r5750  
    2828
    2929using namespace std;
    30 CREATE_FACTORY(Environment);
     30CREATE_FACTORY(Environment, CL_ENVIRONMENT);
    3131
    3232/**
  • trunk/src/world_entities/player.cc

    r5636 r5750  
    2828#include "weapons/test_gun.h"
    2929#include "weapons/turret.h"
     30#include "weapons/cannon.h"
    3031
    3132#include "list.h"
     
    3738using namespace std;
    3839
    39 CREATE_FACTORY(Player);
     40CREATE_FACTORY(Player, CL_PLAYER);
    4041
    4142/**
     
    4647{
    4748  this->init();
    48 
    49   //weapons:
    50   Weapon* wpRight = new TestGun(this->weaponMan, 0);
    51   Weapon* wpLeft = new TestGun(this->weaponMan, 1);
    52 
    53   this->weaponMan->addWeapon(wpRight);
    54 //  this->weaponMan->addWeapon(wpLeft, WM_CONFIG1, WM_SLOT1);
    55 //  this->weaponMan->addWeapon(wpRight, WM_CONFIG2);
    56 //  this->weaponMan->addWeapon(wpLeft, WM_CONFIG2);
    5749}
    5850
     
    8880
    8981  //weapons:
    90   Weapon* wpRight = new TestGun(this->weaponMan, 0);
     82  Weapon* wpRight = new TestGun(0);
    9183  wpRight->setName("testGun Right");
    92   Weapon* wpLeft = new TestGun(this->weaponMan, 1);
     84  Weapon* wpLeft = new TestGun(1);
    9385  wpLeft->setName("testGun Left");
     86  Weapon* cannon = dynamic_cast<Weapon*>(Factory::getFirst()->fabricate(CL_CANNON));
     87
     88  cannon->setName("BFG");
    9489
    9590  this->weaponMan->addWeapon(wpLeft, 1, 0);
    9691  this->weaponMan->addWeapon(wpRight,1 ,1);
     92  this->weaponMan->addWeapon(cannon, 0, 6);
     93
    9794  //this->weaponMan->addWeapon(turret, 3, 0);
    9895
     
    134131
    135132  this->weaponMan = new WeaponManager(this);
    136   this->weaponMan->setSlotCount(10);
     133  this->weaponMan->setSlotCount(7);
    137134
    138135  this->weaponMan->setSlotPosition(0, Vector(-2.6, .1, -3.0));
     
    153150  this->weaponMan->setSlotPosition(5, Vector(-1.5, -.5, -.5));
    154151  this->weaponMan->setSlotDirection(5, Quaternion(+M_PI_4*.5-M_PI, Vector(1,0,0)));
    155 
    156   this->weaponMan->setSlotPosition(6, Vector(-2.0, 0.1, -2.0));
    157   this->weaponMan->setSlotPosition(7, Vector(-2.0, 0.1, 2.0));
    158 
    159   this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
    160   this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
    161 
    162   this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
    163   this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));
     152//
     153   this->weaponMan->setSlotPosition(6, Vector(-1, 0.0, 0));
     154   this->weaponMan->setSlotCapability(6, WTYPE_ALLDIRS | WTYPE_DIRECTIONAL);
     155   //
     156//   this->weaponMan->setSlotPosition(8, Vector(-2.5, -0.3, -2.0));
     157//   this->weaponMan->setSlotDirection(8, Quaternion(-M_PI, Vector(1,0,0)));
     158//
     159//   this->weaponMan->setSlotPosition(9, Vector(-2.5, -0.3, 2.0));
     160//   this->weaponMan->setSlotDirection(9, Quaternion(+M_PI, Vector(1,0,0)));:
     161
    164162}
    165163
     
    337335}
    338336
     337#include "weapons/aiming_turret.h"
    339338// FIXME THIS MIGHT BE CONSIDERED EITHER A FEATURE, OR A BUG
    340339void Player::ADDWEAPON()
    341340{
    342   Weapon* turret1 = new Turret(this->weaponMan);
    343   turret1->setName("Turret");
    344   turret1->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
    345 
    346   this->weaponMan->addWeapon(turret1, 2);
    347 
    348   this->weaponMan->changeWeaponConfig(2);
    349 }
     341  Weapon* turret = NULL;
     342
     343  if ((float)rand()/RAND_MAX < .1)
     344  {
     345    //if (this->weaponMan->hasFreeSlot(2, WTYPE_TURRET))
     346    {
     347      turret = new Turret();
     348      this->weaponMan->addWeapon(turret, 2);
     349      this->weaponMan->changeWeaponConfig(2);
     350    }
     351  }
     352  else
     353  {
     354    //if (this->weaponMan->hasFreeSlot(3))
     355    {
     356      turret = new AimingTurret();
     357      this->weaponMan->addWeapon(turret, 3);
     358
     359      this->weaponMan->changeWeaponConfig(3);
     360    }
     361  }
     362
     363  if(turret != NULL)
     364  {
     365    turret->setName("Turret");
     366    turret->setStateDuration(WS_SHOOTING, (float)rand()/RAND_MAX*.5+.1);
     367  }
     368}
  • trunk/src/world_entities/power_ups/laser_power_up.cc

    r5500 r5750  
    2525using namespace std;
    2626
    27 CREATE_FACTORY(LaserPowerUp);
     27CREATE_FACTORY(LaserPowerUp, CL_LASER_POWER_UP);
    2828
    2929LaserPowerUp::LaserPowerUp ()
  • trunk/src/world_entities/power_ups/turret_power_up.cc

    r5500 r5750  
    2525using namespace std;
    2626
    27 CREATE_FACTORY(TurretPowerUp);
     27CREATE_FACTORY(TurretPowerUp, CL_TURRET_POWER_UP);
    2828
    2929TurretPowerUp::TurretPowerUp ()
  • trunk/src/world_entities/skybox.cc

    r5671 r5750  
    2525using namespace std;
    2626
    27 CREATE_FACTORY(SkyBox);
     27CREATE_FACTORY(SkyBox, CL_SKYBOX);
    2828
    2929/**
  • trunk/src/world_entities/terrain.cc

    r5671 r5750  
    2929using namespace std;
    3030
    31 CREATE_FACTORY(Terrain);
     31CREATE_FACTORY(Terrain, CL_TERRAIN);
    3232
    3333/**
  • trunk/src/world_entities/weapons/aim.cc

    r5671 r5750  
    2020#include "load_param.h"
    2121#include "graphics_engine.h"
    22 #include "glincl.h"
    2322#include "state.h"
     23#include "list.h"
    2424#include "material.h"
     25#include "t_animation.h"
     26#include "text.h"
     27
     28#include "world_entity.h"
    2529
    2630using namespace std;
     
    3034 * standart constructor
    3135 */
    32 Aim::Aim (const TiXmlElement* root)
     36Aim::Aim (PNode* source, const TiXmlElement* root)
    3337{
    3438  this->init();
     39
     40  this->source = source;
    3541
    3642  if (root)
     
    4753  if (this->material)
    4854    delete this->material;
     55
     56  if (this->text != NULL)
     57    delete this->text;
    4958}
    5059
     
    5867
    5968  this->setLayer(E2D_LAYER_TOP);
    60   this->setRotationSpeed(5);
     69  this->setRotationSpeed(30.0* (float)rand()/RAND_MAX + 10.0);
    6170  this->setSize(GraphicsEngine::getInstance()->getResolutionX()/10.0);
    6271
    63 //  this->setBindNode(this);
     72  this->setBindNode(this);
    6473  this->material = new Material;
    65 }
    66 
     74  this->source = NULL;
     75
     76  this->anim = new tAnimation<Aim>(this, &Aim::setSize);
     77  this->anim->setInfinity(ANIM_INF_CONSTANT);
     78  this->anim->addKeyFrame(500, .3, ANIM_LINEAR);
     79  this->anim->addKeyFrame(100, .2, ANIM_LINEAR);
     80  this->anim->addKeyFrame(50, .01, ANIM_LINEAR);
     81
     82  this->text = new Text();
     83  this->text->setParent2D(this);
     84  this->text->setRelCoor2D(10, -50);
     85  this->text->setParentMode2D(E2D_PARENT_MOVEMENT);
     86  this->text->setText("Testing");
     87}
    6788
    6889void Aim::loadParams(const TiXmlElement* root)
     
    80101}
    81102
     103void Aim::searchTarget(float range)
     104{
     105  tIterator<WorldEntity>* iterator = State::getWorldEntityList()->getIterator();
     106  WorldEntity* entity = iterator->firstElement();
     107  while (likely(entity != NULL))
     108  {
     109    if (entity->isA(CL_NPC) && this->source->getAbsCoor().x < entity->getAbsCoor().x && (this->source->getAbsCoor() - entity->getAbsCoor()).len() < range)
     110    {
     111      if (this->getParent() != entity)
     112      {
     113        this->anim->replay();
     114        this->setParentSoft(entity, 5);
     115      }
     116      delete iterator;
     117      return;
     118    }
     119    entity = iterator->nextElement();
     120  }
     121
     122  delete iterator;
     123}
     124
     125
    82126
    83127/**
     
    108152  this->shiftDir2D(dt * rotationSpeed);
    109153
    110 
    111   float z = 0.0f;
    112   glReadPixels ((int)this->getAbsCoor2D().x,
    113                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
    114                  1,
    115                  1,
    116                  GL_DEPTH_COMPONENT,
    117                  GL_FLOAT,
    118                  &z);
    119 
    120 
    121   GLdouble objX=.0, objY=.0, objZ=.0;
    122   gluUnProject(this->getAbsCoor2D().x,
    123                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
    124                .99,  // z
    125                GraphicsEngine::modMat,
    126                GraphicsEngine::projMat,
    127                GraphicsEngine::viewPort,
    128                &objX,
    129                &objY,
    130                &objZ );
    131 
    132   this->setAbsCoor(objX, objY, objZ);
     154  char outputText[100];
     155  sprintf(outputText, "%s - distance: %f\n", this->getParent()->getName(), (this->source->getAbsCoor() - this->getAbsCoor()).len());
     156  this->text->setText(outputText);
     157
     158
     159  if (this->source->getAbsCoor().x > this->getAbsCoor().x )
     160    this->searchTarget(1000);
     161//   float z = 0.0f;
     162//   glReadPixels ((int)this->getAbsCoor2D().x,
     163//                  GraphicsEngine::getInstance()->getResolutionY()-(int)this->getAbsCoor2D().y-1,
     164//                  1,
     165//                  1,
     166//                  GL_DEPTH_COMPONENT,
     167//                  GL_FLOAT,
     168//                  &z);
     169//
     170//
     171//   GLdouble objX=.0, objY=.0, objZ=.0;
     172//   gluUnProject(this->getAbsCoor2D().x,
     173//                GraphicsEngine::getInstance()->getResolutionY()-this->getAbsCoor2D().y-1,
     174//                .99,  // z
     175//                GraphicsEngine::modMat,
     176//                GraphicsEngine::projMat,
     177//                GraphicsEngine::viewPort,
     178//                &objX,
     179//                &objY,
     180//                &objZ );
     181//
     182//   this->setAbsCoor(objX, objY, objZ);
    133183}
    134184
     
    138188void Aim::draw() const
    139189{
     190
    140191  glPushMatrix();
    141192  glTranslatef(this->getAbsCoor2D().x, this->getAbsCoor2D().y, 0);
  • trunk/src/world_entities/weapons/aim.h

    r5557 r5750  
    1212// FORWARD DECLARATION
    1313class Model;
     14class Text;
    1415class Material;
    1516class TiXmlElement;
     17template<class T> class tAnimation;
    1618
    1719//! An Aim for zooming in on Targets.
     20/**
     21 * An Aim is a PNode, that is connected, to the Target, it has aquired
     22 * The target becomes, if selected its Parent.
     23 *
     24 * Also the Aim is a Element2D, as it draws a cross onto the Target.
     25 */
    1826class Aim : public PNode, public Element2D {
    1927
    2028 public:
    21   Aim(const TiXmlElement* root = NULL);
     29  Aim(PNode* source, const TiXmlElement* root = NULL);
    2230  virtual ~Aim();
    2331
     
    2533  void loadParams(const TiXmlElement* root);
    2634
     35  inline void setSource(PNode* source) { this->source = source; };
     36
    2737  inline void selectTarget(PNode* target) { this->setParent(target); };
    2838  inline PNode* getTarget(PNode* target) { return this->getParent(); };
    2939
     40  void searchTarget(float range);
    3041
    3142  void setSize(float size);
     
    4051   Material*        material;             //!< a material for the Aim.
    4152   float            rotationSpeed;        //!< Speed of the Rotation.
     53   tAnimation<Aim>* anim;
     54
     55   PNode*           source;               //!< Where this Shot has come from.
     56
     57   Text*            text;                 //!< A Text to display onto this Node. (distance to Target)
    4258};
    4359
  • trunk/src/world_entities/weapons/crosshair.cc

    r5671 r5750  
    7676  GraphicsEngine::showMouse(false);
    7777  GraphicsEngine::stealWMEvents(true);
     78  SDL_WarpMouse(GraphicsEngine::getInstance()->getResolutionX()/2, GraphicsEngine::getInstance()->getResolutionY()/2);
    7879}
    7980
  • trunk/src/world_entities/weapons/laser.cc

    r5687 r5750  
    8484    Laser::explosionParticles->setName("LaserExplosionParticles");
    8585    Laser::explosionParticles->setLifeSpan(.5, .3);
    86     Laser::explosionParticles->setRadius(0.0, 3.0);
     86    Laser::explosionParticles->setRadius(0.0, 10.0);
    8787    Laser::explosionParticles->setRadius(.5, 6.0);
    8888    Laser::explosionParticles->setRadius(1.0, 3.0);
  • trunk/src/world_entities/weapons/laser.h

    r5500 r5750  
    4242
    4343    WorldEntity* hitEntity; // FIXME TEMPORARY
    44 
    4544};
    4645
  • trunk/src/world_entities/weapons/test_gun.cc

    r5500 r5750  
    4141using namespace std;
    4242
    43 CREATE_FACTORY(TestGun);
     43CREATE_FACTORY(TestGun, CL_TEST_GUN);
    4444
    4545/**
     
    4848   creates a new weapon
    4949*/
    50 TestGun::TestGun (WeaponManager* weaponManager, int leftRight)
    51   : Weapon(weaponManager)
     50TestGun::TestGun ( int leftRight)
     51  : Weapon()
    5252{
    5353  this->init();
  • trunk/src/world_entities/weapons/test_gun.h

    r5500 r5750  
    3838  {
    3939  public:
    40     TestGun (WeaponManager* weaponManager, int leftRight);
     40    TestGun (int leftRight);
    4141    TestGun (const TiXmlElement* root);
    4242    virtual ~TestGun ();
  • trunk/src/world_entities/weapons/turret.cc

    r5512 r5750  
    3030#include "factory.h"
    3131
    32 CREATE_FACTORY(Turret);
     32CREATE_FACTORY(Turret, CL_TURRET);
    3333
    3434using namespace std;
    3535
    36 
    3736/**
    3837 *  standard constructor
    39 
    40    creates a new weapon
    41 */
    42 Turret::Turret (WeaponManager* weaponManager)
    43   : Weapon(weaponManager)
     38 *
     39 * creates a new Turret
     40 */
     41Turret::Turret ()
     42  : Weapon()
    4443{
    4544  this->init();
     
    5352}
    5453
    55 
     54/**
     55 * creates a new Turret from a TiXmlElement
     56 */
    5657Turret::Turret(const TiXmlElement* root)
    5758{
     
    117118{
    118119  Quaternion quat;
    119   Vector direction = this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();
     120  Vector direction = this->getAbsCoor();/*this->getWeaponManager()->getFixedTarget()->getAbsCoor() - this->getAbsCoor();*/
    120121
    121122  direction.normalize();
     
    135136    return;
    136137
    137   PNode* target = this->getWeaponManager()->getFixedTarget();
    138 
    139   if (target != NULL)
    140   {
    141138    pj->setVelocity(this->getVelocity()+(this->getAbsDir().apply(Vector(1,0,0))*100.0 + VECTOR_RAND(13)
    142139            /*target->getAbsCoor() - this->getAbsCoor()*/)*.5);//this->getVelocity());
    143   }
    144   else
    145     pj->setVelocity(target->getVelocity());
    146140
    147141  pj->setParent(NullParent::getInstance());
     
    159153void Turret::draw () const
    160154{
    161   this->getWeaponManager()->getFixedTarget()->debugDraw(10);
    162 
    163155  /* draw gun body */
    164156  glMatrixMode(GL_MODELVIEW);
  • trunk/src/world_entities/weapons/turret.h

    r5511 r5750  
    1212  {
    1313  public:
    14     Turret (WeaponManager* weaponManager);
     14    Turret ();
    1515    Turret(const TiXmlElement* root);
    1616    virtual ~Turret ();
  • trunk/src/world_entities/weapons/weapon.cc

    r5671 r5750  
    4141 * creates a new weapon
    4242*/
    43 Weapon::Weapon (WeaponManager* weaponManager)
     43Weapon::Weapon ()
    4444{
    4545  this->init();
    46   this->setWeaponManager(weaponManager);
    4746}
    4847
     
    9796  this->energyMax = 10.0;                          //< How much energy can be carried
    9897  this->capability = WTYPE_ALL;                    //< The Weapon has all capabilities @see W_Capability.
    99 
    100   this->setWeaponManager(NULL);                    //< By default the Weapon is free, and unhandled by a WeaponManager (this is good for small enemies).
    10198}
    10299
  • trunk/src/world_entities/weapons/weapon.h

    r5500 r5750  
    8181  public:
    8282    // INITIALISATION //
    83     Weapon (WeaponManager* weaponManager = NULL);
     83    Weapon ();
    8484    virtual ~Weapon ();
    8585
     
    9393    ///////////////////
    9494
    95     /** @param weaponManager sets the WeaponManager for this Weapon (NULL if free)) */
    96     inline void setWeaponManager(WeaponManager* weaponManager) { this->weaponManager = weaponManager; };
    97     /** @returns the WeaponManager of this Weapon (or NULL if it is free) */
    98     inline WeaponManager* getWeaponManager() const { return this->weaponManager; };
    99 
    10095    /** @returns true if the Weapon is Active  (this is used to check if the weapon must be drawn)*/
    101     inline bool isActive() const { return (this->currentState == WS_INACTIVE)?false:true; };
     96    inline bool isActive() const { return (this->currentState == WS_INACTIVE)? false : true; };
    10297    /** @returns true if the weapon must be drawn */
    103     inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive)?true:false; };
     98    inline bool isVisible() const { return (this->currentState != WS_INACTIVE || !this->hideInactive) ? true : false; };
    10499    /** @returns true if the Weapon is chargeable */
    105100    inline bool isChargeable() const { return this->chargeable; };
     
    120115
    121116
     117    // EMISSION
    122118    void setEmissionPoint(const Vector& point);
    123119    /** @see void setEmissionPoint(const Vector& point); */
     
    126122    inline const Vector& getEmissionPoint() const { return this->emissionPoint.getAbsCoor(); };
    127123
     124    // STATE CHANGES //
    128125    /** @param state the State to time @param duration the duration of the State */
    129126    inline void setStateDuration(const char* state, float duration) { setStateDuration(charToState(state), duration); };
     
    131128    inline void setStateDuration(WeaponState state, float duration) { /*(state < WS_STATE_COUNT)?*/this->times[state] = duration; };
    132129    /** @param state The state to query @returns the Time the queried State takes to complete */
    133     inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)?this->times[state]:0.0; };
     130    inline float getStateDuration(WeaponState state) const { return (state < WS_STATE_COUNT)? this->times[state] : 0.0; };
    134131    /** @returns true if the time of the currentState is elapsed, false otherwise */
    135     inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])?true:false; };
     132    inline bool stateTimeElapsed() const { return (this->stateDuration > this->times[currentState])? true : false; };
    136133    /** @returns the current State of the Weapon */
    137134    inline WeaponState getCurrentState() const { return this->currentState; };
     
    149146    // FLOW
    150147    void tickW(float dt); //!< this is a function that must be called by the weaponManager, or any other weaponHandler, all other functions are handled from within
     148
    151149    virtual void tick(float dt) {};
    152150    virtual void draw() const;
     
    194192    // it is all about energy
    195193    float                energy;                           //!< The energy stored in the weapons secondary buffers (reserve)
    196     float                energyLoaded;                     //!< The energy stored in the weapons primary buffers (firewithout reload)
     194    float                energyLoaded;                     //!< The energy stored in the weapons primary buffers (fire without reload)
    197195    float                energyMax;                        //!< The maximal energy that can be stored in the secondary buffers (reserveMax)
    198196    float                energyLoadedMax;                  //!< The maximal energy that can be stored in the primary buffers
     
    220218    ClassID              projectile;                      //!< the projectile used for this weapon (since they should be generated via macro and the FastFactory, only the ClassID must be known.)
    221219    FastFactory*         projectileFactory;               //!< A factory, that produces and handles the projectiles.
    222 
    223     WeaponManager*       weaponManager;                   //!< The weaponManager this weapon is connected to. if NULL it is assumed, that the weapon is freely connected to an entity without a binding WeaponManager.
    224220  };
    225221
  • trunk/src/world_entities/weapons/weapon_manager.cc

    r5671 r5750  
    2323#include "crosshair.h"
    2424
     25#include "class_list.h"
    2526#include "load_param.h"
    2627#include "factory.h"
    27 #include "vector.h"
    2828#include "list.h"
    2929#include "t_animation.h"
    3030#include "null_parent.h"
     31
    3132
    3233using namespace std;
     
    109110  this->crossHairSizeAnim->addKeyFrame(100, .05, ANIM_LINEAR);
    110111  this->crossHairSizeAnim->addKeyFrame(50, .01, ANIM_LINEAR);
     112
     113  this->targetIterator = NULL;
    111114}
    112115
     
    334337    }
    335338  }
     339}
     340
     341
     342/**
     343 * Selects an Entity from the NPC-list, and returns the Target
     344 */
     345PNode* WeaponManager::getSomeTarget()
     346{
     347   if (this->targetIterator == NULL)
     348   {
     349     tList<BaseObject>* npcList = ClassList::getList(CL_NPC);
     350     if (npcList != NULL)
     351     {
     352       this->targetIterator = npcList->getIterator();
     353       this->targetIterator->firstElement();
     354     }
     355     else
     356       return NULL;
     357   }
     358
     359   PNode* retNode = dynamic_cast<PNode*>(targetIterator->nextElement());
     360   if (retNode == NULL && this->targetIterator->getList()->getSize() > 0)
     361     retNode =  dynamic_cast<PNode*>(targetIterator->firstElement());
     362
     363   return retNode;
     364}
     365
     366
     367/**
     368 * Selects an Entity from the Entity-List, that is near of the carrier PNode.
     369 * @param carrier: The PNode from which the distance should be measured
     370 * @param distance: The Maximum Distance to Return.
     371 */
     372PNode* WeaponManager::getDistanceTarget(const PNode* carrier, float distance)
     373{
     374  tList<BaseObject>* npcList = ClassList::getList(CL_NPC);
     375  if (npcList != NULL)
     376  {
     377    tIterator<BaseObject>* npcIT = npcList->getIterator();
     378    PNode* tmpNPC = dynamic_cast<PNode*>(npcIT->firstElement());
     379    while (tmpNPC != NULL)
     380    {
     381      if ((carrier->getAbsCoor() - tmpNPC->getAbsCoor()).len() < distance)
     382      {
     383        delete npcIT;
     384        return tmpNPC;
     385      }
     386      tmpNPC = dynamic_cast<PNode*>(npcIT->nextElement());
     387    }
     388    delete npcIT;
     389  }
     390  return this->getFixedTarget();
     391
    336392}
    337393
  • trunk/src/world_entities/weapons/weapon_manager.h

    r5453 r5750  
    1717// FORWARD DECLARATION
    1818template <class T> class tAnimation;
     19template <class T> class tIterator;
    1920
    2021
     
    7071    void removeWeapon(Weapon* weapon, int configID = -1);
    7172
    72 
     73    // FIXME ::
     74//    bool hasFreeSlot(int configID, long capability = WTYPE_ALL) { return ( getNextFreeSlot(configID, capability ) != -1)? true : false; };
    7375
    7476    void nextWeaponConfig();
     
    7779
    7880    /** @returns a fixed target namely the Crosshair's 3D position */
    79     inline PNode* getFixedTarget() { return this->crosshair; };
     81    inline PNode* getFixedTarget() const { return this->crosshair; };
     82    PNode* getSomeTarget();
     83    PNode* getDistanceTarget(const PNode* carrier, float distance);
     84
    8085    void fire();
     86    //! @TODO: implement this function (maybe also in Weapon itself)
     87    void releaseFire();
    8188
    8289    void tick(float dt);
     
    8592    void debug() const;
    8693
    87   private:
     94 // private:
    8895    int getNextFreeSlot(int configID, long capability = WTYPE_ALL);
    8996
     
    102109    Crosshair*              crosshair;                                //!< an aim.
    103110    tAnimation<Crosshair>*  crossHairSizeAnim;                        //!< An animation for the crosshair (scaling)
     111
     112    tIterator<BaseObject>*  targetIterator;                           //!< An iterator for traversion lists of enemies.
    104113};
Note: See TracChangeset for help on using the changeset viewer.