[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs/entrances cloud.cxx,NONE,1.
From: |
torangan |
Subject: |
[Pingus-CVS] CVS: Games/Pingus/src/worldobjs/entrances cloud.cxx,NONE,1.1 cloud.hxx,NONE,1.1 woodthing.cxx,NONE,1.1 woodthing.hxx,NONE,1.1 |
Date: |
27 Sep 2002 11:50:47 -0000 |
Update of /usr/local/cvsroot/Games/Pingus/src/worldobjs/entrances
In directory dark:/tmp/cvs-serv26063
Added Files:
cloud.cxx cloud.hxx woodthing.cxx woodthing.hxx
Log Message:
added missing files
--- NEW FILE: cloud.cxx ---
// $Id: cloud.cxx,v 1.1 2002/09/27 11:50:45 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 "../../pingus_resource.hxx"
#include "../../worldobjsdata/entrance_data.hxx"
#include "cloud.hxx"
namespace WorldObjs {
namespace Entrances {
Cloud::Cloud (const WorldObjsData::EntranceData& data_)
: Entrance(data_)
{
data->pos.z = 100;
surface = PingusResource::load_surface("Entrances/cloud","entrances");
}
void
Cloud::draw_offset (int x, int y, float s)
{
if (s == 1.0) {
surface.put_screen(static_cast<int>(x + data->pos.x - 115),
static_cast<int>(y + data->pos.y - 100));
} else {
surface.put_screen(static_cast<int>((data->pos.x - 32 + x) * s),
static_cast<int>((data->pos.y - 16 + y) * s),
s, s);
}
}
} // namespace Entrances
} // namespace WorldObjs
/* EOF */
--- NEW FILE: cloud.hxx ---
// $Id: cloud.hxx,v 1.1 2002/09/27 11:50:45 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_WORLDOBJS_ENTRANCES_CLOUD_HXX
#define HEADER_PINGUS_WORLDOBJS_ENTRANCES_CLOUD_HXX
#include "../entrance.hxx"
namespace WorldObjs {
namespace Entrances {
class Cloud : public Entrance
{
public:
Cloud (const WorldObjsData::EntranceData& data_);
void draw_offset (int x, int y, float s = 1.0);
private:
Cloud (const Cloud&);
Cloud& operator= (const Cloud&);
};
} // namespace Entrances
} // namespace WorldObjs
#endif
/* EOF */
--- NEW FILE: woodthing.cxx ---
// $Id: woodthing.cxx,v 1.1 2002/09/27 11:50:45 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 "../../algo.hxx"
#include "../../graphic_context.hxx"
#include "../../particles/particle_holder.hxx"
#include "../../particles/smoke_particle.hxx"
#include "../../pingus_resource.hxx"
#include "../../world.hxx"
#include "../../worldobjsdata/entrance_data.hxx"
#include "woodthing.hxx"
namespace WorldObjs {
namespace Entrances {
WoodThing::WoodThing (const WorldObjsData::EntranceData& data_)
: Entrance(data_)
{
surface = PingusResource::load_surface("Entrances/woodthing_mov" ,
"entrances");
surface2 = PingusResource::load_surface("Entrances/woodthing_nmov",
"entrances");
counter.set_size(surface.get_num_frames());
counter.set_type(GameCounter::once);
counter.set_speed(2);
counter = surface.get_num_frames() - 1;
}
void
WoodThing::update (float delta)
{
Entrance::update (delta);
--counter;
if (rand() % 5 == 0)
{
world->get_particle_holder()
->add_particle(new SmokeParticle(static_cast<int>(data->pos.x -
surface.get_width () / 2 - 24),
static_cast<int>(data->pos.y -
surface.get_height() + 32 - 147),
-0.6 * (frand() + 1), -0.6 *
(frand() + 1)));
}
}
void
WoodThing::draw (GraphicContext& gc)
{
gc.draw(surface,
static_cast<int>(data->pos.x - surface.get_width () / 2),
static_cast<int>(data->pos.y - surface.get_height() + 32),
counter);
}
} // namespace Entrances
} // namespace WorldObjs
/* EOF */
--- NEW FILE: woodthing.hxx ---
// $Id: woodthing.hxx,v 1.1 2002/09/27 11:50:45 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_WORLDOBJS_ENTRANCES_WOODTHING_HXX
#define HEADER_PINGUS_WORLDOBJS_ENTRANCES_WOODTHING_HXX
#include "../../game_counter.hxx"
#include "../entrance.hxx"
namespace WorldObjs {
namespace Entrances {
class WoodThing : public Entrance
{
private:
GameCounter counter;
CL_Surface surface2;
public:
WoodThing (const WorldObjsData::EntranceData& data_);
void update (float delta);
void draw (GraphicContext& gc);
private:
WoodThing (const WoodThing&);
WoodThing& operator= (const WoodThing&);
};
} // namespace Entrances
} // namespace WorldObjs
#endif
/* EOF */
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Pingus-CVS] CVS: Games/Pingus/src/worldobjs/entrances cloud.cxx,NONE,1.1 cloud.hxx,NONE,1.1 woodthing.cxx,NONE,1.1 woodthing.hxx,NONE,1.1,
torangan <=
- Prev by Date:
[Pingus-CVS] CVS: Games/Pingus/src pingus.hxx,1.2,1.3
- Next by Date:
[Pingus-CVS] CVS: Games/Pingus/src entrance.cxx,1.7,NONE entrance.hxx,1.4,NONE entrance_data.cxx,1.7,NONE entrance_data.hxx,1.5,NONE
- Previous by thread:
[Pingus-CVS] CVS: Games/Pingus/src pingus.hxx,1.2,1.3
- Next by thread:
[Pingus-CVS] CVS: Games/Pingus/src entrance.cxx,1.7,NONE entrance.hxx,1.4,NONE entrance_data.cxx,1.7,NONE entrance_data.hxx,1.5,NONE
- Index(es):