Skip to content

Commit

Permalink
Refactor|libhexen: Switched st_stuff.c to C++ plus cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Dec 5, 2014
1 parent b4ab165 commit 8e839a3
Show file tree
Hide file tree
Showing 4 changed files with 985 additions and 938 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/heretic/src/st_stuff.cpp
Expand Up @@ -2695,7 +2695,7 @@ struct uiwidgetdef_t
{ UWG_COUNTERS, ALIGN_LEFT, ORDER_RIGHTTOLEFT, UWGF_VERTICAL, PADDING },
{ UWG_AUTOMAP, ALIGN_TOPLEFT }
};
int const widgetGroupDefCount = sizeof(widgetGroupDefs)/sizeof(widgetGroupDefs[0]);
int const widgetGroupDefCount = int(sizeof(widgetGroupDefs) / sizeof(widgetGroupDefs[0]));

uiwidgetdef_t const widgetDefs[] = {
{ GUI_BOX, ALIGN_TOPLEFT, UWG_STATUSBAR, GF_NONE, SBarBackground_UpdateGeometry, SBarBackground_Drawer },
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/hexen/hexen.pro
Expand Up @@ -93,7 +93,7 @@ SOURCES += \
src/p_things.c \
src/p_waggle.cpp \
src/sn_sonix.cpp \
src/st_stuff.c \
src/st_stuff.cpp \
src/tables.c \
src/x_api.c

Expand Down
66 changes: 26 additions & 40 deletions doomsday/plugins/hexen/include/st_stuff.h
@@ -1,31 +1,21 @@
/**\file st_stuff.h
*\section License
* License: GPL
* Online License Link: http://www.gnu.org/licenses/gpl.html
/** @file st_stuff.cpp Hexen specific HUD and statusbar widgets.
*
*\author Copyright © 2005-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
*\author Copyright © 2005-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2005-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2005-2014 Daniel Swanson <danij@dengine.net>
*
* 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
*/

/**
* Statusbar code jHexen - specific.
*
* Does palette indicators as well (red pain, bright pickup)
* <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 LIBHEXEN_STUFF_H
Expand Down Expand Up @@ -55,7 +45,7 @@ void ST_Register(void);
void ST_Init(void);
void ST_Shutdown(void);

int ST_Responder(event_t* ev);
int ST_Responder(event_t *ev);
void ST_Ticker(timespan_t ticLength);
void ST_Drawer(int player);

Expand All @@ -64,9 +54,9 @@ void ST_Stop(int player);

void ST_CloseAll(int player, dd_bool fast);

uiwidget_t* ST_UIChatForPlayer(int player);
uiwidget_t* ST_UILogForPlayer(int player);
uiwidget_t* ST_UIAutomapForPlayer(int player);
uiwidget_t *ST_UIChatForPlayer(int player);
uiwidget_t *ST_UILogForPlayer(int player);
uiwidget_t *ST_UIAutomapForPlayer(int player);

dd_bool ST_ChatIsActive(int player);
dd_bool ST_StatusBarIsActive(int player);
Expand All @@ -75,11 +65,11 @@ dd_bool ST_StatusBarIsActive(int player);
* Post a message to the specified player's log.
*
* @param player Player (local) number whose log to post to.
* @param flags @ref logMessageFlags
* @param text Message Text to be posted. Messages may use the same
* paramater control blocks as with the engine's Text rendering API.
* @param flags @ref logMessageFlags
* @param text Message Text to be posted. Messages may include encoded parameters
* to control how the messae is presented.
*/
void ST_LogPost(int player, byte flags, const char* text);
void ST_LogPost(int player, byte flags, char const *text);

/**
* Rewind the message log of the specified player, making the last few messages
Expand Down Expand Up @@ -120,12 +110,12 @@ float ST_AutomapOpacity(int player);
*
* @return @true= there is no point even partially visible.
*/
dd_bool ST_AutomapObscures2(int player, const RectRaw* region);
dd_bool ST_AutomapObscures2(int player, RectRaw const *region);
dd_bool ST_AutomapObscures(int player, int x, int y, int width, int height);

int ST_AutomapAddPoint(int player, coord_t x, coord_t y, coord_t z);
void ST_AutomapClearPoints(int player);
dd_bool ST_AutomapPointOrigin(int player, int point, coord_t* x, coord_t* y, coord_t* z);
dd_bool ST_AutomapPointOrigin(int player, int point, coord_t *x, coord_t *y, coord_t *z);

void ST_SetAutomapCameraRotation(int player, dd_bool on);

Expand All @@ -148,12 +138,8 @@ void ST_RebuildAutomap(int player);

void ST_FlashCurrentItem(int player);

D_CMD(ChatOpen);
D_CMD(ChatAction);
D_CMD(ChatSendMacro);

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* LIBHEXEN_STUFF_H */
#endif // LIBHEXEN_STUFF_H

0 comments on commit 8e839a3

Please sign in to comment.