Skip to content

Commit

Permalink
Refactor|libcommon: Switched p_door.c to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jan 29, 2014
1 parent a015765 commit 844c07b
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 181 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/common/common.pri
Expand Up @@ -97,7 +97,7 @@ SOURCES += \
$$common_src/pause.c \
$$common_src/p_actor.cpp \
$$common_src/p_ceiling.cpp \
$$common_src/p_door.c \
$$common_src/p_door.cpp \
$$common_src/p_floor.cpp \
$$common_src/p_inventory.c \
$$common_src/p_iterlist.c \
Expand Down
67 changes: 30 additions & 37 deletions doomsday/plugins/common/include/p_door.h
@@ -1,38 +1,29 @@
/**\file p_door.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
/** @file p_door.h Vertical door (opening/closing) thinker.
*
*\author Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
*\author Copyright © 1993-1996 by id Software, Inc.
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 1999 id Software, Inc.
*
* 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.
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* 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., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

/**
* Common playsim routines relating to doors.
* <small>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., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBCOMMON_THINKER_DOOR_H
#define LIBCOMMON_THINKER_DOOR_H

#ifdef __cplusplus
extern "C" {
#endif
#define DOORSPEED (2)
#define DOORWAIT (150)

typedef enum {
DS_DOWN = -1,
Expand Down Expand Up @@ -67,38 +58,40 @@ typedef enum {
typedef struct {
thinker_t thinker;
doortype_e type;
Sector* sector;
Sector *sector;
coord_t topHeight;
float speed;
doorstate_e state;
int topWait; // Tics to wait at the top.
int topCountDown;
} door_t;

#define DOORSPEED (2)
#define DOORWAIT (150)
#ifdef __cplusplus
extern "C" {
#endif

void T_Door(void *doorThinkerPtr);

dd_bool EV_VerticalDoor(Line* li, mobj_t* mo);
dd_bool EV_VerticalDoor(Line *li, mobj_t *mo);

#if __JHEXEN__
int EV_DoDoor(Line* li, byte* args, doortype_e type);
int EV_DoDoor(Line *li, byte *args, doortype_e type);
#else
int EV_DoDoor(Line* li, doortype_e type);
int EV_DoDoor(Line *li, doortype_e type);
#endif

#if __JDOOM__ || __JDOOM64__
int EV_DoLockedDoor(Line* li, doortype_e type, mobj_t* mo);
int EV_DoLockedDoor(Line *li, doortype_e type, mobj_t *mo);
#endif

#if __JDOOM__ || __JDOOM64__ || __JHERETIC__
void P_SpawnDoorCloseIn30(Sector* sec);
void P_SpawnDoorRaiseIn5Mins(Sector* sec);
void P_SpawnDoorCloseIn30(Sector *sec);

void P_SpawnDoorRaiseIn5Mins(Sector *sec);
#endif

#if __JDOOM64__
int EV_AnimateDoor(Line* li, mobj_t* mo);
int EV_AnimateDoor(Line* li, mobj_t *mo);
#endif

#ifdef __cplusplus
Expand Down

0 comments on commit 844c07b

Please sign in to comment.