Merge branch 'master' of https://github.com/coelckers/gzdoom into two_more_stereo_modes

# Conflicts:
#	src/gl/system/gl_framebuffer.cpp
This commit is contained in:
Christopher Bruns 2016-04-11 18:25:54 -04:00
commit 09d0cb5fd5
83 changed files with 654 additions and 524 deletions

34
precompiled_headers.cmake Normal file
View file

@ -0,0 +1,34 @@
#
# Christoph Heindl 2010
# Precompiled Headers Demo
# http://cheind.wordpress.com
#
# Instructs the MSVC toolset to use the precompiled header PRECOMPILED_HEADER
# for each source file given in the collection named by SOURCE_VARIABLE_NAME.
function(enable_precompiled_headers PRECOMPILED_HEADER SOURCE_VARIABLE_NAME)
if(MSVC)
set(files ${${SOURCE_VARIABLE_NAME}})
# Generate precompiled header translation unit
get_filename_component(pch_basename ${PRECOMPILED_HEADER} NAME_WE)
set(pch_abs ${CMAKE_CURRENT_SOURCE_DIR}/${PRECOMPILED_HEADER})
set(pch_unity ${CMAKE_CURRENT_BINARY_DIR}/${pch_basename}.cpp)
FILE(WRITE ${pch_unity} "// Precompiled header unity generated by CMake\n")
FILE(APPEND ${pch_unity} "#include <${pch_abs}>\n")
set_source_files_properties(${pch_unity} PROPERTIES COMPILE_FLAGS "/Yc\"${pch_abs}\"")
# Update properties of source files to use the precompiled header.
# Additionally, force the inclusion of the precompiled header at beginning of each source file.
foreach(source_file ${files} )
set_source_files_properties(
${source_file}
PROPERTIES COMPILE_FLAGS
"/Yu\"${pch_abs}\" /FI\"${pch_abs}\""
)
endforeach(source_file)
# Finally, update the source file collection to contain the precompiled header translation unit
set(${SOURCE_VARIABLE_NAME} ${${SOURCE_VARIABLE_NAME}} ${pch_unity} PARENT_SCOPE)
endif(MSVC)
endfunction(enable_precompiled_headers)

View file

@ -1,5 +1,7 @@
cmake_minimum_required( VERSION 2.8.7 )
include(../precompiled_headers.cmake)
if( COMMAND cmake_policy )
cmake_policy( SET CMP0003 NEW )
endif()
@ -939,8 +941,7 @@ set( NOT_COMPILED_SOURCE_FILES
asm_x86_64/tmap3.s
)
# Enable fast math for some sources
set( FASTMATH_SOURCES
set( FASTMATH_PCH_SOURCES
r_swrenderer.cpp
r_3dfloors.cpp
r_bsp.cpp
@ -976,12 +977,35 @@ set( FASTMATH_SOURCES
oplsynth/fmopl.cpp
oplsynth/mlopl.cpp
oplsynth/mlopl_io.cpp
oplsynth/music_opldumper_mididevice.cpp
oplsynth/music_opl_mididevice.cpp
oplsynth/opl_mus_player.cpp
oplsynth/dosbox/opl.cpp
oplsynth/OPL3.cpp
oplsynth/nukedopl3.cpp
timidity/common.cpp
timidity/instrum.cpp
timidity/instrum_dls.cpp
timidity/instrum_font.cpp
timidity/instrum_sf2.cpp
timidity/mix.cpp
timidity/playmidi.cpp
timidity/resample.cpp
timidity/timidity.cpp
wildmidi/file_io.cpp
wildmidi/gus_pat.cpp
wildmidi/reverb.cpp
wildmidi/wm_error.cpp
r_data/colormaps.cpp
r_data/r_translate.cpp
)
# This is disabled for now because I cannot find a way to give the .pch file a different name.
# Visual C++ 2015 seems hell-bent of only allowing one .pch file with the same name as the executable.
#enable_precompiled_headers( g_pch2.h FASTMATH_PCH_SOURCES )
# Enable fast math for some sources
set( FASTMATH_SOURCES
${FASTMATH_PCH_SOURCES}
oplsynth/music_opldumper_mididevice.cpp
oplsynth/music_opl_mididevice.cpp
oplsynth/opl_mus_player.cpp
sound/fmodsound.cpp
sound/i_music.cpp
sound/i_sound.cpp
@ -1006,22 +1030,7 @@ set( FASTMATH_SOURCES
sound/oalsound.cpp
sound/sndfile_decoder.cpp
sound/music_pseudo_mididevice.cpp
timidity/common.cpp
timidity/instrum.cpp
timidity/instrum_dls.cpp
timidity/instrum_font.cpp
timidity/instrum_sf2.cpp
timidity/mix.cpp
timidity/playmidi.cpp
timidity/resample.cpp
timidity/timidity.cpp
wildmidi/file_io.cpp
wildmidi/gus_pat.cpp
wildmidi/reverb.cpp
wildmidi/wildmidi_lib.cpp
wildmidi/wm_error.cpp
r_data/colormaps.cpp
r_data/r_translate.cpp
gl/data/gl_data.cpp
gl/data/gl_portaldata.cpp
gl/data/gl_setup.cpp
@ -1086,15 +1095,8 @@ set( FASTMATH_SOURCES
gl/models/gl_models.cpp
gl/models/gl_voxels.cpp
)
add_executable( zdoom WIN32 MACOSX_BUNDLE
${HEADER_FILES}
${NOT_COMPILED_SOURCE_FILES}
__autostart.cpp
${ASM_SOURCES}
${SYSTEM_SOURCES}
${X86_SOURCES}
${FASTMATH_SOURCES}
x86.cpp
set (PCH_SOURCES
actorptrselect.cpp
am_map.cpp
b_bot.cpp
@ -1155,7 +1157,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
m_misc.cpp
m_png.cpp
m_random.cpp
m_specialpaths.cpp
memarena.cpp
md5.cpp
name.cpp
@ -1218,7 +1219,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
statistics.cpp
stats.cpp
stringtable.cpp
strnatcmp.c
tables.cpp
teaminfo.cpp
tempfiles.cpp
@ -1233,7 +1233,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
w_wad.cpp
wi_stuff.cpp
zstrformat.cpp
zstring.cpp
g_doom/a_doommisc.cpp
g_heretic/a_hereticmisc.cpp
g_hexen/a_hexenmisc.cpp
@ -1277,22 +1276,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
g_shared/sbar_mugshot.cpp
g_shared/shared_hud.cpp
g_shared/shared_sbar.cpp
math/asin.c
math/atan.c
math/const.c
math/cosh.c
math/exp.c
math/isnan.c
math/log.c
math/log10.c
math/mtherr.c
math/polevl.c
math/sin.c
math/sinh.c
math/sqrt.c
math/tan.c
math/tanh.c
math/fastsin.cpp
resourcefiles/ancientzip.cpp
resourcefiles/file_7z.cpp
resourcefiles/file_grp.cpp
@ -1303,7 +1286,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
resourcefiles/file_pak.cpp
resourcefiles/file_directory.cpp
resourcefiles/resourcefile.cpp
sfmt/SFMT.cpp
textures/animations.cpp
textures/anim_switches.cpp
textures/automaptexture.cpp
@ -1348,6 +1330,7 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
r_data/voxels.cpp
r_data/renderstyle.cpp
r_data/r_interpolate.cpp
sfmt/SFMT.cpp
zscript/ast.cpp
zscript/vmbuilder.cpp
zscript/vmdisasm.cpp
@ -1356,6 +1339,38 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE
zscript/zcc_compile.cpp
zscript/zcc_expr.cpp
zscript/zcc_parser.cpp
)
enable_precompiled_headers( g_pch.h PCH_SOURCES )
add_executable( zdoom WIN32 MACOSX_BUNDLE
${HEADER_FILES}
${NOT_COMPILED_SOURCE_FILES}
__autostart.cpp
${ASM_SOURCES}
${SYSTEM_SOURCES}
${X86_SOURCES}
${FASTMATH_SOURCES}
${PCH_SOURCES}
x86.cpp
m_specialpaths.cpp
strnatcmp.c
zstring.cpp
math/asin.c
math/atan.c
math/const.c
math/cosh.c
math/exp.c
math/isnan.c
math/log.c
math/log10.c
math/mtherr.c
math/polevl.c
math/sin.c
math/sinh.c
math/sqrt.c
math/tan.c
math/tanh.c
math/fastsin.cpp
zzautozend.cpp
)

View file

@ -581,7 +581,7 @@ int VPrintf (int printlevel, const char *format, va_list parms)
return PrintString (printlevel, outline.GetChars());
}
int STACK_ARGS Printf (int printlevel, const char *format, ...)
int Printf (int printlevel, const char *format, ...)
{
va_list argptr;
int count;
@ -593,7 +593,7 @@ int STACK_ARGS Printf (int printlevel, const char *format, ...)
return count;
}
int STACK_ARGS Printf (const char *format, ...)
int Printf (const char *format, ...)
{
va_list argptr;
int count;
@ -605,7 +605,7 @@ int STACK_ARGS Printf (const char *format, ...)
return count;
}
int STACK_ARGS DPrintf (const char *format, ...)
int DPrintf (const char *format, ...)
{
va_list argptr;
int count;

View file

@ -1259,7 +1259,7 @@ void FMaskCVar::DoSet (UCVarValue value, ECVarType type)
////////////////////////////////////////////////////////////////////////
static int STACK_ARGS sortcvars (const void *a, const void *b)
static int sortcvars (const void *a, const void *b)
{
return strcmp (((*(FBaseCVar **)a))->GetName(), ((*(FBaseCVar **)b))->GetName());
}

View file

@ -663,14 +663,14 @@ void D_DoServerInfoChange (BYTE **stream, bool singlebit)
}
}
static int STACK_ARGS userinfosortfunc(const void *a, const void *b)
static int userinfosortfunc(const void *a, const void *b)
{
TMap<FName, FBaseCVar *>::ConstPair *pair1 = *(TMap<FName, FBaseCVar *>::ConstPair **)a;
TMap<FName, FBaseCVar *>::ConstPair *pair2 = *(TMap<FName, FBaseCVar *>::ConstPair **)b;
return stricmp(pair1->Key.GetChars(), pair2->Key.GetChars());
}
static int STACK_ARGS namesortfunc(const void *a, const void *b)
static int namesortfunc(const void *a, const void *b)
{
FName *name1 = (FName *)a;
FName *name2 = (FName *)b;

View file

@ -2827,7 +2827,7 @@ bool PClass::ReadValue(FArchive &ar, void *addr) const
//
//==========================================================================
static int STACK_ARGS cregcmp (const void *a, const void *b) NO_SANITIZE
static int cregcmp (const void *a, const void *b) NO_SANITIZE
{
const PClass *class1 = *(const PClass **)a;
const PClass *class2 = *(const PClass **)b;

View file

@ -100,12 +100,6 @@ typedef TMap<int, PClassActor *> FClassMap;
#endif
#if defined(_MSC_VER) || defined(__WATCOMC__)
#define STACK_ARGS __cdecl
#else
#define STACK_ARGS
#endif
#if defined(_MSC_VER)
#define NOVTABLE __declspec(novtable)
#else
@ -149,11 +143,11 @@ enum
// [RH] This gets used all over; define it here:
int STACK_ARGS Printf (int printlevel, const char *, ...) GCCPRINTF(2,3);
int STACK_ARGS Printf (const char *, ...) GCCPRINTF(1,2);
int Printf (int printlevel, const char *, ...) GCCPRINTF(2,3);
int Printf (const char *, ...) GCCPRINTF(1,2);
// [RH] Same here:
int STACK_ARGS DPrintf (const char *, ...) GCCPRINTF(1,2);
int DPrintf (const char *, ...) GCCPRINTF(1,2);
extern "C" int mysnprintf(char *buffer, size_t count, const char *format, ...) GCCPRINTF(3,4);
extern "C" int myvsnprintf(char *buffer, size_t count, const char *format, va_list argptr) GCCFORMAT(3);

View file

@ -100,7 +100,7 @@ static IdMap DoomEdFromMapinfo;
FDoomEdMap DoomEdMap;
static int STACK_ARGS sortnums (const void *a, const void *b)
static int sortnums (const void *a, const void *b)
{
return (*(const FDoomEdMap::Pair**)a)->Key - (*(const FDoomEdMap::Pair**)b)->Key;
}

20
src/g_pch.h Normal file
View file

@ -0,0 +1,20 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <stdarg.h>
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
#include <zlib.h>
#include <new>
#include <algorithm>
#include <sys/stat.h>
#include <sys/types.h>
#include <cassert>
#include <direct.h>
#include <io.h>
#include <limits>

22
src/g_pch2.h Normal file
View file

@ -0,0 +1,22 @@
// This is separate because the files being compiled with it use different compiler settings which may affect how the header is compiled
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <float.h>
#include <math.h>
#include <limits.h>
#include <stdarg.h>
#include <errno.h>
#include <ctype.h>
#include <stdint.h>
#include <zlib.h>
#include <new>
#include <algorithm>
#include <sys/stat.h>
#include <sys/types.h>
#include <cassert>
#include <direct.h>
#include <io.h>
#include <limits>
#include <fcntl.h>

View file

@ -34,7 +34,7 @@ FWeaponSlots *PlayingKeyConf;
TArray<PClassWeapon *> Weapons_ntoh;
TMap<PClassWeapon *, int> Weapons_hton;
static int STACK_ARGS ntoh_cmp(const void *a, const void *b);
static int ntoh_cmp(const void *a, const void *b);
IMPLEMENT_CLASS(PClassWeapon)
@ -1725,7 +1725,7 @@ void P_SetupWeapons_ntohton()
//
//===========================================================================
static int STACK_ARGS ntoh_cmp(const void *a, const void *b)
static int ntoh_cmp(const void *a, const void *b)
{
PClassWeapon *c1 = *(PClassWeapon **)a;
PClassWeapon *c2 = *(PClassWeapon **)b;

View file

@ -379,7 +379,7 @@ static void DrawArmor(ABasicArmor * barmor, AHexenArmor * harmor, int x, int y)
//---------------------------------------------------------------------------
static TArray<PClassActor *> KeyTypes, UnassignedKeyTypes;
static int STACK_ARGS ktcmp(const void * a, const void * b)
static int ktcmp(const void * a, const void * b)
{
AKey *key1 = (AKey*)GetDefaultByType ( *(PClassActor **)a );
AKey *key2 = (AKey*)GetDefaultByType ( *(PClassActor **)b );

View file

@ -39,13 +39,6 @@
#include <CoreServices/CoreServices.h>
#endif
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
extern HWND Window;
#define USE_WINDOWS_DWORD
#endif
#include "doomdef.h"
#include "gameconfigfile.h"
#include "c_cvars.h"

View file

@ -487,7 +487,7 @@ static void GetSideVertices(int sdnum, DVector2 *v1, DVector2 *v2)
}
}
static int STACK_ARGS segcmp(const void *a, const void *b)
static int segcmp(const void *a, const void *b)
{
seg_t *A = *(seg_t**)a;
seg_t *B = *(seg_t**)b;

View file

@ -560,7 +560,7 @@ void ADynamicLight::CollectWithinRadius(const DVector3 &pos, subsector_t *subSec
if (seg->sidedef && seg->linedef && seg->linedef->validcount != ::validcount)
{
// light is in front of the seg
if ((pos.Y - seg->v1->fY()) * (seg->v2->fX() - seg->v1->fX()) + (seg->v1->fX() - pos.X * (seg->v2->fY() - seg->v1->fY())) <= 0)
if ((pos.Y - seg->v1->fY()) * (seg->v2->fX() - seg->v1->fX()) + (seg->v1->fX() - pos.X) * (seg->v2->fY() - seg->v1->fY()) <= 0)
{
seg->linedef->validcount = validcount;
touching_sides = AddLightNode(&seg->sidedef->lighthead, seg->sidedef, this, touching_sides);
@ -623,10 +623,6 @@ void ADynamicLight::CollectWithinRadius(const DVector3 &pos, subsector_t *subSec
void ADynamicLight::LinkLight()
{
if (X() == 1088 && Y() == 2832)
{
int a = 0;
}
// mark the old light nodes
FLightNode * node;

View file

@ -547,7 +547,7 @@ inline int GLDrawList::CompareSprites(SortNode * a,SortNode * b)
//
//==========================================================================
static GLDrawList * gd;
int __cdecl CompareSprite(const void * a,const void * b)
int CompareSprite(const void * a,const void * b)
{
return gd->CompareSprites(*(SortNode**)a,*(SortNode**)b);
}
@ -838,7 +838,7 @@ void GLDrawList::DrawDecals()
//==========================================================================
static GLDrawList * sortinfo;
static int __cdecl diwcmp (const void *a, const void *b)
static int diwcmp (const void *a, const void *b)
{
const GLDrawItem * di1 = (const GLDrawItem *)a;
GLWall * w1=&sortinfo->walls[di1->index];
@ -850,7 +850,7 @@ static int __cdecl diwcmp (const void *a, const void *b)
return ((w1->flags & 3) - (w2->flags & 3));
}
static int __cdecl difcmp (const void *a, const void *b)
static int difcmp (const void *a, const void *b)
{
const GLDrawItem * di1 = (const GLDrawItem *)a;
GLFlat * w1=&sortinfo->flats[di1->index];

View file

@ -402,7 +402,6 @@ bool OpenGLFrameBuffer::Begin2D(bool)
//
//==========================================================================
// void STACK_ARGS OpenGLFrameBuffer::DrawTextureParms(FTexture *img, DrawParms &parms) // CMB Does not compile for me on VS2015 "redefinition; different type modifiers"
void OpenGLFrameBuffer::DrawTextureParms(FTexture *img, DrawParms &parms)
{
if (GLRenderer != NULL) GLRenderer->DrawTexture(img, parms);

View file

@ -84,7 +84,6 @@ typedef unsigned char byte;
typedef float FLOAT;
template <typename T>
inline T max( T a, T b) { return (((a)>(b)) ? (a) : (b)); }
#define __cdecl
#define _access(a,b) access(a,b)
#endif
#ifndef _WIN32

View file

@ -84,7 +84,7 @@ CVAR (Int, sb_deathmatch_otherplayercolor, CR_GREY, CVAR_ARCHIVE)
CVAR (Bool, sb_teamdeathmatch_enable, true, CVAR_ARCHIVE)
CVAR (Int, sb_teamdeathmatch_headingcolor, CR_RED, CVAR_ARCHIVE)
int STACK_ARGS comparepoints (const void *arg1, const void *arg2)
int comparepoints (const void *arg1, const void *arg2)
{
// Compare first be frags/kills, then by name.
player_t *p1 = *(player_t **)arg1;
@ -99,7 +99,7 @@ int STACK_ARGS comparepoints (const void *arg1, const void *arg2)
return diff;
}
int STACK_ARGS compareteams (const void *arg1, const void *arg2)
int compareteams (const void *arg1, const void *arg2)
{
// Compare first by teams, then by frags, then by name.
player_t *p1 = *(player_t **)arg1;

View file

@ -56,7 +56,7 @@ extern bool SB_ForceActive;
// Sorting routines
int STACK_ARGS comparepoints(const void *arg1, const void *arg2);
int STACK_ARGS compareteams(const void *arg1, const void *arg2);
int comparepoints(const void *arg1, const void *arg2);
int compareteams(const void *arg1, const void *arg2);
#endif

View file

@ -253,7 +253,7 @@ void FNodeBuilder::CreateSubsectorsForReal ()
}
}
int STACK_ARGS FNodeBuilder::SortSegs (const void *a, const void *b)
int FNodeBuilder::SortSegs (const void *a, const void *b)
{
const FPrivSeg *x = ((const USegPtr *)a)->SegPtr;
const FPrivSeg *y = ((const USegPtr *)b)->SegPtr;

View file

@ -299,7 +299,7 @@ private:
void PushConnectingGLSeg (int subsector, TArray<glseg_t> &segs, vertex_t *v1, vertex_t *v2);
int OutputDegenerateSubsector (TArray<glseg_t> &segs, int subsector, bool bForward, double lastdot, FPrivSeg *&prev, vertex_t *outVerts);
static int STACK_ARGS SortSegs (const void *a, const void *b);
static int SortSegs (const void *a, const void *b);
double InterceptVector (const node_t &splitter, const FPrivSeg &seg);

View file

@ -40,7 +40,7 @@
#include "doomtype.h"
#include "nodebuild.h"
static inline void STACK_ARGS Warn (const char *format, ...)
static inline void Warn (const char *format, ...)
{
}

View file

@ -41,13 +41,14 @@
#include "m_swap.h"
#include "w_wad.h"
#include "v_text.h"
#include "i_system.h"
#include "opl.h"
// MACROS ------------------------------------------------------------------
#if defined(_DEBUG) && defined(_WIN32) && defined(_MSC_VER)
#define DEBUGOUT(m,c,s,t) \
{ char foo[128]; mysnprintf(foo, countof(foo), m, c, s, t); OutputDebugString(foo); }
{ char foo[128]; mysnprintf(foo, countof(foo), m, c, s, t); I_DebugPrint(foo); }
#else
#define DEBUGOUT(m,c,s,t)
#endif

View file

@ -236,7 +236,7 @@ bool P_GetMidTexturePosition(const line_t *line, int sideno, double *ptextop, do
double textureheight = tex->GetHeight() / totalscale;
if (totalscale != 1. && !tex->bWorldPanning)
{
y_offset *= totalscale;
y_offset /= totalscale;
}
if(line->flags & ML_DONTPEGBOTTOM)

View file

@ -2507,7 +2507,7 @@ void FBehavior::LoadScriptsDirectory ()
}
}
int STACK_ARGS FBehavior::SortScripts (const void *a, const void *b)
int FBehavior::SortScripts (const void *a, const void *b)
{
ScriptPtr *ptr1 = (ScriptPtr *)a;
ScriptPtr *ptr2 = (ScriptPtr *)b;
@ -8637,8 +8637,11 @@ scriptwait:
else
{
item = activator->GiveInventoryType (static_cast<PClassAmmo *>(type));
item->MaxAmount = STACK(1);
item->Amount = 0;
if (item != NULL)
{
item->MaxAmount = STACK(1);
item->Amount = 0;
}
}
}
}
@ -9997,7 +10000,7 @@ void ClearProfiles(TArray<ProfileCollector> &profiles)
}
}
static int STACK_ARGS sort_by_total_instr(const void *a_, const void *b_)
static int sort_by_total_instr(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
@ -10007,7 +10010,7 @@ static int STACK_ARGS sort_by_total_instr(const void *a_, const void *b_)
return (int)(b->ProfileData->TotalInstr - a->ProfileData->TotalInstr);
}
static int STACK_ARGS sort_by_min(const void *a_, const void *b_)
static int sort_by_min(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
@ -10015,7 +10018,7 @@ static int STACK_ARGS sort_by_min(const void *a_, const void *b_)
return b->ProfileData->MinInstrPerRun - a->ProfileData->MinInstrPerRun;
}
static int STACK_ARGS sort_by_max(const void *a_, const void *b_)
static int sort_by_max(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
@ -10023,7 +10026,7 @@ static int STACK_ARGS sort_by_max(const void *a_, const void *b_)
return b->ProfileData->MaxInstrPerRun - a->ProfileData->MaxInstrPerRun;
}
static int STACK_ARGS sort_by_avg(const void *a_, const void *b_)
static int sort_by_avg(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
@ -10033,7 +10036,7 @@ static int STACK_ARGS sort_by_avg(const void *a_, const void *b_)
return b_avg - a_avg;
}
static int STACK_ARGS sort_by_runs(const void *a_, const void *b_)
static int sort_by_runs(const void *a_, const void *b_)
{
const ProfileCollector *a = (const ProfileCollector *)a_;
const ProfileCollector *b = (const ProfileCollector *)b_;
@ -10042,7 +10045,7 @@ static int STACK_ARGS sort_by_runs(const void *a_, const void *b_)
}
static void ShowProfileData(TArray<ProfileCollector> &profiles, long ilimit,
int (STACK_ARGS *sorter)(const void *, const void *), bool functions)
int (*sorter)(const void *, const void *), bool functions)
{
static const char *const typelabels[2] = { "script", "function" };
@ -10113,7 +10116,7 @@ static void ShowProfileData(TArray<ProfileCollector> &profiles, long ilimit,
CCMD(acsprofile)
{
static int (STACK_ARGS *sort_funcs[])(const void*, const void *) =
static int (*sort_funcs[])(const void*, const void *) =
{
sort_by_total_instr,
sort_by_min,
@ -10126,7 +10129,7 @@ CCMD(acsprofile)
TArray<ProfileCollector> ScriptProfiles, FuncProfiles;
long limit = 10;
int (STACK_ARGS *sorter)(const void *, const void *) = sort_by_total_instr;
int (*sorter)(const void *, const void *) = sort_by_total_instr;
assert(countof(sort_names) == countof(sort_match_len));

View file

@ -361,7 +361,7 @@ private:
void LoadScriptsDirectory ();
static int STACK_ARGS SortScripts (const void *a, const void *b);
static int SortScripts (const void *a, const void *b);
void UnencryptStrings ();
void UnescapeStringTable(BYTE *chunkstart, BYTE *datastart, bool haspadding);
int FindStringInChunk (DWORD *chunk, const char *varname) const;

View file

@ -589,7 +589,7 @@ void P_DrawSplash2 (int count, const DVector3 &pos, DAngle angle, int updown, in
zvel = -1./512.;
zspread = updown ? -6000 / 65536. : 6000 / 65536.;
zadd = (updown == 2) ? 128 : 0;
zadd = (updown == 2) ? -128 : 0;
for (; count; count--)
{
@ -621,7 +621,7 @@ void P_DrawSplash2 (int count, const DVector3 &pos, DAngle angle, int updown, in
}
}
void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, DAngle angle, int duration, double sparsity, double drift, int SpiralOffset)
void P_DrawRailTrail(AActor *source, const DVector3 &start, TArray<SPortalHit> &portalhits, const DVector3 &end, int color1, int color2, double maxdiff_d, int flags, PClassActor *spawnclass, DAngle angle, int duration, double sparsity, double drift, int SpiralOffset)
{
double length, lengthsquared;
int steps, i;

View file

@ -90,7 +90,14 @@ void P_RunEffects (void);
void P_RunEffect (AActor *actor, int effects);
void P_DrawRailTrail(AActor *source, const DVector3 &start, const DVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, DAngle angle = 0., int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270);
struct SPortalHit
{
DVector3 HitPos;
DVector3 ContPos;
DVector3 OutDir;
};
void P_DrawRailTrail(AActor *source, const DVector3 &start, TArray<SPortalHit> &portalhits, const DVector3 &end, int color1, int color2, double maxdiff = 0, int flags = 0, PClassActor *spawnclass = NULL, DAngle angle = 0., int duration = 35, double sparsity = 1.0, double drift = 1.0, int SpiralOffset = 270);
void P_DrawSplash (int count, const DVector3 &pos, DAngle angle, int kind);
void P_DrawSplash2 (int count, const DVector3 &pos, DAngle angle, int updown, int kind);
void P_DisconnectEffect (AActor *actor);

View file

@ -42,6 +42,131 @@ static FRandom pr_lightflash ("LightFlash");
static FRandom pr_strobeflash ("StrobeFlash");
static FRandom pr_fireflicker ("FireFlicker");
class DFireFlicker : public DLighting
{
DECLARE_CLASS(DFireFlicker, DLighting)
public:
DFireFlicker(sector_t *sector);
DFireFlicker(sector_t *sector, int upper, int lower);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
private:
DFireFlicker();
};
class DFlicker : public DLighting
{
DECLARE_CLASS(DFlicker, DLighting)
public:
DFlicker(sector_t *sector, int upper, int lower);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
private:
DFlicker();
};
class DLightFlash : public DLighting
{
DECLARE_CLASS(DLightFlash, DLighting)
public:
DLightFlash(sector_t *sector);
DLightFlash(sector_t *sector, int min, int max);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
int m_MaxTime;
int m_MinTime;
private:
DLightFlash();
};
class DStrobe : public DLighting
{
DECLARE_CLASS(DStrobe, DLighting)
public:
DStrobe(sector_t *sector, int utics, int ltics, bool inSync);
DStrobe(sector_t *sector, int upper, int lower, int utics, int ltics);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_Count;
int m_MinLight;
int m_MaxLight;
int m_DarkTime;
int m_BrightTime;
private:
DStrobe();
};
class DGlow : public DLighting
{
DECLARE_CLASS(DGlow, DLighting)
public:
DGlow(sector_t *sector);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_MinLight;
int m_MaxLight;
int m_Direction;
private:
DGlow();
};
// [RH] Glow from Light_Glow and Light_Fade specials
class DGlow2 : public DLighting
{
DECLARE_CLASS(DGlow2, DLighting)
public:
DGlow2(sector_t *sector, int start, int end, int tics, bool oneshot);
void Serialize(FArchive &arc);
void Tick();
protected:
int m_Start;
int m_End;
int m_MaxTics;
int m_Tics;
bool m_OneShot;
private:
DGlow2();
};
// [RH] Phased light thinker
class DPhased : public DLighting
{
DECLARE_CLASS(DPhased, DLighting)
public:
DPhased(sector_t *sector);
DPhased(sector_t *sector, int baselevel, int phase);
void Serialize(FArchive &arc);
void Tick();
protected:
BYTE m_BaseLevel;
BYTE m_Phase;
private:
DPhased();
DPhased(sector_t *sector, int baselevel);
int PhaseHelper(sector_t *sector, int index, int light, sector_t *prev);
};
#define GLOWSPEED 8
#define STROBEBRIGHT 5
#define FASTDARK 15
#define SLOWDARK TICRATE
//-----------------------------------------------------------------------------
//
//
@ -845,3 +970,63 @@ void EV_StopLightEffect (int tag)
}
}
}
void P_SpawnLights(sector_t *sector)
{
switch (sector->special)
{
case Light_Phased:
new DPhased(sector, 48, 63 - (sector->lightlevel & 63));
break;
// [RH] Hexen-like phased lighting
case LightSequenceStart:
new DPhased(sector);
break;
case dLight_Flicker:
new DLightFlash(sector);
break;
case dLight_StrobeFast:
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
break;
case dLight_StrobeSlow:
new DStrobe(sector, STROBEBRIGHT, SLOWDARK, false);
break;
case dLight_Strobe_Hurt:
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
break;
case dLight_Glow:
new DGlow(sector);
break;
case dLight_StrobeSlowSync:
new DStrobe(sector, STROBEBRIGHT, SLOWDARK, true);
break;
case dLight_StrobeFastSync:
new DStrobe(sector, STROBEBRIGHT, FASTDARK, true);
break;
case dLight_FireFlicker:
new DFireFlicker(sector);
break;
case dScroll_EastLavaDamage:
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
break;
case sLight_Strobe_Hurt:
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
break;
default:
break;
}
}

View file

@ -3555,7 +3555,7 @@ static FLineSpecial LineSpecialNames[] = {
#include "actionspecials.h"
};
static int STACK_ARGS lscmp (const void * a, const void * b)
static int lscmp (const void * a, const void * b)
{
return stricmp( ((FLineSpecial*)a)->name, ((FLineSpecial*)b)->name);
}

View file

@ -186,7 +186,12 @@ enum WARPF
WARPF_COPYPITCH = 0x8000,
};
enum PCM
{
PCM_DROPOFF = 1,
PCM_NOACTORS = 1 << 1,
PCM_NOLINES = 1 << 2,
};
AActor *P_BlockmapSearch (AActor *mo, int distance, AActor *(*check)(AActor*, int, void *), void *params = NULL);
@ -221,7 +226,7 @@ void P_FakeZMovement (AActor *mo);
bool P_TryMove(AActor* thing, const DVector2 &pos, int dropoff, const secplane_t * onfloor, FCheckPosition &tm, bool missileCheck = false);
bool P_TryMove(AActor* thing, const DVector2 &pos, int dropoff, const secplane_t * onfloor = NULL);
bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff = false);
bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags = 0);
void P_ApplyTorque(AActor *mo);
bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modifyactor = true); // [RH] Added z and telefrag parameters

View file

@ -2410,14 +2410,26 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
//
//==========================================================================
bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff)
bool P_CheckMove(AActor *thing, const DVector2 &pos, int flags)
{
FCheckPosition tm;
double newz = thing->Z();
if (!P_CheckPosition(thing, pos, tm))
{
return false;
// Ignore PCM_DROPOFF. Not necessary here: a little later it is.
if (!flags || (!(flags & PCM_NOACTORS) && !(flags & PCM_NOLINES)))
{
return false;
}
if (!(flags & PCM_NOACTORS) && thing->BlockingMobj)
{
return false;
}
if (!(flags & PCM_NOLINES) && thing->BlockingLine)
{
return false;
}
}
if (thing->flags3 & MF3_FLOORHUGGER)
@ -2469,7 +2481,7 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff)
return false;
}
}
else if (dropoff)
else if (flags & PCM_DROPOFF)
{
const DVector3 oldpos = thing->Pos();
thing->SetOrigin(pos.X, pos.Y, newz, true);
@ -4474,12 +4486,6 @@ struct SRailHit
DVector3 HitPos;
DAngle HitAngle;
};
struct SPortalHit
{
DVector3 HitPos;
DVector3 ContPos;
DVector3 OutDir;
};
struct RailData
{
AActor *Caller;
@ -4588,11 +4594,19 @@ void P_RailAttack(FRailParams *p)
AActor *puffDefaults = GetDefaultByType(puffclass->GetReplacement()); //Contains all the flags such as FOILINVUL, etc.
// disabled because not complete yet.
flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0/*TRACE_ReportPortals*/ : TRACE_PCross | TRACE_Impact /*| TRACE_ReportPortals*/;
flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? TRACE_ReportPortals : TRACE_PCross | TRACE_Impact | TRACE_ReportPortals;
rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true;
rail_data.ThruSpecies = (puffDefaults->flags6 & MF6_MTHRUSPECIES) ? true : false;
// to make things easier, push the start position and directional vector onto the PortalHits array as its first element
SPortalHit phit = { start, start, vec };
rail_data.PortalHits.Push(phit);
Trace(start, source->Sector, vec, p->distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, flags, ProcessRailHit, &rail_data);
// and push the hit position, too, so that the array contains the entire trace with all transition points.
phit = { trace.HitPos, trace.HitPos, trace.HitVector };
rail_data.PortalHits.Push(phit);
// Hurt anything the trace hit
unsigned int i;
FName damagetype = (puffDefaults == NULL || puffDefaults->DamageType == NAME_None) ? FName(NAME_Railgun) : puffDefaults->DamageType;
@ -4695,7 +4709,7 @@ void P_RailAttack(FRailParams *p)
}
// Draw the slug's trail.
P_DrawRailTrail(source, start, trace.HitPos, p->color1, p->color2, p->maxdiff, p->flags, p->spawnclass, angle, p->duration, p->sparsity, p->drift, p->SpiralOffset);
P_DrawRailTrail(source, start, rail_data.PortalHits, trace.HitPos, p->color1, p->color2, p->maxdiff, p->flags, p->spawnclass, angle, p->duration, p->sparsity, p->drift, p->SpiralOffset);
}
//==========================================================================
@ -4988,7 +5002,7 @@ bool P_UsePuzzleItem(AActor *PuzzleItemUser, int PuzzleItemType)
start = PuzzleItemUser->GetPortalTransition(PuzzleItemUser->Height / 2);
end = PuzzleItemUser->Angles.Yaw.ToVector(usedist);
FPathTraverse it(start.X, start.Y, end.X, end.Y, PT_ADDLINES | PT_ADDTHINGS);
FPathTraverse it(start.X, start.Y, end.X, end.Y, PT_DELTA | PT_ADDLINES | PT_ADDTHINGS);
intercept_t *in;
while ((in = it.Next()))

View file

@ -5049,15 +5049,13 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position)
// P_SpawnPuff
//
AActor *P_SpawnPuff (AActor *source, PClassActor *pufftype, const DVector3 &pos, DAngle hitdir, DAngle particledir, int updown, int flags, AActor *vict)
AActor *P_SpawnPuff (AActor *source, PClassActor *pufftype, const DVector3 &pos1, DAngle hitdir, DAngle particledir, int updown, int flags, AActor *vict)
{
AActor *puff;
double z = 0;
if (!(flags & PF_NORANDOMZ))
z = pr_spawnpuff.Random2() / 64.;
DVector3 pos = pos1;
puff = Spawn(pufftype, pos + DVector3(0, 0, z), ALLOW_REPLACE);
if (!(flags & PF_NORANDOMZ)) pos.Z += pr_spawnpuff.Random2() / 64.;
puff = Spawn(pufftype, pos, ALLOW_REPLACE);
if (puff == NULL) return NULL;
if ((puff->flags4 & MF4_RANDOMIZE) && puff->tics > 0)
@ -5275,13 +5273,14 @@ void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle)
if (bloodcls != NULL && !(GetDefaultByType(bloodcls)->flags4 & MF4_ALLOWPARTICLES))
bloodtype = 0;
DVector2 add;
add.X = (pr_splat() - 128) / 32.;
add.Y = (pr_splat() - 128) / 32.;
if (bloodcls != NULL)
{
AActor *mo;
DVector2 add;
add.X = (pr_splat()-128) / 32.;
add.Y = (pr_splat()-128) / 32.;
mo = Spawn (bloodcls, pos + add, NO_REPLACE); // GetBloodType already performed the replacement
mo->target = originator;
@ -5296,7 +5295,7 @@ void P_BloodSplatter2 (const DVector3 &pos, AActor *originator, DAngle hitangle)
}
if (bloodtype >= 1)
{
P_DrawSplash2(40, pos, hitangle - 180., 2, bloodcolor);
P_DrawSplash2(40, pos + add, hitangle - 180., 2, bloodcolor);
}
}

View file

@ -1056,6 +1056,7 @@ static void P_SetupSectorDamage(sector_t *sector, int damage, int interval, int
// Sets up everything derived from 'sector->special' for one sector
// ('fromload' is necessary to allow conversion upon savegame load.)
//
void P_SpawnLights(sector_t *sector);
void P_InitSectorSpecial(sector_t *sector, int special)
{
@ -1089,31 +1090,10 @@ void P_InitSectorSpecial(sector_t *sector, int special)
// [RH] Normal DOOM special or BOOM specialized?
bool keepspecial = false;
P_SpawnLights(sector);
switch (sector->special)
{
case Light_Phased:
new DPhased (sector, 48, 63 - (sector->lightlevel & 63));
break;
// [RH] Hexen-like phased lighting
case LightSequenceStart:
new DPhased (sector);
break;
case dLight_Flicker:
new DLightFlash (sector);
break;
case dLight_StrobeFast:
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
break;
case dLight_StrobeSlow:
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, false);
break;
case dLight_Strobe_Hurt:
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0);
break;
@ -1125,10 +1105,6 @@ void P_InitSectorSpecial(sector_t *sector, int special)
P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0);
break;
case dLight_Glow:
new DGlow (sector);
break;
case dSector_DoorCloseIn30:
new DDoor(sector, DDoor::doorWaitClose, 2, 0, 0, 30 * TICRATE);
break;
@ -1137,14 +1113,6 @@ void P_InitSectorSpecial(sector_t *sector, int special)
P_SetupSectorDamage(sector, 20, 32, 256, NAME_None, SECF_ENDGODMODE|SECF_ENDLEVEL);
break;
case dLight_StrobeSlowSync:
new DStrobe (sector, STROBEBRIGHT, SLOWDARK, true);
break;
case dLight_StrobeFastSync:
new DStrobe (sector, STROBEBRIGHT, FASTDARK, true);
break;
case dSector_DoorRaiseIn5Mins:
new DDoor (sector, DDoor::doorWaitRaise, 2, TICRATE*30/7, 0, 5*60*TICRATE);
break;
@ -1159,10 +1127,6 @@ void P_InitSectorSpecial(sector_t *sector, int special)
P_SetupSectorDamage(sector, 20, 32, 5, NAME_Slime, 0);
break;
case dLight_FireFlicker:
new DFireFlicker (sector);
break;
case dDamage_LavaWimpy:
P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX);
break;
@ -1173,7 +1137,6 @@ void P_InitSectorSpecial(sector_t *sector, int special)
case dScroll_EastLavaDamage:
P_SetupSectorDamage(sector, 5, 32, 256, NAME_Fire, SECF_DMGTERRAINFX);
new DStrobe(sector, STROBEBRIGHT, FASTDARK, false);
P_CreateScroller(EScroll::sc_floor, -4., 0, -1, int(sector - sectors), 0);
keepspecial = true;
break;
@ -1184,7 +1147,6 @@ void P_InitSectorSpecial(sector_t *sector, int special)
case sLight_Strobe_Hurt:
P_SetupSectorDamage(sector, 5, 32, 0, NAME_Slime, 0);
new DStrobe (sector, STROBEBRIGHT, FASTDARK, false);
break;
case sDamage_Hellslime:

View file

@ -71,9 +71,6 @@ typedef enum
// (This is so scrolling floors and objects on them can move at same speed.)
const double CARRYFACTOR = 3 / 32.;
// Define values for map objects
#define MO_TELEPORTMAN 14
// Flags for P_SectorDamage
#define DAMAGE_PLAYERS 1
#define DAMAGE_NONPLAYERS 2
@ -87,7 +84,6 @@ const double CARRYFACTOR = 3 / 32.;
bool CheckIfExitIsGood (AActor *self, level_info_t *info);
// at map load
void P_InitSectorSpecial(sector_t *sector, int special);
void P_SpawnSpecials (void);
// every tic
@ -105,39 +101,6 @@ void P_SetSectorFriction (int tag, int amount, bool alterFlag);
double FrictionToMoveFactor(double friction);
void P_GiveSecret(AActor *actor, bool printmessage, bool playsound, int sectornum);
//
// getSide()
// Will return a side_t*
// given the number of the current sector,
// the line number, and the side (0/1) that you want.
//
inline side_t *getSide (int currentSector, int line, int side)
{
return (sectors[currentSector].lines[line])->sidedef[side];
}
//
// getSector()
// Will return a sector_t*
// given the number of the current sector,
// the line number and the side (0/1) that you want.
//
inline sector_t *getSector (int currentSector, int line, int side)
{
return (sectors[currentSector].lines[line])->sidedef[side]->sector;
}
//
// twoSided()
// Given the sector number and the line number,
// it will tell you whether the line is two-sided or not.
//
inline int twoSided (int sector, int line)
{
return (sectors[sector].lines[line])->flags & ML_TWOSIDED;
}
//
// getNextSector()
// Return sector_t * of sector next to current.
@ -156,142 +119,15 @@ inline sector_t *getNextSector (line_t *line, const sector_t *sec)
#include "p_tags.h"
//
// P_LIGHTS
//
class DLighting : public DSectorEffect
{
DECLARE_CLASS (DLighting, DSectorEffect)
DECLARE_CLASS(DLighting, DSectorEffect)
public:
DLighting (sector_t *sector);
DLighting(sector_t *sector);
protected:
DLighting ();
DLighting();
};
class DFireFlicker : public DLighting
{
DECLARE_CLASS (DFireFlicker, DLighting)
public:
DFireFlicker (sector_t *sector);
DFireFlicker (sector_t *sector, int upper, int lower);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
private:
DFireFlicker ();
};
class DFlicker : public DLighting
{
DECLARE_CLASS (DFlicker, DLighting)
public:
DFlicker (sector_t *sector, int upper, int lower);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
private:
DFlicker ();
};
class DLightFlash : public DLighting
{
DECLARE_CLASS (DLightFlash, DLighting)
public:
DLightFlash (sector_t *sector);
DLightFlash (sector_t *sector, int min, int max);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Count;
int m_MaxLight;
int m_MinLight;
int m_MaxTime;
int m_MinTime;
private:
DLightFlash ();
};
class DStrobe : public DLighting
{
DECLARE_CLASS (DStrobe, DLighting)
public:
DStrobe (sector_t *sector, int utics, int ltics, bool inSync);
DStrobe (sector_t *sector, int upper, int lower, int utics, int ltics);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Count;
int m_MinLight;
int m_MaxLight;
int m_DarkTime;
int m_BrightTime;
private:
DStrobe ();
};
class DGlow : public DLighting
{
DECLARE_CLASS (DGlow, DLighting)
public:
DGlow (sector_t *sector);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_MinLight;
int m_MaxLight;
int m_Direction;
private:
DGlow ();
};
// [RH] Glow from Light_Glow and Light_Fade specials
class DGlow2 : public DLighting
{
DECLARE_CLASS (DGlow2, DLighting)
public:
DGlow2 (sector_t *sector, int start, int end, int tics, bool oneshot);
void Serialize (FArchive &arc);
void Tick ();
protected:
int m_Start;
int m_End;
int m_MaxTics;
int m_Tics;
bool m_OneShot;
private:
DGlow2 ();
};
// [RH] Phased light thinker
class DPhased : public DLighting
{
DECLARE_CLASS (DPhased, DLighting)
public:
DPhased (sector_t *sector);
DPhased (sector_t *sector, int baselevel, int phase);
void Serialize (FArchive &arc);
void Tick ();
protected:
BYTE m_BaseLevel;
BYTE m_Phase;
private:
DPhased ();
DPhased (sector_t *sector, int baselevel);
int PhaseHelper (sector_t *sector, int index, int light, sector_t *prev);
};
#define GLOWSPEED 8
#define STROBEBRIGHT 5
#define FASTDARK 15
#define SLOWDARK TICRATE
void EV_StartLightFlickering (int tag, int upper, int lower);
void EV_StartLightStrobing (int tag, int upper, int lower, int utics, int ltics);
void EV_StartLightStrobing (int tag, int utics, int ltics);

View file

@ -451,7 +451,7 @@ FState *FStateDefinitions::FindState(const char * name)
//
//==========================================================================
static int STACK_ARGS labelcmp(const void *a, const void *b)
static int labelcmp(const void *a, const void *b)
{
FStateLabel *A = (FStateLabel *)a;
FStateLabel *B = (FStateLabel *)b;

View file

@ -532,7 +532,7 @@ typedef TMap<int, MapinfoSpawnItem> SpawnMap;
static SpawnMap SpawnablesFromMapinfo;
static SpawnMap ConversationIDsFromMapinfo;
static int STACK_ARGS SpawnableSort(const void *a, const void *b)
static int SpawnableSort(const void *a, const void *b)
{
return (*((FClassMap::Pair **)a))->Key - (*((FClassMap::Pair **)b))->Key;
}

View file

@ -231,7 +231,7 @@ int FTraceInfo::EnterLinePortal(line_t *li, double frac)
frac += 1 / MaxDist;
double enterdist = MaxDist / frac;
DVector2 enter = newtrace.Start + enterdist * Vec;
DVector3 enter = newtrace.Start + enterdist * Vec;
newtrace.ActorMask = ActorMask;
newtrace.WallMask = WallMask;
@ -253,6 +253,18 @@ int FTraceInfo::EnterLinePortal(line_t *li, double frac)
newtrace.lastfloorportalheight = newtrace.lastceilingportalheight = newtrace.limitz;
newtrace.sectorsel = 0;
Results->unlinked = true;
if ((TraceFlags & TRACE_ReportPortals) && TraceCallback != NULL)
{
Results->HitType = TRACE_CrossingPortal;
Results->HitPos = enter;
P_TranslatePortalXY(li, enter.X, enter.Y);
P_TranslatePortalZ(li, enter.Z);
Results->SrcFromTarget = enter;
Results->HitVector = newtrace.Vec;
TraceCallback(*Results, TraceCallbackData);
}
return newtrace.TraceTraverse(ActorMask ? PT_ADDLINES | PT_ADDTHINGS | PT_COMPATIBLE : PT_ADDLINES);
}
@ -455,8 +467,11 @@ bool FTraceInfo::LineCheck(intercept_t *in)
lastfloorportalheight = fc;
if (TraceCallback != NULL)
{
// Todo: calculate the intersection point.
Results->HitType = TRACE_CrossingPortal;
double hitz = CurSector->SkyBoxes[sector_t::floor]->specialf1;
Results->HitPos = Start + Vec * (hitz - Start.Z) / Vec.Z;
Results->SrcFromTarget = Results->HitPos + CurSector->SkyBoxes[sector_t::floor]->Scale;
Results->HitVector = Vec;
TraceCallback(*Results, TraceCallbackData);
}
}
@ -483,8 +498,11 @@ bool FTraceInfo::LineCheck(intercept_t *in)
lastceilingportalheight = fc;
if (TraceCallback != NULL)
{
// Todo: calculate the intersection point.
Results->HitType = TRACE_CrossingPortal;
double hitz = CurSector->SkyBoxes[sector_t::ceiling]->specialf1;
Results->HitPos = Start + Vec * (hitz - Start.Z) / Vec.Z;
Results->SrcFromTarget = Results->HitPos + CurSector->SkyBoxes[sector_t::ceiling]->Scale;
Results->HitVector = Vec;
TraceCallback(*Results, TraceCallbackData);
}
}

View file

@ -294,7 +294,7 @@ void P_ClearUDMFKeys()
}
}
static int STACK_ARGS udmfcmp(const void *a, const void *b)
static int udmfcmp(const void *a, const void *b)
{
FUDMFKey *A = (FUDMFKey*)a;
FUDMFKey *B = (FUDMFKey*)b;

View file

@ -540,7 +540,7 @@ void PClassPlayerPawn::DeriveData(PClass *newclass)
}
}
static int STACK_ARGS intcmp(const void *a, const void *b)
static int intcmp(const void *a, const void *b)
{
return *(const int *)a - *(const int *)b;
}

View file

@ -1469,7 +1469,7 @@ static void IterFindPolySides (FPolyObj *po, side_t *side)
//
//==========================================================================
static int STACK_ARGS posicmp(const void *a, const void *b)
static int posicmp(const void *a, const void *b)
{
return (*(const side_t **)a)->linedef->args[1] - (*(const side_t **)b)->linedef->args[1];
}

View file

@ -128,7 +128,7 @@ void I_Quit()
extern FILE* Logfile;
bool gameisdead;
void STACK_ARGS I_FatalError(const char* const error, ...)
void I_FatalError(const char* const error, ...)
{
static bool alreadyThrown = false;
gameisdead = true;
@ -165,7 +165,7 @@ void STACK_ARGS I_FatalError(const char* const error, ...)
}
}
void STACK_ARGS I_Error(const char* const error, ...)
void I_Error(const char* const error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
@ -183,6 +183,12 @@ void I_SetIWADInfo()
}
void I_DebugPrint(const char *cp)
{
NSLog(@"%s", cp);
}
void I_PrintStr(const char* const message)
{
FConsoleWindow::GetInstance().AddText(message);

View file

@ -363,6 +363,15 @@ void FConsoleWindow::SetTitleText()
textViewFrame.size.width,
TITLE_TEXT_HEIGHT);
// Temporary solution for the same foreground and background colors
// It's used in graphical startup screen, with Hexen style in particular
// Native OS X backend doesn't implement this yet
if (DoomStartupInfo.FgColor == DoomStartupInfo.BkColor)
{
DoomStartupInfo.FgColor = ~DoomStartupInfo.FgColor;
}
NSTextField* titleText = [[NSTextField alloc] initWithFrame:titleTextRect];
[titleText setStringValue:[NSString stringWithUTF8String:DoomStartupInfo.Name]];
[titleText setAlignment:NSCenterTextAlignment];

View file

@ -104,13 +104,15 @@ void I_Quit (void);
void I_Tactile (int on, int off, int total);
void STACK_ARGS I_Error (const char *error, ...) GCCPRINTF(1,2);
void STACK_ARGS I_FatalError (const char *error, ...) GCCPRINTF(1,2);
void I_Error (const char *error, ...) GCCPRINTF(1,2);
void I_FatalError (const char *error, ...) GCCPRINTF(1,2);
void addterm (void (*func)(void), const char *name);
#define atterm(t) addterm (t, #t)
void popterm ();
void I_DebugPrint (const char *cp);
// Print a console string
void I_PrintStr (const char *str);

View file

@ -129,7 +129,7 @@ void popterm ()
NumTerms--;
}
void STACK_ARGS call_terms ()
void call_terms ()
{
while (NumTerms > 0)
{
@ -138,7 +138,7 @@ void STACK_ARGS call_terms ()
}
}
static void STACK_ARGS NewFailure ()
static void NewFailure ()
{
I_FatalError ("Failed to allocate memory from system heap");
}

View file

@ -179,7 +179,7 @@ bool gameisdead;
void Mac_I_FatalError(const char* errortext);
#endif
void STACK_ARGS I_FatalError (const char *error, ...)
void I_FatalError (const char *error, ...)
{
static bool alreadyThrown = false;
gameisdead = true;
@ -216,7 +216,7 @@ void STACK_ARGS I_FatalError (const char *error, ...)
}
}
void STACK_ARGS I_Error (const char *error, ...)
void I_Error (const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
@ -232,6 +232,10 @@ void I_SetIWADInfo ()
{
}
void I_DebugPrint(const char *cp)
{
}
void I_PrintStr (const char *cp)
{
// Strip out any color escape sequences before writing to the log file

View file

@ -499,7 +499,7 @@ static const char *skinsoundnames[NUMSKINSOUNDS][2] =
};
/*
static int STACK_ARGS skinsorter (const void *a, const void *b)
static int skinsorter (const void *a, const void *b)
{
return stricmp (((FPlayerSkin *)a)->name, ((FPlayerSkin *)b)->name);
}

View file

@ -80,7 +80,7 @@ void (*R_DrawSpanTranslucent)(void);
void (*R_DrawSpanMaskedTranslucent)(void);
void (*R_DrawSpanAddClamp)(void);
void (*R_DrawSpanMaskedAddClamp)(void);
void (STACK_ARGS *rt_map4cols)(int,int,int);
void (*rt_map4cols)(int,int,int);
//
// R_DrawColumn
@ -984,7 +984,7 @@ int dscount;
#ifdef X86_ASM
extern "C" void R_SetSpanSource_ASM (const BYTE *flat);
extern "C" void STACK_ARGS R_SetSpanSize_ASM (int xbits, int ybits);
extern "C" void R_SetSpanSize_ASM (int xbits, int ybits);
extern "C" void R_SetSpanColormap_ASM (BYTE *colormap);
extern "C" BYTE *ds_curcolormap, *ds_cursource, *ds_curtiltedsource;
#endif
@ -1493,7 +1493,7 @@ extern "C" void R_SetupDrawSlabC(const BYTE *colormap)
slabcolormap = colormap;
}
extern "C" void STACK_ARGS R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p)
extern "C" void R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p)
{
int x;
const BYTE *colormap = slabcolormap;
@ -1574,53 +1574,53 @@ extern "C" void STACK_ARGS R_DrawSlabC(int dx, fixed_t v, int dy, fixed_t vi, co
// wallscan stuff, in C
#ifndef X86_ASM
static DWORD STACK_ARGS vlinec1 ();
static DWORD vlinec1 ();
static int vlinebits;
DWORD (STACK_ARGS *dovline1)() = vlinec1;
DWORD (STACK_ARGS *doprevline1)() = vlinec1;
DWORD (*dovline1)() = vlinec1;
DWORD (*doprevline1)() = vlinec1;
#ifdef X64_ASM
extern "C" void vlinetallasm4();
#define dovline4 vlinetallasm4
extern "C" void setupvlinetallasm (int);
#else
static void STACK_ARGS vlinec4 ();
void (STACK_ARGS *dovline4)() = vlinec4;
static void vlinec4 ();
void (*dovline4)() = vlinec4;
#endif
static DWORD STACK_ARGS mvlinec1();
static void STACK_ARGS mvlinec4();
static DWORD mvlinec1();
static void mvlinec4();
static int mvlinebits;
DWORD (STACK_ARGS *domvline1)() = mvlinec1;
void (STACK_ARGS *domvline4)() = mvlinec4;
DWORD (*domvline1)() = mvlinec1;
void (*domvline4)() = mvlinec4;
#else
extern "C"
{
DWORD STACK_ARGS vlineasm1 ();
DWORD STACK_ARGS prevlineasm1 ();
DWORD STACK_ARGS vlinetallasm1 ();
DWORD STACK_ARGS prevlinetallasm1 ();
void STACK_ARGS vlineasm4 ();
void STACK_ARGS vlinetallasmathlon4 ();
void STACK_ARGS vlinetallasm4 ();
void STACK_ARGS setupvlineasm (int);
void STACK_ARGS setupvlinetallasm (int);
DWORD vlineasm1 ();
DWORD prevlineasm1 ();
DWORD vlinetallasm1 ();
DWORD prevlinetallasm1 ();
void vlineasm4 ();
void vlinetallasmathlon4 ();
void vlinetallasm4 ();
void setupvlineasm (int);
void setupvlinetallasm (int);
DWORD STACK_ARGS mvlineasm1();
void STACK_ARGS mvlineasm4();
void STACK_ARGS setupmvlineasm (int);
DWORD mvlineasm1();
void mvlineasm4();
void setupmvlineasm (int);
}
DWORD (STACK_ARGS *dovline1)() = vlinetallasm1;
DWORD (STACK_ARGS *doprevline1)() = prevlinetallasm1;
void (STACK_ARGS *dovline4)() = vlinetallasm4;
DWORD (*dovline1)() = vlinetallasm1;
DWORD (*doprevline1)() = prevlinetallasm1;
void (*dovline4)() = vlinetallasm4;
DWORD (STACK_ARGS *domvline1)() = mvlineasm1;
void (STACK_ARGS *domvline4)() = mvlineasm4;
DWORD (*domvline1)() = mvlineasm1;
void (*domvline4)() = mvlineasm4;
#endif
void setupvline (int fracbits)
@ -1660,7 +1660,7 @@ void setupvline (int fracbits)
}
#if !defined(X86_ASM)
DWORD STACK_ARGS vlinec1 ()
DWORD vlinec1 ()
{
DWORD fracstep = dc_iscale;
DWORD frac = dc_texturefrac;
@ -1681,7 +1681,7 @@ DWORD STACK_ARGS vlinec1 ()
return frac;
}
void STACK_ARGS vlinec4 ()
void vlinec4 ()
{
BYTE *dest = dc_dest;
int count = dc_count;
@ -1711,7 +1711,7 @@ void setupmvline (int fracbits)
}
#if !defined(X86_ASM)
DWORD STACK_ARGS mvlinec1 ()
DWORD mvlinec1 ()
{
DWORD fracstep = dc_iscale;
DWORD frac = dc_texturefrac;
@ -1736,7 +1736,7 @@ DWORD STACK_ARGS mvlinec1 ()
return frac;
}
void STACK_ARGS mvlinec4 ()
void mvlinec4 ()
{
BYTE *dest = dc_dest;
int count = dc_count;

View file

@ -65,18 +65,18 @@ extern "C" unsigned int horizspans[4];
// Hook in assembler or system specific BLT here.
extern void (*R_DrawColumn)(void);
extern DWORD (STACK_ARGS *dovline1) ();
extern DWORD (STACK_ARGS *doprevline1) ();
extern DWORD (*dovline1) ();
extern DWORD (*doprevline1) ();
#ifdef X64_ASM
#define dovline4 vlinetallasm4
extern "C" void vlinetallasm4();
#else
extern void (STACK_ARGS *dovline4) ();
extern void (*dovline4) ();
#endif
extern void setupvline (int);
extern DWORD (STACK_ARGS *domvline1) ();
extern void (STACK_ARGS *domvline4) ();
extern DWORD (*domvline1) ();
extern void (*domvline4) ();
extern void setupmvline (int);
extern void setuptmvline (int);
@ -123,11 +123,11 @@ void R_InitColumnDrawers ();
extern "C"
{
void rt_copy1col_c (int hx, int sx, int yl, int yh);
void STACK_ARGS rt_copy4cols_c (int sx, int yl, int yh);
void rt_copy4cols_c (int sx, int yl, int yh);
void rt_shaded1col (int hx, int sx, int yl, int yh);
void STACK_ARGS rt_shaded4cols_c (int sx, int yl, int yh);
void STACK_ARGS rt_shaded4cols_asm (int sx, int yl, int yh);
void rt_shaded4cols_c (int sx, int yl, int yh);
void rt_shaded4cols_asm (int sx, int yl, int yh);
void rt_map1col_c (int hx, int sx, int yl, int yh);
void rt_add1col (int hx, int sx, int yl, int yh);
@ -141,29 +141,29 @@ void rt_tlateaddclamp1col (int hx, int sx, int yl, int yh);
void rt_tlatesubclamp1col (int hx, int sx, int yl, int yh);
void rt_tlaterevsubclamp1col (int hx, int sx, int yl, int yh);
void STACK_ARGS rt_map4cols_c (int sx, int yl, int yh);
void STACK_ARGS rt_add4cols_c (int sx, int yl, int yh);
void STACK_ARGS rt_addclamp4cols_c (int sx, int yl, int yh);
void STACK_ARGS rt_subclamp4cols (int sx, int yl, int yh);
void STACK_ARGS rt_revsubclamp4cols (int sx, int yl, int yh);
void rt_map4cols_c (int sx, int yl, int yh);
void rt_add4cols_c (int sx, int yl, int yh);
void rt_addclamp4cols_c (int sx, int yl, int yh);
void rt_subclamp4cols (int sx, int yl, int yh);
void rt_revsubclamp4cols (int sx, int yl, int yh);
void STACK_ARGS rt_tlate4cols (int sx, int yl, int yh);
void STACK_ARGS rt_tlateadd4cols (int sx, int yl, int yh);
void STACK_ARGS rt_tlateaddclamp4cols (int sx, int yl, int yh);
void STACK_ARGS rt_tlatesubclamp4cols (int sx, int yl, int yh);
void STACK_ARGS rt_tlaterevsubclamp4cols (int sx, int yl, int yh);
void rt_tlate4cols (int sx, int yl, int yh);
void rt_tlateadd4cols (int sx, int yl, int yh);
void rt_tlateaddclamp4cols (int sx, int yl, int yh);
void rt_tlatesubclamp4cols (int sx, int yl, int yh);
void rt_tlaterevsubclamp4cols (int sx, int yl, int yh);
void rt_copy1col_asm (int hx, int sx, int yl, int yh);
void rt_map1col_asm (int hx, int sx, int yl, int yh);
void STACK_ARGS rt_copy4cols_asm (int sx, int yl, int yh);
void STACK_ARGS rt_map4cols_asm1 (int sx, int yl, int yh);
void STACK_ARGS rt_map4cols_asm2 (int sx, int yl, int yh);
void STACK_ARGS rt_add4cols_asm (int sx, int yl, int yh);
void STACK_ARGS rt_addclamp4cols_asm (int sx, int yl, int yh);
void rt_copy4cols_asm (int sx, int yl, int yh);
void rt_map4cols_asm1 (int sx, int yl, int yh);
void rt_map4cols_asm2 (int sx, int yl, int yh);
void rt_add4cols_asm (int sx, int yl, int yh);
void rt_addclamp4cols_asm (int sx, int yl, int yh);
}
extern void (STACK_ARGS *rt_map4cols)(int sx, int yl, int yh);
extern void (*rt_map4cols)(int sx, int yl, int yh);
#ifdef X86_ASM
#define rt_copy1col rt_copy1col_asm
@ -231,7 +231,7 @@ void R_FillSpan (void);
#endif
extern "C" void R_SetupDrawSlab(const BYTE *colormap);
extern "C" void STACK_ARGS R_DrawSlab(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p);
extern "C" void R_DrawSlab(int dx, fixed_t v, int dy, fixed_t vi, const BYTE *vptr, BYTE *p);
extern "C" int ds_y;
extern "C" int ds_x1;

View file

@ -112,7 +112,7 @@ void rt_copy1col_c (int hx, int sx, int yl, int yh)
}
// Copies all four spans to the screen starting at sx.
void STACK_ARGS rt_copy4cols_c (int sx, int yl, int yh)
void rt_copy4cols_c (int sx, int yl, int yh)
{
int *source;
int *dest;
@ -180,7 +180,7 @@ void rt_map1col_c (int hx, int sx, int yl, int yh)
}
// Maps all four spans to the screen starting at sx.
void STACK_ARGS rt_map4cols_c (int sx, int yl, int yh)
void rt_map4cols_c (int sx, int yl, int yh)
{
BYTE *colormap;
BYTE *source;
@ -320,7 +320,7 @@ void rt_tlate1col (int hx, int sx, int yl, int yh)
}
// Translates all four spans to the screen starting at sx.
void STACK_ARGS rt_tlate4cols (int sx, int yl, int yh)
void rt_tlate4cols (int sx, int yl, int yh)
{
rt_Translate4cols(dc_translation, yl, yh);
rt_map4cols(sx, yl, yh);
@ -361,7 +361,7 @@ void rt_add1col (int hx, int sx, int yl, int yh)
}
// Adds all four spans to the screen starting at sx without clamping.
void STACK_ARGS rt_add4cols_c (int sx, int yl, int yh)
void rt_add4cols_c (int sx, int yl, int yh)
{
BYTE *colormap;
BYTE *source;
@ -424,7 +424,7 @@ void rt_tlateadd1col (int hx, int sx, int yl, int yh)
}
// Translates and adds all four spans to the screen starting at sx without clamping.
void STACK_ARGS rt_tlateadd4cols (int sx, int yl, int yh)
void rt_tlateadd4cols (int sx, int yl, int yh)
{
rt_Translate4cols(dc_translation, yl, yh);
rt_add4cols(sx, yl, yh);
@ -462,7 +462,7 @@ void rt_shaded1col (int hx, int sx, int yl, int yh)
}
// Shades all four spans to the screen starting at sx.
void STACK_ARGS rt_shaded4cols_c (int sx, int yl, int yh)
void rt_shaded4cols_c (int sx, int yl, int yh)
{
DWORD *fgstart;
BYTE *colormap;
@ -543,7 +543,7 @@ void rt_addclamp1col (int hx, int sx, int yl, int yh)
}
// Adds all four spans to the screen starting at sx with clamping.
void STACK_ARGS rt_addclamp4cols_c (int sx, int yl, int yh)
void rt_addclamp4cols_c (int sx, int yl, int yh)
{
BYTE *colormap;
BYTE *source;
@ -614,7 +614,7 @@ void rt_tlateaddclamp1col (int hx, int sx, int yl, int yh)
}
// Translates and adds all four spans to the screen starting at sx with clamping.
void STACK_ARGS rt_tlateaddclamp4cols (int sx, int yl, int yh)
void rt_tlateaddclamp4cols (int sx, int yl, int yh)
{
rt_Translate4cols(dc_translation, yl, yh);
rt_addclamp4cols(sx, yl, yh);
@ -656,7 +656,7 @@ void rt_subclamp1col (int hx, int sx, int yl, int yh)
}
// Subtracts all four spans to the screen starting at sx with clamping.
void STACK_ARGS rt_subclamp4cols (int sx, int yl, int yh)
void rt_subclamp4cols (int sx, int yl, int yh)
{
BYTE *colormap;
BYTE *source;
@ -723,7 +723,7 @@ void rt_tlatesubclamp1col (int hx, int sx, int yl, int yh)
}
// Translates and subtracts all four spans to the screen starting at sx with clamping.
void STACK_ARGS rt_tlatesubclamp4cols (int sx, int yl, int yh)
void rt_tlatesubclamp4cols (int sx, int yl, int yh)
{
rt_Translate4cols(dc_translation, yl, yh);
rt_subclamp4cols(sx, yl, yh);
@ -765,7 +765,7 @@ void rt_revsubclamp1col (int hx, int sx, int yl, int yh)
}
// Subtracts all four spans from the screen starting at sx with clamping.
void STACK_ARGS rt_revsubclamp4cols (int sx, int yl, int yh)
void rt_revsubclamp4cols (int sx, int yl, int yh)
{
BYTE *colormap;
BYTE *source;
@ -832,7 +832,7 @@ void rt_tlaterevsubclamp1col (int hx, int sx, int yl, int yh)
}
// Translates and subtracts all four spans from the screen starting at sx with clamping.
void STACK_ARGS rt_tlaterevsubclamp4cols (int sx, int yl, int yh)
void rt_tlaterevsubclamp4cols (int sx, int yl, int yh)
{
rt_Translate4cols(dc_translation, yl, yh);
rt_revsubclamp4cols(sx, yl, yh);

View file

@ -158,7 +158,7 @@ void (*spanfunc) (void);
void (*hcolfunc_pre) (void);
void (*hcolfunc_post1) (int hx, int sx, int yl, int yh);
void (*hcolfunc_post2) (int hx, int sx, int yl, int yh);
void (STACK_ARGS *hcolfunc_post4) (int sx, int yl, int yh);
void (*hcolfunc_post4) (int sx, int yl, int yh);
cycle_t WallCycles, PlaneCycles, MaskedCycles, WallScanCycles;

View file

@ -117,7 +117,7 @@ extern void (*spanfunc) (void);
extern void (*hcolfunc_pre) (void);
extern void (*hcolfunc_post1) (int hx, int sx, int yl, int yh);
extern void (*hcolfunc_post2) (int hx, int sx, int yl, int yh);
extern void (STACK_ARGS *hcolfunc_post4) (int sx, int yl, int yh);
extern void (*hcolfunc_post4) (int sx, int yl, int yh);
void R_InitTextureMapping ();

View file

@ -148,7 +148,7 @@ static DWORD basexfrac, baseyfrac;
#ifdef X86_ASM
extern "C" void R_SetSpanSource_ASM (const BYTE *flat);
extern "C" void STACK_ARGS R_SetSpanSize_ASM (int xbits, int ybits);
extern "C" void R_SetSpanSize_ASM (int xbits, int ybits);
extern "C" void R_SetSpanColormap_ASM (BYTE *colormap);
extern "C" void R_SetTiltedSpanSource_ASM (const BYTE *flat);
extern "C" BYTE *ds_curcolormap, *ds_cursource, *ds_curtiltedsource;
@ -253,7 +253,7 @@ void R_MapPlane (int y, int x1)
//==========================================================================
extern "C" {
void STACK_ARGS R_CalcTiltedLighting (fixed_t lval, fixed_t lend, int width)
void R_CalcTiltedLighting (fixed_t lval, fixed_t lend, int width)
{
fixed_t lstep;
BYTE *lightfiller;

View file

@ -1709,13 +1709,13 @@ static drawseg_t **drawsegsorter;
static int drawsegsortersize = 0;
// Sort vissprites by leftmost column, left to right
static int STACK_ARGS sv_comparex (const void *arg1, const void *arg2)
static int sv_comparex (const void *arg1, const void *arg2)
{
return (*(vissprite_t **)arg2)->x1 - (*(vissprite_t **)arg1)->x1;
}
// Sort drawsegs by rightmost column, left to right
static int STACK_ARGS sd_comparex (const void *arg1, const void *arg2)
static int sd_comparex (const void *arg1, const void *arg2)
{
return (*(drawseg_t **)arg2)->x2 - (*(drawseg_t **)arg1)->x2;
}

View file

@ -116,7 +116,7 @@ void R_DrawMaskedColumn (const BYTE *column, const FTexture::Span *spans);
void R_WallSpriteColumn (void (*drawfunc)(const BYTE *column, const FTexture::Span *spans));
void R_CacheSprite (spritedef_t *sprite);
void R_SortVisSprites (int (STACK_ARGS *compare)(const void *, const void *), size_t first);
void R_SortVisSprites (int (*compare)(const void *, const void *), size_t first);
void R_AddSprites (sector_t *sec, int lightlevel, int fakeside);
void R_AddPSprites ();
void R_DrawSprites ();

View file

@ -135,7 +135,7 @@ unsigned int FZipExploder::InitTable(TArray<HuffNode> &decoder, int numspots)
return start;
}
int STACK_ARGS FZipExploder::buildercmp(const void *a, const void *b)
int FZipExploder::buildercmp(const void *a, const void *b)
{
const TableBuilder *v1 = (const TableBuilder *)a;
const TableBuilder *v2 = (const TableBuilder *)b;

View file

@ -31,7 +31,7 @@ class FZipExploder
unsigned char ReadBuf[256];
unsigned int bs, be;
static int STACK_ARGS buildercmp(const void *a, const void *b);
static int buildercmp(const void *a, const void *b);
void InsertCode(TArray<HuffNode> &decoder, unsigned int pos, int bits, unsigned short code, int len, unsigned char value);
unsigned int InitTable(TArray<HuffNode> &decoder, int numspots);
int BuildDecoder(TArray<HuffNode> &decoder, TableBuilder *values, int numvals);

View file

@ -316,7 +316,7 @@ FResourceFile::~FResourceFile()
delete Reader;
}
int STACK_ARGS lumpcmp(const void * a, const void * b)
int lumpcmp(const void * a, const void * b)
{
FResourceLump * rec1 = (FResourceLump *)a;
FResourceLump * rec2 = (FResourceLump *)b;

View file

@ -199,7 +199,7 @@ extern bool IsFloat (const char *str);
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static int STACK_ARGS SortPlayerClasses (const void *a, const void *b);
static int SortPlayerClasses (const void *a, const void *b);
static int S_DupPlayerSound (const char *pclass, int gender, int refid, int aliasref);
static void S_SavePlayerSound (const char *pclass, int gender, int refid, int lumpnum, bool alias);
static void S_RestorePlayerSounds();
@ -1627,7 +1627,7 @@ void S_ShrinkPlayerSoundLists ()
DefPlayerClass = S_FindPlayerClass (DefPlayerClassName);
}
static int STACK_ARGS SortPlayerClasses (const void *a, const void *b)
static int SortPlayerClasses (const void *a, const void *b)
{
return stricmp (((const FPlayerClassLookup *)a)->Name,
((const FPlayerClassLookup *)b)->Name);

View file

@ -773,7 +773,7 @@ static void CalcSectorSoundOrg(const DVector3 &listenpos, const sector_t *sec, i
if (!(i_compatflags & COMPATF_SECTORSOUNDS))
{
// Are we inside the sector? If yes, the closest point is the one we're on.
if (P_PointInSector(pos.X, pos.Y) == sec)
if (P_PointInSector(listenpos.X, listenpos.Y) == sec)
{
pos.X = (float)listenpos.X;
pos.Z = (float)listenpos.Y;

View file

@ -940,7 +940,7 @@ int FScanner::GetMessageLine()
//
//==========================================================================
void STACK_ARGS FScanner::ScriptError (const char *message, ...)
void FScanner::ScriptError (const char *message, ...)
{
FString composed;
@ -966,7 +966,7 @@ void STACK_ARGS FScanner::ScriptError (const char *message, ...)
//
//==========================================================================
void STACK_ARGS FScanner::ScriptMessage (const char *message, ...)
void FScanner::ScriptMessage (const char *message, ...)
{
FString composed;
@ -1038,7 +1038,7 @@ FScriptPosition &FScriptPosition::operator=(const FScriptPosition &other)
//
//==========================================================================
void STACK_ARGS FScriptPosition::Message (int severity, const char *message, ...) const
void FScriptPosition::Message (int severity, const char *message, ...) const
{
FString composed;

View file

@ -386,34 +386,34 @@ protected:
#ifdef DYN_FLUIDSYNTH
enum { FLUID_FAILED = -1, FLUID_OK = 0 };
fluid_settings_t *(STACK_ARGS *new_fluid_settings)();
fluid_synth_t *(STACK_ARGS *new_fluid_synth)(fluid_settings_t *);
int (STACK_ARGS *delete_fluid_synth)(fluid_synth_t *);
void (STACK_ARGS *delete_fluid_settings)(fluid_settings_t *);
int (STACK_ARGS *fluid_settings_setnum)(fluid_settings_t *, const char *, double);
int (STACK_ARGS *fluid_settings_setstr)(fluid_settings_t *, const char *, const char *);
int (STACK_ARGS *fluid_settings_setint)(fluid_settings_t *, const char *, int);
int (STACK_ARGS *fluid_settings_getstr)(fluid_settings_t *, const char *, char **);
int (STACK_ARGS *fluid_settings_getint)(fluid_settings_t *, const char *, int *);
void (STACK_ARGS *fluid_synth_set_reverb_on)(fluid_synth_t *, int);
void (STACK_ARGS *fluid_synth_set_chorus_on)(fluid_synth_t *, int);
int (STACK_ARGS *fluid_synth_set_interp_method)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_set_polyphony)(fluid_synth_t *, int);
int (STACK_ARGS *fluid_synth_get_polyphony)(fluid_synth_t *);
int (STACK_ARGS *fluid_synth_get_active_voice_count)(fluid_synth_t *);
double (STACK_ARGS *fluid_synth_get_cpu_load)(fluid_synth_t *);
int (STACK_ARGS *fluid_synth_system_reset)(fluid_synth_t *);
int (STACK_ARGS *fluid_synth_noteon)(fluid_synth_t *, int, int, int);
int (STACK_ARGS *fluid_synth_noteoff)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_cc)(fluid_synth_t *, int, int, int);
int (STACK_ARGS *fluid_synth_program_change)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_channel_pressure)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_pitch_bend)(fluid_synth_t *, int, int);
int (STACK_ARGS *fluid_synth_write_float)(fluid_synth_t *, int, void *, int, int, void *, int, int);
int (STACK_ARGS *fluid_synth_sfload)(fluid_synth_t *, const char *, int);
void (STACK_ARGS *fluid_synth_set_reverb)(fluid_synth_t *, double, double, double, double);
void (STACK_ARGS *fluid_synth_set_chorus)(fluid_synth_t *, int, double, double, double, int);
int (STACK_ARGS *fluid_synth_sysex)(fluid_synth_t *, const char *, int, char *, int *, int *, int);
fluid_settings_t *(*new_fluid_settings)();
fluid_synth_t *(*new_fluid_synth)(fluid_settings_t *);
int (*delete_fluid_synth)(fluid_synth_t *);
void (*delete_fluid_settings)(fluid_settings_t *);
int (*fluid_settings_setnum)(fluid_settings_t *, const char *, double);
int (*fluid_settings_setstr)(fluid_settings_t *, const char *, const char *);
int (*fluid_settings_setint)(fluid_settings_t *, const char *, int);
int (*fluid_settings_getstr)(fluid_settings_t *, const char *, char **);
int (*fluid_settings_getint)(fluid_settings_t *, const char *, int *);
void (*fluid_synth_set_reverb_on)(fluid_synth_t *, int);
void (*fluid_synth_set_chorus_on)(fluid_synth_t *, int);
int (*fluid_synth_set_interp_method)(fluid_synth_t *, int, int);
int (*fluid_synth_set_polyphony)(fluid_synth_t *, int);
int (*fluid_synth_get_polyphony)(fluid_synth_t *);
int (*fluid_synth_get_active_voice_count)(fluid_synth_t *);
double (*fluid_synth_get_cpu_load)(fluid_synth_t *);
int (*fluid_synth_system_reset)(fluid_synth_t *);
int (*fluid_synth_noteon)(fluid_synth_t *, int, int, int);
int (*fluid_synth_noteoff)(fluid_synth_t *, int, int);
int (*fluid_synth_cc)(fluid_synth_t *, int, int, int);
int (*fluid_synth_program_change)(fluid_synth_t *, int, int);
int (*fluid_synth_channel_pressure)(fluid_synth_t *, int, int);
int (*fluid_synth_pitch_bend)(fluid_synth_t *, int, int);
int (*fluid_synth_write_float)(fluid_synth_t *, int, void *, int, int, void *, int, int);
int (*fluid_synth_sfload)(fluid_synth_t *, const char *, int);
void (*fluid_synth_set_reverb)(fluid_synth_t *, double, double, double, double);
void (*fluid_synth_set_chorus)(fluid_synth_t *, int, double, double, double, int);
int (*fluid_synth_sysex)(fluid_synth_t *, const char *, int, char *, int *, int *, int);
#ifdef _WIN32
HMODULE FluidSynthDLL;

View file

@ -40,6 +40,7 @@
#include "m_swap.h"
#include "w_wad.h"
#include "v_text.h"
#include "i_system.h"
// MACROS ------------------------------------------------------------------
@ -337,7 +338,7 @@ int SoftSynthMIDIDevice::PlayTick()
char buffer[128];
mysnprintf(buffer, countof(buffer), "C%02d: %11s %3d %3d\n", (status & 15) + 1, commands[(status >> 4) & 7], parm1, parm2);
#ifdef _WIN32
OutputDebugString(buffer);
I_DebugPrint(buffer);
#else
fputs(buffer, stderr);
#endif

View file

@ -209,7 +209,7 @@ void ReadStatistics()
//
// ====================================================================
int STACK_ARGS compare_episode_names(const void *a, const void *b)
int compare_episode_names(const void *a, const void *b)
{
FStatistics *A = (FStatistics*)a;
FStatistics *B = (FStatistics*)b;
@ -217,7 +217,7 @@ int STACK_ARGS compare_episode_names(const void *a, const void *b)
return strnatcasecmp(A->epi_header, B->epi_header);
}
int STACK_ARGS compare_level_names(const void *a, const void *b)
int compare_level_names(const void *a, const void *b)
{
FLevelStatistics *A = (FLevelStatistics*)a;
FLevelStatistics *B = (FLevelStatistics*)b;
@ -225,7 +225,7 @@ int STACK_ARGS compare_level_names(const void *a, const void *b)
return strnatcasecmp(A->name, B->name);
}
int STACK_ARGS compare_dates(const void *a, const void *b)
int compare_dates(const void *a, const void *b)
{
FLevelStatistics *A = (FLevelStatistics*)a;
FLevelStatistics *B = (FLevelStatistics*)b;

View file

@ -46,7 +46,7 @@
#include "farchive.h"
static int STACK_ARGS SortSwitchDefs (const void *a, const void *b)
static int SortSwitchDefs (const void *a, const void *b)
{
return (*(FSwitchDef **)a)->PreTexture - (*(FSwitchDef **)b)->PreTexture;
}

View file

@ -1165,7 +1165,7 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part, bool silent, i
else if (sc.Compare("alpha"))
{
sc.MustGetFloat();
part.Alpha = clamp<blend_t>(int(sc.Float / BLENDUNIT), 0, BLENDUNIT);
part.Alpha = clamp<blend_t>(int(sc.Float * BLENDUNIT), 0, BLENDUNIT);
// bComplex is not set because it is only needed when the style is not OP_COPY.
}
else if (sc.Compare("style"))

View file

@ -6706,8 +6706,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
bool checker = false;
if (flags & CBF_DROPOFF)
{
// Unfortunately, whenever P_CheckMove returned false, that means it could
// ignore a variety of flags mainly because of P_CheckPosition. This
// results in picking up false positives due to actors or lines being in the way
// when they clearly should not be.
int fpass = PCM_DROPOFF;
if (flags & CBF_NOACTORS) fpass |= PCM_NOACTORS;
if (flags & CBF_NOLINES) fpass |= PCM_NOLINES;
mobj->SetZ(pos.Z);
checker = P_CheckMove(mobj, pos, true);
checker = P_CheckMove(mobj, pos, fpass);
mobj->SetZ(oldpos.Z);
}
else
@ -6743,7 +6751,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
//[MC] I don't know why I let myself be persuaded not to include a flag.
//If an actor is loaded with pointers, they don't really have any options to spare.
//Also, fail if a dropoff or a step is too great to pass over when checking for dropoffs.
if ((!(flags & CBF_NOACTORS) && (mobj->BlockingMobj)) || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL) ||
((flags & CBF_DROPOFF) && !checker))
{

View file

@ -557,17 +557,17 @@ PFunction *FindGlobalActionFunction(const char *name)
//
//==========================================================================
static int STACK_ARGS flagcmp (const void * a, const void * b)
static int flagcmp (const void * a, const void * b)
{
return stricmp( ((FFlagDef*)a)->name, ((FFlagDef*)b)->name);
}
static int STACK_ARGS propcmp(const void * a, const void * b)
static int propcmp(const void * a, const void * b)
{
return stricmp( (*(FPropertyInfo**)a)->name, (*(FPropertyInfo**)b)->name);
}
static int STACK_ARGS funccmp(const void * a, const void * b)
static int funccmp(const void * a, const void * b)
{
return stricmp( ((AFuncDesc*)a)->Name, ((AFuncDesc*)b)->Name);
}

View file

@ -782,11 +782,6 @@ void Renderer::MarkInstrument(int banknum, int percussion, int instr)
}
}
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
void cmsg(int type, int verbosity_level, const char *fmt, ...)
{
/*
@ -801,7 +796,7 @@ void cmsg(int type, int verbosity_level, const char *fmt, ...)
va_start(args, fmt);
vsprintf(buf, fmt, args);
va_end(args);
OutputDebugString(buf);
I_DebugPrint(buf);
#endif
}

View file

@ -106,7 +106,7 @@ static int PalFromRGB(uint32 rgb)
return LastPal;
}
void STACK_ARGS DCanvas::DrawTexture (FTexture *img, double x, double y, int tags_first, ...)
void DCanvas::DrawTexture (FTexture *img, double x, double y, int tags_first, ...)
{
va_list tags;
va_start(tags, tags_first);

View file

@ -134,7 +134,7 @@ protected:
void LoadBMF (int lump, const BYTE *data);
void CreateFontFromPic (FTextureID picnum);
static int STACK_ARGS BMFCompare(const void *a, const void *b);
static int BMFCompare(const void *a, const void *b);
enum
{
@ -231,7 +231,7 @@ struct TempColorInfo
// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
static int STACK_ARGS TranslationMapCompare (const void *a, const void *b);
static int TranslationMapCompare (const void *a, const void *b);
// EXTERNAL DATA DECLARATIONS ----------------------------------------------
@ -594,7 +594,7 @@ void RecordTextureColors (FTexture *pic, BYTE *usedcolors)
//
//==========================================================================
static int STACK_ARGS compare (const void *arg1, const void *arg2)
static int compare (const void *arg1, const void *arg2)
{
if (RPART(GPalette.BaseColors[*((BYTE *)arg1)]) * 299 +
GPART(GPalette.BaseColors[*((BYTE *)arg1)]) * 587 +
@ -1360,7 +1360,7 @@ void FSingleLumpFont::LoadBMF(int lump, const BYTE *data)
//
//==========================================================================
int STACK_ARGS FSingleLumpFont::BMFCompare(const void *a, const void *b)
int FSingleLumpFont::BMFCompare(const void *a, const void *b)
{
const PalEntry *pa = (const PalEntry *)a;
const PalEntry *pb = (const PalEntry *)b;
@ -2474,7 +2474,7 @@ void V_InitFontColors ()
//
//==========================================================================
static int STACK_ARGS TranslationMapCompare (const void *a, const void *b)
static int TranslationMapCompare (const void *a, const void *b)
{
return int(((const TranslationMap *)a)->Name) - int(((const TranslationMap *)b)->Name);
}

View file

@ -64,8 +64,8 @@ FColorMatcher ColorMatcher;
/* Current color blending values */
int BlendR, BlendG, BlendB, BlendA;
static int STACK_ARGS sortforremap (const void *a, const void *b);
static int STACK_ARGS sortforremap2 (const void *a, const void *b);
static int sortforremap (const void *a, const void *b);
static int sortforremap2 (const void *a, const void *b);
/**************************/
/* Gamma correction stuff */
@ -222,7 +222,7 @@ void FPalette::MakeGoodRemap ()
// 256 entries are different. :-)
}
static int STACK_ARGS sortforremap (const void *a, const void *b)
static int sortforremap (const void *a, const void *b)
{
return (*(const DWORD *)a & 0xFFFFFF) - (*(const DWORD *)b & 0xFFFFFF);
}
@ -298,7 +298,7 @@ void FPalette::MakeRemap (const DWORD *colors, BYTE *remap, const BYTE *useful,
}
}
static int STACK_ARGS sortforremap2 (const void *a, const void *b)
static int sortforremap2 (const void *a, const void *b)
{
const RemappingWork *ap = (const RemappingWork *)a;
const RemappingWork *bp = (const RemappingWork *)b;
@ -384,7 +384,7 @@ void InitPalette ()
R_InitColormaps ();
}
extern "C" void STACK_ARGS DoBlending_MMX (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a);
extern "C" void DoBlending_MMX (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a);
extern void DoBlending_SSE2 (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a);
void DoBlending (const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a)

View file

@ -52,7 +52,7 @@
//
// Write a single character using the given font
//
void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...)
void DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...)
{
if (font == NULL)
return;
@ -84,7 +84,7 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B
//
// Write a string using the given font
//
void STACK_ARGS DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...)
void DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...)
{
int w;
const BYTE *ch;

View file

@ -246,7 +246,7 @@ public:
// 2D Texture drawing
bool SetTextureParms(DrawParms *parms, FTexture *img, double x, double y) const;
void STACK_ARGS DrawTexture (FTexture *img, double x, double y, int tags, ...);
void DrawTexture (FTexture *img, double x, double y, int tags, ...);
void FillBorder (FTexture *img); // Fills the border around a 4:3 part of the screen on non-4:3 displays
void VirtualToRealCoords(double &x, double &y, double &w, double &h, double vwidth, double vheight, bool vbottom=false, bool handleaspect=true) const;
@ -258,8 +258,8 @@ public:
#undef DrawText // See WinUser.h for the definition of DrawText as a macro
#endif
// 2D Text drawing
void STACK_ARGS DrawText (FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...);
void STACK_ARGS DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...);
void DrawText (FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...);
void DrawChar (FFont *font, int normalcolor, int x, int y, BYTE character, int tag_first, ...);
protected:
BYTE *Buffer;

View file

@ -542,7 +542,7 @@ static DWORD WINAPI WriteMiniDumpInAnotherThread (LPVOID lpParam)
//
//==========================================================================
void __cdecl Writef (HANDLE file, const char *format, ...)
void Writef (HANDLE file, const char *format, ...)
{
char buffer[1024];
va_list args;

View file

@ -227,7 +227,7 @@ protected:
FDInputJoystick *EnumDevices();
static BOOL CALLBACK EnumCallback(LPCDIDEVICEINSTANCE lpddi, LPVOID pvRef);
static int STACK_ARGS NameSort(const void *a, const void *b);
static int NameSort(const void *a, const void *b);
static bool IsXInputDevice(const GUID *guid);
static bool IsXInputDeviceFast(const GUID *guid);
static bool IsXInputDeviceSlow(const GUID *guid);

View file

@ -199,7 +199,7 @@ void popterm ()
//
//==========================================================================
static void STACK_ARGS call_terms (void)
static void call_terms (void)
{
while (NumTerms > 0)
{
@ -208,7 +208,7 @@ static void STACK_ARGS call_terms (void)
}
#ifdef _MSC_VER
static int STACK_ARGS NewFailure (size_t size)
static int NewFailure (size_t size)
{
I_FatalError ("Failed to allocate %d bytes from process heap", size);
return 0;

View file

@ -158,7 +158,7 @@ protected:
void DoRegister();
FRawPS2Controller *EnumDevices();
static int STACK_ARGS DeviceSort(const void *a, const void *b);
static int DeviceSort(const void *a, const void *b);
};
// Each entry is an offset to the corresponding data field in the

View file

@ -784,7 +784,7 @@ void I_Quit()
//
//==========================================================================
void STACK_ARGS I_FatalError(const char *error, ...)
void I_FatalError(const char *error, ...)
{
static BOOL alreadyThrown = false;
gameisdead = true;
@ -824,7 +824,7 @@ void STACK_ARGS I_FatalError(const char *error, ...)
//
//==========================================================================
void STACK_ARGS I_Error(const char *error, ...)
void I_Error(const char *error, ...)
{
va_list argptr;
char errortext[MAX_ERRORTEXT];
@ -1051,6 +1051,11 @@ static void DoPrintStr(const char *cp, HWND edit, HANDLE StdOut)
static TArray<FString> bufferedConsoleStuff;
void I_DebugPrint(const char *cp)
{
OutputDebugStringA(cp);
}
void I_PrintStr(const char *cp)
{
if (con_debugoutput)

View file

@ -132,8 +132,8 @@ void I_Quit (void);
void I_Tactile (int on, int off, int total);
void STACK_ARGS I_Error (const char *error, ...) GCCPRINTF(1,2);
void STACK_ARGS I_FatalError (const char *error, ...) GCCPRINTF(1,2);
void I_Error (const char *error, ...) GCCPRINTF(1,2);
void I_FatalError (const char *error, ...) GCCPRINTF(1,2);
void atterm (void (*func)(void));
void popterm ();
@ -145,6 +145,8 @@ bool I_SetCursor(FTexture *cursor);
// Repaint the pre-game console
void I_PaintConsole (void);
void I_DebugPrint (const char *cp);
// Print a console string
void I_PrintStr (const char *cp);

View file

@ -273,7 +273,7 @@ void DoBlending_MMX2(const PalEntry *from, PalEntry *to, int count, int r, int g
#endif
#ifdef X86_ASM
extern "C" void STACK_ARGS DoBlending_MMX(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a);
extern "C" void DoBlending_MMX(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a);
#endif
void DoBlending_SSE2(const PalEntry *from, PalEntry *to, int count, int r, int g, int b, int a)

View file

@ -56,10 +56,6 @@
// MACROS ------------------------------------------------------------------
#ifndef _WIN32
#define __cdecl
#endif
#ifdef __GNUC__
// With versions of GCC newer than 4.2, it appears it was determined that the
// cost of an unaligned pointer on PPC was high enough to add padding to the
@ -212,7 +208,7 @@ dir_tree_t *add_dir(const char *dirpath);
#endif
dir_tree_t *add_dirs(char **argv);
int count_files(dir_tree_t *trees);
int __cdecl sort_cmp(const void *a, const void *b);
int sort_cmp(const void *a, const void *b);
file_sorted_t *sort_files(dir_tree_t *trees, int num_files);
void write_zip(const char *zipname, dir_tree_t *trees, int update);
int append_to_zip(FILE *zip_file, file_sorted_t *file, FILE *ozip, BYTE *odir);
@ -694,7 +690,7 @@ int count_files(dir_tree_t *trees)
//
//==========================================================================
int __cdecl sort_cmp(const void *a, const void *b)
int sort_cmp(const void *a, const void *b)
{
const file_sorted_t *sort1 = (const file_sorted_t *)a;
const file_sorted_t *sort2 = (const file_sorted_t *)b;
@ -1569,7 +1565,7 @@ int copy_zip_file(FILE *zip, file_entry_t *file, FILE *ozip, CentralDirectoryEnt
//
//==========================================================================
int __cdecl main (int argc, char **argv)
int main (int argc, char **argv)
{
dir_tree_t *tree, *trees;
file_entry_t *file;