clang tidy cleanups
This commit is contained in:
@@ -228,7 +228,6 @@ void ApplyBpsPatch(const std::vector<uint8_t> &source,
|
||||
}
|
||||
|
||||
size_t patch_offset = 4;
|
||||
uint64_t source_size = decode(patch, patch_offset);
|
||||
uint64_t target_size = decode(patch, patch_offset);
|
||||
uint64_t metadata_size = decode(patch, patch_offset);
|
||||
patch_offset += metadata_size;
|
||||
|
||||
@@ -108,6 +108,46 @@ class ExperimentFlags {
|
||||
}
|
||||
return flags_.get();
|
||||
}
|
||||
std::string Serialize() const {
|
||||
std::string result;
|
||||
result +=
|
||||
"kLogInstructions: " + std::to_string(flags_->kLogInstructions) + "\n";
|
||||
result +=
|
||||
"kUseNewImGuiInput: " + std::to_string(flags_->kUseNewImGuiInput) +
|
||||
"\n";
|
||||
result +=
|
||||
"kSaveAllPalettes: " + std::to_string(flags_->kSaveAllPalettes) + "\n";
|
||||
result +=
|
||||
"kSaveGfxGroups: " + std::to_string(flags_->kSaveGfxGroups) + "\n";
|
||||
result += "kSaveWithChangeQueue: " +
|
||||
std::to_string(flags_->kSaveWithChangeQueue) + "\n";
|
||||
result += "kDrawDungeonRoomGraphics: " +
|
||||
std::to_string(flags_->kDrawDungeonRoomGraphics) + "\n";
|
||||
result += "kNewFileDialogWrapper: " +
|
||||
std::to_string(flags_->kNewFileDialogWrapper) + "\n";
|
||||
result +=
|
||||
"kLoadSystemFonts: " + std::to_string(flags_->kLoadSystemFonts) + "\n";
|
||||
result += "kLoadTexturesAsStreaming: " +
|
||||
std::to_string(flags_->kLoadTexturesAsStreaming) + "\n";
|
||||
result +=
|
||||
"kSaveDungeonMaps: " + std::to_string(flags_->kSaveDungeonMaps) + "\n";
|
||||
result += "kLogToConsole: " + std::to_string(flags_->kLogToConsole) + "\n";
|
||||
result +=
|
||||
"kLoadAudioDevice: " + std::to_string(flags_->kLoadAudioDevice) + "\n";
|
||||
result += "kDrawOverworldSprites: " +
|
||||
std::to_string(flags_->overworld.kDrawOverworldSprites) + "\n";
|
||||
result += "kSaveOverworldMaps: " +
|
||||
std::to_string(flags_->overworld.kSaveOverworldMaps) + "\n";
|
||||
result += "kSaveOverworldEntrances: " +
|
||||
std::to_string(flags_->overworld.kSaveOverworldEntrances) + "\n";
|
||||
result += "kSaveOverworldExits: " +
|
||||
std::to_string(flags_->overworld.kSaveOverworldExits) + "\n";
|
||||
result += "kSaveOverworldItems: " +
|
||||
std::to_string(flags_->overworld.kSaveOverworldItems) + "\n";
|
||||
result += "kSaveOverworldProperties: " +
|
||||
std::to_string(flags_->overworld.kSaveOverworldProperties) + "\n";
|
||||
return result;
|
||||
}
|
||||
|
||||
private:
|
||||
static std::shared_ptr<Flags> flags_;
|
||||
|
||||
@@ -446,7 +446,6 @@ absl::Status Controller::CreateGuiContext() {
|
||||
absl::Status Controller::LoadFontFamilies() const {
|
||||
ImGuiIO &io = ImGui::GetIO();
|
||||
|
||||
const char *assets_path = "assets/font/";
|
||||
static const char *KARLA_REGULAR = "Karla-Regular.ttf";
|
||||
static const char *ROBOTO_MEDIUM = "Roboto-Medium.ttf";
|
||||
static const char *COUSINE_REGULAR = "Cousine-Regular.ttf";
|
||||
|
||||
@@ -101,14 +101,9 @@ struct Project : public core::ExperimentFlags {
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
absl::Status SerializeExperimentFlags() {
|
||||
auto flags = mutable_flags();
|
||||
// TODO: Serialize flags
|
||||
return absl::OkStatus();
|
||||
}
|
||||
|
||||
bool project_opened_ = false;
|
||||
std::string name;
|
||||
std::string flags = "";
|
||||
std::string filepath;
|
||||
std::string rom_filename_ = "";
|
||||
std::string code_folder_ = "";
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "absl/status/statusor.h"
|
||||
#include "absl/strings/str_format.h"
|
||||
#include "absl/strings/string_view.h"
|
||||
|
||||
#include "app/core/constants.h"
|
||||
#include "app/core/platform/renderer.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
@@ -197,13 +196,9 @@ absl::Status ScreenEditor::SaveDungeonMaps() {
|
||||
const int nbr_basements = dungeon_maps_[d].nbr_of_basement;
|
||||
for (int i = 0; i < nbr_floors + nbr_basements; i++) {
|
||||
for (int j = 0; j < 25; j++) {
|
||||
// rom()->data()[pcPtr + j + (i * 25)] =
|
||||
// dungeon_maps_[d].floor_rooms[i][j];
|
||||
// rom()->data()[pcPtrGFX++] = dungeon_maps_[d].floor_gfx[i][j];
|
||||
|
||||
RETURN_IF_ERROR(rom()->WriteByte(ptr + j + (i * 25),
|
||||
RETURN_IF_ERROR(rom()->WriteByte(pcPtr + j + (i * 25),
|
||||
dungeon_maps_[d].floor_rooms[i][j]));
|
||||
RETURN_IF_ERROR(rom()->WriteByte(ptrGFX + j + (i * 25),
|
||||
RETURN_IF_ERROR(rom()->WriteByte(pcPtrGFX + j + (i * 25),
|
||||
dungeon_maps_[d].floor_gfx[i][j]));
|
||||
pcPtrGFX++;
|
||||
}
|
||||
@@ -275,8 +270,6 @@ void ScreenEditor::DrawDungeonMapsTabs() {
|
||||
for (int j = 0; j < 25; j++) {
|
||||
if (current_dungeon.floor_rooms[floor_number][j] != 0x0F) {
|
||||
int tile16_id = current_dungeon.floor_rooms[floor_number][j];
|
||||
int tile_x = (tile16_id % 16) * 16;
|
||||
int tile_y = (tile16_id / 16) * 16;
|
||||
int posX = ((j % 5) * 32);
|
||||
int posY = ((j / 5) * 32);
|
||||
|
||||
|
||||
@@ -298,7 +298,6 @@ absl::Status Tile16Editor::LoadTile8() {
|
||||
|
||||
// Calculate the position in the current gfx data
|
||||
int num_columns = current_gfx_bmp_.width() / 8;
|
||||
int num_rows = current_gfx_bmp_.height() / 8;
|
||||
int x = (index % num_columns) * 8 + tx;
|
||||
int y = (index / num_columns) * 8 + ty;
|
||||
int gfx_position = x + (y * 0x100);
|
||||
|
||||
@@ -56,7 +56,6 @@ void Spc700::RunOpcode() {
|
||||
}
|
||||
|
||||
void Spc700::ExecuteInstructions(uint8_t opcode) {
|
||||
uint16_t initialPC = PC;
|
||||
switch (opcode) {
|
||||
case 0x00: { // nop imp
|
||||
read(PC);
|
||||
|
||||
@@ -45,9 +45,6 @@ int main(int argc, char **argv) {
|
||||
} else {
|
||||
SDL_DisplayMode displayMode;
|
||||
SDL_GetCurrentDisplayMode(0, &displayMode);
|
||||
int screenWidth = displayMode.w * 0.8;
|
||||
int screenHeight = displayMode.h * 0.8;
|
||||
|
||||
window_ = std::unique_ptr<SDL_Window, SDL_Deleter>(
|
||||
SDL_CreateWindow("Yaze Emulator", // window title
|
||||
SDL_WINDOWPOS_UNDEFINED, // initial x position
|
||||
@@ -112,7 +109,10 @@ int main(int argc, char **argv) {
|
||||
int wanted_samples_ = 0;
|
||||
SDL_Event event;
|
||||
|
||||
rom_.LoadFromFile("inidisp_hammer_0f00.sfc");
|
||||
if (!rom_.LoadFromFile("inidisp_hammer_0f00.sfc").ok()) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
if (rom_.is_loaded()) {
|
||||
rom_data_ = rom_.vector();
|
||||
snes_.Init(rom_data_);
|
||||
|
||||
@@ -37,7 +37,7 @@ constexpr float kColorByteMaxF = 255.f;
|
||||
*/
|
||||
class SnesColor {
|
||||
public:
|
||||
SnesColor() : rgb_(0.f, 0.f, 0.f, 0.f), snes_(0) {}
|
||||
SnesColor() : rgb_(0.f, 0.f, 0.f, 0.f), snes_(0), rom_color_({0, 0, 0}) {}
|
||||
explicit SnesColor(const ImVec4 val) : rgb_(val) {
|
||||
snes_color color;
|
||||
color.red = val.x / kColorByteMax;
|
||||
|
||||
@@ -434,9 +434,14 @@ void Room::LoadSprites() {
|
||||
break;
|
||||
}
|
||||
|
||||
// sprites_.emplace_back(this, b3, (b2 & 0x1F), (b1 & 0x1F),
|
||||
// ((b2 & 0xE0) >> 5) + ((b1 & 0x60) >> 2),
|
||||
// (b1 & 0x80) >> 7);
|
||||
Sprite new_sprite;
|
||||
/**
|
||||
* TODO: Implement Sprite constructor for Dungeons
|
||||
(b3, (b2 & 0x1F), (b1 & 0x1F),
|
||||
((b2 & 0xE0) >> 5) + ((b1 & 0x60) >> 2),
|
||||
(b1 & 0x80) >> 7);
|
||||
*/
|
||||
sprites_.emplace_back(new_sprite);
|
||||
|
||||
if (sprites_.size() > 1) {
|
||||
Sprite& spr = sprites_.back();
|
||||
|
||||
@@ -119,7 +119,6 @@ class RoomObject : public SharedRom {
|
||||
}
|
||||
|
||||
void AddTiles(int nbr, int pos) {
|
||||
auto rom_data = rom()->data();
|
||||
for (int i = 0; i < nbr; i++) {
|
||||
ASSIGN_OR_LOG_ERROR(auto tile, rom()->ReadTile16(pos + (i * 2)));
|
||||
tiles_.push_back(tile);
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
|
||||
#include "absl/container/flat_hash_map.h"
|
||||
#include "absl/status/status.h"
|
||||
|
||||
#include "app/core/constants.h"
|
||||
#include "app/gfx/bitmap.h"
|
||||
#include "app/gfx/compression.h"
|
||||
@@ -641,9 +640,6 @@ absl::Status Overworld::SaveOverworldMaps() {
|
||||
} else {
|
||||
// Save pointer for map1
|
||||
int snes_pos = map_pointers1[map_pointers1_id[i]];
|
||||
uint8_t b1 = (uint8_t)(snes_pos & 0xFF);
|
||||
uint8_t b2 = (uint8_t)((snes_pos >> 8) & 0xFF);
|
||||
uint8_t b3 = (uint8_t)((snes_pos >> 16) & 0xFF);
|
||||
core::Logger::log("Saving map pointers1 for map " +
|
||||
core::UppercaseHexByte(i) + " at " +
|
||||
core::UppercaseHexLong(snes_pos));
|
||||
@@ -667,9 +663,6 @@ absl::Status Overworld::SaveOverworldMaps() {
|
||||
std::copy(b.begin(), b.end(), map_data_p2[i].begin());
|
||||
int snes_pos = core::PcToSnes(pos);
|
||||
map_pointers2[i] = snes_pos;
|
||||
uint8_t b1 = (uint8_t)(snes_pos & 0xFF);
|
||||
uint8_t b2 = (uint8_t)((snes_pos >> 8) & 0xFF);
|
||||
uint8_t b3 = (uint8_t)((snes_pos >> 16) & 0xFF);
|
||||
core::Logger::log("Saving map pointers2 and compressed data for map " +
|
||||
core::UppercaseHexByte(i) + " at " +
|
||||
core::UppercaseHexLong(snes_pos));
|
||||
|
||||
@@ -21,7 +21,7 @@ void TitleScreen::Create() {
|
||||
}
|
||||
|
||||
void TitleScreen::BuildTileset() {
|
||||
uchar staticgfx[16];
|
||||
uchar staticgfx[16] = {0};
|
||||
|
||||
// Main Blocksets
|
||||
|
||||
|
||||
Reference in New Issue
Block a user