diff --git a/doomsday/build/codeblocks/jdoom.cbp b/doomsday/build/codeblocks/jdoom.cbp index 1473fd1ab5..f5a5602c69 100644 --- a/doomsday/build/codeblocks/jdoom.cbp +++ b/doomsday/build/codeblocks/jdoom.cbp @@ -104,6 +104,7 @@ + @@ -170,6 +171,7 @@ + diff --git a/doomsday/build/codeblocks/jdoom64.cbp b/doomsday/build/codeblocks/jdoom64.cbp index 01a890a3e1..2959f628c1 100644 --- a/doomsday/build/codeblocks/jdoom64.cbp +++ b/doomsday/build/codeblocks/jdoom64.cbp @@ -100,6 +100,7 @@ + @@ -167,6 +168,7 @@ + diff --git a/doomsday/build/codeblocks/jheretic.cbp b/doomsday/build/codeblocks/jheretic.cbp index 022ffeec75..cfb93a3a68 100644 --- a/doomsday/build/codeblocks/jheretic.cbp +++ b/doomsday/build/codeblocks/jheretic.cbp @@ -99,6 +99,7 @@ + @@ -148,6 +149,7 @@ + diff --git a/doomsday/build/codeblocks/jhexen.cbp b/doomsday/build/codeblocks/jhexen.cbp index 9baf22636d..14f5cd6709 100644 --- a/doomsday/build/codeblocks/jhexen.cbp +++ b/doomsday/build/codeblocks/jhexen.cbp @@ -100,6 +100,7 @@ + @@ -167,6 +168,7 @@ + diff --git a/doomsday/build/win32/jdoom64_cl.rsp b/doomsday/build/win32/jdoom64_cl.rsp index 277814c968..dde4ed8af9 100644 --- a/doomsday/build/win32/jdoom64_cl.rsp +++ b/doomsday/build/win32/jdoom64_cl.rsp @@ -9,6 +9,7 @@ .\..\..\plugins\common\src\g_game.c .\..\..\plugins\common\src\g_update.c .\..\..\plugins\common\src\gl_drawcompositefont.c + .\..\..\plugins\common\src\gl_drawpatch.c .\..\..\plugins\common\src\hu_lib.c .\..\..\plugins\common\src\hu_log.c .\..\..\plugins\common\src\hu_menu.c diff --git a/doomsday/build/win32/jdoom_cl.rsp b/doomsday/build/win32/jdoom_cl.rsp index efc3a3c72f..40eff5d7b7 100644 --- a/doomsday/build/win32/jdoom_cl.rsp +++ b/doomsday/build/win32/jdoom_cl.rsp @@ -67,5 +67,6 @@ .\..\..\plugins\common\src\g_game.c .\..\..\plugins\common\src\g_update.c .\..\..\plugins\common\src\gl_drawcompositefont.c + .\..\..\plugins\common\src\gl_drawpatch.c .\..\..\plugins\jdoom\src\d_items.c .\..\..\plugins\jdoom\src\acfnlink.c diff --git a/doomsday/build/win32/jheretic_cl.rsp b/doomsday/build/win32/jheretic_cl.rsp index e33170dc8d..76c80a7732 100644 --- a/doomsday/build/win32/jheretic_cl.rsp +++ b/doomsday/build/win32/jheretic_cl.rsp @@ -42,6 +42,7 @@ .\..\..\plugins\common\src\g_game.c .\..\..\plugins\common\src\g_update.c .\..\..\plugins\common\src\gl_drawcompositefont.c + .\..\..\plugins\common\src\gl_drawpatch.c .\..\..\plugins\common\src\f_infine.c .\..\..\plugins\common\src\hu_stuff.c .\..\..\plugins\common\src\hu_lib.c diff --git a/doomsday/build/win32/jhexen_cl.rsp b/doomsday/build/win32/jhexen_cl.rsp index 99af218e27..50a7c200c2 100644 --- a/doomsday/build/win32/jhexen_cl.rsp +++ b/doomsday/build/win32/jhexen_cl.rsp @@ -36,6 +36,7 @@ .\..\..\plugins\common\src\g_controls.c .\..\..\plugins\common\src\g_game.c .\..\..\plugins\common\src\gl_drawcompositefont.c + .\..\..\plugins\common\src\gl_drawpatch.c .\..\..\plugins\common\src\f_infine.c .\..\..\plugins\common\src\p_saveg.c .\..\..\plugins\common\src\hu_stuff.c diff --git a/doomsday/build/win32/vs8/jdoom.vcproj b/doomsday/build/win32/vs8/jdoom.vcproj index 1512f523a0..b80b9c805f 100644 --- a/doomsday/build/win32/vs8/jdoom.vcproj +++ b/doomsday/build/win32/vs8/jdoom.vcproj @@ -848,6 +848,10 @@ RelativePath="..\..\..\plugins\common\include\gl_drawcompositefont.h" > + + @@ -1044,6 +1048,10 @@ RelativePath="..\..\..\plugins\common\src\gl_drawcompositefont.c" > + + diff --git a/doomsday/build/win32/vs8/jdoom64.vcproj b/doomsday/build/win32/vs8/jdoom64.vcproj index e019d1c53e..464450e999 100644 --- a/doomsday/build/win32/vs8/jdoom64.vcproj +++ b/doomsday/build/win32/vs8/jdoom64.vcproj @@ -844,6 +844,10 @@ RelativePath="..\..\..\plugins\common\include\gl_drawcompositefont.h" > + + @@ -1036,6 +1040,10 @@ RelativePath="..\..\..\plugins\common\src\gl_drawcompositefont.c" > + + diff --git a/doomsday/build/win32/vs8/jheretic.vcproj b/doomsday/build/win32/vs8/jheretic.vcproj index a9f4f06105..65bad15064 100644 --- a/doomsday/build/win32/vs8/jheretic.vcproj +++ b/doomsday/build/win32/vs8/jheretic.vcproj @@ -847,6 +847,10 @@ RelativePath="..\..\..\plugins\common\include\gl_drawcompositefont.h" > + + @@ -1047,6 +1051,10 @@ RelativePath="..\..\..\plugins\common\src\gl_drawcompositefont.c" > + + diff --git a/doomsday/build/win32/vs8/jhexen.vcproj b/doomsday/build/win32/vs8/jhexen.vcproj index fdfbbe5187..5016654c22 100644 --- a/doomsday/build/win32/vs8/jhexen.vcproj +++ b/doomsday/build/win32/vs8/jhexen.vcproj @@ -852,6 +852,10 @@ RelativePath="..\..\..\plugins\common\include\gl_drawcompositefont.h" > + + @@ -1052,6 +1056,10 @@ RelativePath="..\..\..\plugins\common\src\gl_drawcompositefont.c" > + + diff --git a/doomsday/plugins/common/include/gl_drawcompositefont.h b/doomsday/plugins/common/include/gl_drawcompositefont.h index 6fd25cd0e8..d8ba83adb1 100644 --- a/doomsday/plugins/common/include/gl_drawcompositefont.h +++ b/doomsday/plugins/common/include/gl_drawcompositefont.h @@ -84,9 +84,17 @@ void R_InitFont(gamefontid_t fontid, const fontpatch_t* patches, size /*@}*/ /** - * Text string fragments: + * Text strings (formatted). */ +void GL_DrawText(const char* string, int x, int y, gamefontid_t font, short flags, int defTracking, float defRed, float defGreen, float defBlue, float defAlpha, boolean defCase); + +// Utility routines: +int GL_TextWidth(const char* string, gamefontid_t font); +int GL_TextHeight(const char* string, gamefontid_t font); +/** + * Text string fragments: + */ void GL_DrawTextFragment(const char* string, int x, int y); void GL_DrawTextFragment2(const char* string, int x, int y, gamefontid_t font); void GL_DrawTextFragment3(const char* string, int x, int y, gamefontid_t font, short flags); @@ -96,16 +104,8 @@ void GL_DrawTextFragment5(const char* string, int x, int y, gamefonti // Utility routines: int GL_TextFragmentWidth(const char* string, gamefontid_t font); int GL_TextFragmentWidth2(const char* string, gamefontid_t font, int tracking); -int GL_TextFragmentHeight(const char* string, gamefontid_t font); - -/** - * Text strings (formatted). - */ -void GL_DrawText(const char* string, int x, int y, gamefontid_t font, short flags, int defTracking, float defRed, float defGreen, float defBlue, float defAlpha, boolean defCase); -// Utility routines: -int GL_TextWidth(const char* string, gamefontid_t font); -int GL_TextHeight(const char* string, gamefontid_t font); +int GL_TextFragmentHeight(const char* string, gamefontid_t font); /** * Single character: diff --git a/doomsday/plugins/common/include/gl_drawpatch.h b/doomsday/plugins/common/include/gl_drawpatch.h new file mode 100644 index 0000000000..98793cf691 --- /dev/null +++ b/doomsday/plugins/common/include/gl_drawpatch.h @@ -0,0 +1,56 @@ +/**\file + *\section License + * License: GPL + * Online License Link: http://www.gnu.org/licenses/gpl.html + * + *\author Copyright © 1999-2010 Jaakko Keränen + *\author Copyright © 2006-2010 Daniel Swanson + * + * 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 + */ + +/** + * gl_drawpatch.h: Convenient methods for drawing quads textured with + * Patch-format graphics. + */ + +#ifndef LIBCOMMON_GRAPHICS_DRAW_PATCH_H +#define LIBCOMMON_GRAPHICS_DRAW_PATCH_H + +#include "dd_types.h" + +/** + * @defGroup drawPatchFlags Draw Patch Flags. + */ +/*@{*/ +#define DPF_ALIGN_LEFT 0x0001 +#define DPF_ALIGN_RIGHT 0x0002 +#define DPF_ALIGN_BOTTOM 0x0004 +#define DPF_ALIGN_TOP 0x0008 +#define DPF_NO_OFFSETX 0x0010 +#define DPF_NO_OFFSETY 0x0020 + +#define DPF_NO_OFFSET (DPF_NO_OFFSETX|DPF_NO_OFFSETY) +#define DPF_ALIGN_TOPLEFT (DPF_ALIGN_TOP|DPF_ALIGN_LEFT) +#define DPF_ALIGN_BOTTOMLEFT (DPF_ALIGN_BOTTOM|DPF_ALIGN_LEFT) +#define DPF_ALIGN_TOPRIGHT (DPF_ALIGN_TOP|DPF_ALIGN_RIGHT) +#define DPF_ALIGN_BOTTOMRIGHT (DPF_ALIGN_BOTTOM|DPF_ALIGN_RIGHT) +/*@}*/ + +void GL_DrawPatch(patchid_t id, int x, int y); +void GL_DrawPatch2(patchid_t id, int x, int y, short flags); + +#endif /* LIBCOMMON_GRAPHICS_DRAW_PATCH_H */ diff --git a/doomsday/plugins/common/include/hu_stuff.h b/doomsday/plugins/common/include/hu_stuff.h index ba8a47d959..9a1e2427a8 100644 --- a/doomsday/plugins/common/include/hu_stuff.h +++ b/doomsday/plugins/common/include/hu_stuff.h @@ -31,6 +31,7 @@ #define __COMMON_HU_STUFF_H__ #include "gl_drawcompositefont.h" +#include "gl_drawpatch.h" #if __JHEXEN__ # include "h2def.h" @@ -91,31 +92,6 @@ void M_DrawShadowedChar(unsigned char ch, int x, int y); void M_DrawShadowedChar2(unsigned char ch, int x, int y, gamefontid_t font); void M_DrawShadowedChar3(unsigned char ch, int x, int y, gamefontid_t font, short flags, float r, float g, float b, float a); -/** - * Patches: - */ - -/** - * @defGroup drawPatchFlags Draw Patch Flags. - */ -/*@{*/ -#define DPF_ALIGN_LEFT 0x0001 -#define DPF_ALIGN_RIGHT 0x0002 -#define DPF_ALIGN_BOTTOM 0x0004 -#define DPF_ALIGN_TOP 0x0008 -#define DPF_NO_OFFSETX 0x0010 -#define DPF_NO_OFFSETY 0x0020 - -#define DPF_NO_OFFSET (DPF_NO_OFFSETX|DPF_NO_OFFSETY) -#define DPF_ALIGN_TOPLEFT (DPF_ALIGN_TOP|DPF_ALIGN_LEFT) -#define DPF_ALIGN_BOTTOMLEFT (DPF_ALIGN_BOTTOM|DPF_ALIGN_LEFT) -#define DPF_ALIGN_TOPRIGHT (DPF_ALIGN_TOP|DPF_ALIGN_RIGHT) -#define DPF_ALIGN_BOTTOMRIGHT (DPF_ALIGN_BOTTOM|DPF_ALIGN_RIGHT) -/*@}*/ - -void M_DrawPatch(patchid_t id, int x, int y); -void M_DrawPatch2(patchid_t id, int x, int y, short flags); - void M_DrawShadowedPatch(patchid_t id, int x, int y); void M_DrawShadowedPatch2(patchid_t id, int x, int y, short flags); void M_DrawShadowedPatch3(patchid_t id, int x, int y, short flags, float r, float g, float b, float a); diff --git a/doomsday/plugins/common/src/am_map.c b/doomsday/plugins/common/src/am_map.c index 79540d3f98..4db2355297 100644 --- a/doomsday/plugins/common/src/am_map.c +++ b/doomsday/plugins/common/src/am_map.c @@ -1760,9 +1760,9 @@ void M_DrawMapMenu(void) // Draw the page arrows. token = dpInvPageLeft[!menu->firstItem || (menuTime & 8)]; - M_DrawPatch(token, menu->x, menu->y - 22); + GL_DrawPatch(token, menu->x, menu->y - 22); token = dpInvPageRight[menu->firstItem + menu->numVisItems >= menu->itemCount || (menuTime & 8)]; - M_DrawPatch(token, 312 - menu->x, menu->y - 22); + GL_DrawPatch(token, 312 - menu->x, menu->y - 22); #endif idx = 0; diff --git a/doomsday/plugins/common/src/f_infine.c b/doomsday/plugins/common/src/f_infine.c index 7763913af1..06509623c3 100644 --- a/doomsday/plugins/common/src/f_infine.c +++ b/doomsday/plugins/common/src/f_infine.c @@ -1810,7 +1810,7 @@ void FI_Drawer(void) } else if(pic->flags.is_patch) { - M_DrawPatch((patchid_t)pic->tex[sq], 0, 0); + GL_DrawPatch((patchid_t)pic->tex[sq], 0, 0); } else { diff --git a/doomsday/plugins/common/src/gl_drawcompositefont.c b/doomsday/plugins/common/src/gl_drawcompositefont.c index 5b77cb8d04..02d5666180 100644 --- a/doomsday/plugins/common/src/gl_drawcompositefont.c +++ b/doomsday/plugins/common/src/gl_drawcompositefont.c @@ -39,8 +39,8 @@ # include "jhexen.h" #endif +#include "gl_drawpatch.h" #include "gl_drawcompositefont.h" -#include "hu_stuff.h" // MACROS ------------------------------------------------------------------ @@ -748,7 +748,7 @@ void GL_DrawTextFragment(const char* string, int x, int y) void GL_DrawChar3(unsigned char ch, int x, int y, gamefontid_t font, short flags) { - M_DrawPatch2(patchForFontChar(font, ch), x, y, translateTextToPatchDrawFlags(flags)); + GL_DrawPatch2(patchForFontChar(font, ch), x, y, translateTextToPatchDrawFlags(flags)); } void GL_DrawChar2(unsigned char ch, int x, int y, gamefontid_t font) diff --git a/doomsday/plugins/common/src/gl_drawpatch.c b/doomsday/plugins/common/src/gl_drawpatch.c new file mode 100644 index 0000000000..0e71a79951 --- /dev/null +++ b/doomsday/plugins/common/src/gl_drawpatch.c @@ -0,0 +1,107 @@ +/**\file + *\section License + * License: GPL + * Online License Link: http://www.gnu.org/licenses/gpl.html + * + *\author Copyright © 2003-2010 Jaakko Keränen + *\author Copyright © 2005-2010 Daniel Swanson + * + * 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 + */ + +// HEADER FILES ------------------------------------------------------------ + +#include + +#include "doomsday.h" + +#include "gl_drawpatch.h" + +// MACROS ------------------------------------------------------------------ + +// TYPES ------------------------------------------------------------------- + +// EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- + +// PUBLIC FUNCTION PROTOTYPES ---------------------------------------------- + +// PRIVATE FUNCTION PROTOTYPES --------------------------------------------- + +// EXTERNAL DATA DECLARATIONS ---------------------------------------------- + +// PUBLIC DATA DEFINITIONS ------------------------------------------------- + +// PRIVATE DATA DEFINITIONS ------------------------------------------------ + +// CODE -------------------------------------------------------------------- + +void GL_DrawPatch2(patchid_t id, int posX, int posY, short flags) +{ + float x = (float) posX, y = (float) posY, w, h; + patchinfo_t info; + + if(id == -1) + return; + + DGL_SetPatch(id, DGL_CLAMP_TO_EDGE, DGL_CLAMP_TO_EDGE); + if(!R_GetPatchInfo(id, &info)) + return; + + if(flags & DPF_ALIGN_RIGHT) + x -= info.width; + else if(!(flags & DPF_ALIGN_LEFT)) + x -= info.width /2; + + if(flags & DPF_ALIGN_BOTTOM) + y -= info.height; + else if(!(flags & DPF_ALIGN_TOP)) + y -= info.height/2; + + w = (float) info.width; + h = (float) info.height; + + if(!(flags & DPF_NO_OFFSETX)) + x += (float) info.offset; + if(!(flags & DPF_NO_OFFSETY)) + y += (float) info.topOffset; + + if(info.extraOffset[0]) + { + // This offset is used only for the extra borders in the + // "upscaled and sharpened" patches, so we can tweak the values + // to our liking a bit more. + x += info.extraOffset[0]; + y += info.extraOffset[1]; + w += abs(info.extraOffset[0])*2; + h += abs(info.extraOffset[1])*2; + } + + DGL_Begin(DGL_QUADS); + DGL_TexCoord2f(0, 0, 0); + DGL_Vertex2f(x, y); + DGL_TexCoord2f(0, 1, 0); + DGL_Vertex2f(x + w, y); + DGL_TexCoord2f(0, 1, 1); + DGL_Vertex2f(x + w, y + h); + DGL_TexCoord2f(0, 0, 1); + DGL_Vertex2f(x, y + h); + DGL_End(); +} + +void GL_DrawPatch(patchid_t id, int x, int y) +{ + GL_DrawPatch2(id, x, y, DPF_ALIGN_TOPLEFT); +} diff --git a/doomsday/plugins/common/src/hu_inventory.c b/doomsday/plugins/common/src/hu_inventory.c index 9dae6e3614..4ccd518cb5 100644 --- a/doomsday/plugins/common/src/hu_inventory.c +++ b/doomsday/plugins/common/src/hu_inventory.c @@ -372,7 +372,7 @@ Draw_BeginZoom(invScale, x, y + ST_INVENTORYHEIGHT); a = i == selected? .5f : light / 2; DGL_Color4f(light, light, light, a * iconAlpha); - M_DrawPatch(dpInvItemBox, x + slot * ST_INVSLOTWIDTH + ST_INVSLOTOFFX, y); + GL_DrawPatch(dpInvItemBox, x + slot * ST_INVSLOTWIDTH + ST_INVSLOTOFFX, y); if(i >= startSlot && i < endSlot) { @@ -387,7 +387,7 @@ Draw_BeginZoom(invScale, x, y + ST_INVENTORYHEIGHT); int posX = x + slot * ST_INVSLOTWIDTH; #endif DGL_Color4f(1, 1, 1, slot == selected? iconAlpha : iconAlpha / 2); - M_DrawPatch(item->patchId, posX, y + ST_INVICONOFFY); + GL_DrawPatch(item->patchId, posX, y + ST_INVICONOFFY); if(count > 1) { @@ -405,7 +405,7 @@ Draw_BeginZoom(invScale, x, y + ST_INVENTORYHEIGHT); } DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpInvSelectBox, x + selected * ST_INVSLOTWIDTH, y + ST_INVSELECTOFFY - BORDER); + GL_DrawPatch(dpInvSelectBox, x + selected * ST_INVSLOTWIDTH, y + ST_INVSELECTOFFY - BORDER); if(inv->numUsedSlots > maxVisSlots) { @@ -415,13 +415,13 @@ Draw_BeginZoom(invScale, x, y + ST_INVENTORYHEIGHT); if(cfg.inventoryWrap || first != 0) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch2(dpInvPageLeft[!(mapTime & 4)? 1 : 0], x - ARROW_RELXOFF, y + ARROW_YOFFSET, DPF_ALIGN_RIGHT|DPF_ALIGN_TOP); + GL_DrawPatch2(dpInvPageLeft[!(mapTime & 4)? 1 : 0], x - ARROW_RELXOFF, y + ARROW_YOFFSET, DPF_ALIGN_RIGHT|DPF_ALIGN_TOP); } if(cfg.inventoryWrap || inv->numUsedSlots - first > numVisSlots) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpInvPageRight[!(mapTime & 4)? 1 : 0], x + numVisSlots * ST_INVSLOTWIDTH + ARROW_RELXOFF + 1, y + ARROW_YOFFSET); + GL_DrawPatch(dpInvPageRight[!(mapTime & 4)? 1 : 0], x + numVisSlots * ST_INVSLOTWIDTH + ARROW_RELXOFF + 1, y + ARROW_YOFFSET); } #undef ARROW_XOFFSET @@ -477,7 +477,7 @@ void Hu_InventoryDraw2(int player, int x, int y, float alpha) if((count = P_InventoryCount(player, item->type))) { DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch(item->patchId, x + slot * ST_INVSLOTWIDTH, y + ST_INVICONOFFY); + GL_DrawPatch(item->patchId, x + slot * ST_INVSLOTWIDTH, y + ST_INVICONOFFY); if(count > 1) { @@ -496,7 +496,7 @@ void Hu_InventoryDraw2(int player, int x, int y, float alpha) } DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch(dpInvSelectBox, x + cursor * ST_INVSLOTWIDTH, y + ST_INVSELECTOFFY - BORDER); + GL_DrawPatch(dpInvSelectBox, x + cursor * ST_INVSLOTWIDTH, y + ST_INVSELECTOFFY - BORDER); if(inv->numUsedSlots > NUMVISINVSLOTS) { @@ -504,7 +504,7 @@ void Hu_InventoryDraw2(int player, int x, int y, float alpha) if(cfg.inventoryWrap || first != 0) { DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch(dpInvPageLeft[!(mapTime & 4)? 1 : 0], + GL_DrawPatch(dpInvPageLeft[!(mapTime & 4)? 1 : 0], #if __JHEXEN__ 42, 163 #else @@ -517,7 +517,7 @@ void Hu_InventoryDraw2(int player, int x, int y, float alpha) if(cfg.inventoryWrap || inv->numUsedSlots - first > NUMVISINVSLOTS) { DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch(dpInvPageRight[!(mapTime & 4)? 1 : 0], 269, + GL_DrawPatch(dpInvPageRight[!(mapTime & 4)? 1 : 0], 269, #if __JHEXEN__ 163 #else diff --git a/doomsday/plugins/common/src/hu_menu.c b/doomsday/plugins/common/src/hu_menu.c index 0cda730c45..f77cddc2bf 100644 --- a/doomsday/plugins/common/src/hu_menu.c +++ b/doomsday/plugins/common/src/hu_menu.c @@ -2343,16 +2343,16 @@ void M_DrawMainMenu(void) int frame = (menuTime / 5) % 7; DGL_Color4f(1, 1, 1, menuAlpha); - M_DrawPatch(m_htic.id, 88, 0); - M_DrawPatch(dpBullWithFire[(frame + 2) % 7].id, 37, 80); - M_DrawPatch(dpBullWithFire[frame].id, 278, 80); + GL_DrawPatch(m_htic.id, 88, 0); + GL_DrawPatch(dpBullWithFire[(frame + 2) % 7].id, 37, 80); + GL_DrawPatch(dpBullWithFire[frame].id, 278, 80); #elif __JHERETIC__ WI_DrawPatch4(m_htic.id, 88, 0, NULL, GF_FONTB, false, DPF_ALIGN_TOPLEFT, 1, 1, 1, menuAlpha); DGL_Color4f(1, 1, 1, menuAlpha); - M_DrawPatch(dpRotatingSkull[17 - frame].id, 40, 10); - M_DrawPatch(dpRotatingSkull[frame].id, 232, 10); + GL_DrawPatch(dpRotatingSkull[17 - frame].id, 40, 10); + GL_DrawPatch(dpRotatingSkull[frame].id, 232, 10); #elif __JDOOM__ || __JDOOM64__ WI_DrawPatch4(m_doom.id, 94, 2, NULL, GF_FONTB, false, DPF_ALIGN_TOPLEFT, 1, 1, 1, menuAlpha); #endif @@ -2420,7 +2420,7 @@ void M_DrawClassMenu(void) R_GetSpriteInfo(STATES[PCLASS_INFO(pClass)->normalState].sprite, ((menuTime >> 3) & 3), &sprInfo); DGL_Color4f(1, 1, 1, menuAlpha); - M_DrawPatch(dpPlayerClassBG[pClass % 3].id, BG_X, BG_Y); + GL_DrawPatch(dpPlayerClassBG[pClass % 3].id, BG_X, BG_Y); // Fighter's colors are a bit different. if(pClass == PCLASS_FIGHTER) @@ -2620,7 +2620,7 @@ void M_DrawSaveLoadBorder(int x, int y, int width) { #if __JHERETIC__ || __JHEXEN__ DGL_Color4f(1, 1, 1, menuAlpha); - M_DrawPatch(dpFSlot.id, x - 8, y - 4); + GL_DrawPatch(dpFSlot.id, x - 8, y - 4); #else DGL_Color4f(1, 1, 1, menuAlpha); @@ -2857,9 +2857,9 @@ void M_DrawWeaponMenu(void) // Draw the page arrows. token = dpInvPageLeft[!menu->firstItem || (menuTime & 8)]; - M_DrawPatch(token, menu->x, menu->y - 22); + GL_DrawPatch(token, menu->x, menu->y - 22); token = dpInvPageRight[menu->firstItem + menu->numVisItems >= menu->itemCount || (menuTime & 8)]; - M_DrawPatch(token, 312 - menu->x, menu->y - 22); + GL_DrawPatch(token, 312 - menu->x, menu->y - 22); #endif /** @@ -3056,9 +3056,9 @@ void M_DrawHUDMenu(void) // Draw the page arrows. token = dpInvPageLeft[!menu->firstItem || (menuTime & 8)]; - M_DrawPatch(token, menu->x, menu->y - 22); + GL_DrawPatch(token, menu->x, menu->y - 22); token = dpInvPageRight[menu->firstItem + menu->numVisItems >= menu->itemCount || (menuTime & 8)]; - M_DrawPatch(token, 312 - menu->x, menu->y - 22); + GL_DrawPatch(token, 312 - menu->x, menu->y - 22); #endif idx = 0; diff --git a/doomsday/plugins/common/src/hu_stuff.c b/doomsday/plugins/common/src/hu_stuff.c index 1a39a76c7b..ecace9e349 100644 --- a/doomsday/plugins/common/src/hu_stuff.c +++ b/doomsday/plugins/common/src/hu_stuff.c @@ -1701,7 +1701,7 @@ void WI_DrawPatch4(patchid_t patch, int x, int y, const char* altstring, // No replacement possible/wanted - use the original patch. DGL_Color4f(1, 1, 1, a); - M_DrawPatch2(patch, posx, y, flags); + GL_DrawPatch2(patch, posx, y, flags); } void WI_DrawPatch3(patchid_t id, int x, int y, const char* altstring, gamefontid_t font, boolean builtin, short flags) @@ -1836,14 +1836,14 @@ void M_DrawSlider(int x, int y, int height, int range, int slot, float alpha) DGL_Color4f( 1, 1, 1, alpha); - M_DrawPatch2(dpSliderLeft, 0, 0, DPF_ALIGN_RIGHT|DPF_ALIGN_TOP|DPF_NO_OFFSETX); - M_DrawPatch(dpSliderRight, range * WIDTH, 0); + GL_DrawPatch2(dpSliderLeft, 0, 0, DPF_ALIGN_RIGHT|DPF_ALIGN_TOP|DPF_NO_OFFSETX); + GL_DrawPatch(dpSliderRight, range * WIDTH, 0); DGL_SetPatch(dpSliderMiddle, DGL_REPEAT, DGL_REPEAT); DGL_DrawRectTiled(0, middleInfo.topOffset, range * WIDTH, HEIGHT, middleInfo.width, middleInfo.height); DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch2(dpSliderHandle, range * WIDTH * pos, 1, DPF_ALIGN_TOP|DPF_NO_OFFSET); + GL_DrawPatch2(dpSliderHandle, range * WIDTH * pos, 1, DPF_ALIGN_TOP|DPF_NO_OFFSET); DGL_MatrixMode(DGL_MODELVIEW); DGL_PopMatrix(); @@ -2330,74 +2330,16 @@ void Hu_EndBorderedProjection(borderedprojectionstate_t* s) DGL_PopMatrix(); } -void M_DrawPatch2(patchid_t id, int posX, int posY, short flags) -{ - float x = posX, y = posY, w, h; - patchinfo_t info; - - if(id == -1) - return; - - DGL_SetPatch(id, DGL_CLAMP_TO_EDGE, DGL_CLAMP_TO_EDGE); - if(!R_GetPatchInfo(id, &info)) - return; - - if(flags & DPF_ALIGN_RIGHT) - x -= info.width; - else if(!(flags & DPF_ALIGN_LEFT)) - x -= info.width /2; - - if(flags & DPF_ALIGN_BOTTOM) - y -= info.height; - else if(!(flags & DPF_ALIGN_TOP)) - y -= info.height/2; - - w = (float) info.width; - h = (float) info.height; - - if(!(flags & DPF_NO_OFFSETX)) - x += (float) info.offset; - if(!(flags & DPF_NO_OFFSETY)) - y += (float) info.topOffset; - - if(info.extraOffset[0]) - { - // This offset is used only for the extra borders in the - // "upscaled and sharpened" patches, so we can tweak the values - // to our liking a bit more. - x += info.extraOffset[0]; - y += info.extraOffset[1]; - w += fabs(info.extraOffset[0])*2; - h += fabs(info.extraOffset[1])*2; - } - - DGL_Begin(DGL_QUADS); - DGL_TexCoord2f(0, 0, 0); - DGL_Vertex2f(x, y); - DGL_TexCoord2f(0, 1, 0); - DGL_Vertex2f(x + w, y); - DGL_TexCoord2f(0, 1, 1); - DGL_Vertex2f(x + w, y + h); - DGL_TexCoord2f(0, 0, 1); - DGL_Vertex2f(x, y + h); - DGL_End(); -} - -void M_DrawPatch(patchid_t id, int x, int y) -{ - M_DrawPatch2(id, x, y, DPF_ALIGN_TOPLEFT); -} - void M_DrawShadowedPatch3(patchid_t id, int x, int y, short flags, float r, float g, float b, float a) { if(id < 0) return; DGL_Color4f(0, 0, 0, a * .4f); - M_DrawPatch2(id, x+2, y+2, flags); + GL_DrawPatch2(id, x+2, y+2, flags); DGL_Color4f(r, g, b, a); - M_DrawPatch2(id, x, y, flags); + GL_DrawPatch2(id, x, y, flags); } void M_DrawShadowedPatch2(patchid_t id, int x, int y, short flags) diff --git a/doomsday/plugins/common/src/m_ctrl.c b/doomsday/plugins/common/src/m_ctrl.c index 107087f09a..dc6581adf4 100644 --- a/doomsday/plugins/common/src/m_ctrl.c +++ b/doomsday/plugins/common/src/m_ctrl.c @@ -628,9 +628,9 @@ void M_DrawControlsMenu(void) // Draw the page arrows. token = dpInvPageLeft[!menu->firstItem || (menuTime & 8)]; - M_DrawPatch(token, menu->x, menu->y - 12); + GL_DrawPatch(token, menu->x, menu->y - 12); token = dpInvPageRight[menu->firstItem + menu->numVisItems >= menu->itemCount || (menuTime & 8)]; - M_DrawPatch(token, 312 - menu->x, menu->y - 12); + GL_DrawPatch(token, 312 - menu->x, menu->y - 12); #endif strcpy(buf, "Select to assign new, [Del] to clear"); diff --git a/doomsday/plugins/jdoom/src/st_stuff.c b/doomsday/plugins/jdoom/src/st_stuff.c index 5b9b4a4610..39f1fbf8e0 100644 --- a/doomsday/plugins/jdoom/src/st_stuff.c +++ b/doomsday/plugins/jdoom/src/st_stuff.c @@ -1539,8 +1539,8 @@ void drawFaceWidget(int player, float textAlpha, float iconAlpha, return; DGL_Color4f(1, 1, 1, iconAlpha); if(IS_NETGAME) - M_DrawPatch(bgPatch->id, x, -bgPatch->height + 1); - M_DrawPatch(facePatch->id, x, -bgPatch->height); + GL_DrawPatch(bgPatch->id, x, -bgPatch->height + 1); + GL_DrawPatch(facePatch->id, x, -bgPatch->height); *drawnWidth = bgPatch->width; *drawnHeight = bgPatch->height; } diff --git a/doomsday/plugins/jdoom/src/wi_stuff.c b/doomsday/plugins/jdoom/src/wi_stuff.c index 9d1bf0a330..e1ede37f29 100644 --- a/doomsday/plugins/jdoom/src/wi_stuff.c +++ b/doomsday/plugins/jdoom/src/wi_stuff.c @@ -288,7 +288,7 @@ static patchid_t bp[NUM_TEAMS]; // "gray P[1..NUM_TEAMS]" void WI_slamBackground(void) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch2(bg, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(bg, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); } /** diff --git a/doomsday/plugins/jdoom64/src/wi_stuff.c b/doomsday/plugins/jdoom64/src/wi_stuff.c index 0678961e29..478525bb4f 100644 --- a/doomsday/plugins/jdoom64/src/wi_stuff.c +++ b/doomsday/plugins/jdoom64/src/wi_stuff.c @@ -153,7 +153,7 @@ static patchid_t bp[NUM_TEAMS]; // "gray P[1..NUM_TEAMS]" void WI_slamBackground(void) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch2(bg, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(bg, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); } /** diff --git a/doomsday/plugins/jheretic/src/in_lude.c b/doomsday/plugins/jheretic/src/in_lude.c index d6e6e6e242..10153f04ab 100644 --- a/doomsday/plugins/jheretic/src/in_lude.c +++ b/doomsday/plugins/jheretic/src/in_lude.c @@ -584,7 +584,7 @@ void IN_Drawer(void) if(wbs->episode < 3) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpInterPic.id, 0, 0); + GL_DrawPatch(dpInterPic.id, 0, 0); IN_DrawOldLevel(); } break; @@ -593,7 +593,7 @@ void IN_Drawer(void) if(wbs->episode < 3) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpInterPic.id, 0, 0); + GL_DrawPatch(dpInterPic.id, 0, 0); IN_DrawYAH(); } break; @@ -602,7 +602,7 @@ void IN_Drawer(void) if(wbs->episode < 3) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpInterPic.id, 0, 0); + GL_DrawPatch(dpInterPic.id, 0, 0); } break; @@ -634,12 +634,12 @@ void IN_DrawOldLevel(void) DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->nextMap; ++i) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); } if(!(interTime & 16)) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); } } else @@ -648,17 +648,17 @@ void IN_DrawOldLevel(void) DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->currentMap; ++i) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); } if(players[CONSOLEPLAYER].didSecret) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); } if(!(interTime & 16)) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][wbs->currentMap].x, YAHspot[wbs->episode][wbs->currentMap].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][wbs->currentMap].x, YAHspot[wbs->episode][wbs->currentMap].y); } } } @@ -676,17 +676,17 @@ void IN_DrawYAH(void) DGL_Color4f(1, 1, 1, 1); for(i = 0; i < wbs->nextMap; ++i) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][i].x, YAHspot[wbs->episode][i].y); } if(players[CONSOLEPLAYER].didSecret) { - M_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); + GL_DrawPatch(dpBeenThere.id, YAHspot[wbs->episode][8].x, YAHspot[wbs->episode][8].y); } if(!(interTime & 16) || interState == 3) { // Draw the destination 'X' - M_DrawPatch(dpGoingThere.id, YAHspot[wbs->episode][wbs->nextMap].x, YAHspot[wbs->episode][wbs->nextMap].y); + GL_DrawPatch(dpGoingThere.id, YAHspot[wbs->episode][wbs->nextMap].x, YAHspot[wbs->episode][wbs->nextMap].y); } } @@ -818,10 +818,10 @@ void IN_DrawCoopStats(void) char buf[20]; DGL_Color4f(0, 0, 0, .4f); - M_DrawPatch(dpFaceAlive[i].id, 27, ypos+2); + GL_DrawPatch(dpFaceAlive[i].id, 27, ypos+2); DGL_Color4f(defFontRGB[0], defFontRGB[1], defFontRGB[2], 1); - M_DrawPatch(dpFaceAlive[i].id, 25, ypos); + GL_DrawPatch(dpFaceAlive[i].id, 25, ypos); if(interTime < 40) { @@ -914,8 +914,8 @@ void IN_DrawDMStats(void) else { DGL_Color4f(1, 1, 1, .333f); - M_DrawPatch(dpFaceAlive[i].id, 40, ypos); - M_DrawPatch(dpFaceDead[i].id, xpos, 18); + GL_DrawPatch(dpFaceAlive[i].id, 40, ypos); + GL_DrawPatch(dpFaceDead[i].id, xpos, 18); } kpos = 122; diff --git a/doomsday/plugins/jheretic/src/st_stuff.c b/doomsday/plugins/jheretic/src/st_stuff.c index a0b0441b8f..a2448e39ee 100644 --- a/doomsday/plugins/jheretic/src/st_stuff.c +++ b/doomsday/plugins/jheretic/src/st_stuff.c @@ -359,7 +359,7 @@ void drawChainWidget(int player, float textAlpha, float iconAlpha, // Draw the life gem. DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(lifeGems[gemNum].id, x + gemXOffset, chainY); + GL_DrawPatch(lifeGems[gemNum].id, x + gemXOffset, chainY); shadeChain(ORIGINX, ORIGINY-ST_HEIGHT, iconAlpha/2); @@ -409,28 +409,28 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* { // We can just render the full thing as normal. // Top bits. DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(statusbarTopLeft.id, ORIGINX, ORIGINY-10); - M_DrawPatch(statusbarTopRight.id, ORIGINX+290, ORIGINY-10); + GL_DrawPatch(statusbarTopLeft.id, ORIGINX, ORIGINY-10); + GL_DrawPatch(statusbarTopRight.id, ORIGINX+290, ORIGINY-10); // Faces. - M_DrawPatch(statusbar.id, ORIGINX, ORIGINY); + GL_DrawPatch(statusbar.id, ORIGINX, ORIGINY); if(P_GetPlayerCheats(plr) & CF_GODMODE) { - M_DrawPatch(godLeft.id, ORIGINX+16, ORIGINY+9); - M_DrawPatch(godRight.id, ORIGINX+287, ORIGINY+9); + GL_DrawPatch(godLeft.id, ORIGINX+16, ORIGINY+9); + GL_DrawPatch(godRight.id, ORIGINX+287, ORIGINY+9); } if(!Hu_InventoryIsOpen(player)) { if(deathmatch) - M_DrawPatch(statBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(statBar.id, ORIGINX+34, ORIGINY+2); else - M_DrawPatch(lifeBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(lifeBar.id, ORIGINX+34, ORIGINY+2); } else { - M_DrawPatch(invBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(invBar.id, ORIGINX+34, ORIGINY+2); } } else @@ -438,8 +438,8 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* DGL_Color4f(1, 1, 1, iconAlpha); // Top bits. - M_DrawPatch(statusbarTopLeft.id, ORIGINX, ORIGINY-10); - M_DrawPatch(statusbarTopRight.id, ORIGINX+290, ORIGINY-10); + GL_DrawPatch(statusbarTopLeft.id, ORIGINX, ORIGINY-10); + GL_DrawPatch(statusbarTopRight.id, ORIGINX+290, ORIGINY-10); DGL_SetPatch(statusbar.id, DGL_CLAMP_TO_EDGE, DGL_CLAMP_TO_EDGE); @@ -456,8 +456,8 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* DGL_DrawCutRectTiled(ORIGINX, ORIGINY, 34, 42, 320, 42, 0, 0, ORIGINX+16, ORIGINY+9, 16, 8); DGL_DrawCutRectTiled(ORIGINX+282, ORIGINY, 38, 42, 320, 42, 282, 0, ORIGINX+287, ORIGINY+9, 16, 8); - M_DrawPatch(godLeft.id, ORIGINX+16, ORIGINY+9); - M_DrawPatch(godRight.id, ORIGINX+287, ORIGINY+9); + GL_DrawPatch(godLeft.id, ORIGINX+16, ORIGINY+9); + GL_DrawPatch(godRight.id, ORIGINX+287, ORIGINY+9); } else { @@ -468,13 +468,13 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* if(!Hu_InventoryIsOpen(player)) { if(deathmatch) - M_DrawPatch(statBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(statBar.id, ORIGINX+34, ORIGINY+2); else - M_DrawPatch(lifeBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(lifeBar.id, ORIGINX+34, ORIGINY+2); } else { - M_DrawPatch(invBar.id, ORIGINX+34, ORIGINY+2); + GL_DrawPatch(invBar.id, ORIGINX+34, ORIGINY+2); } } @@ -1003,7 +1003,7 @@ void drawSBarCurrentItemWidget(int player, float textAlpha, float iconAlpha, } DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch, x, y); + GL_DrawPatch(patch, x, y); if(!(hud->currentInvItemFlash > 0)) { @@ -1104,7 +1104,7 @@ void drawFlightWidget(int player, float textAlpha, float iconAlpha, } } DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(spinFly[frame].id, 16, 14); + GL_DrawPatch(spinFly[frame].id, 16, 14); } /// \kludge calculate dimensions properly! *drawnWidth = 32; @@ -1133,7 +1133,7 @@ void drawTombOfPowerWidget(int player, float textAlpha, float iconAlpha, if(cfg.tomeCounter && plr->powers[PT_WEAPONLEVEL2] < 35) alpha *= plr->powers[PT_WEAPONLEVEL2] / 35.0f; DGL_Color4f(1, 1, 1, alpha); - M_DrawPatch(spinBook[frame].id, -13, 13); + GL_DrawPatch(spinBook[frame].id, -13, 13); // \fixme Determine the actual center point of the animation at widget creation time. *drawnWidth += 25;//spinBook[frame].width; *drawnHeight += 25;//spinBook[frame].height; @@ -1250,7 +1250,7 @@ void drawAmmoWidget(int player, float textAlpha, float iconAlpha, dd_snprintf(buf, 20, "%i", plr->ammo[ammoType].owned); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch2(dp->id, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(dp->id, 0, 0, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); DGL_Color4f(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha); GL_DrawTextFragment4(buf, dp->width+2, -2, GF_STATUS, DTF_ALIGN_TOPLEFT|DTF_NO_EFFECTS, TRACKING); @@ -1341,7 +1341,7 @@ void drawKeysWidget(int player, float textAlpha, float iconAlpha, if(plr->keys[KT_YELLOW]) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch2(keys[0].id, x, -keys[0].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(keys[0].id, x, -keys[0].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); x += keys[0].width + 1; *drawnWidth += keys[0].width; if(keys[0].height > *drawnHeight) @@ -1352,7 +1352,7 @@ void drawKeysWidget(int player, float textAlpha, float iconAlpha, if(plr->keys[KT_GREEN]) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch2(keys[1].id, x, -keys[1].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(keys[1].id, x, -keys[1].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); x += keys[1].width + 1; *drawnWidth += keys[1].width; if(keys[1].height > *drawnHeight) @@ -1363,7 +1363,7 @@ void drawKeysWidget(int player, float textAlpha, float iconAlpha, if(plr->keys[KT_BLUE]) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch2(keys[2].id, x, -keys[2].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); + GL_DrawPatch2(keys[2].id, x, -keys[2].height, DPF_ALIGN_TOPLEFT|DPF_NO_OFFSET); x += keys[2].width; *drawnWidth += keys[1].width; if(keys[2].height > *drawnHeight) @@ -1424,9 +1424,9 @@ void drawCurrentItemWidget(int player, float textAlpha, float iconAlpha, if(hud->currentInvItemFlash > 0) { DGL_Color4f(1, 1, 1, iconAlpha/2); - M_DrawPatch2(dpInvItemBox, 0, 0, DPF_ALIGN_BOTTOMRIGHT|DPF_NO_OFFSET); + GL_DrawPatch2(dpInvItemBox, 0, 0, DPF_ALIGN_BOTTOMRIGHT|DPF_NO_OFFSET); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpInvItemFlash[hud->currentInvItemFlash % 5].id, -boxInfo.width, -boxInfo.height + 1); + GL_DrawPatch(dpInvItemFlash[hud->currentInvItemFlash % 5].id, -boxInfo.width, -boxInfo.height + 1); } else { @@ -1438,9 +1438,9 @@ void drawCurrentItemWidget(int player, float textAlpha, float iconAlpha, uint count; DGL_Color4f(1, 1, 1, iconAlpha/2); - M_DrawPatch2(dpInvItemBox, 0, 0, DPF_ALIGN_BOTTOMRIGHT|DPF_NO_OFFSET); + GL_DrawPatch2(dpInvItemBox, 0, 0, DPF_ALIGN_BOTTOMRIGHT|DPF_NO_OFFSET); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch, -boxInfo.width, -boxInfo.height); + GL_DrawPatch(patch, -boxInfo.width, -boxInfo.height); if((count = P_InventoryCount(player, readyItem)) > 1) { char buf[20]; diff --git a/doomsday/plugins/jhexen/src/in_lude.c b/doomsday/plugins/jhexen/src/in_lude.c index e33a9c1c6e..870d7cc95d 100644 --- a/doomsday/plugins/jhexen/src/in_lude.c +++ b/doomsday/plugins/jhexen/src/in_lude.c @@ -358,8 +358,8 @@ static void drawDeathTally(void) boolean bold; DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpTallyTop.id, TALLY_TOP_X, TALLY_TOP_Y); - M_DrawPatch(dpTallyLeft.id, TALLY_LEFT_X, TALLY_LEFT_Y); + GL_DrawPatch(dpTallyTop.id, TALLY_TOP_X, TALLY_TOP_Y); + GL_DrawPatch(dpTallyLeft.id, TALLY_LEFT_X, TALLY_LEFT_Y); if(interTime < TALLY_EFFECT_TICKS) { diff --git a/doomsday/plugins/jhexen/src/st_stuff.c b/doomsday/plugins/jhexen/src/st_stuff.c index 7d132f2735..c4b2ff06ff 100644 --- a/doomsday/plugins/jhexen/src/st_stuff.c +++ b/doomsday/plugins/jhexen/src/st_stuff.c @@ -270,7 +270,7 @@ void drawFlightWidget(int player, float textAlpha, float iconAlpha, } } DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpSpinFly[frame].id, 16, 14); + GL_DrawPatch(dpSpinFly[frame].id, 16, 14); } *drawnWidth = 32; *drawnHeight = 28; @@ -289,7 +289,7 @@ void drawBootsWidget(int player, float textAlpha, float iconAlpha, if(plr->powers[PT_SPEED] > BLINKTHRESHOLD || !(plr->powers[PT_SPEED] & 16)) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpSpinSpeed[(mapTime / 3) & 15].id, 12, 14); + GL_DrawPatch(dpSpinSpeed[(mapTime / 3) & 15].id, 12, 14); } *drawnWidth = 24; *drawnHeight = 28; @@ -308,7 +308,7 @@ void drawDefenseWidget(int player, float textAlpha, float iconAlpha, if(plr->powers[PT_INVULNERABILITY] > BLINKTHRESHOLD || !(plr->powers[PT_INVULNERABILITY] & 16)) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpSpinDefense[(mapTime / 3) & 15].id, -13, 14); + GL_DrawPatch(dpSpinDefense[(mapTime / 3) & 15].id, -13, 14); } *drawnWidth = 26; *drawnHeight = 28; @@ -327,7 +327,7 @@ void drawServantWidget(int player, float textAlpha, float iconAlpha, if(plr->powers[PT_MINOTAUR] > BLINKTHRESHOLD || !(plr->powers[PT_MINOTAUR] & 16)) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpSpinMinotaur[(mapTime / 3) & 15].id, -13, 17); + GL_DrawPatch(dpSpinMinotaur[(mapTime / 3) & 15].id, -13, 17); } *drawnWidth = 26; *drawnHeight = 29; @@ -353,26 +353,26 @@ void drawWeaponPiecesWidget(int player, float textAlpha, float iconAlpha, if(plr->pieces == 7) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpWeaponFull[pClass].id, ORIGINX+190, ORIGINY); + GL_DrawPatch(dpWeaponFull[pClass].id, ORIGINX+190, ORIGINY); } else { if(plr->pieces & WPIECE1) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpWeaponPiece1[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[0], ORIGINY); + GL_DrawPatch(dpWeaponPiece1[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[0], ORIGINY); } if(plr->pieces & WPIECE2) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpWeaponPiece2[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[1], ORIGINY); + GL_DrawPatch(dpWeaponPiece2[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[1], ORIGINY); } if(plr->pieces & WPIECE3) { DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpWeaponPiece3[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[2], ORIGINY); + GL_DrawPatch(dpWeaponPiece3[pClass].id, ORIGINX+PCLASS_INFO(pClass)->pieceX[2], ORIGINY); } } @@ -574,7 +574,7 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* if(!(iconAlpha < 1)) { DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpStatusBar.id, ORIGINX, ORIGINY-28); + GL_DrawPatch(dpStatusBar.id, ORIGINX, ORIGINY-28); /** * \kludge The Hexen statusbar graphic has a chain already in the * image, which shows through the modified chain patches. @@ -585,30 +585,30 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* DGL_DrawRect(ORIGINX+44, ORIGINY+31, 232, 7, .1f, .1f, .1f, 1); //// \kludge end DGL_Color4f(1, 1, 1, 1); - M_DrawPatch(dpStatusBarTop.id, ORIGINX, ORIGINY-28); + GL_DrawPatch(dpStatusBarTop.id, ORIGINX, ORIGINY-28); if(!Hu_InventoryIsOpen(player)) { // Main interface if(!AM_IsActive(AM_MapForPlayer(player))) { - M_DrawPatch(dpStatBar.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpStatBar.id, ORIGINX+38, ORIGINY); if(deathmatch) { - M_DrawPatch(dpKills.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpKills.id, ORIGINX+38, ORIGINY); } - M_DrawPatch(dpWeaponSlot[pClass].id, ORIGINX+190, ORIGINY); + GL_DrawPatch(dpWeaponSlot[pClass].id, ORIGINX+190, ORIGINY); } else { - M_DrawPatch(dpKeyBar.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpKeyBar.id, ORIGINX+38, ORIGINY); } } else { - M_DrawPatch(dpInventoryBar.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpInventoryBar.id, ORIGINX+38, ORIGINY); } } else @@ -693,13 +693,13 @@ void drawStatusBarBackground(int player, float textAlpha, float iconAlpha, int* DGL_SetPatch(dpStatBar.id, DGL_CLAMP_TO_EDGE, DGL_CLAMP_TO_EDGE); DGL_DrawCutRectTiled(x, y, w, h, dpStatBar.width, dpStatBar.height, deathmatch?30:0, 0, ORIGINX+190, ORIGINY, 57, 30); - M_DrawPatch(dpWeaponSlot[pClass].id, ORIGINX+190, ORIGINY); + GL_DrawPatch(dpWeaponSlot[pClass].id, ORIGINX+190, ORIGINY); if(deathmatch) - M_DrawPatch(dpKills.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpKills.id, ORIGINX+38, ORIGINY); } else { - M_DrawPatch(dpKeyBar.id, ORIGINX+38, ORIGINY); + GL_DrawPatch(dpKeyBar.id, ORIGINX+38, ORIGINY); } } else @@ -1222,7 +1222,7 @@ void drawKeysWidget(int player, float textAlpha, float iconAlpha, patch = &dpKeySlot[i]; DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch->id, ORIGINX + 46 + numDrawn * 20, ORIGINY + 1); + GL_DrawPatch(patch->id, ORIGINX + 46 + numDrawn * 20, ORIGINY + 1); *drawnWidth += patch->width; if(patch->height > *drawnHeight) @@ -1277,7 +1277,7 @@ void drawSBarArmorIconsWidget(int player, float textAlpha, float iconAlpha, alpha = 1; DGL_Color4f(1, 1, 1, iconAlpha * alpha); - M_DrawPatch(patch->id, ORIGINX + 150 + 31 * i, ORIGINY + 2); + GL_DrawPatch(patch->id, ORIGINX + 150 + 31 * i, ORIGINY + 2); *drawnWidth += patch->width; if(patch->height > *drawnHeight) @@ -1554,7 +1554,7 @@ void drawSBarCurrentItemWidget(int player, float textAlpha, float iconAlpha, } DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch, ORIGINX+x, ORIGINY+y); + GL_DrawPatch(patch, ORIGINX+x, ORIGINY+y); if(!(hud->currentInvItemFlash > 0)) { @@ -1839,7 +1839,7 @@ void drawBlueManaWidget(int player, float textAlpha, float iconAlpha, dd_snprintf(buf, 20, "%i", plr->ammo[AT_BLUEMANA].owned); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch->id, 0, 0); + GL_DrawPatch(patch->id, 0, 0); DGL_Color4f(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha); GL_DrawTextFragment4(buf, patch->width+2, 0, GF_STATUS, DTF_ALIGN_TOPLEFT|DTF_NO_EFFECTS, TRACKING); @@ -1895,7 +1895,7 @@ void drawGreenManaWidget(int player, float textAlpha, float iconAlpha, dd_snprintf(buf, 20, "%i", plr->ammo[AT_GREENMANA].owned); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch->id, 0, 0); + GL_DrawPatch(patch->id, 0, 0); DGL_Color4f(defFontRGB3[CR], defFontRGB3[CG], defFontRGB3[CB], textAlpha); GL_DrawTextFragment4(buf, patch->width+2, 0, GF_STATUS, DTF_ALIGN_TOPLEFT|DTF_NO_EFFECTS, TRACKING); @@ -1956,10 +1956,10 @@ void drawCurrentItemWidget(int player, float textAlpha, float iconAlpha, if(hud->currentInvItemFlash > 0) { DGL_Color4f(1, 1, 1, iconAlpha/2); - M_DrawPatch(dpInvItemBox, -30, -30); + GL_DrawPatch(dpInvItemBox, -30, -30); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(dpInvItemFlash[hud->currentInvItemFlash % 5].id, -27, -30); + GL_DrawPatch(dpInvItemFlash[hud->currentInvItemFlash % 5].id, -27, -30); } else { @@ -1971,10 +1971,10 @@ void drawCurrentItemWidget(int player, float textAlpha, float iconAlpha, uint count; DGL_Color4f(1, 1, 1, iconAlpha/2); - M_DrawPatch(dpInvItemBox, -30, -30); + GL_DrawPatch(dpInvItemBox, -30, -30); DGL_Color4f(1, 1, 1, iconAlpha); - M_DrawPatch(patch, -32, -31); + GL_DrawPatch(patch, -32, -31); if((count = P_InventoryCount(player, readyItem)) > 1) { char buf[20];