Merge pull request #202 from scribam/clang-tidy

clang-tidy: fix some checks
This commit is contained in:
flyinghead 2021-03-14 08:39:00 +01:00 committed by GitHub
commit a60ed281a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
54 changed files with 322 additions and 323 deletions

View File

@ -33,13 +33,13 @@ public:
memset(&archiveStream, 0, sizeof(archiveStream));
memset(&lookStream, 0, sizeof(lookStream));
}
virtual ~SzArchive();
~SzArchive() override;
virtual ArchiveFile* OpenFile(const char* name) override;
virtual ArchiveFile *OpenFileByCrc(u32 crc) override;
ArchiveFile* OpenFile(const char* name) override;
ArchiveFile *OpenFileByCrc(u32 crc) override;
private:
virtual bool Open(const char* path) override;
bool Open(const char* path) override;
CSzArEx szarchive;
UInt32 block_idx; /* it can have any value before first call (if outBuffer = 0) */
@ -54,7 +54,7 @@ class SzArchiveFile : public ArchiveFile
{
public:
SzArchiveFile(u8 *data, u32 offset, u32 length) : data(data), offset(offset), length(length) {}
virtual u32 Read(void *buffer, u32 length) override
u32 Read(void *buffer, u32 length) override
{
length = std::min(length, this->length);
memcpy(buffer, data + offset, length);

View File

@ -27,13 +27,13 @@ class ZipArchive : public Archive
{
public:
ZipArchive() : zip(NULL) {}
virtual ~ZipArchive();
~ZipArchive() override;
virtual ArchiveFile* OpenFile(const char* name) override;
virtual ArchiveFile* OpenFileByCrc(u32 crc) override;
ArchiveFile* OpenFile(const char* name) override;
ArchiveFile* OpenFileByCrc(u32 crc) override;
private:
virtual bool Open(const char* path) override;
bool Open(const char* path) override;
struct zip *zip;
};
@ -42,8 +42,8 @@ class ZipArchiveFile : public ArchiveFile
{
public:
ZipArchiveFile(struct zip_file *zip_file) : zip_file(zip_file) {}
virtual ~ZipArchiveFile() { zip_fclose(zip_file); }
virtual u32 Read(void* buffer, u32 length) override;
~ZipArchiveFile() override { zip_fclose(zip_file); }
u32 Read(void* buffer, u32 length) override;
private:
struct zip_file *zip_file;

View File

@ -110,12 +110,12 @@ public:
settings.options.push_back(this);
}
virtual void reset() override {
void reset() override {
set(defaultValue);
overridden = false;
}
virtual void load() override {
void load() override {
if (PerGameOption && settings.hasPerGameConfig())
set(doLoad(settings.getGameId(), section + "." + name));
else
@ -126,7 +126,7 @@ public:
}
}
virtual void save() const override
void save() const override
{
if (overridden) {
if (value == overriddenDefault)
@ -320,14 +320,14 @@ public:
}
RenderType& operator=(const RenderType& v) { set(v); return value; }
virtual void load() override {
void load() override {
RenderType current = value;
Option<RenderType>::load();
newValue = value;
value = current;
}
virtual void reset() override {
void reset() override {
RenderType current = value;
Option<RenderType>::reset();
newValue = value;

View File

@ -18,7 +18,7 @@ void update_e68k()
{
//Set the pending signal
//Is L register held here too ?
e68k_out=1;
e68k_out=true;
e68k_reg_L=aica_reg_L;
update_armintc();

View File

@ -1035,7 +1035,7 @@ static void rtl8139_BasicModeCtrl_write(RTL8139State *s, uint32_t val)
/* mask unwritable bits */
uint32_t mask = 0xccff;
if (1 || !rtl8139_config_writable(s))
if (true || !rtl8139_config_writable(s))
{
/* Speed setting and autonegotiation enable bits are read-only */
mask |= 0x3000;

View File

@ -146,13 +146,13 @@ struct SRamChip : MemChip
}
}
virtual bool Serialize(void **data, unsigned int *total_size) override
bool Serialize(void **data, unsigned int *total_size) override
{
REICAST_SA(&this->data[write_protect_size], size - write_protect_size);
return true;
}
virtual bool Unserialize(void **data, unsigned int *total_size) override
bool Unserialize(void **data, unsigned int *total_size) override
{
REICAST_USA(&this->data[write_protect_size], size - write_protect_size);
return true;
@ -255,7 +255,7 @@ struct DCFlashChip : MemChip
};
FlashState state;
virtual void Reset() override
void Reset() override
{
//reset the flash chip state
state = FS_Normal;
@ -750,14 +750,14 @@ private:
return result;
}
virtual bool Serialize(void **data, unsigned int *total_size) override
bool Serialize(void **data, unsigned int *total_size) override
{
REICAST_S(state);
REICAST_SA(&this->data[write_protect_size], size - write_protect_size);
return true;
}
virtual bool Unserialize(void **data, unsigned int *total_size) override
bool Unserialize(void **data, unsigned int *total_size) override
{
REICAST_US(state);
REICAST_USA(&this->data[write_protect_size], size - write_protect_size);

View File

@ -79,7 +79,7 @@ struct maple_sega_controller: maple_base
return 0x80; // unused
}
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_SegaController;
}
@ -94,7 +94,7 @@ struct maple_sega_controller: maple_base
return maple_sega_brand;
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
//printf("maple_sega_controller::dma Called 0x%X;Command %d\n", bus_id, cmd);
switch (cmd)
@ -181,7 +181,7 @@ struct maple_sega_controller: maple_base
struct maple_atomiswave_controller: maple_sega_controller
{
virtual u32 get_capabilities() override {
u32 get_capabilities() override {
// byte 0: 0 0 0 0 0 0 0 0
// byte 1: 0 0 a5 a4 a3 a2 a1 a0
// byte 2: R2 L2 D2 U2 D X Y Z
@ -190,11 +190,11 @@ struct maple_atomiswave_controller: maple_sega_controller
return 0xff663f00; // 6 analog axes, X Y L2/D2(?) A B C Start U D L R
}
virtual u32 transform_kcode(u32 kcode) override {
u32 transform_kcode(u32 kcode) override {
return kcode | AWAVE_TRIGGER_KEY;
}
virtual u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
if (index < 2 || index > 5)
return 0x80;
index -= 2;
@ -207,7 +207,7 @@ struct maple_atomiswave_controller: maple_sega_controller
*/
struct maple_sega_twinstick: maple_sega_controller
{
virtual u32 get_capabilities() override {
u32 get_capabilities() override {
// byte 0: 0 0 0 0 0 0 0 0
// byte 1: 0 0 a5 a4 a3 a2 a1 a0
// byte 2: R2 L2 D2 U2 D X Y Z
@ -216,19 +216,19 @@ struct maple_sega_twinstick: maple_sega_controller
return 0xfefe0000; // no analog axes, X Y A B D Start U/D/L/R U2/D2/L2/R2
}
virtual u32 transform_kcode(u32 kcode) override {
u32 transform_kcode(u32 kcode) override {
return kcode | 0x0101;
}
virtual MapleDeviceType get_device_type() override {
MapleDeviceType get_device_type() override {
return MDT_TwinStick;
}
virtual u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
return 0x80;
}
virtual const char *get_device_name() override {
const char *get_device_name() override {
return maple_sega_twinstick_name;
}
};
@ -239,7 +239,7 @@ struct maple_sega_twinstick: maple_sega_controller
*/
struct maple_ascii_stick: maple_sega_controller
{
virtual u32 get_capabilities() override {
u32 get_capabilities() override {
// byte 0: 0 0 0 0 0 0 0 0
// byte 1: 0 0 a5 a4 a3 a2 a1 a0
// byte 2: R2 L2 D2 U2 D X Y Z
@ -248,19 +248,19 @@ struct maple_ascii_stick: maple_sega_controller
return 0xff070000; // no analog axes, X Y Z A B C Start U/D/L/R
}
virtual u32 transform_kcode(u32 kcode) override {
u32 transform_kcode(u32 kcode) override {
return kcode | 0xF800;
}
virtual MapleDeviceType get_device_type() override {
MapleDeviceType get_device_type() override {
return MDT_AsciiStick;
}
virtual u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
u32 get_analog_axis(int index, const PlainJoystickState &pjs) override {
return 0x80;
}
virtual const char *get_device_name() override {
const char *get_device_name() override {
return maple_ascii_stick_name;
}
};
@ -299,7 +299,7 @@ struct maple_sega_vmu: maple_base
u8 lcd_data[192];
u8 lcd_data_decoded[48*32];
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_SegaVMU;
}
@ -318,7 +318,7 @@ struct maple_sega_vmu: maple_base
return (rv == Z_OK && dec_sz == sizeof(flash_data));
}
virtual bool serialize(void **data, unsigned int *total_size) override
bool serialize(void **data, unsigned int *total_size) override
{
maple_base::serialize(data, total_size);
REICAST_SA(flash_data,128*1024);
@ -326,7 +326,7 @@ struct maple_sega_vmu: maple_base
REICAST_SA(lcd_data_decoded,48*32);
return true ;
}
virtual bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
{
maple_base::unserialize(data, total_size, version);
REICAST_USA(flash_data,128*1024);
@ -334,7 +334,7 @@ struct maple_sega_vmu: maple_base
REICAST_USA(lcd_data_decoded,48*32);
return true ;
}
virtual void OnSetup() override
void OnSetup() override
{
memset(flash_data, 0, sizeof(flash_data));
memset(lcd_data, 0, sizeof(lcd_data));
@ -388,11 +388,11 @@ struct maple_sega_vmu: maple_base
}
}
virtual ~maple_sega_vmu()
~maple_sega_vmu() override
{
if (file) std::fclose(file);
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
//printf("maple_sega_vmu::dma Called for port %d:%d, Command %d\n", bus_id, bus_port, cmd);
switch (cmd)
@ -701,17 +701,17 @@ struct maple_microphone: maple_base
bool sampling;
bool eight_khz;
virtual ~maple_microphone()
~maple_microphone() override
{
if (sampling)
StopAudioRecording();
}
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_Microphone;
}
virtual bool serialize(void **data, unsigned int *total_size) override
bool serialize(void **data, unsigned int *total_size) override
{
maple_base::serialize(data, total_size);
REICAST_S(gain);
@ -720,7 +720,7 @@ struct maple_microphone: maple_base
REICAST_SKIP(480 - sizeof(u32) - sizeof(bool) * 2);
return true;
}
virtual bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
{
if (sampling)
StopAudioRecording();
@ -733,14 +733,14 @@ struct maple_microphone: maple_base
StartAudioRecording(eight_khz);
return true;
}
virtual void OnSetup() override
void OnSetup() override
{
gain = 0xf;
sampling = false;
eight_khz = false;
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -880,12 +880,12 @@ struct maple_sega_purupuru : maple_base
u16 AST = 19, AST_ms = 5000;
u32 VIBSET;
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_PurupuruPack;
}
virtual bool serialize(void **data, unsigned int *total_size) override
bool serialize(void **data, unsigned int *total_size) override
{
maple_base::serialize(data, total_size);
REICAST_S(AST);
@ -893,7 +893,7 @@ struct maple_sega_purupuru : maple_base
REICAST_S(VIBSET);
return true ;
}
virtual bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override
{
maple_base::unserialize(data, total_size, version);
REICAST_US(AST);
@ -901,7 +901,7 @@ struct maple_sega_purupuru : maple_base
REICAST_US(VIBSET);
return true ;
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1024,12 +1024,12 @@ u8 kb_key[6]={0}; // normal keys pressed
struct maple_keyboard : maple_base
{
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_Keyboard;
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1129,7 +1129,7 @@ s32 mo_y_phy;
struct maple_mouse : maple_base
{
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_Mouse;
}
@ -1139,7 +1139,7 @@ struct maple_mouse : maple_base
return (u16)std::min(0x3FF, std::max(0, delta + 0x200));
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1223,12 +1223,12 @@ struct maple_lightgun : maple_base
return kcode | 0xFF01;
}
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_LightGun;
}
virtual u32 dma(u32 cmd) override
u32 dma(u32 cmd) override
{
switch (cmd)
{
@ -1296,7 +1296,7 @@ struct maple_lightgun : maple_base
}
}
virtual bool get_lightgun_pos() override
bool get_lightgun_pos() override
{
PlainJoystickState pjs;
config->GetInput(&pjs);
@ -1313,7 +1313,7 @@ struct maple_lightgun : maple_base
struct atomiswave_lightgun : maple_lightgun
{
virtual u32 transform_kcode(u32 kcode) override {
u32 transform_kcode(u32 kcode) override {
// No need for reload on AW
return (kcode & AWAVE_TRIGGER_KEY) == 0 ? ~AWAVE_BTN0_KEY : ~0;
}

View File

@ -246,7 +246,7 @@ struct maple_base: maple_device
}
virtual u32 dma(u32 cmd) = 0;
virtual u32 RawDma(u32* buffer_in, u32 buffer_in_len, u32* buffer_out)
u32 RawDma(u32* buffer_in, u32 buffer_in_len, u32* buffer_out) override
{
u32 command=buffer_in[0] &0xFF;
//Recipient address
@ -280,9 +280,9 @@ struct maple_naomi_jamma : maple_base
u32 jvs_receive_length[32] = { 0 };
maple_naomi_jamma();
virtual ~maple_naomi_jamma();
~maple_naomi_jamma() override;
virtual MapleDeviceType get_device_type() override
MapleDeviceType get_device_type() override
{
return MDT_NaomiJamma;
}
@ -299,9 +299,9 @@ struct maple_naomi_jamma : maple_base
void handle_86_subcommand();
virtual u32 RawDma(u32* buffer_in, u32 buffer_in_len, u32* buffer_out) override;
virtual u32 dma(u32 cmd) override { return 0; }
u32 RawDma(u32* buffer_in, u32 buffer_in_len, u32* buffer_out) override;
u32 dma(u32 cmd) override { return 0; }
virtual bool serialize(void **data, unsigned int *total_size) override;
virtual bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override;
bool serialize(void **data, unsigned int *total_size) override;
bool unserialize(void **data, unsigned int *total_size, serialize_version_enum version) override;
};

View File

@ -279,7 +279,7 @@ public:
output_count = 6;
}
protected:
virtual const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
};
@ -321,7 +321,7 @@ public:
output_count = 8;
}
protected:
virtual const char *get_id() override { return "SEGA ENTERPRISES,LTD.;837-13938 ENCORDER BD ;Ver0.01;99/08"; }
const char *get_id() override { return "SEGA ENTERPRISES,LTD.;837-13938 ENCORDER BD ;Ver0.01;99/08"; }
};
@ -339,7 +339,7 @@ public:
output_count = 22;
}
protected:
virtual const char *get_id() override { return "SEGA ENTERPRISES,LTD.;837-13844-01 I/O CNTL BD2 ;Ver1.00;99/07"; }
const char *get_id() override { return "SEGA ENTERPRISES,LTD.;837-13844-01 I/O CNTL BD2 ;Ver1.00;99/07"; }
};
@ -373,7 +373,7 @@ public:
{
}
protected:
virtual void read_digital_in(u16 *v) override
void read_digital_in(u16 *v) override
{
jvs_837_13844::read_digital_in(v);
@ -398,7 +398,7 @@ protected:
v[1] &= ~NAOMI_BTN2_KEY;
}
virtual void write_digital_out(int count, u8 *data) override {
void write_digital_out(int count, u8 *data) override {
if (count != 3)
return;
@ -448,7 +448,7 @@ public:
light_gun_count = 2;
}
protected:
virtual const char *get_id() override { return "namco ltd.;JYU-PCB;Ver1.00;JPN,2Coins 2Guns"; }
const char *get_id() override { return "namco ltd.;JYU-PCB;Ver1.00;JPN,2Coins 2Guns"; }
};
// Mazan
@ -467,9 +467,9 @@ public:
encoder_count = 2;
}
protected:
virtual const char *get_id() override { return "namco ltd.;FCB;Ver1.0;JPN,Touch Panel & Multipurpose"; }
const char *get_id() override { return "namco ltd.;FCB;Ver1.0;JPN,Touch Panel & Multipurpose"; }
virtual u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
if (init_in_progress)
return 0;
player_num = std::min(player_num, (int)ARRAY_SIZE(mo_x_abs));
@ -495,7 +495,7 @@ public:
encoder_count = 2;
}
protected:
virtual const char *get_id() override { return "namco ltd.;FCA-1;Ver1.01;JPN,Multipurpose + Rotary Encoder"; }
const char *get_id() override { return "namco ltd.;FCA-1;Ver1.01;JPN,Multipurpose + Rotary Encoder"; }
};
// World Kicks
@ -512,9 +512,9 @@ public:
output_count = 6;
}
protected:
virtual const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
virtual void read_digital_in(u16 *v) override
void read_digital_in(u16 *v) override
{
jvs_io_board::read_digital_in(v);
// main button
@ -541,7 +541,7 @@ protected:
return std::min(0xff, 0x80 - axis_y) << 8;
}
virtual u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
switch (player_axis)
{
case 0:
@ -591,9 +591,9 @@ public:
output_count = 6;
}
protected:
virtual const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
const char *get_id() override { return "SEGA ENTERPRISES,LTD.;I/O BD JVS;837-13551 ;Ver1.00;98/10"; }
virtual void read_digital_in(u16 *v) override
void read_digital_in(u16 *v) override
{
jvs_io_board::read_digital_in(v);
for (u32 player = 0; player < player_count; player++)
@ -621,7 +621,7 @@ protected:
return std::min(0xff, 0x80 - axis_y) << 8;
}
virtual u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
u16 read_analog_axis(int player_num, int player_axis, bool inverted) override {
switch (player_axis)
{
case 0:

View File

@ -19,20 +19,20 @@ class AWCartridge: public Cartridge
public:
AWCartridge(u32 size) : Cartridge(size) {}
virtual void Init() override;
virtual u32 ReadMem(u32 address, u32 size) override;
virtual void WriteMem(u32 address, u32 data, u32 size) override;
void Init() override;
u32 ReadMem(u32 address, u32 size) override;
void WriteMem(u32 address, u32 data, u32 size) override;
virtual void *GetDmaPtr(u32 &limit) override;
virtual void AdvancePtr(u32 size) override;
virtual std::string GetGameId() override;
void *GetDmaPtr(u32 &limit) override;
void AdvancePtr(u32 size) override;
std::string GetGameId() override;
void SetKey(u32 key) override;
virtual void Serialize(void **data, unsigned int *total_size) override;
virtual void Unserialize(void **data, unsigned int *total_size) override;
void Serialize(void **data, unsigned int *total_size) override;
void Unserialize(void **data, unsigned int *total_size) override;
private:
virtual void device_reset();
void device_reset();
enum { EPR, MPR_RECORD, MPR_FILE };

View File

@ -21,19 +21,19 @@ public:
GDCartridge(u32 size) : NaomiCartridge(size)
{
}
~GDCartridge()
~GDCartridge() override
{
free(dimm_data);
}
virtual void Init() override
void Init() override
{
device_start();
device_reset();
}
virtual void* GetDmaPtr(u32 &size) override;
virtual void AdvancePtr(u32 size) override;
virtual bool Read(u32 offset, u32 size, void* dst) override;
virtual std::string GetGameId() override;
void* GetDmaPtr(u32 &size) override;
void AdvancePtr(u32 size) override;
bool Read(u32 offset, u32 size, void* dst) override;
std::string GetGameId() override;
void SetGDRomName(const char *name, const char *parentName) { this->gdrom_name = name; this->gdrom_parent_name = parentName; }

View File

@ -15,14 +15,14 @@ class M1Cartridge : public NaomiCartridge
public:
M1Cartridge(u32 size);
virtual u32 ReadMem(u32 address, u32 size) override
u32 ReadMem(u32 address, u32 size) override
{
if ((address & 0xff) == 0x14)
return actel_id;
return NaomiCartridge::ReadMem(address, size);
}
virtual void* GetDmaPtr(u32 &size) override
void* GetDmaPtr(u32 &size) override
{
if (encryption)
{
@ -33,14 +33,14 @@ public:
return NaomiCartridge::GetDmaPtr(size);
}
virtual void AdvancePtr(u32 size) override;
virtual void Serialize(void** data, unsigned int* total_size) override;
virtual void Unserialize(void** data, unsigned int* total_size) override;
void AdvancePtr(u32 size) override;
void Serialize(void** data, unsigned int* total_size) override;
void Unserialize(void** data, unsigned int* total_size) override;
void setActelId(u32 actel_id) { this->actel_id = actel_id; }
protected:
virtual void DmaOffsetChanged(u32 dma_offset) override
void DmaOffsetChanged(u32 dma_offset) override
{
rom_cur_address = dma_offset & 0x1fffffff;
if ((dma_offset & 0x20000000) == 0 && rom_cur_address < RomSize)

View File

@ -18,15 +18,15 @@
class M4Cartridge: public NaomiCartridge {
public:
M4Cartridge(u32 size) : NaomiCartridge(size) { }
~M4Cartridge();
~M4Cartridge() override;
virtual void Init() override
void Init() override
{
device_start();
device_reset();
}
virtual u32 ReadMem(u32 address, u32 size) override
u32 ReadMem(u32 address, u32 size) override
{
if ((address & 0xff) == 0x34)
return m4id & 0xff80;
@ -39,21 +39,21 @@ public:
return data;
}
virtual bool Read(u32 offset, u32 size, void *dst) override;
virtual bool Write(u32 offset, u32 size, u32 data) override;
bool Read(u32 offset, u32 size, void *dst) override;
bool Write(u32 offset, u32 size, u32 data) override;
virtual void* GetDmaPtr(u32 &size) override;
virtual void AdvancePtr(u32 size) override;
virtual std::string GetGameId() override;
virtual void Serialize(void** data, unsigned int* total_size) override;
virtual void Unserialize(void** data, unsigned int* total_size) override;
void* GetDmaPtr(u32 &size) override;
void AdvancePtr(u32 size) override;
std::string GetGameId() override;
void Serialize(void** data, unsigned int* total_size) override;
void Unserialize(void** data, unsigned int* total_size) override;
void SetKey(u32 key) override { this->m4id = key; }
void SetKeyData(u8 *key_data) override { this->m_key_data = key_data; }
protected:
virtual void DmaOffsetChanged(u32 dma_offset) override;
virtual void PioOffsetChanged(u32 pio_offset) override;
void DmaOffsetChanged(u32 dma_offset) override;
void PioOffsetChanged(u32 pio_offset) override;
private:
void device_start();

View File

@ -443,7 +443,7 @@ void naomi_cart_LoadRom(const char* file)
u32 addr, sz;
if (sscanf(line, "\"%[^\"]\",%x,%x", filename, &addr, &sz) == 3)
{
files.push_back(filename);
files.emplace_back(filename);
fstart.push_back(addr);
fsize.push_back(sz);
romSize = std::max(romSize, (addr + sz));
@ -465,7 +465,7 @@ void naomi_cart_LoadRom(const char* file)
std::fseek(fp, 0, SEEK_END);
u32 file_size = (u32)std::ftell(fp);
std::fclose(fp);
files.push_back(file);
files.emplace_back(file);
fstart.push_back(0);
fsize.push_back(file_size);
romSize = file_size;

View File

@ -33,14 +33,14 @@ protected:
class NaomiCartridge : public Cartridge
{
public:
NaomiCartridge(u32 size) : Cartridge(size), RomPioOffset(0), RomPioAutoIncrement(0), DmaOffset(0), DmaCount(0xffff) {}
NaomiCartridge(u32 size) : Cartridge(size), RomPioOffset(0), RomPioAutoIncrement(false), DmaOffset(0), DmaCount(0xffff) {}
virtual u32 ReadMem(u32 address, u32 size) override;
virtual void WriteMem(u32 address, u32 data, u32 size) override;
virtual void* GetDmaPtr(u32 &size) override;
virtual void AdvancePtr(u32 size) override {}
virtual void Serialize(void** data, unsigned int* total_size) override;
virtual void Unserialize(void** data, unsigned int* total_size) override;
u32 ReadMem(u32 address, u32 size) override;
void WriteMem(u32 address, u32 data, u32 size) override;
void* GetDmaPtr(u32 &size) override;
void AdvancePtr(u32 size) override {}
void Serialize(void** data, unsigned int* total_size) override;
void Unserialize(void** data, unsigned int* total_size) override;
void SetKey(u32 key) override { this->key = key; }
@ -65,13 +65,13 @@ class M2Cartridge : public NaomiCartridge
public:
M2Cartridge(u32 size) : NaomiCartridge(size) {}
virtual bool Read(u32 offset, u32 size, void* dst) override;
virtual bool Write(u32 offset, u32 size, u32 data) override;
bool Read(u32 offset, u32 size, void* dst) override;
bool Write(u32 offset, u32 size, u32 data) override;
u16 ReadCipheredData(u32 offset);
virtual void Serialize(void** data, unsigned int* total_size) override;
virtual void Unserialize(void** data, unsigned int* total_size) override;
virtual void* GetDmaPtr(u32& size) override;
virtual std::string GetGameId() override;
void Serialize(void** data, unsigned int* total_size) override;
void Unserialize(void** data, unsigned int* total_size) override;
void* GetDmaPtr(u32& size) override;
std::string GetGameId() override;
private:
u8 naomi_cart_ram[64 * 1024];

View File

@ -507,12 +507,12 @@ RuntimeBlockInfo::~RuntimeBlockInfo()
}
}
void RuntimeBlockInfo::AddRef(RuntimeBlockInfoPtr other)
void RuntimeBlockInfo::AddRef(const RuntimeBlockInfoPtr& other)
{
pre_refs.push_back(other);
}
void RuntimeBlockInfo::RemRef(RuntimeBlockInfoPtr other)
void RuntimeBlockInfo::RemRef(const RuntimeBlockInfoPtr& other)
{
bm_List::iterator it = std::find(pre_refs.begin(), pre_refs.end(), other);
if (it != pre_refs.end())
@ -651,7 +651,7 @@ void print_blocks()
if (print_stats)
{
f=fopen(get_writable_data_path("blkmap.lst").c_str(),"w");
print_stats=0;
print_stats=false;
INFO_LOG(DYNAREC, "Writing blocks to %p", f);
}

View File

@ -68,8 +68,8 @@ struct RuntimeBlockInfo: RuntimeBlockInfo_Core
//predecessors references
std::vector<RuntimeBlockInfoPtr> pre_refs;
void AddRef(RuntimeBlockInfoPtr other);
void RemRef(RuntimeBlockInfoPtr other);
void AddRef(const RuntimeBlockInfoPtr& other);
void RemRef(const RuntimeBlockInfoPtr& other);
void Discard();
void SetProtectedFlags();

View File

@ -97,7 +97,7 @@ extern "C" f32 fipr_asm(float* fn, float* fm);
#if SHIL_MODE==1 || SHIL_MODE==2
//only in structs we use the code :)
#include <math.h>
#include <cmath>
#include "types.h"
#include "shil.h"
#include "decoder.h"

View File

@ -2,9 +2,9 @@
Dreamcast serial port.
This is missing most of the functionality, but works for KOS (And thats all that uses it)
*/
#include <stdlib.h>
#include <cerrno>
#include <cstdlib>
#include <fcntl.h>
#include <errno.h>
#ifndef _WIN32
#include <unistd.h>
#include <sys/ioctl.h>

View File

@ -17,7 +17,7 @@ struct CHDDisc : Disc
bool TryOpen(const char* file);
~CHDDisc()
~CHDDisc() override
{
delete[] hunk_mem;
@ -45,7 +45,7 @@ struct CHDTrack : TrackFile
this->swap_bytes = swap_bytes;
}
virtual void Read(u32 FAD, u8* dst, SectorFormat* sector_type, u8* subcode, SubcodeFormat* subcode_type)
void Read(u32 FAD, u8* dst, SectorFormat* sector_type, u8* subcode, SubcodeFormat* subcode_type) override
{
u32 fad_offs = FAD + Offset;
u32 hunk=(fad_offs)/disc->sph;

View File

@ -300,7 +300,7 @@ struct RawTrackFile : TrackFile
this->cleanup=true;
}
virtual void Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type)
void Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type) override
{
//for now hackish
if (fmt==2352)
@ -319,7 +319,7 @@ struct RawTrackFile : TrackFile
std::fseek(file, offset + FAD * fmt, SEEK_SET);
std::fread(dst, 1, fmt, file);
}
virtual ~RawTrackFile()
~RawTrackFile() override
{
if (cleanup && file)
std::fclose(file);

View File

@ -3,7 +3,7 @@
#ifdef _WIN32
#include "common.h"
#include <stddef.h>
#include <cstddef>
#include <windows.h>
#include <ntddscsi.h>
@ -185,7 +185,7 @@ struct PhysicalTrack:TrackFile
PhysicalDrive* disc;
PhysicalTrack(PhysicalDrive* disc) { this->disc=disc; }
virtual void Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type);
void Read(u32 FAD,u8* dst,SectorFormat* sector_type,u8* subcode,SubcodeFormat* subcode_type) override;
};
struct PhysicalDrive:Disc

View File

@ -406,7 +406,7 @@ static FILE *get_record_input(bool write)
}
#endif
void GamepadDevice::Register(std::shared_ptr<GamepadDevice> gamepad)
void GamepadDevice::Register(const std::shared_ptr<GamepadDevice>& gamepad)
{
int maple_port = cfgLoadInt("input",
MAPLE_PORT_CFG_PREFIX + gamepad->unique_id(), 12345);
@ -425,7 +425,7 @@ void GamepadDevice::Register(std::shared_ptr<GamepadDevice> gamepad)
_gamepads_mutex.unlock();
}
void GamepadDevice::Unregister(std::shared_ptr<GamepadDevice> gamepad)
void GamepadDevice::Unregister(const std::shared_ptr<GamepadDevice>& gamepad)
{
gamepad->save_mapping();
_gamepads_mutex.lock();

View File

@ -57,9 +57,9 @@ public:
virtual void update_rumble() {}
bool is_rumble_enabled() { return _rumble_enabled; }
static void Register(std::shared_ptr<GamepadDevice> gamepad);
static void Register(const std::shared_ptr<GamepadDevice>& gamepad);
static void Unregister(std::shared_ptr<GamepadDevice> gamepad);
static void Unregister(const std::shared_ptr<GamepadDevice>& gamepad);
static int GetGamepadCount();
static std::shared_ptr<GamepadDevice> GetGamepad(int index);

View File

@ -284,7 +284,7 @@ bool InputMapping::save(const char *name)
return true;
}
void InputMapping::SaveMapping(const char *name, std::shared_ptr<InputMapping> mapping)
void InputMapping::SaveMapping(const char *name, const std::shared_ptr<InputMapping>& mapping)
{
mapping->save(name);
InputMapping::loaded_mappings[name] = mapping;

View File

@ -80,7 +80,7 @@ public:
bool is_dirty() { return dirty; }
static std::shared_ptr<InputMapping> LoadMapping(const char *name);
static void SaveMapping(const char *name, std::shared_ptr<InputMapping> mapping);
static void SaveMapping(const char *name, const std::shared_ptr<InputMapping>& mapping);
protected:
bool dirty = false;

View File

@ -10,7 +10,7 @@ class ConsoleListener : public LogListener
{
public:
ConsoleListener();
~ConsoleListener();
~ConsoleListener() override;
void Log(LogTypes::LOG_LEVELS, const char* text) override;

View File

@ -76,6 +76,6 @@ bool MiniUPnP::AddPortMapping(int port, bool tcp)
INFO_LOG(MODEM, "Port %d redirection failed: error %d", port, error);
return false;
}
mappedPorts.push_back(std::make_pair(portStr, tcp));
mappedPorts.emplace_back(portStr, tcp);
return true;
}

View File

@ -137,7 +137,7 @@ public:
class iterator
{
private:
iterator(DIR *dir, std::string pathname) {
iterator(DIR *dir, const std::string& pathname) {
if (dir != nullptr)
{
dirs.push_back(dir);

View File

@ -25,11 +25,11 @@ using namespace Xbyak::util;
struct DynaRBI : RuntimeBlockInfo
{
virtual u32 Relink() {
u32 Relink() override {
return 0;
}
virtual void Relocate(void* dst) {
void Relocate(void* dst) override {
verify(false);
}
};

View File

@ -50,10 +50,10 @@ struct X64RegAlloc : RegAlloc<Xbyak::Operand::Code, s8>
RegAlloc::DoAlloc(block, alloc_regs, alloc_fregs);
}
virtual void Preload(u32 reg, Xbyak::Operand::Code nreg) override;
virtual void Writeback(u32 reg, Xbyak::Operand::Code nreg) override;
virtual void Preload_FPU(u32 reg, s8 nreg) override;
virtual void Writeback_FPU(u32 reg, s8 nreg) override;
void Preload(u32 reg, Xbyak::Operand::Code nreg) override;
void Writeback(u32 reg, Xbyak::Operand::Code nreg) override;
void Preload_FPU(u32 reg, s8 nreg) override;
void Writeback_FPU(u32 reg, s8 nreg) override;
Xbyak::Reg32 MapRegister(const shil_param& param)
{

View File

@ -106,13 +106,13 @@ static void SetGPState(const PolyParam* gp)
if (pass == Pass::Depth)
{
CurrentShader = gl4GetProgram(Type == ListType_Punch_Through ? 1 : 0,
CurrentShader = gl4GetProgram(Type == ListType_Punch_Through ? true : false,
clipmode == TileClipping::Inside,
Type == ListType_Punch_Through ? gp->pcw.Texture : 0,
1,
Type == ListType_Punch_Through ? gp->pcw.Texture : false,
true,
gp->tsp.IgnoreTexA,
0,
0,
false,
2,
false, // TODO Can PT have two different textures for area 0 and 1 ??
false,
@ -130,7 +130,7 @@ static void SetGPState(const PolyParam* gp)
int fog_ctrl = config::Fog ? gp->tsp.FogCtrl : 2;
palette = BaseTextureCacheData::IsGpuHandledPaletted(gp->tsp, gp->tcw);
CurrentShader = gl4GetProgram(Type == ListType_Punch_Through ? 1 : 0,
CurrentShader = gl4GetProgram(Type == ListType_Punch_Through ? true : false,
clipmode == TileClipping::Inside,
gp->pcw.Texture,
gp->tsp.UseAlpha,
@ -677,13 +677,13 @@ static void gl4_draw_quad_texture(GLuint texture, float w, float h)
gl4ShaderUniforms.trilinear_alpha = 1.0;
CurrentShader = gl4GetProgram(0,
CurrentShader = gl4GetProgram(false,
false,
1,
0,
1,
0,
true,
false,
true,
0,
false,
2,
false,
false,

View File

@ -480,7 +480,7 @@ void gl4_delete_shaders()
gl4.modvol_shader.program = 0;
}
static void gl4_term(void)
static void gl4_term()
{
glDeleteBuffers(1, &gl4.vbo.geometry);
gl4.vbo.geometry = 0;

View File

@ -122,7 +122,7 @@ __forceinline
TileClipping clipmode = GetTileClip(gp->tileclip, ViewportMatrix, clip_rect);
bool palette = BaseTextureCacheData::IsGpuHandledPaletted(gp->tsp, gp->tcw);
CurrentShader = GetProgram(Type == ListType_Punch_Through ? 1 : 0,
CurrentShader = GetProgram(Type == ListType_Punch_Through ? true : false,
clipmode == TileClipping::Inside,
gp->pcw.Texture,
gp->tsp.UseAlpha,
@ -653,7 +653,7 @@ static void DrawQuad(GLuint texId, float x, float y, float w, float h, float u0,
ShaderUniforms.trilinear_alpha = 1.0;
PipelineShader *shader = GetProgram(0, false, 1, 0, 1, 0, 0, 2, false, false, false, false, false);
PipelineShader *shader = GetProgram(false, false, true, false, true, 0, false, 2, false, false, false, false, false);
glcache.UseProgram(shader->program);
glActiveTexture(GL_TEXTURE0);

View File

@ -221,9 +221,9 @@ class TextureCacheData final : public BaseTextureCacheData
{
public:
GLuint texID; //gl texture
virtual std::string GetId() override { return std::to_string(texID); }
virtual void UploadToGPU(int width, int height, u8 *temp_tex_buffer, bool mipmapped, bool mipmapsIncluded = false) override;
virtual bool Delete() override;
std::string GetId() override { return std::to_string(texID); }
void UploadToGPU(int width, int height, u8 *temp_tex_buffer, bool mipmapped, bool mipmapsIncluded = false) override;
bool Delete() override;
};
class GlTextureCache final : public BaseTextureCache<TextureCacheData>
@ -262,12 +262,12 @@ struct OpenGLRenderer : Renderer
void DrawOSD(bool clear_screen) override { OSD_DRAW(clear_screen); }
virtual u64 GetTexture(TSP tsp, TCW tcw) override
u64 GetTexture(TSP tsp, TCW tcw) override
{
return gl_GetTexture(tsp, tcw);
}
virtual bool Present() override
bool Present() override
{
if (!frameRendered)
return false;

View File

@ -634,7 +634,7 @@ static void detect_input_popup(int index, bool analog)
ImGui::PopStyleVar(2);
}
static void controller_mapping_popup(std::shared_ptr<GamepadDevice> gamepad)
static void controller_mapping_popup(const std::shared_ptr<GamepadDevice>& gamepad)
{
ImGui::SetNextWindowPos(ImVec2(0, 0));
ImGui::SetNextWindowSize(ImVec2(screen_width, screen_height));

View File

@ -134,7 +134,7 @@ void select_directory_popup(const char *prompt, float scaling, StringCallback ca
if (dir == NULL)
{
error_message = "Cannot read " + select_current_directory;
select_subfolders.push_back("..");
select_subfolders.emplace_back("..");
}
else
{
@ -183,7 +183,7 @@ void select_directory_popup(const char *prompt, float scaling, StringCallback ca
flycast::closedir(dir);
#if defined(_WIN32) || defined(__ANDROID__)
if (!dotdot_seen)
select_subfolders.push_back("..");
select_subfolders.emplace_back("..");
#endif
}
}

View File

@ -113,10 +113,10 @@ const std::vector<OSDVertex>& GetOSDVertices()
DrawButton(vjoy_pos[10], rt[0]);
DrawButton2(vjoy_pos[11], 1);
DrawButton2(vjoy_pos[12], 0);
DrawButton2(vjoy_pos[11], true);
DrawButton2(vjoy_pos[12], false);
DrawButton2(vjoy_pos[13], 0);
DrawButton2(vjoy_pos[13], false);
return osdVertices;
}

View File

@ -22,7 +22,7 @@
#include "utils.h"
#include "vulkan_context.h"
BufferData::BufferData(vk::DeviceSize size, vk::BufferUsageFlags usage, vk::MemoryPropertyFlags propertyFlags)
BufferData::BufferData(vk::DeviceSize size, const vk::BufferUsageFlags& usage, const vk::MemoryPropertyFlags& propertyFlags)
: bufferSize(size), m_usage(usage), m_propertyFlags(propertyFlags)
{
VulkanContext *context = VulkanContext::Instance();

View File

@ -24,8 +24,8 @@
struct BufferData
{
BufferData(vk::DeviceSize size, vk::BufferUsageFlags usage,
vk::MemoryPropertyFlags propertyFlags = vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent);
BufferData(vk::DeviceSize size, const vk::BufferUsageFlags& usage,
const vk::MemoryPropertyFlags& propertyFlags = vk::MemoryPropertyFlagBits::eHostVisible | vk::MemoryPropertyFlagBits::eHostCoherent);
~BufferData()
{
buffer.reset();

View File

@ -194,7 +194,7 @@ class ScreenDrawer : public Drawer
{
public:
void Init(SamplerManager *samplerManager, ShaderManager *shaderManager);
virtual void EndRenderPass() override;
void EndRenderPass() override;
bool PresentFrame()
{
if (!frameRendered)
@ -207,8 +207,8 @@ public:
}
protected:
virtual vk::CommandBuffer BeginRenderPass() override;
virtual size_t GetSwapChainSize() override { return 2; }
vk::CommandBuffer BeginRenderPass() override;
size_t GetSwapChainSize() override { return 2; }
private:
std::unique_ptr<PipelineManager> screenPipelineManager;
@ -230,10 +230,10 @@ class TextureDrawer : public Drawer
{
public:
void Init(SamplerManager *samplerManager, ShaderManager *shaderManager, TextureCache *textureCache);
virtual void EndRenderPass() override;
void EndRenderPass() override;
protected:
virtual vk::CommandBuffer BeginRenderPass() override;
vk::CommandBuffer BeginRenderPass() override;
private:
u32 width = 0;

View File

@ -76,11 +76,11 @@ public:
vk::DescriptorSetAllocateInfo(context->GetDescriptorPool(), 1, &descSetLayout.get())).front());
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
vk::DescriptorBufferInfo pixelBufferInfo(*pixelBuffer->buffer, 0, VK_WHOLE_SIZE);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*descSet, 0, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &pixelBufferInfo, nullptr));
writeDescriptorSets.emplace_back(*descSet, 0, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &pixelBufferInfo, nullptr);
vk::DescriptorBufferInfo pixelCounterBufferInfo(*pixelCounter->buffer, 0, 4);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*descSet, 1, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &pixelCounterBufferInfo, nullptr));
writeDescriptorSets.emplace_back(*descSet, 1, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &pixelCounterBufferInfo, nullptr);
vk::DescriptorImageInfo pointerImageInfo(vk::Sampler(), abufferPointerAttachment->GetImageView(), vk::ImageLayout::eGeneral);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*descSet, 2, 0, 1, vk::DescriptorType::eStorageImage, &pointerImageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(*descSet, 2, 0, 1, vk::DescriptorType::eStorageImage, &pointerImageInfo, nullptr, nullptr);
context->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
}

View File

@ -57,7 +57,7 @@ protected:
else
while (descriptorSets.size() < GetContext()->GetSwapChainSize())
{
descriptorSets.push_back(OITDescriptorSets());
descriptorSets.emplace_back();
descriptorSets.back().Init(samplerManager,
pipelineManager->GetPipelineLayout(),
pipelineManager->GetPerFrameDSLayout(),
@ -177,8 +177,8 @@ public:
OITDrawer::Term();
}
virtual vk::CommandBuffer NewFrame() override;
virtual void EndFrame() override
vk::CommandBuffer NewFrame() override;
void EndFrame() override
{
currentCommandBuffer.endRenderPass();
currentCommandBuffer.end();
@ -200,8 +200,8 @@ public:
}
protected:
virtual vk::Framebuffer GetFinalFramebuffer() const override { return *framebuffers[GetCurrentImage()]; }
virtual vk::Format GetColorFormat() const override { return GetContext()->GetColorFormat(); }
vk::Framebuffer GetFinalFramebuffer() const override { return *framebuffers[GetCurrentImage()]; }
vk::Format GetColorFormat() const override { return GetContext()->GetColorFormat(); }
private:
void MakeFramebuffers();
@ -235,12 +235,12 @@ public:
OITDrawer::Term();
}
virtual void EndFrame() override;
void EndFrame() override;
protected:
virtual vk::CommandBuffer NewFrame() override;
virtual vk::Framebuffer GetFinalFramebuffer() const override { return *framebuffers[GetCurrentImage()]; }
virtual vk::Format GetColorFormat() const override { return vk::Format::eR8G8B8A8Unorm; }
vk::CommandBuffer NewFrame() override;
vk::Framebuffer GetFinalFramebuffer() const override { return *framebuffers[GetCurrentImage()]; }
vk::Format GetColorFormat() const override { return vk::Format::eR8G8B8A8Unorm; }
private:
u32 textureAddr = 0;

View File

@ -100,12 +100,12 @@ public:
vk::DescriptorSet perFrameDescSet = *perFrameDescSetsInFlight.back();
std::vector<vk::DescriptorBufferInfo> bufferInfos;
bufferInfos.push_back(vk::DescriptorBufferInfo(buffer, vertexUniformOffset, sizeof(VertexShaderUniforms)));
bufferInfos.push_back(vk::DescriptorBufferInfo(buffer, fragmentUniformOffset, sizeof(FragmentShaderUniforms)));
bufferInfos.emplace_back(buffer, vertexUniformOffset, sizeof(VertexShaderUniforms));
bufferInfos.emplace_back(buffer, fragmentUniformOffset, sizeof(FragmentShaderUniforms));
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[0], nullptr));
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 1, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[1], nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[0], nullptr);
writeDescriptorSets.emplace_back(perFrameDescSet, 1, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[1], nullptr);
if (fogImageView)
{
TSP fogTsp = {};
@ -115,7 +115,7 @@ public:
vk::Sampler fogSampler = samplerManager->GetSampler(fogTsp);
static vk::DescriptorImageInfo imageInfo;
imageInfo = { fogSampler, fogImageView, vk::ImageLayout::eShaderReadOnlyOptimal };
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 2, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 2, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
}
if (paletteImageView)
{
@ -126,18 +126,18 @@ public:
vk::Sampler palSampler = samplerManager->GetSampler(palTsp);
static vk::DescriptorImageInfo imageInfo;
imageInfo = { palSampler, paletteImageView, vk::ImageLayout::eShaderReadOnlyOptimal };
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 6, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 6, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
}
if (polyParamsSize > 0)
{
static vk::DescriptorBufferInfo polyParamsBufferInfo;
polyParamsBufferInfo = vk::DescriptorBufferInfo(buffer, polyParamsOffset, polyParamsSize);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 3, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &polyParamsBufferInfo, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 3, 0, 1, vk::DescriptorType::eStorageBuffer, nullptr, &polyParamsBufferInfo, nullptr);
}
vk::DescriptorImageInfo stencilImageInfo(vk::Sampler(), stencilImageView, vk::ImageLayout::eDepthStencilReadOnlyOptimal);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 4, 0, 1, vk::DescriptorType::eInputAttachment, &stencilImageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 4, 0, 1, vk::DescriptorType::eInputAttachment, &stencilImageInfo, nullptr, nullptr);
vk::DescriptorImageInfo depthImageInfo(vk::Sampler(), depthImageView, vk::ImageLayout::eDepthStencilReadOnlyOptimal);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 5, 0, 1, vk::DescriptorType::eInputAttachment, &depthImageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 5, 0, 1, vk::DescriptorType::eInputAttachment, &depthImageInfo, nullptr, nullptr);
GetContext()->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
}
@ -172,14 +172,14 @@ public:
vk::DescriptorImageInfo imageInfo0(samplerManager->GetSampler(tsp0), texture->GetReadOnlyImageView(), vk::ImageLayout::eShaderReadOnlyOptimal);
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*perPolyDescSets.back(), 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo0, nullptr, nullptr));
writeDescriptorSets.emplace_back(*perPolyDescSets.back(), 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo0, nullptr, nullptr);
if (textureId1 != (u64)-1)
{
Texture *texture1 = reinterpret_cast<Texture *>(textureId1);
vk::DescriptorImageInfo imageInfo1(samplerManager->GetSampler(tsp1), texture1->GetReadOnlyImageView(), vk::ImageLayout::eShaderReadOnlyOptimal);
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*perPolyDescSets.back(), 1, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo1, nullptr, nullptr));
writeDescriptorSets.emplace_back(*perPolyDescSets.back(), 1, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo1, nullptr, nullptr);
}
GetContext()->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
perPolyDescSetsInFlight[index] = std::move(perPolyDescSets.back());

View File

@ -64,7 +64,7 @@ private:
class RttRenderPasses : public RenderPasses
{
protected:
virtual vk::AttachmentDescription GetAttachment0Description(bool initial, bool last) const override
vk::AttachmentDescription GetAttachment0Description(bool initial, bool last) const override
{
return vk::AttachmentDescription(vk::AttachmentDescriptionFlags(), vk::Format::eR8G8B8A8Unorm, vk::SampleCountFlagBits::e1,
vk::AttachmentLoadOp::eClear, vk::AttachmentStoreOp::eStore,
@ -72,8 +72,8 @@ protected:
vk::ImageLayout::eUndefined,
config::RenderToTextureBuffer && last ? vk::ImageLayout::eTransferSrcOptimal : vk::ImageLayout::eShaderReadOnlyOptimal);
}
virtual vk::Format GetColorFormat() const override { return vk::Format::eR8G8B8A8Unorm; }
virtual std::vector<vk::SubpassDependency> GetSubpassDependencies() const override
vk::Format GetColorFormat() const override { return vk::Format::eR8G8B8A8Unorm; }
std::vector<vk::SubpassDependency> GetSubpassDependencies() const override
{
std::vector<vk::SubpassDependency> deps;
if (config::RenderToTextureBuffer)

View File

@ -54,12 +54,12 @@ public:
vk::DescriptorSet perFrameDescSet = *perFrameDescSetsInFlight.back();
std::vector<vk::DescriptorBufferInfo> bufferInfos;
bufferInfos.push_back(vk::DescriptorBufferInfo(buffer, vertexUniformOffset, sizeof(VertexShaderUniforms)));
bufferInfos.push_back(vk::DescriptorBufferInfo(buffer, fragmentUniformOffset, sizeof(FragmentShaderUniforms)));
bufferInfos.emplace_back(buffer, vertexUniformOffset, sizeof(VertexShaderUniforms));
bufferInfos.emplace_back(buffer, fragmentUniformOffset, sizeof(FragmentShaderUniforms));
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[0], nullptr));
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 1, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[1], nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 0, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[0], nullptr);
writeDescriptorSets.emplace_back(perFrameDescSet, 1, 0, 1, vk::DescriptorType::eUniformBuffer, nullptr, &bufferInfos[1], nullptr);
if (fogImageView)
{
TSP fogTsp = {};
@ -69,7 +69,7 @@ public:
vk::Sampler fogSampler = samplerManager->GetSampler(fogTsp);
static vk::DescriptorImageInfo imageInfo;
imageInfo = { fogSampler, fogImageView, vk::ImageLayout::eShaderReadOnlyOptimal };
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 2, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 2, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
}
if (paletteImageView)
{
@ -80,7 +80,7 @@ public:
vk::Sampler palSampler = samplerManager->GetSampler(palTsp);
static vk::DescriptorImageInfo imageInfo;
imageInfo = { palSampler, paletteImageView, vk::ImageLayout::eShaderReadOnlyOptimal };
writeDescriptorSets.push_back(vk::WriteDescriptorSet(perFrameDescSet, 3, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(perFrameDescSet, 3, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
}
GetContext()->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
}
@ -102,7 +102,7 @@ public:
vk::DescriptorImageInfo imageInfo(samplerManager->GetSampler(tsp), texture->GetReadOnlyImageView(), vk::ImageLayout::eShaderReadOnlyOptimal);
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*perPolyDescSets.back(), 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(*perPolyDescSets.back(), 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
GetContext()->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
inFlight[index] = std::move(perPolyDescSets.back());
@ -365,7 +365,7 @@ public:
}
vk::DescriptorImageInfo imageInfo(*sampler, imageView, vk::ImageLayout::eShaderReadOnlyOptimal);
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(vk::WriteDescriptorSet(*descriptorSet, 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(*descriptorSet, 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
GetContext()->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
}

View File

@ -199,8 +199,7 @@ void QuadDrawer::Draw(vk::CommandBuffer commandBuffer, vk::ImageView imageView,
}
vk::DescriptorImageInfo imageInfo(nearestFilter ? pipeline->GetNearestSampler() : pipeline->GetLinearSampler(), imageView, vk::ImageLayout::eShaderReadOnlyOptimal);
std::vector<vk::WriteDescriptorSet> writeDescriptorSets;
writeDescriptorSets.push_back(
vk::WriteDescriptorSet(*descSet, 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr));
writeDescriptorSets.emplace_back(*descSet, 0, 0, 1, vk::DescriptorType::eCombinedImageSampler, &imageInfo, nullptr, nullptr);
context->GetDevice().updateDescriptorSets(writeDescriptorSets, nullptr);
commandBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, pipeline->GetPipelineLayout(), 0, 1, &descSet.get(), 0, nullptr);

View File

@ -226,8 +226,8 @@ void Texture::Init(u32 width, u32 height, vk::Format format, u32 dataSize, bool
CreateImage(imageTiling, usageFlags, initialLayout, vk::ImageAspectFlagBits::eColor);
}
void Texture::CreateImage(vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::ImageLayout initialLayout,
vk::ImageAspectFlags aspectMask)
void Texture::CreateImage(vk::ImageTiling tiling, const vk::ImageUsageFlags& usage, vk::ImageLayout initialLayout,
const vk::ImageAspectFlags& aspectMask)
{
vk::ImageCreateInfo imageCreateInfo(vk::ImageCreateFlags(), vk::ImageType::e2D, format, vk::Extent3D(extent, 1), mipmapLevels, 1,
vk::SampleCountFlagBits::e1, tiling, usage,
@ -393,7 +393,7 @@ void Texture::GenerateMipmaps()
commandBuffer.pipelineBarrier(vk::PipelineStageFlagBits::eTransfer, vk::PipelineStageFlagBits::eFragmentShader, {}, nullptr, nullptr, barrier);
}
void FramebufferAttachment::Init(u32 width, u32 height, vk::Format format, vk::ImageUsageFlags usage)
void FramebufferAttachment::Init(u32 width, u32 height, vk::Format format, const vk::ImageUsageFlags& usage)
{
this->format = format;
this->extent = vk::Extent2D { width, height };

View File

@ -43,7 +43,7 @@ public:
vk::ImageView GetImageView() const { return *imageView; }
vk::ImageView GetReadOnlyImageView() const { return readOnlyImageView ? readOnlyImageView : *imageView; }
void SetCommandBuffer(vk::CommandBuffer commandBuffer) { this->commandBuffer = commandBuffer; }
virtual bool Force32BitTexture(TextureType type) const override { return !VulkanContext::Instance()->IsFormatSupported(type); }
bool Force32BitTexture(TextureType type) const override { return !VulkanContext::Instance()->IsFormatSupported(type); }
void SetPhysicalDevice(vk::PhysicalDevice physicalDevice) { this->physicalDevice = physicalDevice; }
void SetDevice(vk::Device device) { this->device = device; }
@ -51,8 +51,8 @@ public:
private:
void Init(u32 width, u32 height, vk::Format format ,u32 dataSize, bool mipmapped, bool mipmapsIncluded);
void SetImage(u32 size, void *data, bool isNew, bool genMipmaps);
void CreateImage(vk::ImageTiling tiling, vk::ImageUsageFlags usage, vk::ImageLayout initialLayout,
vk::ImageAspectFlags aspectMask);
void CreateImage(vk::ImageTiling tiling, const vk::ImageUsageFlags& usage, vk::ImageLayout initialLayout,
const vk::ImageAspectFlags& aspectMask);
void GenerateMipmaps();
vk::Format format = vk::Format::eUndefined;
@ -111,7 +111,7 @@ public:
FramebufferAttachment(vk::PhysicalDevice physicalDevice, vk::Device device)
: format(vk::Format::eUndefined), physicalDevice(physicalDevice), device(device)
{}
void Init(u32 width, u32 height, vk::Format format, vk::ImageUsageFlags usage);
void Init(u32 width, u32 height, vk::Format format, const vk::ImageUsageFlags& usage);
void Reset() { image.reset(); imageView.reset(); }
vk::ImageView GetImageView() const { return *imageView; }

View File

@ -60,7 +60,7 @@ static inline vk::BlendFactor getBlendFactor(u32 instr, bool src)
}
}
static inline u32 findMemoryType(vk::PhysicalDeviceMemoryProperties const& memoryProperties, u32 typeBits, vk::MemoryPropertyFlags requirementsMask)
static inline u32 findMemoryType(vk::PhysicalDeviceMemoryProperties const& memoryProperties, u32 typeBits, const vk::MemoryPropertyFlags& requirementsMask)
{
u32 typeIndex = u32(~0);
for (u32 i = 0; i < memoryProperties.memoryTypeCount; i++)

View File

@ -5705,23 +5705,23 @@ class VmaBlockMetadata_Generic : public VmaBlockMetadata
VMA_CLASS_NO_COPY(VmaBlockMetadata_Generic)
public:
VmaBlockMetadata_Generic(VmaAllocator hAllocator);
virtual ~VmaBlockMetadata_Generic();
virtual void Init(VkDeviceSize size);
~VmaBlockMetadata_Generic() override;
void Init(VkDeviceSize size) override;
virtual bool Validate() const;
virtual size_t GetAllocationCount() const { return m_Suballocations.size() - m_FreeCount; }
virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize; }
virtual VkDeviceSize GetUnusedRangeSizeMax() const;
virtual bool IsEmpty() const;
bool Validate() const override;
size_t GetAllocationCount() const override { return m_Suballocations.size() - m_FreeCount; }
VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; }
VkDeviceSize GetUnusedRangeSizeMax() const override;
bool IsEmpty() const override;
virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
void CalcAllocationStatInfo(VmaStatInfo& outInfo) const override;
void AddPoolStats(VmaPoolStats& inoutStats) const override;
#if VMA_STATS_STRING_ENABLED
virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
void PrintDetailedMap(class VmaJsonWriter& json) const override;
#endif
virtual bool CreateAllocationRequest(
bool CreateAllocationRequest(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VkDeviceSize bufferImageGranularity,
@ -5731,25 +5731,25 @@ public:
VmaSuballocationType allocType,
bool canMakeOtherLost,
uint32_t strategy,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual bool MakeRequestedAllocationsLost(
bool MakeRequestedAllocationsLost(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) override;
virtual VkResult CheckCorruption(const void* pBlockData);
VkResult CheckCorruption(const void* pBlockData) override;
virtual void Alloc(
void Alloc(
const VmaAllocationRequest& request,
VmaSuballocationType type,
VkDeviceSize allocSize,
VmaAllocation hAllocation);
VmaAllocation hAllocation) override;
virtual void Free(const VmaAllocation allocation);
virtual void FreeAtOffset(VkDeviceSize offset);
void Free(const VmaAllocation allocation) override;
void FreeAtOffset(VkDeviceSize offset) override;
////////////////////////////////////////////////////////////////////////////////
// For defragmentation
@ -5883,23 +5883,23 @@ class VmaBlockMetadata_Linear : public VmaBlockMetadata
VMA_CLASS_NO_COPY(VmaBlockMetadata_Linear)
public:
VmaBlockMetadata_Linear(VmaAllocator hAllocator);
virtual ~VmaBlockMetadata_Linear();
virtual void Init(VkDeviceSize size);
~VmaBlockMetadata_Linear() override;
void Init(VkDeviceSize size) override;
virtual bool Validate() const;
virtual size_t GetAllocationCount() const;
virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize; }
virtual VkDeviceSize GetUnusedRangeSizeMax() const;
virtual bool IsEmpty() const { return GetAllocationCount() == 0; }
bool Validate() const override;
size_t GetAllocationCount() const override;
VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize; }
VkDeviceSize GetUnusedRangeSizeMax() const override;
bool IsEmpty() const override { return GetAllocationCount() == 0; }
virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
void CalcAllocationStatInfo(VmaStatInfo& outInfo) const override;
void AddPoolStats(VmaPoolStats& inoutStats) const override;
#if VMA_STATS_STRING_ENABLED
virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
void PrintDetailedMap(class VmaJsonWriter& json) const override;
#endif
virtual bool CreateAllocationRequest(
bool CreateAllocationRequest(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VkDeviceSize bufferImageGranularity,
@ -5909,25 +5909,25 @@ public:
VmaSuballocationType allocType,
bool canMakeOtherLost,
uint32_t strategy,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual bool MakeRequestedAllocationsLost(
bool MakeRequestedAllocationsLost(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) override;
virtual VkResult CheckCorruption(const void* pBlockData);
VkResult CheckCorruption(const void* pBlockData) override;
virtual void Alloc(
void Alloc(
const VmaAllocationRequest& request,
VmaSuballocationType type,
VkDeviceSize allocSize,
VmaAllocation hAllocation);
VmaAllocation hAllocation) override;
virtual void Free(const VmaAllocation allocation);
virtual void FreeAtOffset(VkDeviceSize offset);
void Free(const VmaAllocation allocation) override;
void FreeAtOffset(VkDeviceSize offset) override;
private:
/*
@ -6013,23 +6013,23 @@ class VmaBlockMetadata_Buddy : public VmaBlockMetadata
VMA_CLASS_NO_COPY(VmaBlockMetadata_Buddy)
public:
VmaBlockMetadata_Buddy(VmaAllocator hAllocator);
virtual ~VmaBlockMetadata_Buddy();
virtual void Init(VkDeviceSize size);
~VmaBlockMetadata_Buddy() override;
void Init(VkDeviceSize size) override;
virtual bool Validate() const;
virtual size_t GetAllocationCount() const { return m_AllocationCount; }
virtual VkDeviceSize GetSumFreeSize() const { return m_SumFreeSize + GetUnusableSize(); }
virtual VkDeviceSize GetUnusedRangeSizeMax() const;
virtual bool IsEmpty() const { return m_Root->type == Node::TYPE_FREE; }
bool Validate() const override;
size_t GetAllocationCount() const override { return m_AllocationCount; }
VkDeviceSize GetSumFreeSize() const override { return m_SumFreeSize + GetUnusableSize(); }
VkDeviceSize GetUnusedRangeSizeMax() const override;
bool IsEmpty() const override { return m_Root->type == Node::TYPE_FREE; }
virtual void CalcAllocationStatInfo(VmaStatInfo& outInfo) const;
virtual void AddPoolStats(VmaPoolStats& inoutStats) const;
void CalcAllocationStatInfo(VmaStatInfo& outInfo) const override;
void AddPoolStats(VmaPoolStats& inoutStats) const override;
#if VMA_STATS_STRING_ENABLED
virtual void PrintDetailedMap(class VmaJsonWriter& json) const;
void PrintDetailedMap(class VmaJsonWriter& json) const override;
#endif
virtual bool CreateAllocationRequest(
bool CreateAllocationRequest(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VkDeviceSize bufferImageGranularity,
@ -6039,25 +6039,25 @@ public:
VmaSuballocationType allocType,
bool canMakeOtherLost,
uint32_t strategy,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual bool MakeRequestedAllocationsLost(
bool MakeRequestedAllocationsLost(
uint32_t currentFrameIndex,
uint32_t frameInUseCount,
VmaAllocationRequest* pAllocationRequest);
VmaAllocationRequest* pAllocationRequest) override;
virtual uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount);
uint32_t MakeAllocationsLost(uint32_t currentFrameIndex, uint32_t frameInUseCount) override;
virtual VkResult CheckCorruption(const void* pBlockData) { return VK_ERROR_FEATURE_NOT_PRESENT; }
VkResult CheckCorruption(const void* pBlockData) override { return VK_ERROR_FEATURE_NOT_PRESENT; }
virtual void Alloc(
void Alloc(
const VmaAllocationRequest& request,
VmaSuballocationType type,
VkDeviceSize allocSize,
VmaAllocation hAllocation);
VmaAllocation hAllocation) override;
virtual void Free(const VmaAllocation allocation) { FreeAtOffset(allocation, allocation->GetOffset()); }
virtual void FreeAtOffset(VkDeviceSize offset) { FreeAtOffset(VMA_NULL, offset); }
void Free(const VmaAllocation allocation) override { FreeAtOffset(allocation, allocation->GetOffset()); }
void FreeAtOffset(VkDeviceSize offset) override { FreeAtOffset(VMA_NULL, offset); }
private:
static const VkDeviceSize MIN_NODE_SIZE = 32;
@ -6489,18 +6489,18 @@ public:
VmaBlockVector* pBlockVector,
uint32_t currentFrameIndex,
bool overlappingMoveSupported);
virtual ~VmaDefragmentationAlgorithm_Generic();
~VmaDefragmentationAlgorithm_Generic() override;
virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged);
virtual void AddAll() { m_AllAllocations = true; }
void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) override;
void AddAll() override { m_AllAllocations = true; }
virtual VkResult Defragment(
VkResult Defragment(
VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
VkDeviceSize maxBytesToMove,
uint32_t maxAllocationsToMove);
uint32_t maxAllocationsToMove) override;
virtual VkDeviceSize GetBytesMoved() const { return m_BytesMoved; }
virtual uint32_t GetAllocationsMoved() const { return m_AllocationsMoved; }
VkDeviceSize GetBytesMoved() const override { return m_BytesMoved; }
uint32_t GetAllocationsMoved() const override { return m_AllocationsMoved; }
private:
uint32_t m_AllocationCount;
@ -6616,18 +6616,18 @@ public:
VmaBlockVector* pBlockVector,
uint32_t currentFrameIndex,
bool overlappingMoveSupported);
virtual ~VmaDefragmentationAlgorithm_Fast();
~VmaDefragmentationAlgorithm_Fast() override;
virtual void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) { ++m_AllocationCount; }
virtual void AddAll() { m_AllAllocations = true; }
void AddAllocation(VmaAllocation hAlloc, VkBool32* pChanged) override { ++m_AllocationCount; }
void AddAll() override { m_AllAllocations = true; }
virtual VkResult Defragment(
VkResult Defragment(
VmaVector< VmaDefragmentationMove, VmaStlAllocator<VmaDefragmentationMove> >& moves,
VkDeviceSize maxBytesToMove,
uint32_t maxAllocationsToMove);
uint32_t maxAllocationsToMove) override;
virtual VkDeviceSize GetBytesMoved() const { return m_BytesMoved; }
virtual uint32_t GetAllocationsMoved() const { return m_AllocationsMoved; }
VkDeviceSize GetBytesMoved() const override { return m_BytesMoved; }
uint32_t GetAllocationsMoved() const override { return m_AllocationsMoved; }
private:
struct BlockInfo

View File

@ -30,7 +30,7 @@
class BaseVulkanRenderer : public Renderer
{
public:
virtual bool Init() override
bool Init() override
{
texCommandPool.Init();
@ -63,7 +63,7 @@ public:
return true;
}
virtual void Term() override
void Term() override
{
GetContext()->PresentFrame(nullptr, vk::Extent2D());
osdBuffer.reset();
@ -75,7 +75,7 @@ public:
framebufferTextures.clear();
}
virtual u64 GetTexture(TSP tsp, TCW tcw) override
u64 GetTexture(TSP tsp, TCW tcw) override
{
Texture* tf = textureCache.getTextureCacheData(tsp, tcw);
@ -107,7 +107,7 @@ public:
return tf->GetIntId();
}
virtual bool Process(TA_context* ctx) override
bool Process(TA_context* ctx) override
{
if (KillTex)
textureCache.Clear();

View File

@ -141,10 +141,10 @@ public:
//E8-FF Reserved
}
virtual const char* name() override { return "Windows Keyboard"; }
const char* name() override { return "Windows Keyboard"; }
protected:
virtual u8 convert_keycode(u8 keycode) override
u8 convert_keycode(u8 keycode) override
{
return kb_map[keycode];
}

View File

@ -106,14 +106,14 @@ public:
last_right_thumb_y = 0;
}
}
virtual void rumble(float power, float inclination, u32 duration_ms) override
void rumble(float power, float inclination, u32 duration_ms) override
{
vib_inclination = inclination * power;
vib_stop_time = os_GetSeconds() + duration_ms / 1000.0;
do_rumble(power);
}
virtual void update_rumble() override
void update_rumble() override
{
if (vib_stop_time > 0)
{
@ -166,7 +166,7 @@ public:
}
protected:
virtual void load_axis_min_max(u32 axis) override
void load_axis_min_max(u32 axis) override
{
if (axis == 0 || axis == 1)
{
@ -240,7 +240,7 @@ public:
if (!find_mapping())
input_mapper = std::make_shared<KbInputMapping>();
}
virtual ~WinKbGamepadDevice() {}
~WinKbGamepadDevice() override {}
};
class MouseInputMapping : public InputMapping
@ -267,7 +267,7 @@ public:
if (!find_mapping())
input_mapper = std::make_shared<MouseInputMapping>();
}
virtual ~WinMouseGamepadDevice() {}
~WinMouseGamepadDevice() override {}
bool gamepad_btn_input(u32 code, bool pressed) override
{
@ -280,7 +280,7 @@ public:
return GamepadDevice::gamepad_btn_input(code, pressed);
}
virtual const char *get_button_name(u32 code) override
const char *get_button_name(u32 code) override
{
switch (code)
{