pingus-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pingus-CVS] CVS: Games/Pingus/src/editorobjs Makefile.am,NONE,1.1 bumpe


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editorobjs Makefile.am,NONE,1.1 bumper_obj.cxx,NONE,1.1 bumper_obj.hxx,NONE,1.1 fake_exit_obj.cxx,NONE,1.1 fake_exit_obj.hxx,NONE,1.1 guillotine_obj.cxx,NONE,1.1 guillotine_obj.hxx,NONE,1.1 hammer_obj.cxx,NONE,1.1 hammer_obj.hxx,NONE,1.1 laser_exit_obj.cxx,NONE,1.1 laser_exit_obj.hxx,NONE,1.1 smasher_obj.cxx,NONE,1.1 smasher_obj.hxx,NONE,1.1 spike_obj.cxx,NONE,1.1 spike_obj.hxx,NONE,1.1
Date: 4 Sep 2002 14:55:14 -0000

Update of /usr/local/cvsroot/Games/Pingus/src/editorobjs
In directory dark:/tmp/cvs-serv11465/editorobjs

Added Files:
        Makefile.am bumper_obj.cxx bumper_obj.hxx fake_exit_obj.cxx 
        fake_exit_obj.hxx guillotine_obj.cxx guillotine_obj.hxx 
        hammer_obj.cxx hammer_obj.hxx laser_exit_obj.cxx 
        laser_exit_obj.hxx smasher_obj.cxx smasher_obj.hxx 
        spike_obj.cxx spike_obj.hxx 
Log Message:
- removed traps
- various cleanup


--- NEW FILE: Makefile.am ---
# Pingus - A free Lemmings clone
# Copyright (C) 1999 Ingo Ruhnke <address@hidden>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

noinst_LIBRARIES = libpingus_editorobjs.a

libpingus_editorobjs_a_SOURCES = \
        bumper_obj.cxx     bumper_obj.hxx \
        fake_exit_obj.cxx  fake_exit_obj.hxx \
        guillotine_obj.cxx guillotine_obj.hxx \
        hammer_obj.cxx     hammer_obj.hxx \
        laser_exit_obj.cxx laser_exit_obj.hxx \
        smasher_obj.cxx    smasher_obj.hxx \
        spike_obj.cxx      spike_obj.hxx

# EOF #
--- NEW FILE: bumper_obj.cxx ---
//  $Id: bumper_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "bumper_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/bumper_data.hxx"

namespace EditorObjs {

  BumperObj::BumperObj (WorldObjsData::BumperData* data_) : 
SpriteEditorObj(data_->pos),
                                                            frame(0),
                                                            data(new 
WorldObjsData::BumperData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/bumper", "traps");
    sprite.set_align_center_bottom ();
  }
  
  BumperObj::~BumperObj ()
  {
    delete data;
  }
  
  EditorObj*
  BumperObj::duplicate ()
  {
    return new BumperObj(data);
  }
  
  void
  BumperObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  BumperObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }
  
  std::string  
  BumperObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "BumperObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: bumper_obj.hxx ---
//  $Id: bumper_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_BUMPER_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_BUMPER_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class BumperData;
}

namespace EditorObjs {

  class BumperObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::BumperData* const data;
    
    public:
      BumperObj (WorldObjsData::BumperData* data_);
     ~BumperObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      BumperObj (const BumperObj&);
      BumperObj operator= (const BumperObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: fake_exit_obj.cxx ---
//  $Id: fake_exit_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "fake_exit_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/fake_exit_data.hxx"

namespace EditorObjs {

  FakeExitObj::FakeExitObj (WorldObjsData::FakeExitData* data_) : 
SpriteEditorObj(data_->pos),
                                                                  frame(0),
                                                                  data(new 
WorldObjsData::FakeExitData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/fake_exit", "traps");
    sprite.set_align_center_bottom ();
  }
  
  FakeExitObj::~FakeExitObj ()
  {
    delete data;
  }
  
  EditorObj*
  FakeExitObj::duplicate ()
  {
    return new FakeExitObj(data);
  }
  
  void
  FakeExitObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  FakeExitObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }
  
  std::string  
  FakeExitObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "FakeExitObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: fake_exit_obj.hxx ---
//  $Id: fake_exit_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_FAKE_EXIT_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_FAKE_EXIT_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class FakeExitData;
}

namespace EditorObjs {

  class FakeExitObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::FakeExitData* const data;
    
    public:
      FakeExitObj (WorldObjsData::FakeExitData* data_);
     ~FakeExitObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      FakeExitObj (const FakeExitObj&);
      FakeExitObj operator= (const FakeExitObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: guillotine_obj.cxx ---
//  $Id: guillotine_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "guillotine_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/guillotine_data.hxx"

namespace EditorObjs {

  GuillotineObj::GuillotineObj (WorldObjsData::GuillotineData* data_) : 
SpriteEditorObj(data_->pos),
                                                                        
frame(0),
                                                                        
data(new WorldObjsData::GuillotineData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/guillotineidle", "traps");
  }
  
  GuillotineObj::~GuillotineObj ()
  {
    delete data;
  }
  
  EditorObj*
  GuillotineObj::duplicate ()
  {
    return new GuillotineObj(data);
  }
  
  void
  GuillotineObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  GuillotineObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }

  std::string  
  GuillotineObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "GuillotineObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: guillotine_obj.hxx ---
//  $Id: guillotine_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_GUILLOTINE_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_GUILLOTINE_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class GuillotineData;
}

namespace EditorObjs {

  class GuillotineObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::GuillotineData* const data;
    
    public:
      GuillotineObj (WorldObjsData::GuillotineData* data_);
     ~GuillotineObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      GuillotineObj (const GuillotineObj&);
      GuillotineObj operator= (const GuillotineObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: hammer_obj.cxx ---
//  $Id: hammer_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "hammer_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/hammer_data.hxx"

namespace EditorObjs {

  HammerObj::HammerObj (WorldObjsData::HammerData* data_) : 
SpriteEditorObj(data_->pos),
                                                            frame(0),
                                                            data(new 
WorldObjsData::HammerData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/hammer", "traps");
    sprite.set_align_center_bottom ();
  }
  
  HammerObj::~HammerObj ()
  {
    delete data;
  }
  
  EditorObj*
  HammerObj::duplicate ()
  {
    return new HammerObj(data);
  }
  
  void
  HammerObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  HammerObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }

  std::string  
  HammerObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "HammerObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: hammer_obj.hxx ---
//  $Id: hammer_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_HAMMER_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_HAMMER_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class HammerData;
}

namespace EditorObjs {

  class HammerObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::HammerData* const data;
    
    public:
      HammerObj (WorldObjsData::HammerData* data_);
     ~HammerObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      HammerObj (const HammerObj&);
      HammerObj operator= (const HammerObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: laser_exit_obj.cxx ---
//  $Id: laser_exit_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "laser_exit_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/laser_exit_data.hxx"

namespace EditorObjs {

  LaserExitObj::LaserExitObj (WorldObjsData::LaserExitData* data_) : 
SpriteEditorObj(data_->pos),
                                                                     frame(0),
                                                                     data(new 
WorldObjsData::LaserExitData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/laser_exit", "traps");
    sprite.set_align_center_bottom ();
  }
  
  LaserExitObj::~LaserExitObj ()
  {
    delete data;
  }
  
  EditorObj*
  LaserExitObj::duplicate ()
  {
    return new LaserExitObj(data);
  }
  
  void
  LaserExitObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  LaserExitObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }

  std::string  
  LaserExitObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "LaserExitObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: laser_exit_obj.hxx ---
//  $Id: laser_exit_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_LASER_EXIT_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_LASER_EXIT_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class LaserExitData;
}

namespace EditorObjs {

  class LaserExitObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::LaserExitData* const data;
    
    public:
      LaserExitObj (WorldObjsData::LaserExitData* data_);
     ~LaserExitObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      LaserExitObj (const LaserExitObj&);
      LaserExitObj operator= (const LaserExitObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: smasher_obj.cxx ---
//  $Id: smasher_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "smasher_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/smasher_data.hxx"

namespace EditorObjs {

  SmasherObj::SmasherObj (WorldObjsData::SmasherData* data_) : 
SpriteEditorObj(data_->pos),
                                                               frame(0),
                                                               data(new 
WorldObjsData::SmasherData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/smasher", "traps");
  }
  
  SmasherObj::~SmasherObj ()
  {
    delete data;
  }
  
  EditorObj*
  SmasherObj::duplicate ()
  {
    return new SmasherObj(data);
  }
  
  void
  SmasherObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  SmasherObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }

  std::string  
  SmasherObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "SmasherObj: %4.2fx%4.2fx%4.2f", data->pos.x, 
data->pos.y, data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: smasher_obj.hxx ---
//  $Id: smasher_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_SMASHER_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_SMASHER_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class SmasherData;
}

namespace EditorObjs {

  class SmasherObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::SmasherData* const data;
    
    public:
      SmasherObj (WorldObjsData::SmasherData* data_);
     ~SmasherObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      SmasherObj (const SmasherObj&);
      SmasherObj operator= (const SmasherObj&);
  };

}

#endif

/* EOF */

--- NEW FILE: spike_obj.cxx ---
//  $Id: spike_obj.cxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#include "spike_obj.hxx"
#include "../editor/editor_view.hxx"
#include "../worldobjsdata/spike_data.hxx"

namespace EditorObjs {

  SpikeObj::SpikeObj (WorldObjsData::SpikeData* data_) : 
SpriteEditorObj(data_->pos),
                                                         frame(0),
                                                         data(new 
WorldObjsData::SpikeData(*data_))
  {
    data->pos.z = -100;
    sprite = Sprite("Traps/spike", "traps");
  }
  
  SpikeObj::~SpikeObj ()
  {
    delete data;
  }
  
  EditorObj*
  SpikeObj::duplicate ()
  {
    return new SpikeObj(data);
  }
  
  void
  SpikeObj::write_xml (std::ostream& xml)
  {
    data->write_xml(xml);
  }
  
  void
  SpikeObj::draw (EditorView* view)
  {
    view->draw(sprite, data->pos, frame);
  }

  std::string  
  SpikeObj::status_line ()
  {
    char str[64];
    snprintf (str, 64, "SpikeObj: %4.2fx%4.2fx%4.2f", data->pos.x, data->pos.y, 
data->pos.z);
    return str;
  }
  
}

/* EOF */

--- NEW FILE: spike_obj.hxx ---
//  $Id: spike_obj.hxx,v 1.1 2002/09/04 14:55:12 torangan Exp $
//
//  Pingus - A free Lemmings clone
//  Copyright (C) 1999 Ingo Ruhnke <address@hidden>
//
//  This program is free software; you can redistribute it and/or
//  modify it under the terms of the GNU General Public License
//  as published by the Free Software Foundation; either version 2
//  of the License, or (at your option) any later version.
//
//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.
//
//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software
//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

#ifndef HEADER_PINGUS_EDITOROBJS_SPIKE_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_SPIKE_OBJ_HXX

#include "../editor/sprite_editorobj.hxx"

namespace WorldObjsData {
  class SpikeData;
}

namespace EditorObjs {

  class SpikeObj : public SpriteEditorObj
  {
    private:
      int frame;
      WorldObjsData::SpikeData* const data;
    
    public:
      SpikeObj (WorldObjsData::SpikeData* data_);
     ~SpikeObj ();
     
      EditorObj* duplicate ();
      
      void write_xml (std::ostream& xml);
      void draw (EditorView* view);
      
      std::string status_line ();
    
    private:
      SpikeObj (const SpikeObj&);
      SpikeObj operator= (const SpikeObj&);
  };

}

#endif

/* EOF */





reply via email to

[Prev in Thread] Current Thread [Next in Thread]