Merge branch 'master' into window-dimensions-constant

This commit is contained in:
Justin Scofield
2022-08-10 10:10:53 -04:00
committed by GitHub
24 changed files with 190 additions and 272 deletions

View File

@@ -1,6 +1,7 @@
#include "common.h"
#include <cstdint>
#include <string>
namespace yaze {
namespace app {
@@ -19,7 +20,7 @@ int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3) {
}
// hextodec has been imported from SNESDisasm to parse hex numbers
int HexToDec(char* input, int length) {
int HexToDec(char *input, int length) {
int result = 0;
int value;
int ceiling = length - 1;
@@ -48,6 +49,15 @@ int HexToDec(char* input, int length) {
return result;
}
bool StringReplace(std::string &str, const std::string &from,
const std::string &to) {
size_t start = str.find(from);
if (start == std::string::npos) return false;
str.replace(start, from.length(), to);
return true;
}
} // namespace core
} // namespace app
} // namespace yaze

View File

@@ -2,6 +2,7 @@
#define YAZE_CORE_COMMON_H
#include <cstdint>
#include <string>
namespace yaze {
namespace app {
@@ -10,6 +11,8 @@ namespace core {
unsigned int SnesToPc(unsigned int addr);
int AddressFromBytes(uint8_t addr1, uint8_t addr2, uint8_t addr3);
int HexToDec(char *input, int length);
bool StringReplace(std::string &str, const std::string &from,
const std::string &to);
} // namespace core
} // namespace app

View File

@@ -156,7 +156,7 @@ absl::Status Controller::CreateWindow() {
SDL_WINDOWPOS_UNDEFINED, // initial y position
kScreenWidth, // width, in pixels
kScreenHeight, // height, in pixels
SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL),
SDL_WINDOW_RESIZABLE),
sdl_deleter());
if (window_ == nullptr) {
return absl::InternalError(