This commit is contained in:
ZakatTeamI2P 2026-04-19 14:13:45 +02:00
parent f3a06ceb6d
commit 17c3f38685
6 changed files with 21 additions and 48 deletions

View file

@ -83,7 +83,6 @@ set(MAIN_HEADERS
) )
set(MAIN_SOURCE set(MAIN_SOURCE
${OLDIMPLS_SOURCE}
src/main.cpp src/main.cpp
src/audio.cpp src/audio.cpp
src/bitmap.cpp src/bitmap.cpp

View file

@ -30,8 +30,7 @@
DEF_TYPE_CUSTOMFREE(TilemapAutotiles, RUBY_TYPED_NEVER_FREE); DEF_TYPE_CUSTOMFREE(TilemapAutotiles, RUBY_TYPED_NEVER_FREE);
RB_METHOD(tilemapAutotilesSet) RB_METHOD(tilemapAutotilesSet){
{
Tilemap::Autotiles *a = getPrivateData<Tilemap::Autotiles>(self); Tilemap::Autotiles *a = getPrivateData<Tilemap::Autotiles>(self);
int i; int i;
@ -49,8 +48,7 @@ RB_METHOD(tilemapAutotilesSet)
return self; return self;
} }
RB_METHOD(tilemapAutotilesGet) RB_METHOD(tilemapAutotilesGet){
{
int i; int i;
rb_get_args (argc, argv, "i", &i RB_ARG_END); rb_get_args (argc, argv, "i", &i RB_ARG_END);
@ -64,8 +62,7 @@ RB_METHOD(tilemapAutotilesGet)
DEF_TYPE(Tilemap); DEF_TYPE(Tilemap);
RB_METHOD(tilemapInitialize) RB_METHOD(tilemapInitialize){
{
Tilemap *t; Tilemap *t;
/* Get parameters */ /* Get parameters */
@ -101,8 +98,7 @@ RB_METHOD(tilemapInitialize)
return self; return self;
} }
RB_METHOD(tilemapGetAutotiles) RB_METHOD(tilemapGetAutotiles){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
checkDisposed<Tilemap>(self); checkDisposed<Tilemap>(self);
@ -110,8 +106,7 @@ RB_METHOD(tilemapGetAutotiles)
return rb_iv_get(self, "autotiles"); return rb_iv_get(self, "autotiles");
} }
RB_METHOD(tilemapUpdate) RB_METHOD(tilemapUpdate){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
Tilemap *t = getPrivateData<Tilemap>(self); Tilemap *t = getPrivateData<Tilemap>(self);
@ -121,8 +116,7 @@ RB_METHOD(tilemapUpdate)
return Qnil; return Qnil;
} }
RB_METHOD(tilemapGetViewport) RB_METHOD(tilemapGetViewport){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
checkDisposed<Tilemap>(self); checkDisposed<Tilemap>(self);
@ -141,9 +135,7 @@ DEF_PROP_B(Tilemap, Wrapping)
DEF_PROP_I(Tilemap, OX) DEF_PROP_I(Tilemap, OX)
DEF_PROP_I(Tilemap, OY) DEF_PROP_I(Tilemap, OY)
void void tilemapBindingInit(){
tilemapBindingInit()
{
VALUE klass = rb_define_class("TilemapAutotiles", rb_cObject); VALUE klass = rb_define_class("TilemapAutotiles", rb_cObject);
rb_define_alloc_func(klass, classAllocate<&TilemapAutotilesType>); rb_define_alloc_func(klass, classAllocate<&TilemapAutotilesType>);

View file

@ -29,16 +29,13 @@
DEF_TYPE(Viewport); DEF_TYPE(Viewport);
RB_METHOD(viewportInitialize) RB_METHOD(viewportInitialize){
{
Viewport *v; Viewport *v;
if (argc == 0 && rgssVer >= 3) if (argc == 0 && rgssVer >= 3){
{
v = new Viewport(); v = new Viewport();
} }
else if (argc == 1) else if (argc == 1){
{
/* The rect arg is only used to init the viewport, /* The rect arg is only used to init the viewport,
* and does NOT replace its 'rect' property */ * and does NOT replace its 'rect' property */
VALUE rectObj; VALUE rectObj;
@ -49,9 +46,7 @@ RB_METHOD(viewportInitialize)
rect = getPrivateDataCheck<Rect>(rectObj, RectType); rect = getPrivateDataCheck<Rect>(rectObj, RectType);
v = new Viewport(rect); v = new Viewport(rect);
} }else{
else
{
int x, y, width, height; int x, y, width, height;
rb_get_args(argc, argv, "iiii", &x, &y, &width, &height RB_ARG_END); rb_get_args(argc, argv, "iiii", &x, &y, &width, &height RB_ARG_END);
@ -84,9 +79,7 @@ DEF_PROP_I(Viewport, OX)
DEF_PROP_I(Viewport, OY) DEF_PROP_I(Viewport, OY)
void void viewportBindingInit(){
viewportBindingInit()
{
VALUE klass = rb_define_class("Viewport", rb_cObject); VALUE klass = rb_define_class("Viewport", rb_cObject);
rb_define_alloc_func(klass, classAllocate<&ViewportType>); rb_define_alloc_func(klass, classAllocate<&ViewportType>);

View file

@ -31,8 +31,7 @@
#include "disposable-binding.h" #include "disposable-binding.h"
template<class C> template<class C>
RB_METHOD(viewportElementGetViewport) RB_METHOD(viewportElementGetViewport){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
checkDisposed<C>(self); checkDisposed<C>(self);
@ -41,8 +40,7 @@ RB_METHOD(viewportElementGetViewport)
} }
template<class C> template<class C>
RB_METHOD(viewportElementSetViewport) RB_METHOD(viewportElementSetViewport){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
ViewportElement *ve = getPrivateData<C>(self); ViewportElement *ve = getPrivateData<C>(self);
@ -63,17 +61,14 @@ RB_METHOD(viewportElementSetViewport)
} }
template<class C> template<class C>
static C * static C *viewportElementInitialize(int argc, VALUE *argv, VALUE self){
viewportElementInitialize(int argc, VALUE *argv, VALUE self)
{
/* Get parameters */ /* Get parameters */
VALUE viewportObj = Qnil; VALUE viewportObj = Qnil;
Viewport *viewport = 0; Viewport *viewport = 0;
rb_get_args(argc, argv, "|o", &viewportObj RB_ARG_END); rb_get_args(argc, argv, "|o", &viewportObj RB_ARG_END);
if (!NIL_P(viewportObj)) if (!NIL_P(viewportObj)){
{
viewport = getPrivateDataCheck<Viewport>(viewportObj, ViewportType); viewport = getPrivateDataCheck<Viewport>(viewportObj, ViewportType);
if (rgssVer == 1) if (rgssVer == 1)
@ -90,9 +85,7 @@ viewportElementInitialize(int argc, VALUE *argv, VALUE self)
} }
template<class C> template<class C>
void void viewportElementBindingInit(VALUE klass){
viewportElementBindingInit(VALUE klass)
{
sceneElementBindingInit<C>(klass); sceneElementBindingInit<C>(klass);
_rb_define_method(klass, "viewport", viewportElementGetViewport<C>); _rb_define_method(klass, "viewport", viewportElementGetViewport<C>);

View file

@ -165,8 +165,7 @@
} }
#endif #endif
RB_METHOD(wallpaperSet) RB_METHOD(wallpaperSet){
{
RB_UNUSED_PARAM; RB_UNUSED_PARAM;
const char *name; const char *name;
int color; int color;
@ -483,8 +482,7 @@ RB_METHOD(wallpaperReset)
return Qnil; return Qnil;
} }
void wallpaperBindingInit() void wallpaperBindingInit(){
{
VALUE module = rb_define_module("Wallpaper"); VALUE module = rb_define_module("Wallpaper");
// Functions // Functions
@ -493,8 +491,7 @@ void wallpaperBindingInit()
} }
#ifdef __linux__ #ifdef __linux__
void wallpaperBindingTerminate() void wallpaperBindingTerminate(){
{
// Clean up. // Clean up.
if (desktop == "xfce") { if (desktop == "xfce") {
xfconf_shutdown(); xfconf_shutdown();

View file

@ -10,8 +10,7 @@ uniform lowp float opacity;
varying vec2 v_texCoord; varying vec2 v_texCoord;
void main() void main(){
{
vec2 coor = v_texCoord; vec2 coor = v_texCoord;
vec2 dstCoor = (coor - subRect.xy) * subRect.zw; vec2 dstCoor = (coor - subRect.xy) * subRect.zw;