mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
0c5e01643e
![image](https://github.com/open-goal/jak-project/assets/48171810/4c285f31-c874-424a-8510-d181ba0f88d5) ![image](https://github.com/open-goal/jak-project/assets/48171810/6baa29ef-df92-435e-ad2f-9a42d56e6f17) and the minimap has filtering now: ![image](https://github.com/open-goal/jak-project/assets/48171810/7cb2b0c9-5c86-426e-b028-dddcc3d649f7) It's mostly implemented in C++ using the texture animator.
33 lines
1.2 KiB
C++
33 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "game/graphics/opengl_renderer/BucketRenderer.h"
|
|
#include "game/graphics/opengl_renderer/DirectRenderer.h"
|
|
#include "game/graphics/opengl_renderer/TextureAnimator.h"
|
|
#include "game/graphics/texture/TexturePool.h"
|
|
|
|
/*!
|
|
* The TextureUploadHandler receives textures uploads in the DMA chain and updates the TexturePool.
|
|
* The actual textures are preconverted and provided by the loader, so this just updates tables that
|
|
* tell the renderers which OpenGL texture goes with PS2 VRAM addresses.
|
|
*/
|
|
class TextureUploadHandler : public BucketRenderer {
|
|
public:
|
|
TextureUploadHandler(const std::string& name,
|
|
int my_id,
|
|
std::shared_ptr<TextureAnimator> texture_animator,
|
|
bool add_direct = false);
|
|
void render(DmaFollower& dma, SharedRenderState* render_state, ScopedProfilerNode& prof) override;
|
|
void draw_debug_window() override;
|
|
|
|
private:
|
|
struct TextureUpload {
|
|
u64 page;
|
|
s64 mode;
|
|
};
|
|
void flush_uploads(std::vector<TextureUpload>& uploads, SharedRenderState* render_state);
|
|
bool m_fake_uploads = false;
|
|
int m_upload_count = 0;
|
|
std::shared_ptr<TextureAnimator> m_texture_animator;
|
|
std::unique_ptr<DirectRenderer> m_direct;
|
|
};
|