Auth 2D stuff
This commit is contained in:
@@ -253,6 +253,7 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="auth_2d.cpp" />
|
||||
<ClCompile Include="Glitter\counter.cpp" />
|
||||
<ClCompile Include="Glitter\glitter.cpp" />
|
||||
<ClCompile Include="Glitter\particle.cpp" />
|
||||
@@ -301,6 +302,7 @@ del "$(SolutionDir)bin\$(TargetName).lib"</Command>
|
||||
<ResourceCompile Include="DivaGL.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="auth_2d.hpp" />
|
||||
<ClInclude Include="Glitter\glitter.hpp" />
|
||||
<ClInclude Include="auth_3d.hpp" />
|
||||
<ClInclude Include="camera.hpp" />
|
||||
|
||||
@@ -0,0 +1,310 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#include "auth_2d.hpp"
|
||||
#include "file_handler.hpp"
|
||||
#include "task.hpp"
|
||||
|
||||
struct aet_comp;
|
||||
struct aet_marker;
|
||||
struct aet_scene;
|
||||
|
||||
typedef uint16_t aet_layer_flag;
|
||||
typedef uint8_t aet_layer_quality;
|
||||
|
||||
union aet_item {
|
||||
void* none;
|
||||
uint32_t offset;
|
||||
struct aet_video* video;
|
||||
struct aet_audio* audio;
|
||||
aet_comp* comp;
|
||||
};
|
||||
enum aet_item_type : uint8_t {
|
||||
AET_ITEM_TYPE_NONE = 0x00,
|
||||
AET_ITEM_TYPE_VIDEO = 0x01,
|
||||
AET_ITEM_TYPE_AUDIO = 0x02,
|
||||
AET_ITEM_TYPE_COMPOSITION = 0x03,
|
||||
};
|
||||
|
||||
struct aet_layer {
|
||||
const char* name;
|
||||
float_t start_time;
|
||||
float_t end_time;
|
||||
float_t offset_time;
|
||||
float_t time_scale;
|
||||
aet_layer_flag flags;
|
||||
aet_layer_quality quality;
|
||||
aet_item_type item_type;
|
||||
aet_item item;
|
||||
aet_layer* parent;
|
||||
uint32_t markers_count;
|
||||
aet_marker* markers;
|
||||
struct aet_layer_video* video;
|
||||
struct aet_layer_audio* audio;
|
||||
};
|
||||
|
||||
struct AetSet;
|
||||
|
||||
struct AetSet_vtbl {
|
||||
AetSet* (__fastcall* Dispose)(AetSet* _this, uint8_t flags);
|
||||
void(__fastcall* ReadFile)(AetSet* _this, const char* file_path);
|
||||
bool(__fastcall* LoadFile)(AetSet* _this);
|
||||
void(__fastcall* Unload)(AetSet* _this);
|
||||
bool(__fastcall* Load)(AetSet* _this);
|
||||
};
|
||||
|
||||
struct AetSet {
|
||||
AetSet_vtbl* __vftable;
|
||||
int32_t index;
|
||||
aet_scene** scenes;
|
||||
uint32_t scenes_count;
|
||||
int32_t load_count;
|
||||
p_file_handler file_handler;
|
||||
bool ready;
|
||||
prj::shared_ptr<void*> alloc_handler; // prj::stack_allocator
|
||||
};
|
||||
|
||||
struct AetObj;
|
||||
|
||||
struct AetObj_vtbl {
|
||||
AetObj*(FASTCALL * Dispose)(AetObj* _this, uint8_t flags);
|
||||
void(FASTCALL* Init)(AetObj* _this, AetArgs* init_data, aet_scene* scene, aet_comp* comp,
|
||||
aet_layer* layer, aet_marker* start_marker, aet_marker* end_marker, resolution_mode mode);
|
||||
void(FASTCALL* Ctrl)(AetObj* _this);
|
||||
void(FASTCALL* Disp)(AetObj* _this);
|
||||
bool(FASTCALL* StepFrame)(AetObj* _this);
|
||||
void(FASTCALL* SetPlay)(AetObj* _this, bool value);
|
||||
void(FASTCALL* SetVisible)(AetObj* _this, bool value);
|
||||
void(FASTCALL* SetPosition)(AetObj* _this, vec3* value);
|
||||
void(FASTCALL* SetScale)(AetObj* _this, vec3* value);
|
||||
void(FASTCALL* SetRotation)(AetObj* _this, vec3* value);
|
||||
void(FASTCALL* SetAlpha)(AetObj* _this, float_t value);
|
||||
void(FASTCALL* SetSpriteReplace)(AetObj* _this, prj::map<uint32_t, uint32_t>& value);
|
||||
void(FASTCALL* SetSpriteTexture)(AetObj* _this, prj::map<uint32_t, texture*>& value);
|
||||
void(FASTCALL* SetSpriteDiscard)(AetObj* _this, prj::map<uint32_t, uint32_t>& value);
|
||||
void(FASTCALL* SetColor)(AetObj* _this, vec4* value);
|
||||
void(FASTCALL* SetEndTime)(AetObj* _this, float_t value);
|
||||
void(FASTCALL* SetFrame)(AetObj* _this, float_t value);
|
||||
void(FASTCALL* SetPrio)(AetObj* _this, spr::SprPrio value);
|
||||
aet_info(FASTCALL* GetInfo)(AetObj* _this);
|
||||
bool(FASTCALL* GetPlay)(AetObj* _this);
|
||||
bool(FASTCALL* GetVisible)(AetObj* _this);
|
||||
float_t(FASTCALL* GetFrame)(AetObj* _this);
|
||||
bool(FASTCALL* GetEnd)(AetObj* _this);
|
||||
void(FASTCALL* CtrlComp)(AetObj* _this, aet_comp* comp, float_t frame);
|
||||
void(FASTCALL* DispComp)(AetObj* _this, mat4* mat, aet_comp* comp, float_t frame, float_t opacity);
|
||||
void(FASTCALL* CtrlLayer)(AetObj* _this, aet_layer* layer, float_t frame);
|
||||
void(FASTCALL* DispLayer)(AetObj* _this, mat4* mat, aet_layer* layer, float_t frame, float_t opacity);
|
||||
void(FASTCALL* DispVideo)(AetObj* _this, mat4* mat, aet_layer* layer, float_t frame, float_t opacity);
|
||||
void(FASTCALL* DispSprite)(AetObj* _this, mat4* mat, aet_layer* layer, float_t opacity);
|
||||
void(FASTCALL* DispSpriteSource)(AetObj* _this, mat4* mat,
|
||||
aet_layer* layer, uint32_t source_index, float_t opacity);
|
||||
void(FASTCALL* CalcMat)(AetObj* _this, mat4* mat, aet_layer* layer, float_t frame);
|
||||
};
|
||||
|
||||
struct AetObj {
|
||||
AetObj_vtbl* __vftable;
|
||||
aet_info info;
|
||||
aet_scene* scene;
|
||||
aet_comp* comp;
|
||||
aet_layer* layer;
|
||||
float_t start_time;
|
||||
float_t end_time;
|
||||
AetFlags flags;
|
||||
int32_t index;
|
||||
int32_t layer_index;
|
||||
spr::SprPrio prio;
|
||||
resolution_mode src_mode;
|
||||
vec3 pos;
|
||||
vec3 rot;
|
||||
vec3 scale;
|
||||
vec3 anchor;
|
||||
float_t frame_speed;
|
||||
vec4 color;
|
||||
float_t frame;
|
||||
resolution_mode dst_mode;
|
||||
vec2 scale_size;
|
||||
bool matte;
|
||||
spr::SprArgs spr_args;
|
||||
float_t opacity;
|
||||
prj::map<prj::string, int32_t> layer_sprite;
|
||||
prj::string sound_path;
|
||||
prj::map<prj::string, prj::string> sound_replace;
|
||||
int32_t sound_queue_index;
|
||||
prj::map<uint32_t, uint32_t> sprite_replace;
|
||||
prj::map<uint32_t, texture*> sprite_texture;
|
||||
prj::map<uint32_t, uint32_t> sprite_discard;
|
||||
FrameRateControl* frame_rate_control;
|
||||
bool sound_voice;
|
||||
bool use_float;
|
||||
|
||||
void SetFrameRateControl(FrameRateControl* value);
|
||||
};
|
||||
|
||||
class AetMgr : public app::Task {
|
||||
public:
|
||||
prj::map<int32_t, AetSet> sets;
|
||||
prj::map<uint32_t, AetObj> objects;
|
||||
prj::list<prj::map<uint32_t, AetObj>::iterator> free_objects;
|
||||
uint32_t load_counter;
|
||||
|
||||
AetObj* get_obj(uint32_t id);
|
||||
void set_obj_frame_rate_control(uint32_t id, FrameRateControl* value);
|
||||
};
|
||||
|
||||
void (FASTCALL* aet_manager_unload_set)(int32_t set_id)
|
||||
= (void (FASTCALL*)(int32_t set_id))0x000000014019CDD0;
|
||||
bool (FASTCALL* aet_manager_get_obj_end)(uint32_t id)
|
||||
= (bool (FASTCALL*)(uint32_t id))0x000000014019CE60;
|
||||
void (FASTCALL* aet_manager_init_aet_layout)(AetComp* comp, AetArgs* args)
|
||||
= (void (FASTCALL*)(AetComp* comp, AetArgs * args))0x000000014019CEB0;
|
||||
float_t(FASTCALL* aet_manager_get_obj_frame)(uint32_t id) = (float_t(FASTCALL*)(uint32_t id))0x000000014019CE70;
|
||||
void (FASTCALL* aet_manager_init_aet_layout_0)(AetComp* comp, int32_t aet_id, const char* layer_name,
|
||||
AetFlags flags, resolution_mode mode, const char* start_marker, float_t start_time)
|
||||
= (void (FASTCALL * )(AetComp * comp, int32_t aet_id, const char* layer_name,
|
||||
AetFlags flags, resolution_mode mode, const char* start_marker, float_t start_time))0x000000014019CF40;
|
||||
uint32_t(FASTCALL* aet_manager_init_aet_object)(AetArgs& args)
|
||||
= (uint32_t(FASTCALL*)(AetArgs & args))0x000000014019D3F0;
|
||||
void (FASTCALL* aet_manager_free_aet_object)(uint32_t id)
|
||||
= (void (FASTCALL*)(uint32_t id))0x000000014019D570;
|
||||
void (FASTCALL* aet_manager_read_file)(int32_t set_id, const prj::string mdata_dir)
|
||||
= (void (FASTCALL*)(int32_t set_id, const prj::string mdata_dir))0x000000014019D650;
|
||||
void (FASTCALL* aet_manager_set_obj_visible)(uint32_t id, bool value)
|
||||
= (void (FASTCALL*)(uint32_t id, bool value))0x000000014019D750;
|
||||
void (FASTCALL* aet_manager_set_obj_frame)(uint32_t id, float_t value)
|
||||
= (void (FASTCALL*)(uint32_t id, float_t value))0x000000014019D790;
|
||||
void (FASTCALL* aet_manager_set_obj_alpha)(uint32_t id, float_t value)
|
||||
= (void (FASTCALL*)(uint32_t id, float_t value))0x000000014019D7B0;
|
||||
bool (FASTCALL* aet_manager_load_file)(int32_t set_id)
|
||||
= (bool (FASTCALL*)(int32_t set_id))0x000000014019D970;
|
||||
|
||||
AetMgr& aet_manager = *(AetMgr*)0x0000000140EC5390;
|
||||
|
||||
AetArgs::AetArgs() : layer_name(), start_marker(), end_marker(),
|
||||
flags(), index(), layer(), frame_rate_control(), sound_voice() {
|
||||
start_time = -1.0f;
|
||||
end_time = -1.0f;
|
||||
prio = spr::SPR_PRIO_DEFAULT;
|
||||
mode = RESOLUTION_MODE_HD;
|
||||
scale = 1.0f;
|
||||
frame_speed = 1.0f;
|
||||
color = 1.0f;
|
||||
sound_queue_index = 1;
|
||||
}
|
||||
|
||||
AetArgs::~AetArgs() {
|
||||
|
||||
}
|
||||
|
||||
aet_layout_data::aet_layout_data() : width(), height() {
|
||||
mat = mat4_identity;
|
||||
opacity = 1.0f;
|
||||
color = 0xFFFFFFFF;
|
||||
mode = RESOLUTION_MODE_HD;
|
||||
}
|
||||
|
||||
void aet_layout_data::put_sprite(int32_t spr_id, spr::SprAttr attr,
|
||||
spr::SprPrio prio, const vec2* pos, const aet_layout_data* layout) {
|
||||
if (!layout)
|
||||
return;
|
||||
|
||||
spr::SprArgs args;
|
||||
aet_layout_data::set_args(layout, &args);
|
||||
args.id.id = spr_id;
|
||||
args.attr = attr;
|
||||
args.prio = prio;
|
||||
if (pos)
|
||||
*(vec2*)&args.trans.x += *pos;
|
||||
spr::put_sprite(&args);
|
||||
}
|
||||
|
||||
void aet_layout_data::set_args(const aet_layout_data* layout, spr::SprArgs* args) {
|
||||
if (!layout || !args)
|
||||
return;
|
||||
|
||||
args->trans = layout->position;
|
||||
args->center = layout->anchor;
|
||||
args->scale.x = layout->mat.row0.x;
|
||||
args->scale.y = layout->mat.row1.y;
|
||||
args->scale.z = layout->mat.row2.z;
|
||||
}
|
||||
|
||||
AetComp::AetComp() {
|
||||
|
||||
}
|
||||
|
||||
AetComp::~AetComp() {
|
||||
|
||||
}
|
||||
|
||||
void AetComp::Add(const char* name, const aet_layout_data& data) {
|
||||
this->data.insert({ name, data });
|
||||
}
|
||||
|
||||
void AetComp::Clear() {
|
||||
data.clear();
|
||||
}
|
||||
|
||||
const aet_layout_data* AetComp::Find(const char* name) {
|
||||
auto elem = data.find(name);
|
||||
if (elem != data.end())
|
||||
return &elem->second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AetComp::put_number_sprite(int32_t value, int32_t max_digits,
|
||||
AetComp* comp, const char** names, const int32_t* spr_ids,
|
||||
spr::SprPrio prio, const vec2* pos, bool all_digits) {
|
||||
if (!comp || !names || !spr_ids)
|
||||
return;
|
||||
|
||||
for (int32_t i = 0; i < max_digits; i++) {
|
||||
int32_t digit = value % 10;
|
||||
value /= 10;
|
||||
|
||||
const aet_layout_data* layout = comp->Find(names[i]);
|
||||
if (layout)
|
||||
aet_layout_data::put_sprite(spr_ids[digit],
|
||||
spr::SPR_ATTR_CTR_CC, prio, pos, layout);
|
||||
|
||||
if (!all_digits && !value)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
int32_t aet_database_get_aet_id_by_name(const prj::string& name) {
|
||||
int32_t(FASTCALL * aet_database_struct__get_aet_id_by_name)
|
||||
(size_t _this, const prj::string & name)
|
||||
= (int32_t(FASTCALL*)(size_t _this, const prj::string & name))0x0000000140112180;
|
||||
return aet_database_struct__get_aet_id_by_name(0x0000000140EC5430, name);
|
||||
}
|
||||
|
||||
int32_t aet_database_get_aet_set_id_by_name(const prj::string& name) {
|
||||
int32_t(FASTCALL * aet_database_struct__get_aet_set_id_by_name)
|
||||
(size_t _this, const prj::string & name)
|
||||
= (int32_t(FASTCALL*)(size_t _this, const prj::string & name))0x0000000140112190;
|
||||
return aet_database_struct__get_aet_set_id_by_name(0x0000000140EC5430, name);
|
||||
}
|
||||
|
||||
void aet_manager_set_obj_frame_rate_control(uint32_t id, FrameRateControl* value) {
|
||||
aet_manager.set_obj_frame_rate_control(id, value);
|
||||
}
|
||||
|
||||
void AetObj::SetFrameRateControl(FrameRateControl* value) {
|
||||
frame_rate_control = value;
|
||||
}
|
||||
|
||||
AetObj* AetMgr::get_obj(uint32_t id) {
|
||||
auto elem = objects.find(id);
|
||||
if (elem != objects.end())
|
||||
return &elem->second;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void AetMgr::set_obj_frame_rate_control(uint32_t id, FrameRateControl* value) {
|
||||
AetObj* obj = get_obj(id);
|
||||
if (obj)
|
||||
obj->SetFrameRateControl(value);
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
/*
|
||||
by korenkonder
|
||||
GitHub/GitLab: korenkonder
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "../KKdLib/vec.hpp"
|
||||
#include "frame_rate_control.hpp"
|
||||
#include "sprite.hpp"
|
||||
#include "texture.hpp"
|
||||
#include "types.hpp"
|
||||
|
||||
enum AetFlags {
|
||||
AET_END = 0x000001,
|
||||
AET_REVERSE = 0x000002,
|
||||
AET_PAUSE = 0x000004,
|
||||
AET_HIDDEN = 0x000008,
|
||||
AET_LOOP = 0x010000,
|
||||
AET_PLAY_ONCE = 0x020000,
|
||||
AET_FLIP_H = 0x040000,
|
||||
AET_FLIP_V = 0x080000,
|
||||
AET_100000 = 0x100000,
|
||||
};
|
||||
|
||||
struct aet_info {
|
||||
uint16_t index;
|
||||
uint16_t set_index;
|
||||
|
||||
inline aet_info() {
|
||||
this->index = (uint16_t)-1;
|
||||
this->set_index = (uint16_t)-1;
|
||||
}
|
||||
|
||||
inline aet_info(uint16_t index, uint16_t set_index) {
|
||||
this->index = index;
|
||||
this->set_index = set_index;
|
||||
}
|
||||
|
||||
inline bool is_null() const {
|
||||
return index == (uint16_t)-1 && set_index == (uint16_t)-1;
|
||||
}
|
||||
|
||||
inline bool not_null() const {
|
||||
return index != (uint16_t)-1 || set_index != (uint16_t)-1;
|
||||
}
|
||||
};
|
||||
|
||||
static_assert(sizeof(aet_info) == 0x04, "\"aet_info\" struct should have a size of 0x04");
|
||||
|
||||
inline bool operator >(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left > *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
inline bool operator <(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left < *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
inline bool operator >=(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left >= *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
inline bool operator <=(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left <= *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
inline bool operator ==(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left == *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
inline bool operator !=(const aet_info& left, const aet_info& right) {
|
||||
return *(uint32_t*)&left != *(uint32_t*)&right;
|
||||
}
|
||||
|
||||
struct AetArgs {
|
||||
union IDUnion {
|
||||
aet_info info;
|
||||
int32_t id;
|
||||
|
||||
IDUnion() {
|
||||
id = -1;
|
||||
info = {};
|
||||
}
|
||||
};
|
||||
|
||||
IDUnion id;
|
||||
const char* layer_name;
|
||||
const char* start_marker;
|
||||
const char* end_marker;
|
||||
float_t start_time;
|
||||
float_t end_time;
|
||||
AetFlags flags;
|
||||
int32_t index;
|
||||
int32_t layer;
|
||||
spr::SprPrio prio;
|
||||
resolution_mode mode;
|
||||
vec3 pos;
|
||||
vec3 rot;
|
||||
vec3 scale;
|
||||
vec3 anchor;
|
||||
float_t frame_speed;
|
||||
vec4 color;
|
||||
prj::map<prj::string, int32_t> layer_sprite;
|
||||
prj::string sound_path;
|
||||
prj::map<prj::string, prj::string> sound_replace;
|
||||
int32_t sound_queue_index;
|
||||
prj::map<uint32_t, uint32_t> sprite_replace;
|
||||
prj::map<uint32_t, texture*> sprite_texture;
|
||||
prj::map<uint32_t, uint32_t> sprite_discard;
|
||||
FrameRateControl* frame_rate_control;
|
||||
bool sound_voice;
|
||||
|
||||
AetArgs();
|
||||
~AetArgs();
|
||||
};
|
||||
|
||||
static_assert(sizeof(AetArgs) == 0x108, "\"AetArgs\" struct should have a size of 0x108");
|
||||
|
||||
struct aet_layout_data {
|
||||
mat4 mat;
|
||||
vec3 position;
|
||||
vec3 anchor;
|
||||
float_t width;
|
||||
float_t height;
|
||||
float_t opacity;
|
||||
color4u8 color;
|
||||
resolution_mode mode;
|
||||
|
||||
aet_layout_data();
|
||||
|
||||
static void put_sprite(int32_t spr_id, spr::SprAttr attr,
|
||||
spr::SprPrio prio, const vec2* pos, const aet_layout_data* layout);
|
||||
static void set_args(const aet_layout_data* layout, spr::SprArgs* args);
|
||||
};
|
||||
|
||||
static_assert(sizeof(aet_layout_data) == 0x6C, "\"aet_layout_data\" struct should have a size of 0x6C");
|
||||
|
||||
struct AetComp {
|
||||
prj::map<std::string, aet_layout_data> data;
|
||||
|
||||
AetComp();
|
||||
~AetComp();
|
||||
|
||||
void Add(const char* name, const aet_layout_data& data);
|
||||
void Clear();
|
||||
const aet_layout_data* Find(const char* name);
|
||||
|
||||
static void put_number_sprite(int32_t value, int32_t max_digits,
|
||||
AetComp* comp, const char** names, const int32_t* spr_ids,
|
||||
spr::SprPrio prio, const vec2* pos, bool all_digits);
|
||||
};
|
||||
|
||||
static_assert(sizeof(AetComp) == 0x10, "\"AetComp\" struct should have a size of 0x10");
|
||||
|
||||
extern void (FASTCALL* aet_manager_unload_set)(int32_t set_id);
|
||||
extern bool (FASTCALL* aet_manager_get_obj_end)(uint32_t id);
|
||||
extern void (FASTCALL* aet_manager_init_aet_layout)(AetComp* comp, AetArgs* args);
|
||||
extern float_t(FASTCALL* aet_manager_get_obj_frame)(uint32_t id);
|
||||
extern void (FASTCALL* aet_manager_init_aet_layout_0)(AetComp* comp, int32_t aet_id, const char* layer_name,
|
||||
AetFlags flags, resolution_mode mode, const char* start_marker, float_t start_time);
|
||||
extern uint32_t(FASTCALL* aet_manager_init_aet_object)(AetArgs& args);
|
||||
extern void (FASTCALL* aet_manager_free_aet_object)(uint32_t id);
|
||||
extern void (FASTCALL* aet_manager_read_file)(int32_t set_id, const prj::string mdata_dir);
|
||||
extern void (FASTCALL* aet_manager_set_obj_visible)(uint32_t id, bool value);
|
||||
extern void (FASTCALL* aet_manager_set_obj_frame)(uint32_t id, float_t value);
|
||||
extern void (FASTCALL* aet_manager_set_obj_alpha)(uint32_t id, float_t value);
|
||||
extern bool (FASTCALL* aet_manager_load_file)(int32_t set_id);
|
||||
|
||||
extern int32_t aet_database_get_aet_id_by_name(const prj::string& name);
|
||||
extern int32_t aet_database_get_aet_set_id_by_name(const prj::string& name);
|
||||
|
||||
extern void aet_manager_set_obj_frame_rate_control(uint32_t id, FrameRateControl* value);
|
||||
@@ -109,8 +109,12 @@ namespace spr {
|
||||
|
||||
vec4& spr_color = *(vec4*)0x00000001411ACC30;
|
||||
|
||||
void (FASTCALL* sprite_manager_unload_set)(int32_t set_id)
|
||||
= (void (FASTCALL*)(int32_t set_id))0x000000014063F8D0;
|
||||
size_t(FASTCALL* sprite_manager_get_reqlist_count)(int32_t index)
|
||||
= (size_t(FASTCALL*)(int32_t index))0x000000014063FA90;
|
||||
void (FASTCALL* sprite_manager_read_file)(int32_t set_id, const prj::string mdata_dir)
|
||||
= (void (FASTCALL*)(int32_t set_id, const prj::string mdata_dir))0x0000000140640E10;
|
||||
bool (FASTCALL* sprite_manager_load_file)(int32_t set_id)
|
||||
= (bool (FASTCALL*)(int32_t set_id))0x0000000140640FB0;
|
||||
|
||||
@@ -131,6 +135,8 @@ static const GLenum spr_blend_param[6][4] = {
|
||||
|
||||
namespace spr {
|
||||
void(FASTCALL* put_rgb_cross)(mat4* mat) = (void(FASTCALL*)(mat4 * mat))0x00000001404BC8F0;
|
||||
spr::SprArgs* (FASTCALL* put_sprite)(const spr::SprArgs* args)
|
||||
= (spr::SprArgs * (FASTCALL*)(const spr::SprArgs * args))0x0000000140640740;
|
||||
|
||||
SpriteManager::RenderData::RenderData() {
|
||||
glGenVertexArrays(1, &vao);
|
||||
@@ -1187,6 +1193,13 @@ namespace spr {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t sprite_database_get_spr_set_id_by_name(const prj::string& name) {
|
||||
int32_t(FASTCALL * sprite_database_struct__get_spr_set_id_by_name)
|
||||
(size_t _this, const prj::string & name)
|
||||
= (int32_t(FASTCALL*)(size_t _this, const prj::string & name))0x00000001401121A0;
|
||||
return sprite_database_struct__get_spr_set_id_by_name(0x000000014CC62290, name);
|
||||
}
|
||||
|
||||
void sprite_manager_init() {
|
||||
if (!sprite_manager_render_data)
|
||||
sprite_manager_render_data = new spr::SpriteManager::RenderData;
|
||||
|
||||
@@ -207,13 +207,18 @@ namespace spr {
|
||||
|
||||
|
||||
extern void(FASTCALL* put_rgb_cross)(mat4* mat);
|
||||
extern spr::SprArgs* (FASTCALL* put_sprite)(const spr::SprArgs* args);
|
||||
}
|
||||
|
||||
extern vec4& spr_color;
|
||||
|
||||
extern void (FASTCALL* sprite_manager_unload_set)(int32_t set_id);
|
||||
extern size_t(FASTCALL* sprite_manager_get_reqlist_count)(int32_t index);
|
||||
extern void (FASTCALL* sprite_manager_read_file)(int32_t set_id, const prj::string mdata_dir);
|
||||
extern bool (FASTCALL* sprite_manager_load_file)(int32_t set_id);
|
||||
|
||||
extern int32_t sprite_database_get_spr_set_id_by_name(const prj::string& name);
|
||||
|
||||
extern void sprite_manager_init();
|
||||
extern void sprite_manager_draw(int32_t index, bool font, texture* tex);
|
||||
extern void sprite_manager_set_res(double_t aspect, int32_t width, int32_t height);
|
||||
|
||||
Reference in New Issue
Block a user