Changeset 1417


Ignore:
Timestamp:
May 29, 2012, 8:37:59 PM (8 years ago)
Author:
sam
Message:

orbital: undo the gun command parser changes.

Location:
trunk/orbital
Files:
6 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/orbital/Makefile.am

    r1416 r1417  
    55    orbital.cpp orbital.h \
    66    mesh.cpp mesh.h \
    7     gun.cpp gun.h \
    87    particlesystem.h tank.h player.h gun.h snake.h starfield.h
    98nodist_orbital_SOURCES = \
     
    1413orbital_DEPENDENCIES = $(top_builddir)/src/liblol.a \
    1514    generated/mesh-scanner.cpp \
    16     generated/mesh-parser.cpp \
    17     generated/gun-scanner.cpp \
    18     generated/gun-parser.cpp
     15    generated/mesh-parser.cpp
    1916
    2017all-local: orbital$(EXEEXT)
     
    2623        flex -o generated/mesh-scanner.cpp mesh.l
    2724        bison -o generated/mesh-parser.cpp -d -b generated/mesh mesh.yy
    28         flex -o generated/gun-scanner.cpp gun.l
    29         bison -o generated/gun-parser.cpp -d -b generated/gun gun.yy
    3025.FORCE:
    3126endif
  • trunk/orbital/gun.h

    r1416 r1417  
    55//
    66
     7/* TODO for this file:
     8 *  - rename "AppendQuadVert" to "AddVertex" or something; it has nothing
     9 *    to do with quads.
     10 */
     11
    712extern char const *lolfx_shiny;
     13
     14#include "CommandParser.h"
    815
    916#if !defined __GUN_H__
    1017#define __GUN_H__
    1118
    12 namespace yy { class GunParser; }
    13 
    14 class Gun
     19class Gun : public CommandParser
    1520{
    16     friend class yy::GunParser;
    17 
    1821public:
    1922    Gun()
     
    3437    {}
    3538
    36     void SendCommand(char const *command);
     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    }
    3767
    3868    void Shoot(int count)
Note: See TracChangeset for help on using the changeset viewer.