Merge: Windows x64 build support (#1899)

This commit is contained in:
Tracy Ward
2019-10-13 15:56:04 -04:00
committed by GitHub
104 changed files with 2374 additions and 1017 deletions
+1 -3
View File
@@ -13,12 +13,10 @@ if(NOT EXISTS "$ENV{DXSDK_DIR}")
endif()
set(DIRECTX_INCLUDE_SEARCH_PATHS
# TODO: Do not be limited to x86 in the future.
"$ENV{DXSDK_DIR}/Include")
set(DIRECTX_LIBRARY_SEARCH_PATHS
# TODO: Do not be limited to x86 in the future.
"$ENV{DXSDK_DIR}/Lib/x86")
"$ENV{DXSDK_DIR}/Lib/${SM_WIN32_ARCH}")
find_path(DIRECTX_INCLUDE_DIR
NAMES "DxErr.h"
+23 -4
View File
@@ -156,6 +156,14 @@ check_type_size(pid_t SIZEOF_PID_T)
check_type_size(size_t SIZEOF_SIZE_T)
check_type_size(ssize_t SIZEOF_SSIZE_T)
if(WIN32)
if(SIZEOF_INTPTR_T EQUAL 8)
set(SM_WIN32_ARCH "x64")
else()
set(SM_WIN32_ARCH "x86")
endif()
endif()
include(TestBigEndian)
test_big_endian(BIGENDIAN)
if(${BIGENDIAN})
@@ -283,27 +291,38 @@ if(WIN32)
# FFMPEG...it can be evil.
find_library(LIB_SWSCALE
NAMES "swscale"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib"
PATHS "${SM_EXTERN_DIR}/ffmpeg/${SM_WIN32_ARCH}/lib"
NO_DEFAULT_PATH)
get_filename_component(LIB_SWSCALE ${LIB_SWSCALE} NAME)
find_library(LIB_AVCODEC
NAMES "avcodec"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib"
PATHS "${SM_EXTERN_DIR}/ffmpeg/${SM_WIN32_ARCH}/lib"
NO_DEFAULT_PATH)
get_filename_component(LIB_AVCODEC ${LIB_AVCODEC} NAME)
find_library(LIB_AVFORMAT
NAMES "avformat"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib"
PATHS "${SM_EXTERN_DIR}/ffmpeg/${SM_WIN32_ARCH}/lib"
NO_DEFAULT_PATH)
get_filename_component(LIB_AVFORMAT ${LIB_AVFORMAT} NAME)
find_library(LIB_AVUTIL
NAMES "avutil"
PATHS "${SM_EXTERN_DIR}/ffmpeg/lib"
PATHS "${SM_EXTERN_DIR}/ffmpeg/${SM_WIN32_ARCH}/lib"
NO_DEFAULT_PATH)
get_filename_component(LIB_AVUTIL ${LIB_AVUTIL} NAME)
list(APPEND SM_FFMPEG_WIN32_DLLS
"avcodec-55.dll"
"avformat-55.dll"
"avutil-52.dll"
"swscale-2.dll"
)
foreach(dll ${SM_FFMPEG_WIN32_DLLS})
file(REMOVE "${SM_PROGRAM_DIR}/${dll}")
file(COPY "${SM_EXTERN_DIR}/ffmpeg/${SM_WIN32_ARCH}/bin/${dll}" DESTINATION "${SM_PROGRAM_DIR}/")
endforeach()
endif()
elseif(MACOSX)
if(WITH_FFMPEG AND NOT WITH_SYSTEM_FFMPEG)
+9 -3
View File
@@ -62,9 +62,15 @@ else()
# first glance.
sm_add_compile_definition("mad" ASO_ZEROCHECK)
sm_add_compile_definition("mad" $<$<CONFIG:Debug>:FPM_DEFAULT>)
sm_add_compile_definition("mad" $<$<CONFIG:Release>:FPM_INTEL>)
sm_add_compile_definition("mad" $<$<CONFIG:MinSizeRel>:FPM_INTEL>)
sm_add_compile_definition("mad" $<$<CONFIG:RelWithDebInfo>:FPM_INTEL>)
if(SM_WIN32_ARCH MATCHES "x64")
sm_add_compile_definition("mad" $<$<CONFIG:Release>:FPM_64BIT>)
sm_add_compile_definition("mad" $<$<CONFIG:MinSizeRel>:FPM_64BIT>)
sm_add_compile_definition("mad" $<$<CONFIG:RelWithDebInfo>:FPM_64BIT>)
else()
sm_add_compile_definition("mad" $<$<CONFIG:Release>:FPM_INTEL>)
sm_add_compile_definition("mad" $<$<CONFIG:MinSizeRel>:FPM_INTEL>)
sm_add_compile_definition("mad" $<$<CONFIG:RelWithDebInfo>:FPM_INTEL>)
endif()
# TODO: Provide a proper define for inline.
sm_add_compile_definition("mad" inline=__inline)
elseif(APPLE OR UNIX)
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+281
View File
@@ -0,0 +1,281 @@
EXPORTS
audio_resample
audio_resample_close
av_audio_convert
av_audio_convert_alloc
av_audio_convert_free
av_audio_resample_init
av_bitstream_filter_close
av_bitstream_filter_filter
av_bitstream_filter_init
av_bitstream_filter_next
av_codec_get_codec_descriptor
av_codec_get_lowres
av_codec_get_max_lowres
av_codec_get_pkt_timebase
av_codec_get_seek_preroll
av_codec_is_decoder
av_codec_is_encoder
av_codec_next
av_codec_set_codec_descriptor
av_codec_set_lowres
av_codec_set_pkt_timebase
av_codec_set_seek_preroll
av_copy_packet
av_copy_packet_side_data
av_dct_calc
av_dct_end
av_dct_init
av_destruct_packet
av_dup_packet
av_fast_malloc
av_fast_padded_malloc
av_fast_padded_mallocz
av_fast_realloc
av_fft_calc
av_fft_end
av_fft_init
av_fft_permute
av_free_packet
av_get_audio_frame_duration
av_get_bits_per_sample
av_get_codec_tag_string
av_get_exact_bits_per_sample
av_get_pcm_codec
av_get_profile_name
av_grow_packet
av_hwaccel_next
av_imdct_calc
av_imdct_half
av_init_packet
av_lockmgr_register
av_log_ask_for_sample
av_log_missing_feature
av_mdct_calc
av_mdct_end
av_mdct_init
av_new_packet
av_packet_copy_props
av_packet_free_side_data
av_packet_from_data
av_packet_get_side_data
av_packet_merge_side_data
av_packet_move_ref
av_packet_new_side_data
av_packet_ref
av_packet_shrink_side_data
av_packet_split_side_data
av_packet_unref
av_parser_change
av_parser_close
av_parser_init
av_parser_next
av_parser_parse2
av_picture_copy
av_picture_crop
av_picture_pad
av_rdft_calc
av_rdft_end
av_rdft_init
av_register_bitstream_filter
av_register_codec_parser
av_register_hwaccel
av_resample
av_resample_close
av_resample_compensate
av_resample_init
av_shrink_packet
av_xiphlacing
available_bits
avcodec_align_dimensions
avcodec_align_dimensions2
avcodec_alloc_context3
avcodec_alloc_frame
avcodec_chroma_pos_to_enum
avcodec_close
avcodec_configuration
avcodec_copy_context
avcodec_decode_audio3
avcodec_decode_audio4
avcodec_decode_subtitle2
avcodec_decode_video2
avcodec_default_execute
avcodec_default_execute2
avcodec_default_get_buffer
avcodec_default_get_buffer2
avcodec_default_get_format
avcodec_default_reget_buffer
avcodec_default_release_buffer
avcodec_descriptor_get
avcodec_descriptor_get_by_name
avcodec_descriptor_next
avcodec_encode_audio
avcodec_encode_audio2
avcodec_encode_subtitle
avcodec_encode_video
avcodec_encode_video2
avcodec_enum_to_chroma_pos
avcodec_fill_audio_frame
avcodec_find_best_pix_fmt2
avcodec_find_best_pix_fmt_of_2
avcodec_find_best_pix_fmt_of_list
avcodec_find_decoder
avcodec_find_decoder_by_name
avcodec_find_encoder
avcodec_find_encoder_by_name
avcodec_flush_buffers
avcodec_free_frame
avcodec_get_chroma_sub_sample
avcodec_get_class
avcodec_get_context_defaults3
avcodec_get_edge_width
avcodec_get_frame_class
avcodec_get_frame_defaults
avcodec_get_name
avcodec_get_pix_fmt_loss
avcodec_get_subtitle_rect_class
avcodec_get_type
avcodec_is_open
avcodec_license
avcodec_open2
avcodec_pix_fmt_to_codec_tag
avcodec_register
avcodec_register_all
avcodec_set_dimensions
avcodec_string
avcodec_version
aver_isf_history
avpicture_alloc
avpicture_deinterlace
avpicture_fill
avpicture_free
avpicture_get_size
avpicture_layout
avpriv_aac_parse_header
avpriv_ac3_channel_layout_tab DATA
avpriv_ac3_parse_header
avpriv_adx_decode_header
avpriv_align_put_bits
avpriv_bprint_to_extradata
avpriv_color_frame
avpriv_copy_bits
avpriv_copy_pce_data
avpriv_dca_sample_rates DATA
avpriv_dirac_parse_sequence_header
avpriv_dnxhd_get_frame_size
avpriv_dsputil_init
avpriv_dv_codec_profile
avpriv_dv_frame_profile
avpriv_dv_frame_profile2
avpriv_find_pix_fmt
avpriv_find_start_code
avpriv_flac_is_extradata_valid
avpriv_flac_parse_block_header
avpriv_flac_parse_streaminfo
avpriv_h264_has_num_reorder_frames
avpriv_lock_avformat
avpriv_mjpeg_bits_ac_chrominance DATA
avpriv_mjpeg_bits_ac_luminance DATA
avpriv_mjpeg_bits_dc_chrominance DATA
avpriv_mjpeg_bits_dc_luminance DATA
avpriv_mjpeg_val_ac_chrominance DATA
avpriv_mjpeg_val_ac_luminance DATA
avpriv_mjpeg_val_dc DATA
avpriv_mpa_bitrate_tab DATA
avpriv_mpa_decode_header
avpriv_mpa_freq_tab DATA
avpriv_mpeg4audio_get_config
avpriv_mpeg4audio_sample_rates DATA
avpriv_mpegaudio_decode_header
avpriv_put_string
avpriv_split_xiph_headers
avpriv_tak_parse_streaminfo
avpriv_toupper4
avpriv_unlock_avformat
avpriv_vorbis_parse_extradata
avpriv_vorbis_parse_frame
avpriv_vorbis_parse_reset
avsubtitle_free
dsputil_init
ff_aanscales DATA
ff_dct32_fixed
ff_dct32_float
ff_dct32_float_avx DATA
ff_dct32_float_sse DATA
ff_dct32_float_sse2 DATA
ff_dct_common_init
ff_dct_encode_init
ff_dct_encode_init_x86
ff_dct_end
ff_dct_init
ff_dct_init_x86
ff_dct_quantize_c
ff_dnxhd_cid_table DATA
ff_dnxhd_get_cid_table
ff_dsputil_init
ff_faandct
ff_faandct248
ff_faanidct
ff_faanidct_add
ff_faanidct_put
ff_fdct248_islow_10
ff_fdct248_islow_8
ff_fdct_ifast
ff_fdct_ifast248
ff_fdct_mmx
ff_fdct_mmxext
ff_fdct_sse2
ff_fft_calc_avx DATA
ff_fft_calc_sse DATA
ff_fft_end
ff_fft_end_fixed
ff_fft_end_fixed_32
ff_fft_init
ff_fft_init_fixed
ff_fft_init_fixed_32
ff_fft_init_x86
ff_fft_lut_init
ff_fft_permute_sse DATA
ff_idct_xvid_mmx
ff_idct_xvid_mmx_add
ff_idct_xvid_mmx_put
ff_idct_xvid_mmxext
ff_idct_xvid_mmxext_add
ff_idct_xvid_mmxext_put
ff_idct_xvid_sse2
ff_idct_xvid_sse2_add
ff_idct_xvid_sse2_put
ff_jpeg_fdct_islow_10
ff_jpeg_fdct_islow_8
ff_mdct_calc_c
ff_mdct_calc_c_fixed
ff_mdct_calc_c_fixed_32
ff_mdct_calcw_c
ff_mdct_end
ff_mdct_end_fixed
ff_mdct_end_fixed_32
ff_mdct_init
ff_mdct_init_fixed
ff_mdct_init_fixed_32
ff_mdct_win_fixed DATA
ff_mdct_win_float DATA
ff_prores_idct_put_10_sse2 DATA
ff_raw_pix_fmt_tags DATA
ff_rdft_end
ff_rdft_init
ff_simple_idct248_put
ff_simple_idct44_add
ff_simple_idct48_add
ff_simple_idct84_add
ff_simple_idct_10
ff_simple_idct_12
ff_simple_idct_8
ff_simple_idct_add_10
ff_simple_idct_add_12
ff_simple_idct_add_8
ff_simple_idct_add_mmx
ff_simple_idct_mmx
ff_simple_idct_put_10
ff_simple_idct_put_12
ff_simple_idct_put_8
ff_simple_idct_put_mmx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+418
View File
@@ -0,0 +1,418 @@
EXPORTS
av_add_q
av_adler32_update
av_aes_alloc
av_aes_crypt
av_aes_init
av_aes_size DATA
av_asprintf
av_audio_fifo_alloc
av_audio_fifo_drain
av_audio_fifo_free
av_audio_fifo_read
av_audio_fifo_realloc
av_audio_fifo_reset
av_audio_fifo_size
av_audio_fifo_space
av_audio_fifo_write
av_base64_decode
av_base64_encode
av_basename
av_blowfish_crypt
av_blowfish_crypt_ecb
av_blowfish_init
av_bmg_get
av_bprint_append_data
av_bprint_channel_layout
av_bprint_chars
av_bprint_clear
av_bprint_escape
av_bprint_finalize
av_bprint_get_buffer
av_bprint_init
av_bprint_init_for_buffer
av_bprint_strftime
av_bprintf
av_buffer_alloc
av_buffer_allocz
av_buffer_create
av_buffer_default_free
av_buffer_get_opaque
av_buffer_get_ref_count
av_buffer_is_writable
av_buffer_make_writable
av_buffer_pool_get
av_buffer_pool_init
av_buffer_pool_uninit
av_buffer_realloc
av_buffer_ref
av_buffer_unref
av_calloc
av_channel_layout_extract_channel
av_compare_mod
av_compare_ts
av_cpu_count
av_crc
av_crc_get_table
av_crc_init
av_ctz
av_d2q
av_d2str
av_dbl2ext
av_dbl2int
av_default_get_category
av_default_item_name
av_des_crypt
av_des_init
av_des_mac
av_dict_copy
av_dict_count
av_dict_free
av_dict_get
av_dict_parse_string
av_dict_set
av_dirname
av_div_q
av_dynarray2_add
av_dynarray_add
av_escape
av_evaluate_lls
av_expr_eval
av_expr_free
av_expr_parse
av_expr_parse_and_eval
av_ext2dbl
av_fifo_alloc
av_fifo_drain
av_fifo_free
av_fifo_generic_read
av_fifo_generic_write
av_fifo_grow
av_fifo_realloc2
av_fifo_reset
av_fifo_size
av_fifo_space
av_file_map
av_file_unmap
av_find_info_tag
av_find_nearest_q_idx
av_find_opt
av_flt2int
av_force_cpu_flags
av_frame_alloc
av_frame_clone
av_frame_copy_props
av_frame_free
av_frame_get_best_effort_timestamp
av_frame_get_buffer
av_frame_get_channel_layout
av_frame_get_channels
av_frame_get_color_range
av_frame_get_colorspace
av_frame_get_decode_error_flags
av_frame_get_metadata
av_frame_get_pkt_duration
av_frame_get_pkt_pos
av_frame_get_pkt_size
av_frame_get_plane_buffer
av_frame_get_qp_table
av_frame_get_sample_rate
av_frame_get_side_data
av_frame_is_writable
av_frame_make_writable
av_frame_move_ref
av_frame_new_side_data
av_frame_ref
av_frame_set_best_effort_timestamp
av_frame_set_channel_layout
av_frame_set_channels
av_frame_set_color_range
av_frame_set_colorspace
av_frame_set_decode_error_flags
av_frame_set_metadata
av_frame_set_pkt_duration
av_frame_set_pkt_pos
av_frame_set_pkt_size
av_frame_set_qp_table
av_frame_set_sample_rate
av_frame_unref
av_free
av_freep
av_gcd
av_get_alt_sample_fmt
av_get_bits_per_pixel
av_get_bits_per_sample_fmt
av_get_bytes_per_sample
av_get_channel_description
av_get_channel_layout
av_get_channel_layout_channel_index
av_get_channel_layout_nb_channels
av_get_channel_layout_string
av_get_channel_name
av_get_colorspace_name
av_get_cpu_flags
av_get_default_channel_layout
av_get_double
av_get_int
av_get_known_color_name
av_get_media_type_string
av_get_packed_sample_fmt
av_get_padded_bits_per_pixel
av_get_picture_type_char
av_get_pix_fmt
av_get_pix_fmt_name
av_get_pix_fmt_string
av_get_planar_sample_fmt
av_get_q
av_get_random_seed
av_get_sample_fmt
av_get_sample_fmt_name
av_get_sample_fmt_string
av_get_standard_channel_layout
av_get_string
av_get_token
av_gettime
av_hash_alloc
av_hash_final
av_hash_freep
av_hash_get_name
av_hash_get_size
av_hash_init
av_hash_names
av_hash_update
av_hmac_alloc
av_hmac_calc
av_hmac_final
av_hmac_free
av_hmac_init
av_hmac_update
av_image_alloc
av_image_check_size
av_image_copy
av_image_copy_plane
av_image_copy_to_buffer
av_image_fill_arrays
av_image_fill_linesizes
av_image_fill_max_pixsteps
av_image_fill_pointers
av_image_get_buffer_size
av_image_get_linesize
av_init_lls
av_int2dbl
av_int2flt
av_int_list_length_for_size
av_isdigit
av_isgraph
av_isspace
av_isxdigit
av_lfg_init
av_log
av_log2
av_log2_16bit
av_log_default_callback
av_log_format_line
av_log_get_level
av_log_set_callback
av_log_set_flags
av_log_set_level
av_lzo1x_decode
av_malloc
av_mallocz
av_max_alloc
av_md5_alloc
av_md5_final
av_md5_init
av_md5_size DATA
av_md5_sum
av_md5_update
av_memcpy_backptr
av_memdup
av_mul_q
av_murmur3_alloc
av_murmur3_final
av_murmur3_init
av_murmur3_init_seeded
av_murmur3_update
av_nearer_q
av_next_option
av_opt_child_class_next
av_opt_child_next
av_opt_eval_double
av_opt_eval_flags
av_opt_eval_float
av_opt_eval_int
av_opt_eval_int64
av_opt_eval_q
av_opt_find
av_opt_find2
av_opt_flag_is_set
av_opt_free
av_opt_freep_ranges
av_opt_get
av_opt_get_channel_layout
av_opt_get_double
av_opt_get_image_size
av_opt_get_int
av_opt_get_key_value
av_opt_get_pixel_fmt
av_opt_get_q
av_opt_get_sample_fmt
av_opt_get_video_rate
av_opt_next
av_opt_ptr
av_opt_query_ranges
av_opt_query_ranges_default
av_opt_set
av_opt_set_bin
av_opt_set_channel_layout
av_opt_set_defaults
av_opt_set_defaults2
av_opt_set_dict
av_opt_set_double
av_opt_set_from_string
av_opt_set_image_size
av_opt_set_int
av_opt_set_pixel_fmt
av_opt_set_q
av_opt_set_sample_fmt
av_opt_set_video_rate
av_opt_show2
av_parse_color
av_parse_cpu_caps
av_parse_cpu_flags
av_parse_ratio
av_parse_time
av_parse_video_rate
av_parse_video_size
av_pix_fmt_count_planes
av_pix_fmt_desc_get
av_pix_fmt_desc_get_id
av_pix_fmt_desc_next
av_pix_fmt_descriptors DATA
av_pix_fmt_get_chroma_sub_sample
av_pix_fmt_swap_endianness
av_rc4_crypt
av_rc4_init
av_read_image_line
av_realloc
av_realloc_array
av_realloc_f
av_reallocp
av_reallocp_array
av_reduce
av_rescale
av_rescale_delta
av_rescale_q
av_rescale_q_rnd
av_rescale_rnd
av_reverse DATA
av_ripemd_alloc
av_ripemd_final
av_ripemd_init
av_ripemd_size DATA
av_ripemd_update
av_sample_fmt_is_planar
av_samples_alloc
av_samples_alloc_array_and_samples
av_samples_copy
av_samples_fill_arrays
av_samples_get_buffer_size
av_samples_set_silence
av_set_cpu_flags_mask
av_set_double
av_set_int
av_set_options_string
av_set_q
av_set_string3
av_sha512_alloc
av_sha512_final
av_sha512_init
av_sha512_size DATA
av_sha512_update
av_sha_alloc
av_sha_final
av_sha_init
av_sha_size DATA
av_sha_update
av_small_strptime
av_solve_lls
av_strcasecmp
av_strdup
av_strerror
av_stristart
av_stristr
av_strlcat
av_strlcatf
av_strlcpy
av_strncasecmp
av_strnstr
av_strstart
av_strtod
av_strtok
av_sub_q
av_tempfile
av_timecode_adjust_ntsc_framenum2
av_timecode_check_frame_rate
av_timecode_get_smpte_from_framenum
av_timecode_init
av_timecode_init_from_string
av_timecode_make_mpeg_tc_string
av_timecode_make_smpte_tc_string
av_timecode_make_string
av_timegm
av_tree_destroy
av_tree_enumerate
av_tree_find
av_tree_insert
av_tree_node_alloc
av_tree_node_size DATA
av_update_lls
av_usleep
av_vbprintf
av_vlog
av_write_image_line
av_xtea_crypt
av_xtea_init
avpriv_cga_font DATA
avpriv_emms_yasm DATA
avpriv_evaluate_lls
avpriv_float_dsp_init
avpriv_frame_get_metadatap
avpriv_init_lls
avpriv_init_lls2
avpriv_open
avpriv_report_missing_feature
avpriv_request_sample
avpriv_scalarproduct_float_c
avpriv_set_systematic_pal2
avpriv_solve_lls
avpriv_solve_lls2
avpriv_update_lls
avpriv_vga16_font DATA
avutil_configuration
avutil_license
avutil_version
ff_butterflies_float_sse DATA
ff_check_pixfmt_descriptors
ff_cpu_cpuid DATA
ff_cpu_xgetbv DATA
ff_evaluate_lls_sse2 DATA
ff_float_dsp_init_x86
ff_get_channel_layout
ff_get_cpu_flags_x86
ff_init_lls_x86
ff_log2_tab DATA
ff_scalarproduct_float_sse DATA
ff_update_lls_avx DATA
ff_update_lls_sse2 DATA
ff_vector_dmul_scalar_avx DATA
ff_vector_dmul_scalar_sse2 DATA
ff_vector_fmac_scalar_avx DATA
ff_vector_fmac_scalar_sse DATA
ff_vector_fmul_add_avx DATA
ff_vector_fmul_add_sse DATA
ff_vector_fmul_avx DATA
ff_vector_fmul_reverse_avx DATA
ff_vector_fmul_reverse_sse DATA
ff_vector_fmul_scalar_sse DATA
ff_vector_fmul_sse DATA
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+5
View File
@@ -0,0 +1,5 @@
EXPORTS
avdevice_configuration
avdevice_license
avdevice_register_all
avdevice_version
+261
View File
@@ -0,0 +1,261 @@
EXPORTS
av_2_vs_pixel_format
av_abuffersink_params_alloc
av_buffersink_get_buffer_ref
av_buffersink_get_frame
av_buffersink_get_frame_flags
av_buffersink_get_frame_rate
av_buffersink_get_samples
av_buffersink_params_alloc
av_buffersink_poll_frame
av_buffersink_read
av_buffersink_read_samples
av_buffersink_set_frame_size
av_buffersrc_add_frame
av_buffersrc_add_frame_flags
av_buffersrc_add_ref
av_buffersrc_buffer
av_buffersrc_get_nb_failed_requests
av_buffersrc_write_frame
av_filter_next
avfilter_add_matrix
avfilter_af_aconvert DATA
avfilter_af_adelay DATA
avfilter_af_aecho DATA
avfilter_af_afade DATA
avfilter_af_afifo DATA
avfilter_af_aformat DATA
avfilter_af_ainterleave DATA
avfilter_af_allpass DATA
avfilter_af_amerge DATA
avfilter_af_amix DATA
avfilter_af_anull DATA
avfilter_af_apad DATA
avfilter_af_aperms DATA
avfilter_af_aphaser DATA
avfilter_af_aresample DATA
avfilter_af_aselect DATA
avfilter_af_asendcmd DATA
avfilter_af_asetnsamples DATA
avfilter_af_asetpts DATA
avfilter_af_asetrate DATA
avfilter_af_asettb DATA
avfilter_af_ashowinfo DATA
avfilter_af_asplit DATA
avfilter_af_astats DATA
avfilter_af_astreamsync DATA
avfilter_af_atempo DATA
avfilter_af_atrim DATA
avfilter_af_bandpass DATA
avfilter_af_bandreject DATA
avfilter_af_bass DATA
avfilter_af_biquad DATA
avfilter_af_channelmap DATA
avfilter_af_channelsplit DATA
avfilter_af_compand DATA
avfilter_af_earwax DATA
avfilter_af_ebur128 DATA
avfilter_af_equalizer DATA
avfilter_af_highpass DATA
avfilter_af_join DATA
avfilter_af_lowpass DATA
avfilter_af_pan DATA
avfilter_af_replaygain DATA
avfilter_af_silencedetect DATA
avfilter_af_treble DATA
avfilter_af_volume DATA
avfilter_af_volumedetect DATA
avfilter_all_channel_layouts DATA
avfilter_asink_abuffer DATA
avfilter_asink_anullsink DATA
avfilter_asink_ffabuffersink DATA
avfilter_asrc_abuffer DATA
avfilter_asrc_aevalsrc DATA
avfilter_asrc_anullsrc DATA
avfilter_asrc_sine DATA
avfilter_avf_avectorscope DATA
avfilter_avf_concat DATA
avfilter_avf_showspectrum DATA
avfilter_avf_showwaves DATA
avfilter_avsrc_amovie DATA
avfilter_avsrc_movie DATA
avfilter_config_links
avfilter_configuration
avfilter_copy_buf_props
avfilter_copy_buffer_ref_props
avfilter_copy_frame_props
avfilter_fill_frame_from_audio_buffer_ref
avfilter_fill_frame_from_buffer_ref
avfilter_fill_frame_from_video_buffer_ref
avfilter_free
avfilter_get_audio_buffer_ref_from_arrays
avfilter_get_audio_buffer_ref_from_arrays_channels
avfilter_get_audio_buffer_ref_from_frame
avfilter_get_buffer_ref_from_frame
avfilter_get_by_name
avfilter_get_class
avfilter_get_matrix
avfilter_get_video_buffer_ref_from_arrays
avfilter_get_video_buffer_ref_from_frame
avfilter_graph_add_filter
avfilter_graph_alloc
avfilter_graph_alloc_filter
avfilter_graph_config
avfilter_graph_create_filter
avfilter_graph_dump
avfilter_graph_free
avfilter_graph_get_filter
avfilter_graph_parse
avfilter_graph_parse2
avfilter_graph_parse_ptr
avfilter_graph_queue_command
avfilter_graph_request_oldest
avfilter_graph_send_command
avfilter_graph_set_auto_convert
avfilter_init_dict
avfilter_init_filter
avfilter_init_str
avfilter_inout_alloc
avfilter_inout_free
avfilter_insert_filter
avfilter_license
avfilter_link
avfilter_link_free
avfilter_link_get_channels
avfilter_link_set_closed
avfilter_make_format64_list
avfilter_mul_matrix
avfilter_next
avfilter_open
avfilter_pad_count
avfilter_pad_get_name
avfilter_pad_get_type
avfilter_process_command
avfilter_ref_buffer
avfilter_ref_get_channels
avfilter_register
avfilter_register_all
avfilter_sub_matrix
avfilter_transform
avfilter_uninit
avfilter_unref_buffer
avfilter_unref_bufferp
avfilter_version
avfilter_vf_alphaextract DATA
avfilter_vf_alphamerge DATA
avfilter_vf_ass DATA
avfilter_vf_bbox DATA
avfilter_vf_blackdetect DATA
avfilter_vf_blackframe DATA
avfilter_vf_blend DATA
avfilter_vf_boxblur DATA
avfilter_vf_colorbalance DATA
avfilter_vf_colorchannelmixer DATA
avfilter_vf_colormatrix DATA
avfilter_vf_copy DATA
avfilter_vf_crop DATA
avfilter_vf_cropdetect DATA
avfilter_vf_curves DATA
avfilter_vf_dctdnoiz DATA
avfilter_vf_decimate DATA
avfilter_vf_delogo DATA
avfilter_vf_deshake DATA
avfilter_vf_drawbox DATA
avfilter_vf_drawgrid DATA
avfilter_vf_drawtext DATA
avfilter_vf_edgedetect DATA
avfilter_vf_extractplanes DATA
avfilter_vf_fade DATA
avfilter_vf_field DATA
avfilter_vf_fieldmatch DATA
avfilter_vf_fieldorder DATA
avfilter_vf_fifo DATA
avfilter_vf_format DATA
avfilter_vf_fps DATA
avfilter_vf_framestep DATA
avfilter_vf_frei0r DATA
avfilter_vf_geq DATA
avfilter_vf_gradfun DATA
avfilter_vf_haldclut DATA
avfilter_vf_hflip DATA
avfilter_vf_histeq DATA
avfilter_vf_histogram DATA
avfilter_vf_hqdn3d DATA
avfilter_vf_hue DATA
avfilter_vf_idet DATA
avfilter_vf_il DATA
avfilter_vf_interlace DATA
avfilter_vf_interleave DATA
avfilter_vf_kerndeint DATA
avfilter_vf_lut DATA
avfilter_vf_lut3d DATA
avfilter_vf_lutrgb DATA
avfilter_vf_lutyuv DATA
avfilter_vf_mcdeint DATA
avfilter_vf_mergeplanes DATA
avfilter_vf_mp DATA
avfilter_vf_mpdecimate DATA
avfilter_vf_negate DATA
avfilter_vf_noformat DATA
avfilter_vf_noise DATA
avfilter_vf_null DATA
avfilter_vf_overlay DATA
avfilter_vf_owdenoise DATA
avfilter_vf_pad DATA
avfilter_vf_perms DATA
avfilter_vf_perspective DATA
avfilter_vf_phase DATA
avfilter_vf_pixdesctest DATA
avfilter_vf_pp DATA
avfilter_vf_psnr DATA
avfilter_vf_pullup DATA
avfilter_vf_removelogo DATA
avfilter_vf_rotate DATA
avfilter_vf_sab DATA
avfilter_vf_scale DATA
avfilter_vf_select DATA
avfilter_vf_sendcmd DATA
avfilter_vf_separatefields DATA
avfilter_vf_setdar DATA
avfilter_vf_setfield DATA
avfilter_vf_setpts DATA
avfilter_vf_setsar DATA
avfilter_vf_settb DATA
avfilter_vf_showinfo DATA
avfilter_vf_smartblur DATA
avfilter_vf_split DATA
avfilter_vf_spp DATA
avfilter_vf_stereo3d DATA
avfilter_vf_subtitles DATA
avfilter_vf_super2xsai DATA
avfilter_vf_swapuv DATA
avfilter_vf_telecine DATA
avfilter_vf_thumbnail DATA
avfilter_vf_tile DATA
avfilter_vf_tinterlace DATA
avfilter_vf_transpose DATA
avfilter_vf_trim DATA
avfilter_vf_unsharp DATA
avfilter_vf_vflip DATA
avfilter_vf_vidstabdetect DATA
avfilter_vf_vidstabtransform DATA
avfilter_vf_vignette DATA
avfilter_vf_w3fdif DATA
avfilter_vf_yadif DATA
avfilter_vsink_buffer DATA
avfilter_vsink_ffbuffersink DATA
avfilter_vsink_nullsink DATA
avfilter_vsrc_buffer DATA
avfilter_vsrc_cellauto DATA
avfilter_vsrc_color DATA
avfilter_vsrc_frei0r_src DATA
avfilter_vsrc_haldclutsrc DATA
avfilter_vsrc_life DATA
avfilter_vsrc_mandelbrot DATA
avfilter_vsrc_mptestsrc DATA
avfilter_vsrc_nullsrc DATA
avfilter_vsrc_rgbtestsrc DATA
avfilter_vsrc_smptebars DATA
avfilter_vsrc_smptehdbars DATA
avfilter_vsrc_testsrc DATA
ff_default_query_formats
+152
View File
@@ -0,0 +1,152 @@
EXPORTS
av_add_index_entry
av_append_packet
av_close_input_file
av_codec_get_id
av_codec_get_tag
av_codec_get_tag2
av_convert_lang_to
av_demuxer_open
av_dump_format
av_filename_number_test
av_find_best_stream
av_find_default_stream_index
av_find_input_format
av_find_program_from_stream
av_find_stream_info
av_fmt_ctx_get_duration_estimation_method
av_format_get_audio_codec
av_format_get_probe_score
av_format_get_subtitle_codec
av_format_get_video_codec
av_format_set_audio_codec
av_format_set_subtitle_codec
av_format_set_video_codec
av_get_frame_filename
av_get_output_timestamp
av_get_packet
av_guess_codec
av_guess_format
av_guess_frame_rate
av_guess_sample_aspect_ratio
av_hex_dump
av_hex_dump_log
av_iformat_next
av_index_search_timestamp
av_interleaved_write_frame
av_match_ext
av_new_program
av_new_stream
av_oformat_next
av_pkt_dump2
av_pkt_dump_log2
av_probe_input_buffer
av_probe_input_buffer2
av_probe_input_format
av_probe_input_format2
av_probe_input_format3
av_read_frame
av_read_packet
av_read_pause
av_read_play
av_register_all
av_register_input_format
av_register_output_format
av_register_rdt_dynamic_payload_handlers
av_register_rtp_dynamic_payload_handlers
av_sdp_create
av_seek_frame
av_set_pts_info
av_stream_get_r_frame_rate
av_stream_set_r_frame_rate
av_url_split
av_write_frame
av_write_trailer
avformat_alloc_context
avformat_alloc_output_context
avformat_alloc_output_context2
avformat_close_input
avformat_configuration
avformat_find_stream_info
avformat_free_context
avformat_get_class
avformat_get_riff_audio_tags
avformat_get_riff_video_tags
avformat_license
avformat_match_stream_specifier
avformat_network_deinit
avformat_network_init
avformat_new_stream
avformat_open_input
avformat_query_codec
avformat_queue_attached_pictures
avformat_seek_file
avformat_version
avformat_write_header
avio_alloc_context
avio_check
avio_close
avio_close_dyn_buf
avio_closep
avio_enum_protocols
avio_flush
avio_get_str
avio_get_str16be
avio_get_str16le
avio_open
avio_open2
avio_open_dyn_buf
avio_pause
avio_printf
avio_put_str
avio_put_str16le
avio_r8
avio_rb16
avio_rb24
avio_rb32
avio_rb64
avio_read
avio_rl16
avio_rl24
avio_rl32
avio_rl64
avio_seek
avio_seek_time
avio_size
avio_skip
avio_w8
avio_wb16
avio_wb24
avio_wb32
avio_wb64
avio_wl16
avio_wl24
avio_wl32
avio_wl64
avio_write
avpriv_dv_get_packet
avpriv_dv_init_demux
avpriv_dv_produce_packet
avpriv_new_chapter
avpriv_set_pts_info
ff_codec_get_id
ff_inet_aton
ff_mpegts_parse_close
ff_mpegts_parse_open
ff_mpegts_parse_packet
ff_rtp_get_local_rtcp_port
ff_rtp_get_local_rtp_port
ff_rtsp_parse_line
ff_socket_nonblock
ffio_open_dyn_packet_buf
ffio_set_buf_size
ffurl_close
ffurl_open
ffurl_protocol_next
ffurl_read_complete
ffurl_seek
ffurl_size
ffurl_write
get_crc_table
get_extension
url_feof
+10
View File
@@ -0,0 +1,10 @@
EXPORTS
postproc_configuration
postproc_license
postproc_version
pp_free_context
pp_free_mode
pp_get_context
pp_get_mode_by_name_and_quality
pp_help DATA
pp_postprocess
+105
View File
@@ -0,0 +1,105 @@
EXPORTS
ff_float_to_int16_a_sse2 DATA
ff_float_to_int16_u_sse2 DATA
ff_float_to_int32_a_sse2 DATA
ff_float_to_int32_u_sse2 DATA
ff_int16_to_float_a_sse2 DATA
ff_int16_to_float_u_sse2 DATA
ff_int16_to_int32_a_mmx DATA
ff_int16_to_int32_a_sse2 DATA
ff_int16_to_int32_u_mmx DATA
ff_int16_to_int32_u_sse2 DATA
ff_int32_to_float_a_avx DATA
ff_int32_to_float_a_sse2 DATA
ff_int32_to_float_u_avx DATA
ff_int32_to_float_u_sse2 DATA
ff_int32_to_int16_a_mmx DATA
ff_int32_to_int16_a_sse2 DATA
ff_int32_to_int16_u_mmx DATA
ff_int32_to_int16_u_sse2 DATA
ff_log2_tab DATA
ff_mix_1_1_a_float_avx DATA
ff_mix_1_1_a_float_sse DATA
ff_mix_1_1_a_int16_mmx DATA
ff_mix_1_1_a_int16_sse2 DATA
ff_mix_1_1_u_float_avx DATA
ff_mix_1_1_u_float_sse DATA
ff_mix_1_1_u_int16_mmx DATA
ff_mix_1_1_u_int16_sse2 DATA
ff_mix_2_1_a_float_avx DATA
ff_mix_2_1_a_float_sse DATA
ff_mix_2_1_a_int16_mmx DATA
ff_mix_2_1_a_int16_sse2 DATA
ff_mix_2_1_u_float_avx DATA
ff_mix_2_1_u_float_sse DATA
ff_mix_2_1_u_int16_mmx DATA
ff_mix_2_1_u_int16_sse2 DATA
ff_pack_2ch_float_to_int16_a_sse2 DATA
ff_pack_2ch_float_to_int16_u_sse2 DATA
ff_pack_2ch_float_to_int32_a_sse2 DATA
ff_pack_2ch_float_to_int32_u_sse2 DATA
ff_pack_2ch_int16_to_float_a_sse2 DATA
ff_pack_2ch_int16_to_float_u_sse2 DATA
ff_pack_2ch_int16_to_int16_a_sse2 DATA
ff_pack_2ch_int16_to_int16_u_sse2 DATA
ff_pack_2ch_int16_to_int32_a_sse2 DATA
ff_pack_2ch_int16_to_int32_u_sse2 DATA
ff_pack_2ch_int32_to_float_a_sse2 DATA
ff_pack_2ch_int32_to_float_u_sse2 DATA
ff_pack_2ch_int32_to_int16_a_sse2 DATA
ff_pack_2ch_int32_to_int16_u_sse2 DATA
ff_pack_2ch_int32_to_int32_a_sse2 DATA
ff_pack_2ch_int32_to_int32_u_sse2 DATA
ff_pack_6ch_float_to_float_a_avx DATA
ff_pack_6ch_float_to_float_a_mmx DATA
ff_pack_6ch_float_to_float_a_sse4 DATA
ff_pack_6ch_float_to_float_u_avx DATA
ff_pack_6ch_float_to_float_u_mmx DATA
ff_pack_6ch_float_to_float_u_sse4 DATA
ff_pack_6ch_float_to_int32_a_avx DATA
ff_pack_6ch_float_to_int32_a_sse4 DATA
ff_pack_6ch_float_to_int32_u_avx DATA
ff_pack_6ch_float_to_int32_u_sse4 DATA
ff_pack_6ch_int32_to_float_a_avx DATA
ff_pack_6ch_int32_to_float_a_sse4 DATA
ff_pack_6ch_int32_to_float_u_avx DATA
ff_pack_6ch_int32_to_float_u_sse4 DATA
ff_resample_int16_rounder DATA
ff_unpack_2ch_float_to_int16_a_sse2 DATA
ff_unpack_2ch_float_to_int16_u_sse2 DATA
ff_unpack_2ch_float_to_int32_a_sse2 DATA
ff_unpack_2ch_float_to_int32_u_sse2 DATA
ff_unpack_2ch_int16_to_float_a_sse2 DATA
ff_unpack_2ch_int16_to_float_a_ssse3 DATA
ff_unpack_2ch_int16_to_float_u_sse2 DATA
ff_unpack_2ch_int16_to_float_u_ssse3 DATA
ff_unpack_2ch_int16_to_int16_a_sse2 DATA
ff_unpack_2ch_int16_to_int16_a_ssse3 DATA
ff_unpack_2ch_int16_to_int16_u_sse2 DATA
ff_unpack_2ch_int16_to_int16_u_ssse3 DATA
ff_unpack_2ch_int16_to_int32_a_sse2 DATA
ff_unpack_2ch_int16_to_int32_a_ssse3 DATA
ff_unpack_2ch_int16_to_int32_u_sse2 DATA
ff_unpack_2ch_int16_to_int32_u_ssse3 DATA
ff_unpack_2ch_int32_to_float_a_sse2 DATA
ff_unpack_2ch_int32_to_float_u_sse2 DATA
ff_unpack_2ch_int32_to_int16_a_sse2 DATA
ff_unpack_2ch_int32_to_int16_u_sse2 DATA
ff_unpack_2ch_int32_to_int32_a_sse2 DATA
ff_unpack_2ch_int32_to_int32_u_sse2 DATA
swr_alloc
swr_alloc_set_opts
swr_convert
swr_drop_output
swr_free
swr_get_class
swr_get_delay
swr_init
swr_inject_silence
swr_next_pts
swr_set_channel_mapping
swr_set_compensation
swr_set_matrix
swresample_configuration
swresample_license
swresample_version
+37
View File
@@ -0,0 +1,37 @@
EXPORTS
sws_addVec
sws_allocVec
sws_alloc_context
sws_cloneVec
sws_context_class DATA
sws_convVec
sws_convertPalette8ToPacked24
sws_convertPalette8ToPacked32
sws_format_name
sws_freeContext
sws_freeFilter
sws_freeVec
sws_getCachedContext
sws_getCoefficients
sws_getColorspaceDetails
sws_getConstVec
sws_getContext
sws_getDefaultFilter
sws_getGaussianVec
sws_getIdentityVec
sws_get_class
sws_init_context
sws_isSupportedEndiannessConversion
sws_isSupportedInput
sws_isSupportedOutput
sws_normalizeVec
sws_printVec2
sws_rgb2rgb_init
sws_scale
sws_scaleVec
sws_setColorspaceDetails
sws_shiftVec
sws_subVec
swscale_configuration
swscale_license
swscale_version
+4 -2
View File
@@ -24,9 +24,11 @@
extern "C" {
# endif
# if _WIN64
# define FPM_64BIT
# else
# define FPM_INTEL
# endif
# define SIZEOF_INT 4
# define SIZEOF_LONG 4
+1 -1
View File
@@ -146,7 +146,7 @@ void ActorFrame::AddChild( Actor *pActor )
#endif
ASSERT( pActor != nullptr );
ASSERT( (void*)pActor != (void*)0xC0000005 );
ASSERT( reinterpret_cast<uintptr_t>(pActor) != static_cast<uintptr_t>(0xC0000005) );
m_SubActors.push_back( pActor );
pActor->SetParent( this );
+746 -744
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -186,8 +186,8 @@ void ImageCache::ReadFromDisk()
struct ImageTexture: public RageTexture
{
unsigned m_uTexHandle;
unsigned GetTexHandle() const { return m_uTexHandle; }; // accessed by RageDisplay
uintptr_t m_uTexHandle;
uintptr_t GetTexHandle() const { return m_uTexHandle; }; // accessed by RageDisplay
/* This is a reference to a pointer in g_ImagePathToImage. */
RageSurface *&m_pImage;
int m_iWidth, m_iHeight;
+1
View File
@@ -84,6 +84,7 @@ namespace LuaHelpers
template<> void Push<double>( lua_State *L, const double &Object ) { lua_pushnumber( L, Object ); }
template<> void Push<int>( lua_State *L, const int &Object ) { lua_pushinteger( L, Object ); }
template<> void Push<unsigned int>( lua_State *L, const unsigned int &Object ) { lua_pushnumber( L, double(Object) ); }
template<> void Push<unsigned long long>( lua_State *L, const unsigned long long &Object ) { lua_pushnumber( L, double(Object) ); }
template<> void Push<RString>( lua_State *L, const RString &Object ) { lua_pushlstring( L, Object.data(), Object.size() ); }
template<> void Push<std::string>( lua_State *L, std::string const& object ) { lua_pushlstring( L, object.data(), object.size() ); }
+1 -2
View File
@@ -224,8 +224,7 @@ inline bool MyLua_checkintboolean( lua_State *L, int iArg )
int iType = lua_type( L, iArg );
if( iType == LUA_TNUMBER )
{
int iValue = lua_tointeger( L, iArg );
return iValue != 0;
return lua_tointeger(L, iArg) != 0;
}
return MyLua_checkboolean( L, iArg );
+2 -2
View File
@@ -13,12 +13,12 @@ public:
/* only called by RageTextureManager::InvalidateTextures */
virtual void Invalidate() { m_uTexHandle = 0; /* don't Destroy() */}
virtual void Reload();
virtual unsigned GetTexHandle() const { return m_uTexHandle; }; // accessed by RageDisplay
virtual uintptr_t GetTexHandle() const { return m_uTexHandle; }; // accessed by RageDisplay
private:
void Create(); // called by constructor and Reload
void Destroy();
unsigned m_uTexHandle; // treat as unsigned in OpenGL, ID3D8Texture* for D3D
uintptr_t m_uTexHandle; // treat as unsigned in OpenGL, IDirect3DTexture9* for D3D
};
#endif
+10 -10
View File
@@ -205,7 +205,7 @@ struct RageTextureLock
/* Given a surface with a format and no pixel data, lock the texture into the
* surface. The data is write-only. */
virtual void Lock( unsigned iTexHandle, RageSurface *pSurface ) = 0;
virtual void Lock( uintptr_t iTexHandle, RageSurface *pSurface ) = 0;
/* Unlock and update the texture. If bChanged is false, the texture update
* may be omitted. */
@@ -261,23 +261,23 @@ public:
/* return 0 if failed or internal texture resource handle
* (unsigned in OpenGL, texture pointer in D3D) */
virtual unsigned CreateTexture(
virtual uintptr_t CreateTexture(
RagePixelFormat pixfmt, // format of img and of texture in video mem
RageSurface* img, // must be in pixfmt
bool bGenerateMipMaps
) = 0;
virtual void UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height
) = 0;
virtual void DeleteTexture( unsigned iTexHandle ) = 0;
virtual void DeleteTexture( uintptr_t iTexHandle ) = 0;
/* Return an object to lock pixels for streaming. If not supported, returns nullptr.
* Delete the object normally. */
virtual RageTextureLock *CreateTextureLock() { return nullptr; }
virtual void ClearAllTextures() = 0;
virtual int GetNumTextureUnits() = 0;
virtual void SetTexture( TextureUnit, unsigned /* iTexture */ ) = 0;
virtual void SetTexture( TextureUnit, uintptr_t /* iTexture */ ) = 0;
virtual void SetTextureMode( TextureUnit, TextureMode ) = 0;
virtual void SetTextureWrapping( TextureUnit, bool ) = 0;
virtual int GetMaxTextureSize() const = 0;
@@ -293,9 +293,9 @@ public:
* DeleteTexture. (UpdateTexture is not permitted.) Returns 0 if render-to-
* texture is unsupported.
*/
virtual unsigned CreateRenderTarget( const RenderTargetParam &, int & /* iTextureWidthOut */, int & /* iTextureHeightOut */ ) { return 0; }
virtual uintptr_t CreateRenderTarget( const RenderTargetParam &, int & /* iTextureWidthOut */, int & /* iTextureHeightOut */ ) { return 0; }
virtual unsigned GetRenderTarget() { return 0; }
virtual uintptr_t GetRenderTarget() { return 0; }
/* Set the render target, or 0 to resume rendering to the framebuffer. An active render
* target may not be used as a texture. If bPreserveTexture is true, the contents
@@ -303,7 +303,7 @@ public:
* bPreserveTexture is true the first time a render target is used, behave as if
* bPreserveTexture was false.
*/
virtual void SetRenderTarget( unsigned /* iHandle */, bool /* bPreserveTexture */ = true ) { }
virtual void SetRenderTarget( uintptr_t /* iHandle */, bool /* bPreserveTexture */ = true ) { }
virtual bool IsZTestEnabled() const = 0;
virtual bool IsZWriteEnabled() const = 0;
@@ -364,9 +364,9 @@ public:
};
bool SaveScreenshot( RString sPath, GraphicsFileFormat format );
virtual RString GetTextureDiagnostics( unsigned /* id */ ) const { return RString(); }
virtual RString GetTextureDiagnostics( uintptr_t /* id */ ) const { return RString(); }
virtual RageSurface* CreateScreenshot() = 0; // allocates a surface. Caller must delete it.
virtual RageSurface *GetTexture( unsigned /* iTexture */ ) { return nullptr; } // allocates a surface. Caller must delete it.
virtual RageSurface *GetTexture( uintptr_t /* iTexture */ ) { return nullptr; } // allocates a surface. Caller must delete it.
protected:
virtual void DrawQuadsInternal( const RageSpriteVertex v[], int iNumVerts ) = 0;
+26 -26
View File
@@ -44,13 +44,13 @@ const D3DFORMAT g_DefaultAdapterFormat = D3DFMT_X8R8G8B8;
/* Direct3D doesn't associate a palette with textures. Instead, we load a
* palette into a slot. We need to keep track of which texture's palette is
* stored in what slot. */
map<unsigned,int> g_TexResourceToPaletteIndex;
list<int> g_PaletteIndex;
std::map<uintptr_t, size_t> g_TexResourceToPaletteIndex;
std::list<size_t> g_PaletteIndex;
struct TexturePalette { PALETTEENTRY p[256]; };
map<unsigned,TexturePalette> g_TexResourceToTexturePalette;
std::map<uintptr_t, TexturePalette> g_TexResourceToTexturePalette;
// Load the palette, if any, for the given texture into a palette slot, and make it current.
static void SetPalette( unsigned TexResource )
static void SetPalette( uintptr_t TexResource )
{
// If the texture isn't paletted, we have nothing to do.
if( g_TexResourceToTexturePalette.find(TexResource) == g_TexResourceToTexturePalette.end() )
@@ -60,10 +60,10 @@ static void SetPalette( unsigned TexResource )
if( g_TexResourceToPaletteIndex.find(TexResource) == g_TexResourceToPaletteIndex.end() )
{
// It's not. Grab the least recently used slot.
int iPalIndex = g_PaletteIndex.front();
UINT iPalIndex = static_cast<UINT>(g_PaletteIndex.front());
// If any other texture is currently using this slot, mark that palette unloaded.
for( map<unsigned,int>::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i )
for( std::map<uintptr_t, size_t>::iterator i = g_TexResourceToPaletteIndex.begin(); i != g_TexResourceToPaletteIndex.end(); ++i )
{
if( i->second != iPalIndex )
continue;
@@ -81,7 +81,7 @@ static void SetPalette( unsigned TexResource )
const int iPalIndex = g_TexResourceToPaletteIndex[TexResource];
// Find this palette index in the least-recently-used queue and move it to the end.
for(list<int>::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i)
for(std::list<size_t>::iterator i = g_PaletteIndex.begin(); i != g_PaletteIndex.end(); ++i)
{
if( *i != iPalIndex )
continue;
@@ -327,7 +327,7 @@ D3DFORMAT FindBackBufferType(bool bWindowed, int iBPP)
}
// Test each back buffer format until we find something that works.
for( unsigned i=0; i < vBackBufferFormats.size(); i++ )
for( size_t i=0; i < vBackBufferFormats.size(); i++ )
{
D3DFORMAT fmtBackBuffer = vBackBufferFormats[i];
@@ -782,18 +782,18 @@ public:
}
void Change( const vector<msMesh> &vMeshes )
{
for( unsigned i=0; i<vMeshes.size(); i++ )
for( size_t i=0; i<vMeshes.size(); i++ )
{
const MeshInfo& meshInfo = m_vMeshInfo[i];
const msMesh& mesh = vMeshes[i];
const vector<RageModelVertex> &Vertices = mesh.Vertices;
const vector<msTriangle> &Triangles = mesh.Triangles;
for( unsigned j=0; j<Vertices.size(); j++ )
for( size_t j=0; j<Vertices.size(); j++ )
m_vVertex[meshInfo.iVertexStart+j] = Vertices[j];
for( unsigned j=0; j<Triangles.size(); j++ )
for( unsigned k=0; k<3; k++ )
for( size_t j=0; j<Triangles.size(); j++ )
for( size_t k=0; k<3; k++ )
m_vTriangles[meshInfo.iTriangleStart+j].nVertexIndices[k] = (uint16_t) meshInfo.iVertexStart + Triangles[j].nVertexIndices[k];
}
}
@@ -851,8 +851,8 @@ void RageDisplay_D3D::DrawQuadsInternal( const RageSpriteVertex v[], int iNumVer
// make a temporary index buffer
static vector<uint16_t> vIndices;
unsigned uOldSize = vIndices.size();
unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices);
size_t uOldSize = vIndices.size();
size_t uNewSize = max(uOldSize, static_cast<size_t>(iNumIndices));
vIndices.resize( uNewSize );
for( uint16_t i=(uint16_t)uOldSize/6; i<(uint16_t)iNumQuads; i++ )
{
@@ -887,8 +887,8 @@ void RageDisplay_D3D::DrawQuadStripInternal( const RageSpriteVertex v[], int iNu
// make a temporary index buffer
static vector<uint16_t> vIndices;
unsigned uOldSize = vIndices.size();
unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices);
size_t uOldSize = vIndices.size();
size_t uNewSize = max(uOldSize, static_cast<size_t>(iNumIndices));
vIndices.resize( uNewSize );
for( uint16_t i=(uint16_t)uOldSize/6; i<(uint16_t)iNumQuads; i++ )
{
@@ -922,8 +922,8 @@ void RageDisplay_D3D::DrawSymmetricQuadStripInternal( const RageSpriteVertex v[]
// make a temporary index buffer
static vector<uint16_t> vIndices;
unsigned uOldSize = vIndices.size();
unsigned uNewSize = max(uOldSize,(unsigned)iNumIndices);
size_t uOldSize = vIndices.size();
size_t uNewSize = max(uOldSize, static_cast<size_t>(iNumIndices));
vIndices.resize( uNewSize );
for( uint16_t i=(uint16_t)uOldSize/12; i<(uint16_t)iNumPieces; i++ )
{
@@ -1048,7 +1048,7 @@ int RageDisplay_D3D::GetNumTextureUnits()
return g_DeviceCaps.MaxSimultaneousTextures;
}
void RageDisplay_D3D::SetTexture( TextureUnit tu, unsigned iTexture )
void RageDisplay_D3D::SetTexture( TextureUnit tu, uintptr_t iTexture )
{
// g_DeviceCaps.MaxSimultaneousTextures = 1;
if( tu >= (int) g_DeviceCaps.MaxSimultaneousTextures ) // not supported
@@ -1065,7 +1065,7 @@ void RageDisplay_D3D::SetTexture( TextureUnit tu, unsigned iTexture )
}
else
{
IDirect3DTexture9* pTex = (IDirect3DTexture9*) iTexture;
IDirect3DTexture9* pTex = reinterpret_cast<IDirect3DTexture9*>(iTexture);
g_pd3dDevice->SetTexture( tu, pTex );
/* Intentionally commented out. Don't mess with texture stage state
@@ -1356,12 +1356,12 @@ void RageDisplay_D3D::SetCullMode( CullMode mode )
}
}
void RageDisplay_D3D::DeleteTexture( unsigned iTexHandle )
void RageDisplay_D3D::DeleteTexture( uintptr_t iTexHandle )
{
if( iTexHandle == 0 )
return;
IDirect3DTexture9* pTex = (IDirect3DTexture9*) iTexHandle;
IDirect3DTexture9* pTex = reinterpret_cast<IDirect3DTexture9*>(iTexHandle);
pTex->Release();
// Delete palette (if any)
@@ -1372,7 +1372,7 @@ void RageDisplay_D3D::DeleteTexture( unsigned iTexHandle )
}
unsigned RageDisplay_D3D::CreateTexture(
uintptr_t RageDisplay_D3D::CreateTexture(
RagePixelFormat pixfmt,
RageSurface* img,
bool bGenerateMipMaps )
@@ -1385,7 +1385,7 @@ unsigned RageDisplay_D3D::CreateTexture(
RageException::Throw( "CreateTexture(%i,%i,%s) failed: %s",
img->w, img->h, RagePixelFormatToString(pixfmt).c_str(), GetErrorString(hr).c_str() );
unsigned uTexHandle = (unsigned)pTex;
uintptr_t uTexHandle = reinterpret_cast<uintptr_t>(pTex);
if( pixfmt == RagePixelFormat_PAL )
{
@@ -1411,11 +1411,11 @@ unsigned RageDisplay_D3D::CreateTexture(
}
void RageDisplay_D3D::UpdateTexture(
unsigned uTexHandle,
uintptr_t uTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height )
{
IDirect3DTexture9* pTex = (IDirect3DTexture9*)uTexHandle;
IDirect3DTexture9* pTex = reinterpret_cast<IDirect3DTexture9*>(uTexHandle);
ASSERT( pTex != nullptr );
RECT rect;
+4 -4
View File
@@ -22,19 +22,19 @@ public:
bool SupportsTextureFormat( RagePixelFormat pixfmt, bool realtime=false );
bool SupportsThreadedRendering();
bool SupportsPerVertexMatrixScale() { return false; }
unsigned CreateTexture(
uintptr_t CreateTexture(
RagePixelFormat pixfmt,
RageSurface* img,
bool bGenerateMipMaps );
void UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height
);
void DeleteTexture( unsigned iTexHandle );
void DeleteTexture( uintptr_t iTexHandle );
void ClearAllTextures();
int GetNumTextureUnits();
void SetTexture( TextureUnit tu, unsigned iTexture );
void SetTexture( TextureUnit tu, uintptr_t iTexture );
void SetTextureMode( TextureUnit tu, TextureMode tm );
void SetTextureWrapping( TextureUnit tu, bool b );
int GetMaxTextureSize() const;
+5 -5
View File
@@ -559,7 +559,7 @@ RageDisplay_GLES2::SupportsPerVertexMatrixScale()
return true;
}
unsigned
uintptr_t
RageDisplay_GLES2::CreateTexture(
RagePixelFormat pixfmt,
RageSurface* img,
@@ -572,7 +572,7 @@ RageDisplay_GLES2::CreateTexture(
void
RageDisplay_GLES2::UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height
)
@@ -581,7 +581,7 @@ RageDisplay_GLES2::UpdateTexture(
}
void
RageDisplay_GLES2::DeleteTexture( unsigned iTexHandle )
RageDisplay_GLES2::DeleteTexture( uintptr_t iTexHandle )
{
// TODO
}
@@ -613,7 +613,7 @@ SetTextureUnit( TextureUnit tu )
}
void
RageDisplay_GLES2::SetTexture( TextureUnit tu, unsigned iTexture )
RageDisplay_GLES2::SetTexture( TextureUnit tu, uintptr_t iTexture )
{
if (!SetTextureUnit( tu ))
return;
@@ -621,7 +621,7 @@ RageDisplay_GLES2::SetTexture( TextureUnit tu, unsigned iTexture )
if (iTexture)
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, iTexture );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(iTexture) );
}
else
{
+4 -4
View File
@@ -18,18 +18,18 @@ public:
void SetBlendMode( BlendMode mode );
bool SupportsTextureFormat( RagePixelFormat pixfmt, bool realtime=false );
bool SupportsPerVertexMatrixScale();
unsigned CreateTexture(
uintptr_t CreateTexture(
RagePixelFormat pixfmt,
RageSurface* img,
bool bGenerateMipMaps );
void UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height );
void DeleteTexture( unsigned iTexHandle );
void DeleteTexture( uintptr_t iTexHandle );
void ClearAllTextures();
int GetNumTextureUnits();
void SetTexture( TextureUnit tu, unsigned iTexture );
void SetTexture( TextureUnit tu, uintptr_t iTexture );
void SetTextureMode( TextureUnit tu, TextureMode tm );
void SetTextureWrapping( TextureUnit tu, bool b );
int GetMaxTextureSize() const;
+4 -4
View File
@@ -19,19 +19,19 @@ public:
void SetBlendMode( BlendMode ) { }
bool SupportsTextureFormat( RagePixelFormat, bool /* realtime */ =false ) { return true; }
bool SupportsPerVertexMatrixScale() { return false; }
unsigned CreateTexture(
uintptr_t CreateTexture(
RagePixelFormat,
RageSurface* /* img */,
bool /* bGenerateMipMaps */ ) { return 1; }
void UpdateTexture(
unsigned /* iTexHandle */,
uintptr_t /* iTexHandle */,
RageSurface* /* img */,
int /* xoffset */, int /* yoffset */, int /* width */, int /* height */
) { }
void DeleteTexture( unsigned /* iTexHandle */ ) { }
void DeleteTexture( uintptr_t /* iTexHandle */ ) { }
void ClearAllTextures() { }
int GetNumTextureUnits() { return 1; }
void SetTexture( TextureUnit, unsigned /* iTexture */ ) { }
void SetTexture( TextureUnit, uintptr_t /* iTexture */ ) { }
void SetTextureMode( TextureUnit, TextureMode ) { }
void SetTextureWrapping( TextureUnit, bool ) { }
int GetMaxTextureSize() const { return 2048; }
+29 -29
View File
@@ -62,7 +62,7 @@ static const GLenum RageSpriteVertexFormat = GL_T2F_C4F_N3F_V3F;
/* If we support texture matrix scaling, a handle to the vertex program: */
static GLhandleARB g_bTextureMatrixShader = 0;
static std::map<unsigned, RenderTarget *> g_mapRenderTargets;
static std::map<uintptr_t, RenderTarget *> g_mapRenderTargets;
static RenderTarget *g_pCurrentRenderTarget = nullptr;
static LowLevelWindow *g_pWind;
@@ -795,7 +795,7 @@ RString RageDisplay_Legacy::TryVideoMode( const VideoModeParams &p, bool &bNewDe
/* Delete all render targets. They may have associated resources other than
* the texture itself. */
for (std::pair<unsigned const, RenderTarget *> &rt : g_mapRenderTargets)
for (std::pair<uintptr_t const, RenderTarget *> &rt : g_mapRenderTargets)
delete rt.second;
g_mapRenderTargets.clear();
@@ -922,14 +922,14 @@ RageSurface* RageDisplay_Legacy::CreateScreenshot()
return image;
}
RageSurface *RageDisplay_Legacy::GetTexture( unsigned iTexture )
RageSurface *RageDisplay_Legacy::GetTexture( uintptr_t iTexture )
{
if (iTexture == 0)
return nullptr; // XXX
FlushGLErrors();
glBindTexture( GL_TEXTURE_2D, iTexture );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(iTexture) );
GLint iHeight, iWidth, iAlphaBits;
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT, &iHeight );
glGetTexLevelParameteriv( GL_TEXTURE_2D, 0, GL_TEXTURE_WIDTH, &iWidth );
@@ -1677,7 +1677,7 @@ int RageDisplay_Legacy::GetNumTextureUnits()
return g_iMaxTextureUnits;
}
void RageDisplay_Legacy::SetTexture( TextureUnit tu, unsigned iTexture )
void RageDisplay_Legacy::SetTexture( TextureUnit tu, uintptr_t iTexture )
{
if (!SetTextureUnit( tu ))
return;
@@ -1685,7 +1685,7 @@ void RageDisplay_Legacy::SetTexture( TextureUnit tu, unsigned iTexture )
if (iTexture)
{
glEnable( GL_TEXTURE_2D );
glBindTexture( GL_TEXTURE_2D, iTexture );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(iTexture) );
}
else
{
@@ -2104,7 +2104,7 @@ void RageDisplay_Legacy::EndConcurrentRendering()
g_pWind->EndConcurrentRendering();
}
void RageDisplay_Legacy::DeleteTexture( unsigned iTexture )
void RageDisplay_Legacy::DeleteTexture( uintptr_t iTexture )
{
if (iTexture == 0)
return;
@@ -2189,7 +2189,7 @@ void SetPixelMapForSurface( int glImageFormat, int glTexFormat, const RageSurfac
DebugAssertNoGLError();
}
unsigned RageDisplay_Legacy::CreateTexture(
uintptr_t RageDisplay_Legacy::CreateTexture(
RagePixelFormat pixfmt,
RageSurface* pImg,
bool bGenerateMipMaps )
@@ -2234,11 +2234,11 @@ unsigned RageDisplay_Legacy::CreateTexture(
SetTextureUnit( TextureUnit_1 );
// allocate OpenGL texture resource
unsigned int iTexHandle;
uintptr_t iTexHandle;
glGenTextures( 1, reinterpret_cast<GLuint*>(&iTexHandle) );
ASSERT( iTexHandle != 0 );
glBindTexture( GL_TEXTURE_2D, iTexHandle );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(iTexHandle) );
if (g_pWind->GetActualVideoModeParams().bAnisotropicFiltering &&
GLEW_EXT_texture_filter_anisotropic )
@@ -2350,7 +2350,7 @@ public:
m_iTexHandle = 0;
}
void Lock( unsigned iTexHandle, RageSurface *pSurface )
void Lock( uintptr_t iTexHandle, RageSurface *pSurface )
{
ASSERT( m_iTexHandle == 0 );
ASSERT( pSurface->pixels == nullptr );
@@ -2396,7 +2396,7 @@ private:
GLuint m_iBuffer;
unsigned m_iTexHandle;
uintptr_t m_iTexHandle;
};
RageTextureLock *RageDisplay_Legacy::CreateTextureLock()
@@ -2408,11 +2408,11 @@ RageTextureLock *RageDisplay_Legacy::CreateTextureLock()
}
void RageDisplay_Legacy::UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* pImg,
int iXOffset, int iYOffset, int iWidth, int iHeight )
{
glBindTexture( GL_TEXTURE_2D, iTexHandle );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(iTexHandle) );
bool bFreeImg;
RagePixelFormat SurfacePixFmt = GetImgPixelFormat( pImg, bFreeImg, iWidth, iHeight, false );
@@ -2450,16 +2450,16 @@ public:
RenderTarget_FramebufferObject();
~RenderTarget_FramebufferObject();
void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned GetTexture() const { return m_iTexHandle; }
uintptr_t GetTexture() const { return m_iTexHandle; }
void StartRenderingTo();
void FinishRenderingTo();
virtual bool InvertY() const { return true; }
private:
unsigned int m_iFrameBufferHandle;
unsigned int m_iTexHandle;
unsigned int m_iDepthBufferHandle;
uintptr_t m_iFrameBufferHandle;
uintptr_t m_iTexHandle;
uintptr_t m_iDepthBufferHandle;
};
RenderTarget_FramebufferObject::RenderTarget_FramebufferObject()
@@ -2495,7 +2495,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam &param, int
iTextureWidthOut = iTextureWidth;
iTextureHeightOut = iTextureHeight;
glBindTexture( GL_TEXTURE_2D, m_iTexHandle );
glBindTexture( GL_TEXTURE_2D, static_cast<GLuint>(m_iTexHandle) );
GLenum internalformat;
GLenum type = param.bWithAlpha? GL_RGBA:GL_RGB;
if (param.bFloat && GLEW_ARB_texture_float)
@@ -2517,8 +2517,8 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam &param, int
ASSERT( m_iFrameBufferHandle != 0 );
/* Attach the texture to it. */
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, m_iFrameBufferHandle );
glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, m_iTexHandle, 0 );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, static_cast<GLuint>(m_iFrameBufferHandle) );
glFramebufferTexture2DEXT( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, static_cast<GLuint>(m_iTexHandle), 0 );
DebugAssertNoGLError();
/* Attach a depth buffer, if requested. */
@@ -2527,9 +2527,9 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam &param, int
glGenRenderbuffersEXT( 1, reinterpret_cast<GLuint*>(&m_iDepthBufferHandle) );
ASSERT( m_iDepthBufferHandle != 0 );
glBindRenderbufferEXT( GL_RENDERBUFFER, m_iDepthBufferHandle );
glBindRenderbufferEXT( GL_RENDERBUFFER, static_cast<GLuint>(m_iDepthBufferHandle) );
glRenderbufferStorageEXT( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT16, iTextureWidth, iTextureHeight );
glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, m_iDepthBufferHandle );
glFramebufferRenderbufferEXT( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, static_cast<GLuint>(m_iDepthBufferHandle) );
}
GLenum status = glCheckFramebufferStatusEXT( GL_FRAMEBUFFER_EXT );
@@ -2555,7 +2555,7 @@ void RenderTarget_FramebufferObject::Create( const RenderTargetParam &param, int
void RenderTarget_FramebufferObject::StartRenderingTo()
{
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, m_iFrameBufferHandle );
glBindFramebufferEXT( GL_FRAMEBUFFER_EXT, static_cast<GLuint>(m_iFrameBufferHandle) );
}
void RenderTarget_FramebufferObject::FinishRenderingTo()
@@ -2582,7 +2582,7 @@ bool RageDisplay_Legacy::SupportsFullscreenBorderlessWindow() const
* particularly GeForce 2, but is simpler and faster when available.
*/
unsigned RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut )
uintptr_t RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut )
{
RenderTarget *pTarget;
if (GLEW_EXT_framebuffer_object)
@@ -2592,22 +2592,22 @@ unsigned RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam &param,
pTarget->Create( param, iTextureWidthOut, iTextureHeightOut );
unsigned iTexture = pTarget->GetTexture();
uintptr_t iTexture = pTarget->GetTexture();
ASSERT( g_mapRenderTargets.find(iTexture) == g_mapRenderTargets.end() );
g_mapRenderTargets[iTexture] = pTarget;
return iTexture;
}
unsigned RageDisplay_Legacy::GetRenderTarget( )
uintptr_t RageDisplay_Legacy::GetRenderTarget()
{
for( map<unsigned, RenderTarget*>::const_iterator it = g_mapRenderTargets.begin( ); it != g_mapRenderTargets.end( ); ++it )
for( map<uintptr_t, RenderTarget*>::const_iterator it = g_mapRenderTargets.begin(); it != g_mapRenderTargets.end(); ++it )
if( it->second == g_pCurrentRenderTarget )
return it->first;
return 0;
}
void RageDisplay_Legacy::SetRenderTarget( unsigned iTexture, bool bPreserveTexture )
void RageDisplay_Legacy::SetRenderTarget( uintptr_t iTexture, bool bPreserveTexture )
{
if (iTexture == 0)
{
+8 -8
View File
@@ -53,23 +53,23 @@ public:
void SetBlendMode( BlendMode mode );
bool SupportsTextureFormat( RagePixelFormat pixfmt, bool realtime=false );
bool SupportsPerVertexMatrixScale();
unsigned CreateTexture(
uintptr_t CreateTexture(
RagePixelFormat pixfmt,
RageSurface* img,
bool bGenerateMipMaps );
void UpdateTexture(
unsigned iTexHandle,
uintptr_t iTexHandle,
RageSurface* img,
int xoffset, int yoffset, int width, int height
);
void DeleteTexture( unsigned iTexHandle );
void DeleteTexture( uintptr_t iTexHandle );
bool UseOffscreenRenderTarget();
RageSurface *GetTexture( unsigned iTexture );
RageSurface *GetTexture( uintptr_t iTexture );
RageTextureLock *CreateTextureLock();
void ClearAllTextures();
int GetNumTextureUnits();
void SetTexture( TextureUnit tu, unsigned iTexture );
void SetTexture( TextureUnit tu, uintptr_t iTexture );
void SetTextureMode( TextureUnit tu, TextureMode tm );
void SetTextureWrapping( TextureUnit tu, bool b );
int GetMaxTextureSize() const;
@@ -78,9 +78,9 @@ public:
bool IsEffectModeSupported( EffectMode effect );
bool SupportsRenderToTexture() const;
bool SupportsFullscreenBorderlessWindow() const;
unsigned CreateRenderTarget( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned GetRenderTarget();
void SetRenderTarget( unsigned iHandle, bool bPreserveTexture );
uintptr_t CreateRenderTarget( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
uintptr_t GetRenderTarget();
void SetRenderTarget( uintptr_t iHandle, bool bPreserveTexture );
bool IsZWriteEnabled() const;
bool IsZTestEnabled() const;
void SetZWrite( bool b );
+1 -1
View File
@@ -28,7 +28,7 @@ public:
virtual ~RenderTarget() { }
virtual void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut ) = 0;
virtual unsigned GetTexture() const = 0;
virtual uintptr_t GetTexture() const = 0;
/* Render to this RenderTarget. */
virtual void StartRenderingTo() = 0;
+1 -1
View File
@@ -15,7 +15,7 @@ public:
virtual void Update( float /* fDeltaTime */ ) {}
virtual void Reload() {}
virtual void Invalidate() { } /* only called by RageTextureManager::InvalidateTextures */
virtual unsigned GetTexHandle() const = 0; // accessed by RageDisplay
virtual uintptr_t GetTexHandle() const = 0; // accessed by RageDisplay
// movie texture/animated texture stuff
virtual void SetPosition( float /* fSeconds */ ) {} // seek
+2 -2
View File
@@ -132,10 +132,10 @@ public:
m_iImageWidth = m_iImageHeight = 1;
CreateFrameRects();
}
unsigned GetTexHandle() const { return m_uTexHandle; }
uintptr_t GetTexHandle() const { return m_uTexHandle; }
private:
unsigned m_uTexHandle;
uintptr_t m_uTexHandle;
};
// Load and unload textures from disk.
+3 -3
View File
@@ -14,7 +14,7 @@ public:
virtual ~RageTextureRenderTarget();
virtual void Invalidate() { m_iTexHandle = 0; /* don't Destroy() */ }
virtual void Reload();
virtual unsigned GetTexHandle() const { return m_iTexHandle; }
virtual uintptr_t GetTexHandle() const { return m_iTexHandle; }
void BeginRenderingTo( bool bPreserveTexture = true );
void FinishRenderingTo();
@@ -26,8 +26,8 @@ private:
void Create();
void Destroy();
unsigned m_iTexHandle;
unsigned m_iPreviousRenderTarget;
uintptr_t m_iTexHandle;
uintptr_t m_iPreviousRenderTarget;
};
#endif
+2
View File
@@ -31,8 +31,10 @@ inline float max( float a, int b ) { return a > b? a:b; }
inline float max( int a, float b ) { return a > b? a:b; }
inline unsigned long min( unsigned int a, unsigned long b ) { return a < b? a:b; }
inline unsigned long min( unsigned long a, unsigned int b ) { return a < b? a:b; }
inline unsigned long long min( unsigned int a, unsigned long long b ) { return a < b? a:b; }
inline unsigned long max( unsigned int a, unsigned long b ) { return a > b? a:b; }
inline unsigned long max( unsigned long a, unsigned int b ) { return a > b? a:b; }
inline unsigned long long max( unsigned int a, unsigned long long b ) { return a > b? a:b; }
/** @brief If outside the range from low to high, bring it within range. */
#define clamp(val,low,high) ( max( (low), min((val),(high)) ) )
+3 -3
View File
@@ -29,7 +29,7 @@ static RString g_sMessage;
static bool g_bAllowHush;
#if !defined(SMPACKAGE)
static BOOL CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
static INT_PTR CALLBACK OKWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
@@ -139,7 +139,7 @@ Dialog::Result DialogDriver_Win32::OKCancel( RString sMessage, RString sID )
#if !defined(SMPACKAGE)
static RString g_sErrorString;
static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
static INT_PTR CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
@@ -208,7 +208,7 @@ static BOOL CALLBACK ErrorWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
}
// TODO: Return a different brush if the default is not desired
return (BOOL)hbr;
return reinterpret_cast<INT_PTR>(hbr);
}
}
return FALSE;
@@ -11,7 +11,7 @@
REGISTER_INPUT_HANDLER_CLASS2( MIDI, Win32_MIDI );
static HMIDIIN g_device;
static void CALLBACK midiCallback(HMIDIIN g_device, UINT status, DWORD instancePtr, DWORD data, DWORD timestamp);
static void CALLBACK midiCallback(HMIDIIN g_device, UINT status, DWORD_PTR instancePtr, DWORD_PTR data, DWORD_PTR timestamp);
static RString GetMidiError( MMRESULT result )
{
@@ -33,7 +33,7 @@ InputHandler_Win32_MIDI::InputHandler_Win32_MIDI()
}
m_bFoundDevice = true;
MMRESULT result = midiInOpen( &g_device, device_id, (DWORD) &midiCallback, (DWORD) this, CALLBACK_FUNCTION );
MMRESULT result = midiInOpen( &g_device, device_id, reinterpret_cast<DWORD_PTR>(&midiCallback), reinterpret_cast<DWORD_PTR>(this), CALLBACK_FUNCTION );
if( result != MMSYSERR_NOERROR )
{
LOG->Warn( "Error opening MIDI device: %s", GetMidiError(result).c_str() );
@@ -75,7 +75,7 @@ void InputHandler_Win32_MIDI::GetDevicesAndDescriptions( vector<InputDeviceInfo>
}
}
static void CALLBACK midiCallback( HMIDIIN device, UINT status, DWORD instancePtr, DWORD data, DWORD timestamp )
static void CALLBACK midiCallback( HMIDIIN device, UINT status, DWORD_PTR instancePtr, DWORD_PTR data, DWORD_PTR timestamp )
{
if( status == MIM_DATA )
{
@@ -91,7 +91,7 @@ static void CALLBACK midiCallback( HMIDIIN device, UINT status, DWORD instancePt
{
DeviceInput di = DeviceInput( DEVICE_MIDI, enum_add2(MIDI_FIRST, iChannel), iValue > 0 );
di.ts.Touch();
((InputHandler_Win32_MIDI *)instancePtr)->SetDev( di );
(reinterpret_cast<InputHandler_Win32_MIDI*>(instancePtr))->SetDev( di );
}
}
}
@@ -81,7 +81,7 @@ static HBITMAP LoadWin32Surface( RString sFile, HWND hWnd )
return ret;
}
BOOL CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
INT_PTR CALLBACK LoadingWindow_Win32::WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
{
switch( msg )
{
@@ -118,8 +118,7 @@ void LoadingWindow_Win32::SetIcon( const RageSurface *pIcon )
m_hIcon = IconFromSurface( pIcon );
if( m_hIcon != nullptr )
// XXX: GCL_HICON isn't available on x86-64 Windows
SetClassLong( hwnd, GCL_HICON, (LONG) m_hIcon );
SetClassLongPtrA( hwnd, GCLP_HICON, reinterpret_cast<LONG_PTR>(m_hIcon) );
}
void LoadingWindow_Win32::SetSplash( const RageSurface *pSplash )
+1 -1
View File
@@ -27,7 +27,7 @@ private:
RString text[3];
HICON m_hIcon;
static BOOL CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
static INT_PTR CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam );
};
#define USE_LOADING_WINDOW_WIN32
@@ -188,7 +188,7 @@ public:
RenderTarget_MacOSX( id shareContext );
~RenderTarget_MacOSX();
void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned GetTexture() const { return m_iTexHandle; }
uintptr_t GetTexture() const { return static_cast<uintptr_t>(m_iTexHandle); }
void StartRenderingTo();
void FinishRenderingTo();
@@ -323,7 +323,7 @@ public:
virtual ~RenderTarget_Win32();
void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned int GetTexture() const { return m_texHandle; }
uintptr_t GetTexture() const { return static_cast<uintptr_t>(m_texHandle); }
void StartRenderingTo();
void FinishRenderingTo();
@@ -758,7 +758,7 @@ public:
~RenderTarget_X11();
void Create( const RenderTargetParam &param, int &iTextureWidthOut, int &iTextureHeightOut );
unsigned GetTexture() const { return m_iTexHandle; }
uintptr_t GetTexture() const { return static_cast<uintptr_t>(m_iTexHandle); }
void StartRenderingTo();
void FinishRenderingTo();
@@ -770,7 +770,7 @@ private:
LowLevelWindow_X11 *m_pWind;
GLXPbuffer m_iPbuffer;
GLXContext m_pPbufferContext;
unsigned int m_iTexHandle;
GLuint m_iTexHandle;
GLXContext m_pOldContext;
GLXDrawable m_pOldDrawable;
@@ -145,7 +145,7 @@ public:
virtual void Invalidate() { m_uTexHandle = 0; }
virtual void Reload() { }
virtual unsigned GetTexHandle() const
virtual uintptr_t GetTexHandle() const
{
return m_uTexHandle;
}
@@ -168,7 +168,7 @@ private:
delete pSurface;
}
unsigned m_uTexHandle;
uintptr_t m_uTexHandle;
RageSurfaceFormat m_SurfaceFormat;
RagePixelFormat m_PixFmt;
};
@@ -449,7 +449,7 @@ void MovieTexture_Generic::UpdateFrame()
if( m_pTextureLock != nullptr )
{
int iHandle = m_pTextureIntermediate != nullptr? m_pTextureIntermediate->GetTexHandle(): this->GetTexHandle();
uintptr_t iHandle = m_pTextureIntermediate != nullptr? m_pTextureIntermediate->GetTexHandle(): this->GetTexHandle();
m_pTextureLock->Lock( iHandle, m_pSurface );
}
@@ -518,7 +518,7 @@ void MovieTexture_Generic::SetPosition( float fSeconds )
m_bWantRewind = true;
}
unsigned MovieTexture_Generic::GetTexHandle() const
uintptr_t MovieTexture_Generic::GetTexHandle() const
{
if( m_pRenderTarget != nullptr )
return m_pRenderTarget->GetTexHandle();
+2 -2
View File
@@ -93,7 +93,7 @@ public:
virtual void DecodeSeconds( float fSeconds );
virtual void SetPlaybackRate( float fRate ) { m_fRate = fRate; }
void SetLooping( bool bLooping=true ) { m_bLoop = bLooping; }
unsigned GetTexHandle() const;
uintptr_t GetTexHandle() const;
static EffectMode GetEffectMode( MovieDecoderPixelFormatYCbCr fmt );
@@ -110,7 +110,7 @@ private:
enum State { DECODER_QUIT, DECODER_RUNNING } m_State;
unsigned m_uTexHandle;
uintptr_t m_uTexHandle;
RageTextureRenderTarget *m_pRenderTarget;
RageTexture *m_pTextureIntermediate;
Sprite *m_pSprite;
+2 -2
View File
@@ -11,7 +11,7 @@ public:
MovieTexture_Null(RageTextureID ID);
virtual ~MovieTexture_Null();
void Invalidate() { texHandle = 0; }
unsigned GetTexHandle() const { return texHandle; }
uintptr_t GetTexHandle() const { return texHandle; }
void Update(float /* delta */) { }
void Reload() { }
void SetPosition(float /* seconds */) { }
@@ -21,7 +21,7 @@ public:
private:
bool playing;
bool loop;
unsigned texHandle;
uintptr_t texHandle;
};
MovieTexture_Null::MovieTexture_Null(RageTextureID ID) : RageMovieTexture(ID)
+51 -26
View File
@@ -85,7 +85,7 @@ void WriteToChild( HANDLE hPipe, const void *pData, size_t iSize )
while( iSize )
{
DWORD iActual;
if( !WriteFile(hPipe, pData, iSize, &iActual, nullptr) )
if( !WriteFile(hPipe, pData, static_cast<DWORD>(iSize), &iActual, nullptr) )
return;
iSize -= iActual;
}
@@ -114,7 +114,7 @@ bool StartChild( HANDLE &hProcess, HANDLE &hToStdin, HANDLE &hFromStdout )
SetHandleInformation( hFromStdout, HANDLE_FLAG_INHERIT, 0 );
}
char szBuf[256] = "";
char szBuf[MAX_PATH] = "";
GetModuleFileName( nullptr, szBuf, MAX_PATH );
strcat( szBuf, " " );
strcat( szBuf, CHILD_MAGIC_PARAMETER );
@@ -144,6 +144,7 @@ bool StartChild( HANDLE &hProcess, HANDLE &hToStdin, HANDLE &hFromStdout )
}
hProcess = pi.hProcess;
CloseHandle(pi.hThread);
return true;
}
@@ -209,13 +210,13 @@ void RunChild()
// 2. Write info.
const TCHAR *p = RageLog::GetInfo();
int iSize = strlen( p );
int iSize = static_cast<int>(strlen( p ));
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, p, iSize );
// 3. Write AdditionalLog.
p = RageLog::GetAdditionalLog();
iSize = strlen( p );
iSize = static_cast<int>(strlen( p ));
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, p, iSize );
@@ -228,7 +229,7 @@ void RunChild()
WriteToChild(hToStdin, &cnt, sizeof(cnt));
for( int i = 0; i < cnt; ++i )
{
iSize = strlen(ps[i])+1;
iSize = static_cast<int>(strlen(ps[i])) + 1;
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, ps[i], iSize );
}
@@ -236,13 +237,13 @@ void RunChild()
// 5. Write CHECKPOINTs.
static TCHAR buf[1024*32];
Checkpoints::GetLogs( buf, sizeof(buf), "$$" );
iSize = strlen( buf )+1;
iSize = static_cast<int>(strlen( buf )) + 1;
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, buf, iSize );
// 6. Write the crashed thread's name.
p = RageThread::GetCurrentThreadName();
iSize = strlen( p )+1;
iSize = static_cast<int>(strlen( p )) + 1;
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, p, iSize );
@@ -260,13 +261,13 @@ void RunChild()
TCHAR szName[MAX_PATH];
if( !CrashGetModuleBaseName(hMod, szName) )
strcpy( szName, "???" );
iSize = strlen( szName );
iSize = static_cast<int>(strlen( szName ));
WriteToChild( hToStdin, &iSize, sizeof(iSize) );
WriteToChild( hToStdin, szName, iSize );
}
}
static long MainExceptionHandler( EXCEPTION_POINTERS *pExc )
static DWORD WINAPI MainExceptionHandler( LPVOID lpParameter )
{
// Flush the log so it isn't cut off at the end.
/* 1. We can't do regular file access in the crash handler.
@@ -283,6 +284,7 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc )
* does this exception occur, and we never unmask it.
* However, once in a while some driver or library turns evil and unmasks an
* exception flag on us. If this happens, re-mask it and continue execution. */
PEXCEPTION_POINTERS pExc = reinterpret_cast<PEXCEPTION_POINTERS>(lpParameter);
switch( pExc->ExceptionRecord->ExceptionCode )
{
case EXCEPTION_FLT_INVALID_OPERATION:
@@ -291,7 +293,11 @@ static long MainExceptionHandler( EXCEPTION_POINTERS *pExc )
case EXCEPTION_FLT_OVERFLOW:
case EXCEPTION_FLT_UNDERFLOW:
case EXCEPTION_FLT_INEXACT_RESULT:
#if _WIN64
pExc->ContextRecord->FltSave.ControlWord |= 0x3F;
#else
pExc->ContextRecord->FloatSave.ControlWord |= 0x3F;
#endif
return EXCEPTION_CONTINUE_EXECUTION;
}
@@ -361,20 +367,19 @@ long __stdcall CrashHandler::ExceptionHandler( EXCEPTION_POINTERS *pExc )
/* If the stack overflowed, we have a very limited amount of stack space.
* Allocate a new stack, and run the exception handler in it, to increase
* the chances of success. */
int iSize = 1024*32;
char *pStack = (char *) VirtualAlloc( nullptr, iSize, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE );
pStack += iSize;
// FIXME: This will probably explode on x86-64
#if defined(_MSC_VER)
_asm mov esp, pStack;
#elif defined(__GNUC__)
asm volatile ("movl %%esp, %0\n\t"
:
: "r" (pStack)
);
#endif
HANDLE hExceptionHandler = CreateThread(nullptr, 1024 * 32, MainExceptionHandler, reinterpret_cast<LPVOID>(pExc), 0, nullptr);
if (hExceptionHandler == NULL)
{
TerminateProcess(GetCurrentProcess(), 0);
return EXCEPTION_EXECUTE_HANDLER;
}
WaitForSingleObject(hExceptionHandler, INFINITE);
return MainExceptionHandler( pExc );
DWORD ret;
GetExitCodeThread(hExceptionHandler, &ret);
CloseHandle(hExceptionHandler);
return static_cast<long>(ret);
}
//////////////////////////////////////////////////////////////////////////////
@@ -449,7 +454,7 @@ static bool IsExecutableProtection(DWORD dwProtect) {
return false;
}
static bool PointsToValidCall( unsigned long ptr )
static bool PointsToValidCall( ULONG_PTR ptr )
{
char buf[7];
int len = 7;
@@ -473,9 +478,15 @@ void CrashHandler::do_backtrace( const void **buf, size_t size,
* due to stack corruption, we might not be able to get any frames from the
* stack. Pull it out of pContext->Eip, which is always valid, and then
* discard the first stack frame if it's the same. */
#if _WIN64
if( buf+1 != pLast && pContext->Rip != 0 )
{
*buf = (void *) pContext->Rip;
#else
if( buf+1 != pLast && pContext->Eip != 0 )
{
*buf = (void *) pContext->Eip;
#endif
++buf;
}
@@ -489,15 +500,21 @@ void CrashHandler::do_backtrace( const void **buf, size_t size,
return;
}
const NT_TIB *tib = (NT_TIB *) ((sel.HighWord.Bits.BaseHi<<24)+(sel.HighWord.Bits.BaseMid<<16)+sel.BaseLow);
const NT_TIB *tib = reinterpret_cast<NT_TIB *>(((static_cast<DWORD_PTR>(sel.HighWord.Bits.BaseHi) << 24) + (static_cast<DWORD_PTR>(sel.HighWord.Bits.BaseMid) << 16) + sel.BaseLow));
const NT_TIB *pTib = tib->Self;
pStackBase = (char *)pTib->StackBase;
}
// Walk up the stack.
#if _WIN64
const char *lpAddr = (const char *)pContext->Rsp;
const void *data = (void *) pContext->Rip;
#else
const char *lpAddr = (const char *)pContext->Esp;
const void *data = (void *) pContext->Eip;
#endif
do {
if( buf == pLast )
break;
@@ -506,7 +523,11 @@ void CrashHandler::do_backtrace( const void **buf, size_t size,
/* The first entry is usually EIP. We already logged it; skip it, so we don't always
* show the first frame twice. */
#if _WIN64
if( bFirst && data == (void *) pContext->Rip )
#else
if( bFirst && data == (void *) pContext->Eip )
#endif
fValid = false;
bFirst = false;
@@ -518,7 +539,11 @@ void CrashHandler::do_backtrace( const void **buf, size_t size,
if (!IsExecutableProtection(meminfo.Protect) || meminfo.State!=MEM_COMMIT)
fValid = false;
if ( data != (void *) pContext->Eip && !PointsToValidCall((unsigned long)data) )
#if _WIN64
if ( data != (void *) pContext->Rip && !PointsToValidCall(reinterpret_cast<ULONG_PTR>(data)) )
#else
if ( data != (void *) pContext->Eip && !PointsToValidCall(reinterpret_cast<ULONG_PTR>(data)) )
#endif
fValid = false;
}
@@ -589,7 +614,7 @@ void CrashHandler::ForceDeadlock( RString reason, uint64_t iID )
context.ContextFlags = CONTEXT_FULL;
if( !GetThreadContext( hThread, &context ) )
wsprintf( g_CrashInfo.m_CrashReason + strlen(g_CrashInfo.m_CrashReason),
"; GetThreadContext(%x) failed", (int) hThread );
"; GetThreadContext(%Ix) failed", reinterpret_cast<uintptr_t>(hThread) );
else
{
static const void *BacktracePointers[BACKTRACE_MAX_SIZE];
+50 -39
View File
@@ -36,6 +36,12 @@
// XXX: What happens when we *don't* have version info? Does that ever actually happen?
#include "ver.h"
#if _WIN64
#define ADDRESS_ZEROS "016"
#else
#define ADDRESS_ZEROS "08"
#endif
// VDI symbol lookup:
namespace VDDebugInfo
{
@@ -48,10 +54,10 @@ namespace VDDebugInfo
int nBuildNumber;
const unsigned char *pRVAHeap;
unsigned nFirstRVA;
uintptr_t nFirstRVA;
const char *pFuncNameHeap;
const unsigned long (*pSegments)[2];
const uintptr_t (*pSegments)[2];
int nSegments;
char sFilename[1024];
RString sError;
@@ -98,13 +104,18 @@ namespace VDDebugInfo
// Extract fields
src += 64;
const int* pVer = reinterpret_cast<const int*>(src);
const size_t* pRVASize = reinterpret_cast<const size_t*>(src + sizeof(int));
const size_t* pFNamSize = reinterpret_cast<const size_t*>(src + sizeof(int) + sizeof(size_t));
const int* pSegCnt = reinterpret_cast<const int*>(src + sizeof(int) + 2 * sizeof(size_t));
src += 2 * (sizeof(int) + sizeof(size_t));
pctx->nBuildNumber = *(int *)src;
pctx->pRVAHeap = (const unsigned char *)(src + 20);
pctx->nFirstRVA = *(const long *)(src + 16);
pctx->pFuncNameHeap = (const char *)pctx->pRVAHeap - 4 + *(const long *)(src + 4);
pctx->pSegments = (unsigned long (*)[2])(pctx->pFuncNameHeap + *(const long *)(src + 8));
pctx->nSegments = *(const long *)(src + 12);
pctx->nBuildNumber = *pVer;
pctx->pRVAHeap = reinterpret_cast<const unsigned char*>(src + sizeof(uintptr_t));
pctx->nFirstRVA = *reinterpret_cast<const uintptr_t*>(src);
pctx->pFuncNameHeap = reinterpret_cast<const char*>(src + *pRVASize);
pctx->pSegments = reinterpret_cast<const uintptr_t(*)[2]>(src + *pRVASize + *pFNamSize);
pctx->nSegments = *pSegCnt;
return true;
}
@@ -137,7 +148,7 @@ namespace VDDebugInfo
if( dwFileSize == INVALID_FILE_SIZE )
break;
char *buffer = new char[dwFileSize + 1];
char *buffer = new char[static_cast<size_t>(dwFileSize) + 1];
std::fill(buffer, buffer + dwFileSize + 1, '\0' );
DWORD dwActual;
@@ -157,7 +168,7 @@ namespace VDDebugInfo
return false;
}
static bool PointerIsInAnySegment( const Context *pctx, unsigned rva )
static bool PointerIsInAnySegment( const Context *pctx, uintptr_t rva )
{
for( int i=0; i<pctx->nSegments; ++i )
{
@@ -168,7 +179,7 @@ namespace VDDebugInfo
return false;
}
static const char *GetNameFromHeap(const char *heap, int idx)
static const char *GetNameFromHeap(const char *heap, size_t idx)
{
while(idx--)
while(*heap++);
@@ -176,25 +187,25 @@ namespace VDDebugInfo
return heap;
}
long VDDebugInfoLookupRVA( const Context *pctx, unsigned rva, char *buf, int buflen )
intptr_t VDDebugInfoLookupRVA( const Context *pctx, uintptr_t rva, char *buf, int buflen )
{
if( !PointerIsInAnySegment(pctx, rva) )
return -1;
const unsigned char *pr = pctx->pRVAHeap;
const unsigned char *pr_limit = (const unsigned char *)pctx->pFuncNameHeap;
int idx = 0;
size_t idx = 0;
// Linearly unpack RVA deltas and find lower_bound
rva -= pctx->nFirstRVA;
if( (signed)rva < 0 )
if( static_cast<intptr_t>(rva) < 0 )
return -1;
while( pr < pr_limit )
{
unsigned char c;
unsigned diff = 0;
uintptr_t diff = 0;
do
{
@@ -205,7 +216,7 @@ namespace VDDebugInfo
rva -= diff;
if ((signed)rva < 0) {
if (static_cast<intptr_t>(rva) < 0) {
rva += diff;
break;
}
@@ -224,7 +235,7 @@ namespace VDDebugInfo
strncpy( buf, fn_name, buflen );
buf[buflen-1] = 0;
return rva;
return static_cast<intptr_t>(rva);
}
}
@@ -234,7 +245,7 @@ bool ReadFromParent( int fd, void *p, int size )
int got = 0;
while( got < size )
{
int ret = read( fd, buf+got, size-got );
int ret = _read( fd, buf+got, size-got );
if( ret == -1 )
{
if( errno == EINTR )
@@ -277,7 +288,7 @@ namespace SymbolLookup
return true;
}
SYMBOL_INFO *GetSym( unsigned long ptr, DWORD64 &disp )
SYMBOL_INFO *GetSym( uintptr_t ptr, DWORD64 &disp )
{
InitDbghelp();
@@ -322,16 +333,16 @@ namespace SymbolLookup
RString CrashChildGetModuleBaseName( HMODULE hMod )
{
write( _fileno(stdout), &hMod, sizeof(hMod) );
_write( _fileno(stdout), &hMod, sizeof(hMod) );
int iFD = fileno(stdin);
int iFD = _fileno(stdin);
int iSize;
if (!ReadFromParent(iFD, &iSize, sizeof(iSize)))
{
return "???";
}
RString sName;
char *buffer = new char[iSize + 1];
char *buffer = new char[static_cast<size_t>(iSize) + 1];
std::fill(buffer, buffer + iSize + 1, '\0');
if (!ReadFromParent(iFD, buffer, iSize))
{
@@ -357,12 +368,12 @@ namespace SymbolLookup
VirtualQueryEx( g_hParent, ptr, &meminfo, sizeof meminfo );
char tmp[512];
long iAddress = VDDebugInfo::VDDebugInfoLookupRVA(pctx, (unsigned int)ptr, tmp, sizeof(tmp));
intptr_t iAddress = VDDebugInfo::VDDebugInfoLookupRVA(pctx, reinterpret_cast<uintptr_t>(ptr), tmp, sizeof(tmp));
if( iAddress >= 0 )
{
wsprintf( buf, "%08x: %s [%08lx+%lx+%lx]", ptr, Demangle(tmp),
wsprintf( buf, "%" ADDRESS_ZEROS "Ix: %s [%" ADDRESS_ZEROS "Ix+%Ix+%Ix]", reinterpret_cast<uintptr_t>(ptr), Demangle(tmp),
pctx->nFirstRVA,
((unsigned int) ptr) - pctx->nFirstRVA - iAddress,
reinterpret_cast<uintptr_t>(ptr) - pctx->nFirstRVA - iAddress,
iAddress );
return;
}
@@ -370,21 +381,21 @@ namespace SymbolLookup
RString sName = CrashChildGetModuleBaseName( (HMODULE)meminfo.AllocationBase );
DWORD64 disp;
SYMBOL_INFO *pSymbol = GetSym( (unsigned int)ptr, disp );
SYMBOL_INFO *pSymbol = GetSym( reinterpret_cast<uintptr_t>(ptr), disp );
if( pSymbol )
{
wsprintf( buf, "%08lx: %s!%s [%08lx+%lx+%lx]",
(unsigned long) ptr, sName.c_str(), pSymbol->Name,
(unsigned long) meminfo.AllocationBase,
(unsigned long) (pSymbol->Address) - (unsigned long) (meminfo.AllocationBase),
(unsigned long) disp);
wsprintf( buf, "%" ADDRESS_ZEROS "Ix: %s!%s [%" ADDRESS_ZEROS "Ix+%Ix+%Ix]",
reinterpret_cast<uintptr_t>(ptr), sName.c_str(), pSymbol->Name,
reinterpret_cast<uintptr_t>(meminfo.AllocationBase),
static_cast<uintptr_t>(pSymbol->Address) - reinterpret_cast<uintptr_t>(meminfo.AllocationBase),
static_cast<ULONG_PTR>(disp));
return;
}
wsprintf( buf, "%08lx: %s!%08lx",
(unsigned long) ptr, sName.c_str(),
(unsigned long) meminfo.AllocationBase );
wsprintf( buf, "%" ADDRESS_ZEROS "Ix: %s!%" ADDRESS_ZEROS "Ix",
reinterpret_cast<uintptr_t>(ptr), sName.c_str(),
reinterpret_cast<uintptr_t>(meminfo.AllocationBase) );
}
}
@@ -518,7 +529,7 @@ bool ReadCrashDataFromParent( int iFD, CompleteCrashData &Data )
if( !ReadFromParent(iFD, &iSize, sizeof(iSize)) )
return false;
char *buffer = new char[iSize + 1];
char *buffer = new char[static_cast<size_t>(iSize) + 1];
std::fill(buffer, buffer + iSize + 1, '\0');
bool wasReadSuccessful = ReadFromParent(iFD, buffer, iSize);
RString tmp = buffer;
@@ -643,7 +654,7 @@ public:
~CrashDialog();
protected:
virtual BOOL HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam );
virtual INT_PTR HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam );
private:
void SetDialogInitial();
@@ -677,7 +688,7 @@ void CrashDialog::SetDialogInitial()
ShowWindow( GetDlgItem(hDlg, IDC_BUTTON_AUTO_REPORT), true );
}
BOOL CrashDialog::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam )
INT_PTR CrashDialog::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam )
{
HWND hDlg = GetHwnd();
@@ -706,7 +717,7 @@ BOOL CrashDialog::HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam )
}
// TODO: Return a different brush if the default is not desired
return (BOOL)hbr;
return reinterpret_cast<INT_PTR>(hbr);
}
case WM_COMMAND:
@@ -861,7 +872,7 @@ void ChildProcess()
{
// Read the crash data from the crashed parent.
CompleteCrashData Data;
ReadCrashDataFromParent( fileno(stdin), Data );
ReadCrashDataFromParent( _fileno(stdin), Data );
RString sCrashReport;
VDDebugInfo::VDDebugInfoInitFromFile( &g_debugInfo );
+1 -1
View File
@@ -25,7 +25,7 @@ static LONG GetRegKey( HKEY key, RString subkey, LPTSTR retdata )
bool GotoURL( RString sUrl )
{
// First try ShellExecute()
int iRet = (int) ShellExecute( nullptr, "open", sUrl, nullptr, nullptr, SW_SHOWDEFAULT );
intptr_t iRet = reinterpret_cast<intptr_t>(ShellExecute( nullptr, "open", sUrl, nullptr, nullptr, SW_SHOWDEFAULT ));
// If it failed, get the .htm regkey and lookup the program
if( iRet > 32 )
+2 -2
View File
@@ -321,13 +321,13 @@ void GraphicsWindow::CreateGraphicsWindow( const VideoModeParams &p, bool bForce
// Update the window icon.
if( g_hIcon != nullptr )
{
SetClassLong( g_hWndMain, GCL_HICON, (LONG) LoadIcon(nullptr,IDI_APPLICATION) );
SetClassLongPtrA( g_hWndMain, GCLP_HICON, reinterpret_cast<LONG_PTR>(LoadIcon(nullptr,IDI_APPLICATION)) );
DestroyIcon( g_hIcon );
g_hIcon = nullptr;
}
g_hIcon = IconFromFile( p.sIconFile );
if( g_hIcon != nullptr )
SetClassLong( g_hWndMain, GCL_HICON, (LONG) g_hIcon );
SetClassLongPtrA( g_hWndMain, GCLP_HICON, reinterpret_cast<LONG_PTR>(g_hIcon) );
/* The window style may change as a result of switching to or from fullscreen;
* apply it. Don't change the WS_VISIBLE bit. */
+1 -1
View File
@@ -15,7 +15,7 @@ void WindowsDialogBox::Run( int iDialog )
DialogBoxParam( hHandle, MAKEINTRESOURCE(iDialog), nullptr, DlgProc, (LPARAM) this );
}
BOOL APIENTRY WindowsDialogBox::DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
INT_PTR APIENTRY WindowsDialogBox::DlgProc( HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam )
{
if( msg == WM_INITDIALOG )
SetProp( hDlg, "WindowsDialogBox", (HANDLE) lParam );
+2 -2
View File
@@ -15,10 +15,10 @@ public:
HWND GetHwnd() { return m_hWnd; }
protected:
virtual BOOL HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return false; }
virtual INT_PTR HandleMessage( UINT msg, WPARAM wParam, LPARAM lParam ) { return false; }
private:
static BOOL APIENTRY DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR APIENTRY DlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
HWND m_hWnd;
};
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More