~swag/armagetronad/0.2.9-sty+ct+ap-fork

« back to all changes in this revision

Viewing changes to src/tron/gSensor.cpp

  • Committer: luke-jr
  • Date: 2006-05-29 01:55:42 UTC
  • Revision ID: svn-v3-list-QlpoOTFBWSZTWZvbKhsAAAdRgAAQABK6798QIABURMgAAaeoNT1TxT1DQbKaeobXKiyAmlWT7Y5MkdJOtXDtB7w7DOGFBHiOBxaUIu7HQyyQSvxdyRThQkJvbKhs:7d95bf1e-0414-0410-9756-b78462a59f44:armagetronad%2Fbranches%2F0.2.8%2Farmagetronad:4612
Unify tags/branches of modules released together

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
*************************************************************************
 
4
 
 
5
ArmageTron -- Just another Tron Lightcycle Game in 3D.
 
6
Copyright (C) 2000  Manuel Moos (manuel@moosnet.de)
 
7
 
 
8
**************************************************************************
 
9
 
 
10
This program is free software; you can redistribute it and/or
 
11
modify it under the terms of the GNU General Public License
 
12
as published by the Free Software Foundation; either version 2
 
13
of the License, or (at your option) any later version.
 
14
 
 
15
This program is distributed in the hope that it will be useful,
 
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
GNU General Public License for more details.
 
19
 
 
20
You should have received a copy of the GNU General Public License
 
21
along with this program; if not, write to the Free Software
 
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
23
  
 
24
***************************************************************************
 
25
 
 
26
*/
 
27
 
 
28
#include "gCycle.h"
 
29
#include "gSensor.h"
 
30
#include "gWall.h"
 
31
#include "eDebugLine.h"
 
32
 
 
33
extern REAL sg_delayCycle;
 
34
 
 
35
void gSensor::PassEdge(const eWall *ww,REAL time,REAL a,int r){
 
36
    if (hit>time)
 
37
    {
 
38
        if (!ww)
 
39
            return;
 
40
 
 
41
        eSensor::PassEdge(ww,time,a,r);
 
42
 
 
43
        // see if the base class found the hit unworthy: ( HACK! )
 
44
        if ( time != hit )
 
45
            return;
 
46
 
 
47
        const gPlayerWall *w=dynamic_cast<const gPlayerWall*>(ww);
 
48
        if (w)
 
49
        {
 
50
            gCycle *owner=w->Cycle();
 
51
            if (owner==owned)
 
52
            {
 
53
                type=gSENSOR_SELF;
 
54
            }
 
55
            else
 
56
            {
 
57
                type=gSENSOR_ENEMY;
 
58
            }
 
59
 
 
60
            if (w->EndTime() < w->BegTime())
 
61
                lr=-lr;
 
62
        }
 
63
        else if (dynamic_cast<const gWallRim*>(ww))
 
64
            type=gSENSOR_RIM;
 
65
    }
 
66
}
 
67