mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 23:06:18 +00:00
afef
This commit is contained in:
parent
ee3e60581c
commit
b94b6aa731
7 changed files with 93 additions and 38 deletions
|
|
@ -4,7 +4,7 @@
|
||||||
| :--- | :---: | :--- |
|
| :--- | :---: | :--- |
|
||||||
| Windows | 100% | Играбельно |
|
| Windows | 100% | Играбельно |
|
||||||
| Linux | 90% | В работе, но уже играбельно<br>TODO:<br> * Fix Wallpaper manager |
|
| Linux | 90% | В работе, но уже играбельно<br>TODO:<br> * Fix Wallpaper manager |
|
||||||
| *BSD | 20% | в работе |
|
| *BSD | 15% | в работе |
|
||||||
| GNU/Hurd | 1% | В работе |
|
| GNU/Hurd | 1% | В работе |
|
||||||
| Solaris/OpenSolaris | 1% | В работе |
|
| Solaris/OpenSolaris | 1% | В работе |
|
||||||
| RedoxOS | 0% | Не хватает библеотек |
|
| RedoxOS | 0% | Не хватает библеотек |
|
||||||
|
|
|
||||||
|
|
@ -304,6 +304,41 @@ RB_METHOD(bitmapGradientFillRect){
|
||||||
return self;
|
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){
|
RB_METHOD(bitmapClearRect){
|
||||||
Bitmap *b = getPrivateData<Bitmap>(self);
|
Bitmap *b = getPrivateData<Bitmap>(self);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -264,14 +264,10 @@ class Game_Map
|
||||||
# distance : scroll distance
|
# distance : scroll distance
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_down(distance)
|
def scroll_down(distance)
|
||||||
if $game_switches[98] == true
|
if self.height < Graphics.height / 28
|
||||||
if self.height < Graphics.height / 28
|
@display_y = self.height / 2
|
||||||
@display_y = self.height / 2
|
|
||||||
else
|
|
||||||
@display_y = [@display_y + distance, (self.height - Graphics.height / 28) * 128].min
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@display_y += distance
|
@display_y = [@display_y + distance, (self.height - Graphics.height / 28) * 128].min
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -279,36 +275,24 @@ class Game_Map
|
||||||
# distance : scroll distance
|
# distance : scroll distance
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_left(distance)
|
def scroll_left(distance)
|
||||||
if $game_switches[98] == true
|
@display_x = [@display_x - distance, 0].max
|
||||||
@display_x = [@display_x - distance, 0].max
|
|
||||||
else
|
|
||||||
@display_x -= distance
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Scroll Right
|
# * Scroll Right
|
||||||
# distance : scroll distance
|
# distance : scroll distance
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_right(distance)
|
def scroll_right(distance)
|
||||||
if $game_switches[98] == true
|
@display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min
|
||||||
@display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min
|
|
||||||
else
|
|
||||||
@display_x += distance
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Scroll Up
|
# * Scroll Up
|
||||||
# distance : scroll distance
|
# distance : scroll distance
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_up(distance)
|
def scroll_up(distance)
|
||||||
if $game_switches[98] == true
|
if self.height < Graphics.height / 28
|
||||||
if self.height < Graphics.height / 28
|
@display_y = self.height / 2
|
||||||
@display_y = self.height / 2
|
|
||||||
else
|
|
||||||
@display_y = [@display_y - distance, 0].max
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
@display_y -= distance
|
@display_y = [@display_y - distance, 0].max
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -39,15 +39,10 @@ class Game_Player < Game_Character
|
||||||
# * Set Map Display Position to Center of Screen
|
# * Set Map Display Position to Center of Screen
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def center(x, y)
|
def center(x, y)
|
||||||
if $game_switches[98] == true
|
max_x = ($game_map.width - (Graphics.width / 32)) * 128
|
||||||
max_x = ($game_map.width - (Graphics.width / 32)) * 128
|
max_y = ($game_map.height - (Graphics.height / 28)) * 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_x = [0, [x * 128 - CENTER_X, max_x].min].max
|
$game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].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
|
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Move to Designated Position
|
# * Move to Designated Position
|
||||||
|
|
@ -57,9 +52,7 @@ class Game_Player < Game_Character
|
||||||
def moveto(x, y)
|
def moveto(x, y)
|
||||||
super
|
super
|
||||||
# Centering
|
# Centering
|
||||||
if !$game_switches[100]
|
center(x, y)
|
||||||
center(x, y)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Increaase Steps
|
# * Increaase Steps
|
||||||
|
|
|
||||||
|
|
@ -526,6 +526,41 @@ void Bitmap::gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec
|
||||||
p->onModified();
|
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){
|
void Bitmap::clearRect(int x, int y, int width, int height){
|
||||||
clearRect(IntRect(x, y, width, height));
|
clearRect(IntRect(x, y, width, height));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,10 @@ public:
|
||||||
|
|
||||||
void gradientFillRect(const IntRect &rect, const Vec4 &color1, const Vec4 &color2, bool vertical = false);
|
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,
|
void clearRect(int x, int y,
|
||||||
int width, int height);
|
int width, int height);
|
||||||
void clearRect(const IntRect &rect);
|
void clearRect(const IntRect &rect);
|
||||||
|
|
|
||||||
4
update_android_project.sh
Executable file
4
update_android_project.sh
Executable 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
|
||||||
Loading…
Reference in a new issue