Changeset 1417
- Timestamp:
- May 29, 2012, 8:37:59 PM (9 years ago)
- Location:
- trunk/orbital
- Files:
-
- 6 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/orbital/Makefile.am
r1416 r1417 5 5 orbital.cpp orbital.h \ 6 6 mesh.cpp mesh.h \ 7 gun.cpp gun.h \8 7 particlesystem.h tank.h player.h gun.h snake.h starfield.h 9 8 nodist_orbital_SOURCES = \ … … 14 13 orbital_DEPENDENCIES = $(top_builddir)/src/liblol.a \ 15 14 generated/mesh-scanner.cpp \ 16 generated/mesh-parser.cpp \ 17 generated/gun-scanner.cpp \ 18 generated/gun-parser.cpp 15 generated/mesh-parser.cpp 19 16 20 17 all-local: orbital$(EXEEXT) … … 26 23 flex -o generated/mesh-scanner.cpp mesh.l 27 24 bison -o generated/mesh-parser.cpp -d -b generated/mesh mesh.yy 28 flex -o generated/gun-scanner.cpp gun.l29 bison -o generated/gun-parser.cpp -d -b generated/gun gun.yy30 25 .FORCE: 31 26 endif -
trunk/orbital/gun.h
r1416 r1417 5 5 // 6 6 7 /* TODO for this file: 8 * - rename "AppendQuadVert" to "AddVertex" or something; it has nothing 9 * to do with quads. 10 */ 11 7 12 extern char const *lolfx_shiny; 13 14 #include "CommandParser.h" 8 15 9 16 #if !defined __GUN_H__ 10 17 #define __GUN_H__ 11 18 12 namespace yy { class GunParser; } 13 14 class Gun 19 class Gun : public CommandParser 15 20 { 16 friend class yy::GunParser;17 18 21 public: 19 22 Gun() … … 34 37 {} 35 38 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 } 37 67 38 68 void Shoot(int count)
Note: See TracChangeset
for help on using the changeset viewer.