Merge pull request #366 from LightyPonce/cathook-NCC
Remove useless files
This commit is contained in:
commit
7286c5c64e
@ -8,7 +8,6 @@
|
|||||||
#ifndef BACKGROUND_HPP_
|
#ifndef BACKGROUND_HPP_
|
||||||
#define BACKGROUND_HPP_
|
#define BACKGROUND_HPP_
|
||||||
|
|
||||||
#include "resource.hpp"
|
|
||||||
#include "common.hpp"
|
#include "common.hpp"
|
||||||
#include "menu/ncc/Menu.hpp"
|
#include "menu/ncc/Menu.hpp"
|
||||||
|
|
||||||
|
@ -1,29 +0,0 @@
|
|||||||
/*
|
|
||||||
* resource.hpp
|
|
||||||
*
|
|
||||||
* Created on: Mar 28, 2017
|
|
||||||
* Author: nullifiedcat
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef RESOURCE_HPP_
|
|
||||||
#define RESOURCE_HPP_
|
|
||||||
|
|
||||||
#include "common.hpp"
|
|
||||||
|
|
||||||
class Texture
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Texture(unsigned char *start, unsigned w, unsigned h);
|
|
||||||
~Texture();
|
|
||||||
void Load();
|
|
||||||
void Draw(int x, int y, int w, int h,
|
|
||||||
int color = colorsint::Create(255, 255, 255, 255));
|
|
||||||
|
|
||||||
public:
|
|
||||||
int id{ 0 };
|
|
||||||
const unsigned char *const start_addr;
|
|
||||||
const unsigned w;
|
|
||||||
const unsigned h;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* RESOURCE_HPP_ */
|
|
@ -1,41 +0,0 @@
|
|||||||
/*
|
|
||||||
* resource.cpp
|
|
||||||
*
|
|
||||||
* Created on: Mar 28, 2017
|
|
||||||
* Author: nullifiedcat
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "common.hpp"
|
|
||||||
#include "resource.hpp"
|
|
||||||
|
|
||||||
Texture::Texture(unsigned char *start, unsigned w, unsigned h)
|
|
||||||
: start_addr(start), w(w), h(h)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Texture::~Texture()
|
|
||||||
{
|
|
||||||
if (id)
|
|
||||||
{
|
|
||||||
g_ISurface->DeleteTextureByID(id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void Texture::Load()
|
|
||||||
{
|
|
||||||
id = g_ISurface->CreateNewTextureID(true);
|
|
||||||
logging::Info("Loading %ix%i texture from 0x%08x: got id %i", w, h,
|
|
||||||
start_addr, id);
|
|
||||||
// g_ISurface->DrawSetTextureRGBA(id, start_addr, w, h, 0, 0);
|
|
||||||
g_ISurface->DrawSetTextureRGBAEx(id, start_addr, w, h,
|
|
||||||
ImageFormat::IMAGE_FORMAT_RGBA8888);
|
|
||||||
}
|
|
||||||
|
|
||||||
void Texture::Draw(int x, int y, int sw, int sh, int color)
|
|
||||||
{
|
|
||||||
if (!g_ISurface->IsTextureIDValid(id))
|
|
||||||
throw std::runtime_error("Invalid texture ID!");
|
|
||||||
g_ISurface->DrawSetColor(*reinterpret_cast<Color *>(&color));
|
|
||||||
g_ISurface->DrawSetTexture(id);
|
|
||||||
g_ISurface->DrawTexturedRect(x, y, x + sw, y + sh);
|
|
||||||
}
|
|
Reference in New Issue
Block a user