diff --git a/dumb/CMakeLists.txt b/dumb/CMakeLists.txt index 97a72b42c..c8fa34bf7 100644 --- a/dumb/CMakeLists.txt +++ b/dumb/CMakeLists.txt @@ -14,6 +14,10 @@ if( ZD_CMAKE_COMPILER_IS_GNUC_COMPATIBLE ) endif(NOT CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "4.5") endif() +if( MSVC ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast" ) +endif() + CHECK_FUNCTION_EXISTS( itoa ITOA_EXISTS ) if( NOT ITOA_EXISTS ) add_definitions( -DNEED_ITOA=1 ) diff --git a/game-music-emu/CMakeLists.txt b/game-music-emu/CMakeLists.txt index 27b065f42..f1d467bcc 100644 --- a/game-music-emu/CMakeLists.txt +++ b/game-music-emu/CMakeLists.txt @@ -29,6 +29,11 @@ if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) endif() endif() +if( MSVC ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /fp:fast" ) + set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /fp:fast" ) +endif() + # Default emulators to build (all of them! ;) if (NOT DEFINED USE_GME_AY) diff --git a/game-music-emu/gme/Fir_Resampler.cpp b/game-music-emu/gme/Fir_Resampler.cpp index fa426c78c..7f0deeca3 100644 --- a/game-music-emu/gme/Fir_Resampler.cpp +++ b/game-music-emu/gme/Fir_Resampler.cpp @@ -156,7 +156,7 @@ int Fir_Resampler_::input_needed( blargg_long output_count ) const output_count -= 2; } - long input_extra = input_count - (write_pos - &buf [(width_ - 1) * stereo]); + long input_extra = (long)(input_count - (write_pos - &buf [(width_ - 1) * stereo])); if ( input_extra < 0 ) input_extra = 0; return input_extra; diff --git a/gdtoa/CMakeLists.txt b/gdtoa/CMakeLists.txt index e0a6bab29..94ab9a691 100644 --- a/gdtoa/CMakeLists.txt +++ b/gdtoa/CMakeLists.txt @@ -5,7 +5,7 @@ set( CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG" ) # Disable warnings for << operator precedence (4554) and # unreferenced labels (4102) from VC if( MSVC ) - set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4554 /wd4102" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /wd4554 /wd4102 /fp:fast" ) endif() if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 62c6dd13a..9c2377272 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -36,6 +36,14 @@ if( CMAKE_SIZEOF_VOID_P MATCHES "8" ) set( X64 64 ) endif() +if( ZD_CMAKE_COMPILER_IS_GNUCXX_COMPATIBLE ) + set ( FASTMATH "-ffast-math" ) +else() + if ( MSVC ) + set ( FASTMATH "/fp:fast" ) + endif() +endif() + # You can either use "make install" on the FMOD distribution to put it # in standard system locations, or you can unpack the FMOD distribution # in the root of the zdoom tree. e.g.: @@ -102,8 +110,6 @@ if( WIN32 ) "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API ${WIN_TYPE}/api" # This next one is for Randy. "E:/Software/Dev/FMOD/${WIN_TYPE}/api" - # .. and this one for Graf Zahl - "D:/portable/FMOD SoundSystem 4.26/FMOD Programmers API WIN32/api" ) set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES inc ) set( FMOD_LIB_PATH_SUFFIXES PATH_SUFFIXES lib ) @@ -922,6 +928,151 @@ set( NOT_COMPILED_SOURCE_FILES asm_x86_64/tmap3.s ) +set( FASTMATH_SOURCES + r_swrenderer.cpp + r_3dfloors.cpp + r_bsp.cpp + r_draw.cpp + r_drawt.cpp + r_main.cpp + r_plane.cpp + r_segs.cpp + r_sky.cpp + r_things.cpp + s_advsound.cpp + s_environment.cpp + s_playlist.cpp + s_sndseq.cpp + s_sound.cpp + GuillotineBinPack.cpp + SkylineBinPack.cpp + intermission/intermission.cpp + intermission/intermission_parse.cpp + menu/colorpickermenu.cpp + menu/joystickmenu.cpp + menu/listmenu.cpp + menu/loadsavemenu.cpp + menu/menu.cpp + menu/menudef.cpp + menu/menuinput.cpp + menu/messagebox.cpp + menu/optionmenu.cpp + menu/playerdisplay.cpp + menu/playermenu.cpp + menu/readthis.cpp + menu/videomenu.cpp + 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 + sound/fmodsound.cpp + sound/i_music.cpp + sound/i_sound.cpp + sound/mpg123_decoder.cpp + sound/music_cd.cpp + sound/music_dumb.cpp + sound/music_gme.cpp + sound/music_mus_midiout.cpp + sound/music_smf_midiout.cpp + sound/music_hmi_midiout.cpp + sound/music_xmi_midiout.cpp + sound/music_midistream.cpp + sound/music_midi_base.cpp + sound/music_midi_timidity.cpp + sound/music_mus_opl.cpp + sound/music_stream.cpp + sound/music_fluidsynth_mididevice.cpp + sound/music_softsynth_mididevice.cpp + sound/music_timidity_mididevice.cpp + sound/music_wildmidi_mididevice.cpp + sound/music_win_mididevice.cpp + 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 + gl/data/gl_matrix.cpp + gl/data/gl_vertexbuffer.cpp + gl/dynlights/a_dynlight.cpp + gl/utility/gl_clock.cpp + gl/utility/gl_cycler.cpp + gl/utility/gl_geometric.cpp + gl/renderer/gl_renderer.cpp + gl/renderer/gl_renderstate.cpp + gl/renderer/gl_lightdata.cpp + gl/hqnx/init.cpp + gl/hqnx/hq2x.cpp + gl/hqnx/hq3x.cpp + gl/hqnx/hq4x.cpp + gl/textures/gl_hwtexture.cpp + gl/textures/gl_texture.cpp + gl/textures/gl_material.cpp + gl/textures/gl_hirestex.cpp + gl/textures/gl_bitmap.cpp + gl/textures/gl_samplers.cpp + gl/textures/gl_translate.cpp + gl/textures/gl_hqresize.cpp + gl/textures/gl_skyboxtexture.cpp + gl/scene/gl_bsp.cpp + gl/scene/gl_fakeflat.cpp + gl/scene/gl_clipper.cpp + gl/scene/gl_decal.cpp + gl/scene/gl_drawinfo.cpp + gl/scene/gl_flats.cpp + gl/scene/gl_walls.cpp + gl/scene/gl_sprite.cpp + gl/scene/gl_skydome.cpp + gl/scene/gl_renderhacks.cpp + gl/scene/gl_weapon.cpp + gl/scene/gl_scene.cpp + gl/scene/gl_sky.cpp + gl/scene/gl_portal.cpp + gl/scene/gl_walls_draw.cpp + gl/scene/gl_vertex.cpp + gl/scene/gl_spritelight.cpp + gl/stereo3d/gl_stereo3d.cpp + gl/stereo3d/gl_stereo_cvars.cpp + gl/stereo3d/gl_stereo_leftright.cpp + gl/stereo3d/scoped_view_shifter.cpp + gl/stereo3d/gl_anaglyph.cpp + gl/dynlights/gl_dynlight.cpp + gl/dynlights/gl_glow.cpp + gl/dynlights/gl_dynlight1.cpp + gl/dynlights/gl_lightbuffer.cpp + gl/shaders/gl_shader.cpp + gl/shaders/gl_texshader.cpp + gl/system/gl_interface.cpp + gl/system/gl_framebuffer.cpp + gl/system/gl_menu.cpp + gl/system/gl_wipe.cpp + gl/system/gl_load.c + gl/models/gl_models_md3.cpp + gl/models/gl_models_md2.cpp + gl/models/gl_models.cpp + gl/models/gl_voxels.cpp +) add_executable( zdoom WIN32 MACOSX_BUNDLE ${HEADER_FILES} ${NOT_COMPILED_SOURCE_FILES} @@ -929,6 +1080,7 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE ${ASM_SOURCES} ${SYSTEM_SOURCES} ${X86_SOURCES} + ${FASTMATH_SOURCES} x86.cpp actorptrselect.cpp am_map.cpp @@ -1044,23 +1196,8 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE p_xlat.cpp parsecontext.cpp po_man.cpp - portal.cpp - r_swrenderer.cpp + portal.cpp r_utility.cpp - r_3dfloors.cpp - r_bsp.cpp - r_draw.cpp - r_drawt.cpp - r_main.cpp - r_plane.cpp - r_segs.cpp - r_sky.cpp - r_things.cpp - s_advsound.cpp - s_environment.cpp - s_playlist.cpp - s_sndseq.cpp - s_sound.cpp sc_man.cpp st_stuff.cpp statistics.cpp @@ -1082,8 +1219,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE wi_stuff.cpp zstrformat.cpp zstring.cpp - GuillotineBinPack.cpp - SkylineBinPack.cpp g_doom/a_doommisc.cpp g_heretic/a_hereticmisc.cpp g_hexen/a_hexenmisc.cpp @@ -1127,92 +1262,7 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE g_shared/sbar_mugshot.cpp g_shared/shared_hud.cpp g_shared/shared_sbar.cpp - intermission/intermission.cpp - intermission/intermission_parse.cpp - menu/colorpickermenu.cpp - menu/joystickmenu.cpp - menu/listmenu.cpp - menu/loadsavemenu.cpp - menu/menu.cpp - menu/menudef.cpp - menu/menuinput.cpp - menu/messagebox.cpp - menu/optionmenu.cpp - menu/playerdisplay.cpp - menu/playermenu.cpp - menu/readthis.cpp - menu/videomenu.cpp - gl/data/gl_data.cpp - gl/data/gl_portaldata.cpp - gl/data/gl_setup.cpp - gl/data/gl_matrix.cpp - gl/data/gl_vertexbuffer.cpp - gl/dynlights/a_dynlight.cpp - gl/utility/gl_clock.cpp - gl/utility/gl_cycler.cpp - gl/utility/gl_geometric.cpp - gl/renderer/gl_renderer.cpp - gl/renderer/gl_renderstate.cpp - gl/renderer/gl_lightdata.cpp - gl/hqnx/init.cpp - gl/hqnx/hq2x.cpp - gl/hqnx/hq3x.cpp - gl/hqnx/hq4x.cpp - gl/textures/gl_hwtexture.cpp - gl/textures/gl_texture.cpp - gl/textures/gl_material.cpp - gl/textures/gl_hirestex.cpp - gl/textures/gl_bitmap.cpp - gl/textures/gl_samplers.cpp - gl/textures/gl_translate.cpp - gl/textures/gl_hqresize.cpp - gl/textures/gl_skyboxtexture.cpp - gl/scene/gl_bsp.cpp - gl/scene/gl_fakeflat.cpp - gl/scene/gl_clipper.cpp - gl/scene/gl_decal.cpp - gl/scene/gl_drawinfo.cpp - gl/scene/gl_flats.cpp - gl/scene/gl_walls.cpp - gl/scene/gl_sprite.cpp - gl/scene/gl_skydome.cpp - gl/scene/gl_renderhacks.cpp - gl/scene/gl_weapon.cpp - gl/scene/gl_scene.cpp - gl/scene/gl_sky.cpp - gl/scene/gl_portal.cpp - gl/scene/gl_walls_draw.cpp - gl/scene/gl_vertex.cpp - gl/scene/gl_spritelight.cpp - gl/stereo3d/gl_stereo3d.cpp - gl/stereo3d/gl_stereo_cvars.cpp - gl/stereo3d/gl_stereo_leftright.cpp - gl/stereo3d/scoped_view_shifter.cpp - gl/stereo3d/gl_anaglyph.cpp - gl/dynlights/gl_dynlight.cpp - gl/dynlights/gl_glow.cpp - gl/dynlights/gl_dynlight1.cpp - gl/dynlights/gl_lightbuffer.cpp - gl/shaders/gl_shader.cpp - gl/shaders/gl_texshader.cpp - gl/system/gl_interface.cpp - gl/system/gl_framebuffer.cpp - gl/system/gl_menu.cpp - gl/system/gl_wipe.cpp - gl/system/gl_load.c - gl/models/gl_models_md3.cpp - gl/models/gl_models_md2.cpp - gl/models/gl_models.cpp - gl/models/gl_voxels.cpp 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 resourcefiles/ancientzip.cpp resourcefiles/file_7z.cpp resourcefiles/file_grp.cpp @@ -1224,30 +1274,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE resourcefiles/file_directory.cpp resourcefiles/resourcefile.cpp sfmt/SFMT.cpp - sound/fmodsound.cpp - sound/i_music.cpp - sound/i_sound.cpp - sound/mpg123_decoder.cpp - sound/music_cd.cpp - sound/music_dumb.cpp - sound/music_gme.cpp - sound/music_mus_midiout.cpp - sound/music_smf_midiout.cpp - sound/music_hmi_midiout.cpp - sound/music_xmi_midiout.cpp - sound/music_midistream.cpp - sound/music_midi_base.cpp - sound/music_midi_timidity.cpp - sound/music_mus_opl.cpp - sound/music_stream.cpp - sound/music_fluidsynth_mididevice.cpp - sound/music_softsynth_mididevice.cpp - sound/music_timidity_mididevice.cpp - sound/music_wildmidi_mididevice.cpp - sound/music_win_mididevice.cpp - sound/oalsound.cpp - sound/sndfile_decoder.cpp - sound/music_pseudo_mididevice.cpp textures/animations.cpp textures/anim_switches.cpp textures/automaptexture.cpp @@ -1277,20 +1303,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE thingdef/thingdef_parse.cpp thingdef/thingdef_properties.cpp thingdef/thingdef_states.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 xlat/parse_xlat.cpp fragglescript/t_fspic.cpp fragglescript/t_func.cpp @@ -1302,12 +1314,10 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE fragglescript/t_spec.cpp fragglescript/t_variable.cpp fragglescript/t_cmd.cpp - r_data/colormaps.cpp r_data/sprites.cpp r_data/voxels.cpp r_data/renderstyle.cpp r_data/r_interpolate.cpp - r_data/r_translate.cpp zscript/ast.cpp zscript/vmbuilder.cpp zscript/vmdisasm.cpp @@ -1319,9 +1329,14 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE zzautozend.cpp ) +set_source_files_properties( ${FASTMATH_SOURCES} PROPERTIES COMPILE_FLAGS ${FASTMATH} ) set_source_files_properties( xlat/parse_xlat.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c" ) set_source_files_properties( sc_man.cpp PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h" ) set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE ) +if ( WIN32 ) + set_source_files_properties( win32/fb_d3d9.cpp win32/fb_d3d9_wipe.cpp PROPERTIES COMPILE_FLAGS ${FASTMATH} ) +endif() + if(${CMAKE_SYSTEM_NAME} STREQUAL "SunOS") # [BL] Solaris requires these to be explicitly linked. @@ -1341,6 +1356,7 @@ include_directories( . textures thingdef timidity + wildmidi xlat zscript ../gdtoa diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index cacffd6ca..73fda96b3 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -636,7 +636,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_BFGSpray) PARAM_INT_OPT (damagecnt) { damagecnt = 15; } PARAM_ANGLE_OPT (angle) { angle = ANGLE_90; } PARAM_FIXED_OPT (distance) { distance = 16*64*FRACUNIT; } - PARAM_ANGLE_OPT (vrange) { vrange = 32*FRACUNIT; } + PARAM_ANGLE_OPT (vrange) { vrange = 32*ANGLE_1; } PARAM_INT_OPT (defdamage) { defdamage = 0; } int i; diff --git a/src/g_hexen/a_flechette.cpp b/src/g_hexen/a_flechette.cpp index f26a6b41a..7c8afb4cf 100644 --- a/src/g_hexen/a_flechette.cpp +++ b/src/g_hexen/a_flechette.cpp @@ -332,7 +332,7 @@ int APoisonCloud::DoSpecialDamage (AActor *victim, int damage, FName damagetype) int damage = 15 + (pr_poisoncloudd()&15); if (mate) { - damage = (int)((float)damage * level.teamdamage); + damage = (int)((double)damage * level.teamdamage); } // Handle passive damage modifiers (e.g. PowerProtection) if (victim->Inventory != NULL) diff --git a/src/sound/mpg123_decoder.cpp b/src/sound/mpg123_decoder.cpp index 5b33100a5..0f0afa299 100644 --- a/src/sound/mpg123_decoder.cpp +++ b/src/sound/mpg123_decoder.cpp @@ -38,7 +38,7 @@ off_t MPG123Decoder::file_lseek(void *handle, off_t offset, int whence) ssize_t MPG123Decoder::file_read(void *handle, void *buffer, size_t bytes) { FileReader *reader = reinterpret_cast(handle)->Reader; - return reader->Read(buffer, bytes); + return (ssize_t)reader->Read(buffer, (long)bytes); } @@ -183,7 +183,7 @@ bool MPG123Decoder::seek(size_t ms_offset) if(mpg123_getformat(MPG123, &srate, &channels, &enc) == MPG123_OK) { size_t smp_offset = (size_t)((double)ms_offset / 1000. * srate); - if(mpg123_seek(MPG123, smp_offset, SEEK_SET) >= 0) + if(mpg123_seek(MPG123, (off_t)smp_offset, SEEK_SET) >= 0) { Done = false; return true; diff --git a/src/sound/oalsound.cpp b/src/sound/oalsound.cpp index 1eec34c1b..f35cc8c3e 100644 --- a/src/sound/oalsound.cpp +++ b/src/sound/oalsound.cpp @@ -617,7 +617,7 @@ public: SampleRate = srate; Looping = loop; - Data.Resize((size_t)(0.2 * SampleRate) * FrameSize); + Data.Resize((SampleRate / 5) * FrameSize); return true; } @@ -781,8 +781,21 @@ OpenALSoundRenderer::OpenALSoundRenderer() alcGetIntegerv(Device, ALC_MONO_SOURCES, 1, &numMono); alcGetIntegerv(Device, ALC_STEREO_SOURCES, 1, &numStereo); - Sources.Resize(MIN(MAX(*snd_channels, 2), numMono+numStereo)); - for(size_t i = 0;i < Sources.Size();i++) + // OpenAL specification doesn't require alcGetIntegerv() to return + // meaningful values for ALC_MONO_SOURCES and ALC_MONO_SOURCES. + // At least Apple's OpenAL implementation returns zeroes, + // although it can generate reasonable number of sources. + + const int numChannels = MAX(*snd_channels, 2); + int numSources = numMono + numStereo; + + if (0 == numSources) + { + numSources = numChannels; + } + + Sources.Resize(MIN(numChannels, numSources)); + for(unsigned i = 0;i < Sources.Size();i++) { alGenSources(1, &Sources[i]); if(getALError() != AL_NO_ERROR) diff --git a/src/sound/sndfile_decoder.cpp b/src/sound/sndfile_decoder.cpp index 52376a6c7..382b22ab6 100644 --- a/src/sound/sndfile_decoder.cpp +++ b/src/sound/sndfile_decoder.cpp @@ -126,7 +126,7 @@ TArray SndFileDecoder::readAll() output.Resize((unsigned)(SndInfo.frames * framesize)); size_t got = read(&output[0], output.Size()); - output.Resize(got); + output.Resize((unsigned)got); return output; } diff --git a/src/thingdef/thingdef.h b/src/thingdef/thingdef.h index d8c13174a..aa6a54445 100644 --- a/src/thingdef/thingdef.h +++ b/src/thingdef/thingdef.h @@ -258,7 +258,7 @@ enum EDefinitionType union FPropParam { int i; - float f; + double d; const char *s; FxExpression *exp; }; @@ -317,10 +317,13 @@ int MatchString (const char *in, const char **strings); int var = params[(no)+1].i; #define PROP_FLOAT_PARM(var, no) \ - float var = params[(no)+1].f; + float var = float(params[(no)+1].d); + +#define PROP_DOUBLE_PARM(var, no) \ + double var = params[(no)+1].d; #define PROP_FIXED_PARM(var, no) \ - fixed_t var = fixed_t(params[(no)+1].f * FRACUNIT); + fixed_t var = FLOAT2FIXED(params[(no)+1].d); #define PROP_COLOR_PARM(var, no) \ int var = params[(no)+1].i== 0? params[(no)+2].i : V_GetColor(NULL, params[(no)+2].s); diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 82fe3a739..c972493d0 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -54,8 +54,8 @@ static TArray AFTable; //========================================================================== // [RH] Keep GCC quiet by not using offsetof on Actor types. -#define DEFINE_FLAG(prefix, name, type, variable) { prefix##_##name, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) } -#define DEFINE_FLAG2(symbol, name, type, variable) { symbol, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) } +#define DEFINE_FLAG(prefix, name, type, variable) { (unsigned int)prefix##_##name, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) } +#define DEFINE_FLAG2(symbol, name, type, variable) { (unsigned int)symbol, #name, (int)(size_t)&((type*)1)->variable - 1, sizeof(((type *)0)->variable) } #define DEFINE_DEPRECATED_FLAG(name) { DEPF_##name, #name, -1, 0 } #define DEFINE_DUMMY_FLAG(name) { DEPF_UNUSED, #name, -1, 0 } diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index 2cd271ad5..93a139850 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -825,7 +825,7 @@ static bool ParsePropertyParams(FScanner &sc, FPropertyInfo *prop, AActor *defau case 'F': sc.MustGetFloat(); - conv.f = float(sc.Float); + conv.d = sc.Float; break; case 'Z': // an optional string. Does not allow any numerical value. diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 57de3684f..2d69c0eb8 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2174,7 +2174,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, color, C_f, Inventory) } if (PROP_PARM_COUNT > 2) { - PROP_FLOAT_PARM(falpha, 2); + PROP_DOUBLE_PARM(falpha, 2); alpha=int(falpha*255); } else alpha = 255/3; @@ -2718,17 +2718,17 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, damagescreencolor, Cfs, PlayerPawn) } else if (PROP_PARM_COUNT < 4) { - PROP_FLOAT_PARM(a, 2); + PROP_DOUBLE_PARM(a, 2); - color.a = BYTE(255 * clamp(a, 0.f, 1.f)); + color.a = BYTE(255 * clamp(a, 0.f, 1.f)); defaults->DamageFade = color; } else { - PROP_FLOAT_PARM(a, 2); + PROP_DOUBLE_PARM(a, 2); PROP_STRING_PARM(type, 3); - color.a = BYTE(255 * clamp(a, 0.f, 1.f)); + color.a = BYTE(255 * clamp(a, 0.f, 1.f)); assert(info->IsKindOf(RUNTIME_CLASS(PClassPlayerPawn))); static_cast(info)->PainFlashes.Insert(type, color); } diff --git a/src/vectors.h b/src/vectors.h index c1bcf74b9..466e8cd4e 100644 --- a/src/vectors.h +++ b/src/vectors.h @@ -1230,6 +1230,6 @@ typedef TVector2 FVector2; typedef TVector3 FVector3; typedef TRotator FRotator; typedef TMatrix3x3 FMatrix3x3; -typedef TAngle FAngle; +//typedef TAngle FAngle; #endif diff --git a/src/win32/st_start.cpp b/src/win32/st_start.cpp index 69e00f586..b172b282f 100644 --- a/src/win32/st_start.cpp +++ b/src/win32/st_start.cpp @@ -1584,7 +1584,7 @@ void ST_Util_DrawChar (BITMAPINFO *screen, const BYTE *font, int x, int y, BYTE const BYTE fg = attrib & 0x0F; const BYTE fg_left = fg << 4; const BYTE bg = bg_left >> 4; - const BYTE color_array[4] = { bg_left | bg, attrib & 0x7F, fg_left | bg, fg_left | fg }; + const BYTE color_array[4] = { (BYTE)(bg_left | bg), (BYTE)(attrib & 0x7F), (BYTE)(fg_left | bg), (BYTE)(fg_left | fg) }; const BYTE *src = font + 1 + charnum * font[0]; int pitch = screen->bmiHeader.biWidth >> 1; BYTE *dest = ST_Util_BitsForBitmap(screen) + x*4 + y * font[0] * pitch;