From 199671301defd16458cc033bd3acc6972a6b0285 Mon Sep 17 00:00:00 2001
From: emufan4568 <geoster3d@gmail.com>
Date: Sat, 20 Aug 2022 13:03:09 +0300
Subject: [PATCH] rasterizer_cache: Header cleanup and copyright date update

---
 .../rasterizer_cache/rasterizer_cache.cpp     | 26 +++----------------
 .../rasterizer_cache/rasterizer_cache.h       | 23 +---------------
 .../rasterizer_cache/rasterizer_cache_types.h |  3 ++-
 .../rasterizer_cache/surface_params.cpp       |  2 +-
 .../rasterizer_cache/surface_params.h         |  2 +-
 5 files changed, 9 insertions(+), 47 deletions(-)

diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.cpp b/src/video_core/rasterizer_cache/rasterizer_cache.cpp
index 0be54679e..a8a0eec86 100644
--- a/src/video_core/rasterizer_cache/rasterizer_cache.cpp
+++ b/src/video_core/rasterizer_cache/rasterizer_cache.cpp
@@ -1,37 +1,19 @@
-// Copyright 2015 Citra Emulator Project
+// Copyright 2022 Citra Emulator Project
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
-#include <algorithm>
-#include <array>
-#include <atomic>
-#include <bitset>
-#include <cmath>
-#include <cstring>
-#include <iterator>
-#include <memory>
 #include <optional>
-#include <unordered_set>
-#include <utility>
-#include <vector>
 #include <boost/range/iterator_range.hpp>
-#include <glad/glad.h>
-#include "common/alignment.h"
-#include "common/bit_field.h"
 #include "common/logging/log.h"
-#include "common/math_util.h"
 #include "common/microprofile.h"
 #include "common/scope_exit.h"
 #include "common/texture.h"
-#include "common/vector_math.h"
 #include "core/core.h"
-#include "core/custom_tex_cache.h"
 #include "core/hle/kernel/process.h"
-#include "core/settings.h"
 #include "video_core/pica_state.h"
-#include "video_core/renderer_opengl/gl_format_reinterpreter.h"
 #include "video_core/rasterizer_cache/morton_swizzle.h"
 #include "video_core/rasterizer_cache/rasterizer_cache.h"
+#include "video_core/renderer_opengl/gl_format_reinterpreter.h"
 #include "video_core/renderer_opengl/gl_state.h"
 #include "video_core/renderer_opengl/texture_downloader_es.h"
 #include "video_core/renderer_opengl/texture_filters/texture_filterer.h"
@@ -64,7 +46,7 @@ OGLTexture RasterizerCacheOpenGL::AllocateSurfaceTexture(const FormatTuple& form
 
     if (GL_ARB_texture_storage) {
         // Allocate all possible mipmap levels upfront
-        const GLsizei levels = std::log2(std::max(width, height)) + 1;
+        const GLsizei levels = static_cast<GLsizei>(std::log2(std::max(width, height))) + 1;
         glTexStorage2D(GL_TEXTURE_2D, levels, format_tuple.internal_format, width, height);
     } else {
         glTexImage2D(GL_TEXTURE_2D, 0, format_tuple.internal_format, width, height, 0,
@@ -93,7 +75,7 @@ static void AllocateTextureCube(GLuint texture, const FormatTuple& format_tuple,
     glActiveTexture(TextureUnits::TextureCube.Enum());
     if (GL_ARB_texture_storage) {
         // Allocate all possible mipmap levels in case the game uses them later
-        const GLsizei levels = std::log2(width) + 1;
+        const GLsizei levels = static_cast<GLsizei>(std::log2(width)) + 1;
         glTexStorage2D(GL_TEXTURE_CUBE_MAP, levels, format_tuple.internal_format, width, width);
     } else {
         for (auto faces : {
diff --git a/src/video_core/rasterizer_cache/rasterizer_cache.h b/src/video_core/rasterizer_cache/rasterizer_cache.h
index d5f20ce92..b95262674 100644
--- a/src/video_core/rasterizer_cache/rasterizer_cache.h
+++ b/src/video_core/rasterizer_cache/rasterizer_cache.h
@@ -1,31 +1,10 @@
-// Copyright 2015 Citra Emulator Project
+// Copyright 2022 Citra Emulator Project
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
 #pragma once
-
-#include <array>
-#include <list>
-#include <memory>
-#include <mutex>
-#include <set>
-#include <tuple>
-#ifdef __GNUC__
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
-#endif
-#include <boost/icl/interval_map.hpp>
-#include <boost/icl/interval_set.hpp>
-#ifdef __GNUC__
-#pragma GCC diagnostic pop
-#endif
 #include <unordered_map>
-#include <boost/functional/hash.hpp>
-#include <glad/glad.h>
 #include "common/assert.h"
-#include "common/common_funcs.h"
-#include "common/common_types.h"
-#include "common/math_util.h"
 #include "core/custom_tex_cache.h"
 #include "video_core/rasterizer_cache/rasterizer_cache_utils.h"
 #include "video_core/rasterizer_cache/surface_params.h"
diff --git a/src/video_core/rasterizer_cache/rasterizer_cache_types.h b/src/video_core/rasterizer_cache/rasterizer_cache_types.h
index 1074a50ac..698f6ec7f 100644
--- a/src/video_core/rasterizer_cache/rasterizer_cache_types.h
+++ b/src/video_core/rasterizer_cache/rasterizer_cache_types.h
@@ -5,6 +5,7 @@
 #pragma once
 #include <memory>
 #include <set>
+#include <tuple>
 #include <boost/icl/interval_map.hpp>
 #include <boost/icl/interval_set.hpp>
 #include "common/common_types.h"
@@ -12,7 +13,7 @@
 
 namespace OpenGL {
 
-class CachedSurface;
+struct CachedSurface;
 using Surface = std::shared_ptr<CachedSurface>;
 
 // Declare rasterizer interval types
diff --git a/src/video_core/rasterizer_cache/surface_params.cpp b/src/video_core/rasterizer_cache/surface_params.cpp
index fae3b4106..d5fb3ecdb 100644
--- a/src/video_core/rasterizer_cache/surface_params.cpp
+++ b/src/video_core/rasterizer_cache/surface_params.cpp
@@ -1,4 +1,4 @@
-// Copyright 2020 Citra Emulator Project
+// Copyright 2022 Citra Emulator Project
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.
 
diff --git a/src/video_core/rasterizer_cache/surface_params.h b/src/video_core/rasterizer_cache/surface_params.h
index 0d26ad9a5..23fbad4d2 100644
--- a/src/video_core/rasterizer_cache/surface_params.h
+++ b/src/video_core/rasterizer_cache/surface_params.h
@@ -1,4 +1,4 @@
-// Copyright 2020 Citra Emulator Project
+// Copyright 2022 Citra Emulator Project
 // Licensed under GPLv2 or any later version
 // Refer to the license.txt file included.