1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-10-20 13:40:02 +00:00

git subrepo pull --force tools/ZAPD (#1049)

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "a3363333d"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "a3363333d"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"
This commit is contained in:
fig02 2021-12-03 15:57:05 -05:00 committed by GitHub
commit 68899c2e33
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 1311 additions and 569 deletions

View file

@ -1,5 +1,5 @@
#include "BinaryReader.h"
#include <math.h>
#include <cmath>
#include <stdexcept>
#include "Stream.h"
@ -89,7 +89,7 @@ float BinaryReader::ReadSingle()
stream->Read((char*)&result, sizeof(float));
if (isnan(result))
if (std::isnan(result))
throw std::runtime_error("BinaryReader::ReadSingle(): Error reading stream");
return result;
@ -100,7 +100,7 @@ double BinaryReader::ReadDouble()
double result = NAN;
stream->Read((char*)&result, sizeof(double));
if (isnan(result))
if (std::isnan(result))
throw std::runtime_error("BinaryReader::ReadDouble(): Error reading stream");
return result;

View file

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include <limits>
#include <stdint.h>
#include <vector>
class BitConverter

View file

@ -1,8 +1,8 @@
#pragma once
#include <cstdio>
#include <fstream>
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include "Directory.h"

View file

@ -1,5 +1,5 @@
#include "MemoryStream.h"
#include <string.h>
#include <cstring>
#ifndef _MSC_VER
#define memcpy_s(dest, destSize, source, sourceSize) memcpy(dest, source, destSize)

View file

@ -18,13 +18,13 @@ public:
static std::string GetFileName(const fs::path& input)
{
// https://en.cppreference.com/w/cpp/filesystem/path/filename
return input.filename();
return input.filename().string();
};
static std::string GetFileNameWithoutExtension(const fs::path& input)
{
// https://en.cppreference.com/w/cpp/filesystem/path/stem
return input.stem();
return input.stem().string();
};
static std::string GetFileNameExtension(const std::string& input)

View file

@ -1,7 +1,7 @@
#pragma once
#include <cstdint>
#include <memory>
#include <stdint.h>
enum class SeekOffsetType
{

View file

@ -1,18 +1,12 @@
#pragma once
#include <algorithm>
#include <cstdarg>
#include <cstring>
#include <numeric>
#include <stdarg.h>
#include <string>
#include <vector>
#ifdef _MSC_VER
#define __PRETTY_FUNCTION__ __FUNCSIG__
#elif not defined(__GNUC__)
#define __PRETTY_FUNCTION__ __func__
#endif
class StringHelper
{
public:
@ -111,4 +105,10 @@ public:
{
return std::all_of(str.begin(), str.end(), ::isdigit);
}
static bool IEquals(const std::string& a, const std::string& b)
{
return std::equal(a.begin(), a.end(), b.begin(), b.end(),
[](char a, char b) { return tolower(a) == tolower(b); });
}
};

View file

@ -0,0 +1,45 @@
#ifndef VT_H
#define VT_H
// clang-format off
#define VT_COLOR_BLACK 0
#define VT_COLOR_RED 1
#define VT_COLOR_GREEN 2
#define VT_COLOR_YELLOW 3
#define VT_COLOR_BLUE 4
#define VT_COLOR_PURPLE 5
#define VT_COLOR_CYAN 6
#define VT_COLOR_WHITE 7
#define VT_COLOR_LIGHTGRAY 8
#define VT_COLOR_DARKGRAY 9
#define VT_COLOR_FOREGROUND 3
#define VT_COLOR_BACKGROUND 4
// clang-format on
#define VT_COLOR_EXPAND0(type, color) #type #color
#define VT_COLOR_EXPAND1(type, color) VT_COLOR_EXPAND0(type, color)
#define VT_COLOR(type, color) VT_COLOR_EXPAND1(VT_COLOR_##type, VT_COLOR_##color)
#define VT_ESC "\x1b"
#define VT_CSI "["
#define VT_CUP(x, y) VT_ESC VT_CSI y ";" x "H"
#define VT_ED(n) VT_ESC VT_CSI #n "J"
#define VT_SGR(n) VT_ESC VT_CSI n "m"
// Add more macros if necessary
#define VT_COL(back, fore) VT_SGR(VT_COLOR(BACKGROUND, back) ";" VT_COLOR(FOREGROUND, fore))
#define VT_FGCOL(color) VT_SGR(VT_COLOR(FOREGROUND, color))
#define VT_BGCOL(color) VT_SGR(VT_COLOR(BACKGROUND, color))
// Bold
#define VT_BOLD "1"
// Bold color support
#define VT_BOLD_FGCOL(color) VT_SGR(VT_BOLD ";" VT_COLOR(FOREGROUND, color))
#define VT_BOLD_BGCOL(color) VT_SGR(VT_BOLD ";" VT_COLOR(BACKGROUND, color))
#define VT_RST VT_SGR("")
#define VT_CLS VT_ED(2)
#endif