Ignore:
Timestamp:
May 29, 2012, 9:23:17 AM (8 years ago)
Author:
sam
Message:

orbital: parser for the gun commands... fails to link because of flex.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/gun.h

    r1396 r1416  
    55//
    66
    7 /* TODO for this file:
    8  *  - rename "AppendQuadVert" to "AddVertex" or something; it has nothing
    9  *    to do with quads.
    10  */
    11 
    127extern char const *lolfx_shiny;
    13 
    14 #include "CommandParser.h"
    158
    169#if !defined __GUN_H__
    1710#define __GUN_H__
    1811
    19 class Gun : public CommandParser
     12namespace yy { class GunParser; }
     13
     14class Gun
    2015{
     16    friend class yy::GunParser;
     17
    2118public:
    2219    Gun()
     
    3734    {}
    3835
    39     virtual void SwitchCommand(char const *&command)
    40     {
    41         vec4 v4;
    42         vec3 v3;
    43         float f1, f2, f3, f4, f5, f6, f7, f8;
    44 
    45         const char *&p = command;
    46         {
    47 #define CASE(str) if (CheckCommand(str, p))
    48                  CASE("ai") { m_angle = AimActor(); }
    49             else CASE("pai") { p = GetArg(p, f1); PreAimActor(f1); }
    50             else CASE("ca") { p = GetArg(p, f1); m_pre_aim = f1; }
    51             else CASE("sa") { p = GetArg(p, f1); m_angle = f1; }
    52             else CASE("tim") { p = GetArg(p, f1); m_round_duration = f1; }
    53             else CASE("so") { p = GetArg(p, f1); m_angle_offset = f1; }
    54             else CASE("rd") { p = GetArg(p, f1); m_radius = f1; }
    55             else CASE("spd") { p = GetArg(p, f1); m_shoot_speed = f1; }
    56             else CASE("moda") { p = GetArg(p, v3); /* FIXME: 1st modifier */ }
    57             else CASE("modb") { p = GetArg(p, v3); /* FIXME: 2nd modifier */ }
    58             else CASE("ffb") { p = GetArg(p, f1); for (int i = 0; i < (int)f1; i++) Shoot(1); m_shoot_type = 1; m_round_timer = m_round_duration; }
    59             else CASE("ffp") { p = GetArg(p, f1); for (int i = 0; i < (int)f1; i++) Shoot(0); m_shoot_type = 0; m_round_timer = m_round_duration; }
    60             else CASE("fb") { p = GetArg(p, f1); Shoot(1); m_nbshoots = (int)f1 - 1; m_shoot_type = 1; m_round_timer = m_round_duration; }
    61             else CASE("fp") { p = GetArg(p, f1); Shoot(0); m_nbshoots = (int)f1 - 1; m_shoot_type = 0; m_round_timer = m_round_duration; }
    62             else CASE("sk") { p = GetArg(p, f1); m_round_timer = m_round_duration * f1; /* FIXME: modifiers */ }
    63             else CASE("loop") { /* FIXME: loops */ }
    64 #undef CASE
    65         }
    66     }
     36    void SendCommand(char const *command);
    6737
    6838    void Shoot(int count)
Note: See TracChangeset for help on using the changeset viewer.