This commit is contained in:
DepressedTWM 2026-06-29 18:56:21 +04:00
parent ee3e60581c
commit b94b6aa731
7 changed files with 93 additions and 38 deletions

View file

@ -4,7 +4,7 @@
| :--- | :---: | :--- |
| Windows | 100% | Играбельно |
| Linux | 90% | В работе, но уже играбельно<br>TODO:<br>&nbsp;* Fix Wallpaper manager |
| *BSD | 20% | в работе |
| *BSD | 15% | в работе |
| GNU/Hurd | 1% | В работе |
| Solaris/OpenSolaris | 1% | В работе |
| RedoxOS | 0% | Не хватает библеотек |

View file

@ -304,6 +304,41 @@ RB_METHOD(bitmapGradientFillRect){
return self;
}
RB_METHOD(bitmapGradientFillRect4){
Bitmap *b = getPrivateData<Bitmap>(self);
VALUE color1Obj, color2Obj, color3Obj, color4Obj;
Color *color1, *color2, *color3, *color4;
if (argc == 4 || argc == 5){
VALUE rectObj;
Rect *rect;
rb_get_args(argc, argv, "ooo|b", &rectObj, &color1Obj, &color2Obj, &color3Obj, &color4Obj RB_ARG_END);
rect = getPrivateDataCheck<Rect>(rectObj, RectType);
color1 = getPrivateDataCheck<Color>(color1Obj, ColorType);
color2 = getPrivateDataCheck<Color>(color2Obj, ColorType);
color3 = getPrivateDataCheck<Color>(color3Obj, ColorType);
color4 = getPrivateDataCheck<Color>(color4Obj, ColorType);
GUARD_EXC( b->gradientFillRect(rect->toIntRect(), color1->norm, color2->norm, color3->norm, color4->norm); );
}else{
int x, y, width, height;
rb_get_args(argc, argv, "iiiioo|b", &x, &y, &width, &height, &color1Obj, &color2Obj, &color3Obj, &color4Obj RB_ARG_END);
color1 = getPrivateDataCheck<Color>(color1Obj, ColorType);
color2 = getPrivateDataCheck<Color>(color2Obj, ColorType);
color3 = getPrivateDataCheck<Color>(color3Obj, ColorType);
color4 = getPrivateDataCheck<Color>(color4Obj, ColorType);
GUARD_EXC( b->gradientFillRect(x, y, width, height, color1->norm, color2->norm, color3->norm, color4->norm); );
}
return self;
}
RB_METHOD(bitmapClearRect){
Bitmap *b = getPrivateData<Bitmap>(self);

View file

@ -264,14 +264,10 @@ class Game_Map
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_down(distance)
if $game_switches[98] == true
if self.height < Graphics.height / 28
@display_y = self.height / 2
else
@display_y = [@display_y + distance, (self.height - Graphics.height / 28) * 128].min
end
if self.height < Graphics.height / 28
@display_y = self.height / 2
else
@display_y += distance
@display_y = [@display_y + distance, (self.height - Graphics.height / 28) * 128].min
end
end
#--------------------------------------------------------------------------
@ -279,36 +275,24 @@ class Game_Map
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_left(distance)
if $game_switches[98] == true
@display_x = [@display_x - distance, 0].max
else
@display_x -= distance
end
@display_x = [@display_x - distance, 0].max
end
#--------------------------------------------------------------------------
# * Scroll Right
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_right(distance)
if $game_switches[98] == true
@display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min
else
@display_x += distance
end
@display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min
end
#--------------------------------------------------------------------------
# * Scroll Up
# distance : scroll distance
#--------------------------------------------------------------------------
def scroll_up(distance)
if $game_switches[98] == true
if self.height < Graphics.height / 28
@display_y = self.height / 2
else
@display_y = [@display_y - distance, 0].max
end
if self.height < Graphics.height / 28
@display_y = self.height / 2
else
@display_y -= distance
@display_y = [@display_y - distance, 0].max
end
end
#--------------------------------------------------------------------------
@ -553,4 +537,4 @@ class Game_Map
@fog_opacity_duration -= 1
end
end
end
end

View file

@ -39,15 +39,10 @@ class Game_Player < Game_Character
# * Set Map Display Position to Center of Screen
#--------------------------------------------------------------------------
def center(x, y)
if $game_switches[98] == true
max_x = ($game_map.width - (Graphics.width / 32)) * 128
max_y = ($game_map.height - (Graphics.height / 28)) * 128
$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
else
$game_map.display_x = x * 128 - CENTER_X
$game_map.display_y = y * 128 - CENTER_Y
end
max_x = ($game_map.width - (Graphics.width / 32)) * 128
max_y = ($game_map.height - (Graphics.height / 28)) * 128
$game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max
end
#--------------------------------------------------------------------------
# * Move to Designated Position
@ -57,9 +52,7 @@ class Game_Player < Game_Character
def moveto(x, y)
super
# Centering
if !$game_switches[100]
center(x, y)
end
center(x, y)
end
#--------------------------------------------------------------------------
# * Increaase Steps

View file

@ -526,6 +526,41 @@ void Bitmap::gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec
p->onModified();
}
void Bitmap::gradientFillRect(int x, int y, int width, int height, const Vec4 &color1, const Vec4 &color2, const Vec4 &color3, const Vec4 &color4) {
gradientFillRect(IntRect(x, y, width, height), color1, color2);
}
void Bitmap::gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec4 &color2, const Vec4 &color3, const Vec4 &color4) {
guardDisposed();
GUARD_MEGA;
SimpleColorShader &shader = shState->shaders().simpleColor;
shader.bind();
shader.setTranslation(Vec2i());
Quad &quad = shState->gpQuad();
quad.vert[0].color = color1;
quad.vert[1].color = color2;
quad.vert[2].color = color3;
quad.vert[3].color = color4;
quad.setPosRect(rect);
p->bindFBO();
p->pushSetViewport(shader);
p->blitQuad(quad);
p->popViewport();
p->addTaintedArea(rect);
p->onModified();
}
void Bitmap::clearRect(int x, int y, int width, int height){
clearRect(IntRect(x, y, width, height));
}

View file

@ -60,6 +60,10 @@ public:
void gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec4 &color2, bool vertical = false);
void gradientFillRect(int x, int y, int width, int height, const Vec4 &color1, const Vec4 &color2, const Vec4 &color3, const Vec4 &color4);
void gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec4 &color2, const Vec4 &color3, const Vec4 &color4);
void clearRect(int x, int y,
int width, int height);
void clearRect(const IntRect &rect);

4
update_android_project.sh Executable file
View file

@ -0,0 +1,4 @@
#/bin/sh
TMP=$(mktemp)
find src > $TMP
python3 create-android-project.py cats.catwindowteam.sunshine --variant symlink --output ./android-project < $TMP