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 exit_obj.cxx,NONE,1.1 exit


From: torangan
Subject: [Pingus-CVS] CVS: Games/Pingus/src/editorobjs exit_obj.cxx,NONE,1.1 exit_obj.hxx,NONE,1.1 Makefile.am,1.12,1.13
Date: 27 Sep 2002 16:01:57 -0000

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

Modified Files:
        Makefile.am 
Added Files:
        exit_obj.cxx exit_obj.hxx 
Log Message:
splitted Exit


--- NEW FILE: exit_obj.cxx ---
//  $Id: exit_obj.cxx,v 1.1 2002/09/27 16:01:55 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 <stdio.h>
#include "../worldobjsdata/exit_data.hxx"
#include "exit_obj.hxx"

namespace EditorObjs {

ExitObj::ExitObj (const WorldObjsData::ExitData& data_)
  : SpriteEditorObj(data_.desc.res_name, data_.desc.datafile),
    data(new WorldObjsData::ExitData(data_))
{
  pos_ref = &data->pos;
  sprite.set_align_center_bottom();
         
  if (data->use_old_pos_handling)
    {
      data->pos.x += sprite.get_width ()/2;
      data->pos.y += sprite.get_height();
      data->use_old_pos_handling = false;
    }
}

ExitObj::~ExitObj ()
{
  delete data;
}

EditorObj*
ExitObj::duplicate ()
{
  return new ExitObj(*data);
}

void
ExitObj::write_xml (std::ostream& xml)
{
  data->write_xml(xml);
}

std::string 
ExitObj::status_line ()
{
  char str[256];
  
  snprintf(str, 256, "Exit - %s - X:%4.2f Y:%4.2f Z:%4.2f OwnerId: %d",
           data->desc.res_name.c_str(), data->pos.x, data->pos.y, data->pos.z, 
data->owner_id);

  return str;
}

} // namespace EditorObjs

/* EOF */

--- NEW FILE: exit_obj.hxx ---
//  $Id: exit_obj.hxx,v 1.1 2002/09/27 16:01:55 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_EDIT_OBJ_HXX
#define HEADER_PINGUS_EDITOROBJS_EXIT_OBJ_HXX

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

namespace WorldObjsData {
class ExitData;
}

namespace EditorObjs {

class ExitObj : public SpriteEditorObj
{
private:
  WorldObjsData::ExitData* const data;
  
public:
  ExitObj (const WorldObjsData::ExitData& data_);
 ~ExitObj ();

  EditorObj* duplicate ();
  
  void write_xml (std::ostream& xml);
  
  std::string status_line ();
  
private:
  ExitObj (const ExitObj&);
  ExitObj& operator= (const ExitObj&);
};

} // namespace EditorObjs

#endif

/* EOF */


Index: Makefile.am
===================================================================
RCS file: /usr/local/cvsroot/Games/Pingus/src/editorobjs/Makefile.am,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- Makefile.am 27 Sep 2002 11:26:46 -0000      1.12
+++ Makefile.am 27 Sep 2002 16:01:55 -0000      1.13
@@ -21,6 +21,7 @@
        bumper_obj.cxx                  bumper_obj.hxx \
        conveyor_belt_obj.cxx           conveyer_belt_obj.hxx \
        entrance_obj.cxx                entrance_obj.hxx \
+       exit_obj.cxx                    exit_obj.hxx \
        fake_exit_obj.cxx               fake_exit_obj.hxx \
        guillotine_obj.cxx              guillotine_obj.hxx \
        groundpiece_obj.cxx             groundpiece_obj.hxx \





reply via email to

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