Merge branch 'master' of ssh://femoz.anipic.ru:222/Sunshine/mkxp-sunshine
This commit is contained in:
commit
ede3ba5782
|
|
@ -1,11 +1,23 @@
|
||||||
|
# aspects, resolutions and filenames
|
||||||
|
# 4:3 - 640x480 - "_4_3"
|
||||||
|
# 16:9 - 960x540 - "_16_9"
|
||||||
|
# 16:10 - 960x600 - "_16_10"
|
||||||
|
#
|
||||||
|
# extra (not recomendated)
|
||||||
|
# 16:9 HD - 1280x720 - "_16_9_hd"
|
||||||
|
# 16:9 FHD - 1920x1080 - "_16_9_fhd"
|
||||||
module Graphics
|
module Graphics
|
||||||
RESOLUTION_ASPECT =
|
RESOLUTION_ASPECT =
|
||||||
if Graphics.width == 1280 && Graphics.height == 720
|
if Graphics.width == 1920 && Graphics.height == 1080
|
||||||
|
"_16_9_fhd"
|
||||||
|
elsif Graphics.width == 1280 && Graphics.height == 720
|
||||||
"_16_9_hd"
|
"_16_9_hd"
|
||||||
elsif Graphics.width == 1920 / 2 && Graphics.height == 1080 / 2
|
elsif Graphics.width == 1920 / 2 && Graphics.height == 1080 / 2
|
||||||
"_16_9"
|
"_16_9"
|
||||||
elsif Graphics.width == 640 && Graphics.height == 480
|
elsif Graphics.width == 640 && Graphics.height == 480
|
||||||
"_4_3"
|
"_4_3"
|
||||||
|
else
|
||||||
|
""
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -455,7 +467,7 @@ module RPG
|
||||||
sprite.zoom_x = cell_data[i, 3] / 100.0
|
sprite.zoom_x = cell_data[i, 3] / 100.0
|
||||||
sprite.zoom_y = cell_data[i, 3] / 100.0
|
sprite.zoom_y = cell_data[i, 3] / 100.0
|
||||||
sprite.angle = cell_data[i, 4]
|
sprite.angle = cell_data[i, 4]
|
||||||
sprite.mirror = (cell_data[i, 5] == 1)
|
sprite.mirror_x = (cell_data[i, 5] == 1)
|
||||||
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
|
sprite.opacity = cell_data[i, 6] * self.opacity / 255.0
|
||||||
sprite.blend_type = cell_data[i, 7]
|
sprite.blend_type = cell_data[i, 7]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,8 @@ DEF_PROP_F(Sprite, ZoomY)
|
||||||
DEF_PROP_F(Sprite, Angle)
|
DEF_PROP_F(Sprite, Angle)
|
||||||
DEF_PROP_F(Sprite, WavePhase)
|
DEF_PROP_F(Sprite, WavePhase)
|
||||||
|
|
||||||
DEF_PROP_B(Sprite, Mirror)
|
DEF_PROP_B(Sprite, MirrorX)
|
||||||
|
DEF_PROP_B(Sprite, MirrorY)
|
||||||
DEF_PROP_B(Sprite, Obscured)
|
DEF_PROP_B(Sprite, Obscured)
|
||||||
|
|
||||||
RB_METHOD(spriteWidth){
|
RB_METHOD(spriteWidth){
|
||||||
|
|
@ -114,7 +115,8 @@ void spriteBindingInit(){
|
||||||
INIT_PROP_BIND( Sprite, ZoomX, "zoom_x" );
|
INIT_PROP_BIND( Sprite, ZoomX, "zoom_x" );
|
||||||
INIT_PROP_BIND( Sprite, ZoomY, "zoom_y" );
|
INIT_PROP_BIND( Sprite, ZoomY, "zoom_y" );
|
||||||
INIT_PROP_BIND( Sprite, Angle, "angle" );
|
INIT_PROP_BIND( Sprite, Angle, "angle" );
|
||||||
INIT_PROP_BIND( Sprite, Mirror, "mirror" );
|
INIT_PROP_BIND( Sprite, MirrorX, "mirror_x" );
|
||||||
|
INIT_PROP_BIND( Sprite, MirrorY, "mirror_y" );
|
||||||
INIT_PROP_BIND( Sprite, BushDepth, "bush_depth" );
|
INIT_PROP_BIND( Sprite, BushDepth, "bush_depth" );
|
||||||
INIT_PROP_BIND( Sprite, Opacity, "opacity" );
|
INIT_PROP_BIND( Sprite, Opacity, "opacity" );
|
||||||
INIT_PROP_BIND( Sprite, BlendType, "blend_type" );
|
INIT_PROP_BIND( Sprite, BlendType, "blend_type" );
|
||||||
|
|
|
||||||
|
|
@ -10,22 +10,26 @@ class Game_Character
|
||||||
# * Public Instance Variables
|
# * Public Instance Variables
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
attr_reader :id # ID
|
attr_reader :id # ID
|
||||||
attr_accessor :x # map x-coordinate (logical)
|
attr_accessor :x # map x-coordinate (logical)
|
||||||
attr_accessor :y # map y-coordinate (logical)
|
attr_accessor :y # map y-coordinate (logical)
|
||||||
attr_accessor :real_x # map x-coordinate (real * 128)
|
attr_accessor :z
|
||||||
attr_accessor :real_y # map y-coordinate (real * 128)
|
attr_accessor :real_x # map x-coordinate (real * 128)
|
||||||
|
attr_accessor :real_y # map y-coordinate (real * 128)
|
||||||
|
attr_accessor :mirror_x
|
||||||
|
attr_accessor :mirror_y
|
||||||
attr_reader :tile_id # tile ID (invalid if 0)
|
attr_reader :tile_id # tile ID (invalid if 0)
|
||||||
attr_reader :character_name # character file name
|
attr_reader :character_name # character file name
|
||||||
attr_reader :character_hue # character hue
|
attr_reader :character_hue # character hue
|
||||||
attr_reader :opacity # opacity level
|
attr_reader :opacity # opacity level
|
||||||
attr_reader :blend_type # blending method
|
attr_reader :blend_type # blending method
|
||||||
attr_accessor :direction # direction
|
attr_accessor :direction # direction
|
||||||
attr_accessor :pattern # pattern
|
attr_accessor :pattern # pattern
|
||||||
attr_reader :move_route_forcing # forced move route flag
|
attr_reader :move_route_forcing # forced move route flag
|
||||||
attr_reader :through # through
|
attr_reader :through # through
|
||||||
attr_accessor :animation_id # animation ID
|
attr_accessor :animation_id # animation ID
|
||||||
attr_accessor :transparent # transparent flag
|
attr_accessor :transparent # transparent flag
|
||||||
attr_accessor :shader
|
attr_accessor :shader
|
||||||
|
attr_accessor :light_ignore_transition
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Object Initialization
|
# * Object Initialization
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -33,6 +37,7 @@ class Game_Character
|
||||||
@id = 0
|
@id = 0
|
||||||
@x = 0
|
@x = 0
|
||||||
@y = 0
|
@y = 0
|
||||||
|
@z = 0
|
||||||
@real_x = 0
|
@real_x = 0
|
||||||
@real_y = 0
|
@real_y = 0
|
||||||
@tile_id = 0
|
@tile_id = 0
|
||||||
|
|
@ -66,7 +71,11 @@ class Game_Character
|
||||||
@locked = false
|
@locked = false
|
||||||
@prelock_direction = 0
|
@prelock_direction = 0
|
||||||
@custom_flags = []
|
@custom_flags = []
|
||||||
|
@sprite = nil;
|
||||||
@shader = Shader::Sprite
|
@shader = Shader::Sprite
|
||||||
|
@light_ignore_transition = false
|
||||||
|
@mirror_x = false
|
||||||
|
@mirror_y = false
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Determine if Moving
|
# * Determine if Moving
|
||||||
|
|
@ -258,7 +267,7 @@ class Game_Character
|
||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
# Get screen coordinates from real coordinates and map display position
|
# Get screen coordinates from real coordinates and map display position
|
||||||
z = (@real_y - $game_map.display_y + 3) / 4 + 32
|
z = (@real_y - $game_map.display_y + 3) / 4 + 32 + @z
|
||||||
# If tile
|
# If tile
|
||||||
if @tile_id > 0
|
if @tile_id > 0
|
||||||
# Add tile priority * 32
|
# Add tile priority * 32
|
||||||
|
|
|
||||||
|
|
@ -258,9 +258,28 @@ class Interpreter
|
||||||
end
|
end
|
||||||
# Continue
|
# Continue
|
||||||
begin
|
begin
|
||||||
eval(script)
|
eval(script, binding, "event")
|
||||||
rescue
|
rescue => e
|
||||||
STDERR.puts "[EVENT] Failed to execute script #{script}"
|
event = get_character(0)
|
||||||
|
event_info = "Event ID:#{event&.id || "???"} #{event&.name || "Unknown Event"}"
|
||||||
|
error_line = e.backtrace.find { |line| line.include?("event") }
|
||||||
|
line_number = error_line&.split(":")[1]
|
||||||
|
|
||||||
|
formated_script = ""
|
||||||
|
script.each_line.with_index(1) do |line, index|
|
||||||
|
if line_number.to_i == index
|
||||||
|
formated_script << "%3d > %s\n" % [index, line.chomp]
|
||||||
|
else
|
||||||
|
formated_script << "%3d | %s\n" % [index, line.chomp]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
result = "[EVENT] Failed to execute event script | " + event_info
|
||||||
|
result << "\n-----------------------------------------\n"
|
||||||
|
result << formated_script
|
||||||
|
result << "-----------------------------------------\n"
|
||||||
|
result << e.message
|
||||||
|
result << "\n-----------------------------------------\n"
|
||||||
|
STDERR.puts result
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -234,28 +234,28 @@ module Script
|
||||||
return cdown_update(0)
|
return cdown_update(0)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.niko_reflection_update
|
def self.reflection_update(npc_id, offset_x = 0, offset_y = 0, reverse_x = false, reverse_y = false)
|
||||||
for event in $game_map.events.values
|
event = $game_map.events[npc_id]
|
||||||
if event.name == "niko reflection"
|
event.real_x = reverse_x ? offset_x * 128 - $game_player.real_x : $game_player.real_x + offset_x * 128
|
||||||
event.real_y = 27*128/2 - ($game_player.real_y - 27*128/2)
|
event.real_y = reverse_y ? offset_y * 128 - $game_player.real_y : $game_player.real_y + offset_y * 128
|
||||||
event.real_x = $game_player.real_x
|
event.x = reverse_x ? offset_x - $game_player.x : $game_player.x + offset_x
|
||||||
event.y = 14 - (($game_player.y - 13))
|
event.y = reverse_y ? offset_y - $game_player.y : $game_player.y + offset_y
|
||||||
event.x = $game_player.x
|
event.direction = $game_player.direction
|
||||||
if event.y > 14
|
event.pattern = $game_player.pattern
|
||||||
event.y = 14
|
if reverse_x
|
||||||
end
|
case event.direction
|
||||||
if event.real_y > 14*128
|
when 4
|
||||||
event.real_y = 14*128
|
event.direction = 6
|
||||||
end
|
when 6
|
||||||
event.direction = $game_player.direction
|
event.direction = 4
|
||||||
event.pattern = $game_player.pattern
|
end
|
||||||
case event.direction
|
end
|
||||||
when 2
|
if reverse_y
|
||||||
event.direction = 8
|
case event.direction
|
||||||
when 8
|
when 2
|
||||||
event.direction = 2
|
event.direction = 8
|
||||||
end
|
when 8
|
||||||
return
|
event.direction = 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -33,26 +33,28 @@ class Sprite_Character
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def update
|
def update
|
||||||
# Choose the appropriate light sprite
|
# Choose the appropriate light sprite
|
||||||
@light_sprite.viewport = ($game_screen.tone.blank?) ? @viewport : @light_viewport
|
@light_sprite.viewport = @character.light_ignore_transition ? @viewport : (($game_screen.tone.blank?) ? @viewport : @light_viewport)
|
||||||
@light_sprite.shader = @sprite.shader =
|
@light_sprite.shader = @sprite.shader =
|
||||||
#idk what is this, maybe later i remake this
|
#idk what is this, maybe later i remake this
|
||||||
@character.character_name.start_with?("en") || (Settings[:twm_shader] && @character.character_name.start_with?("niko") && $game_switches[160]) ? Shader::WorldMachine :
|
@character.character_name.start_with?("en") || (Settings[:twm_shader] && @character.character_name.start_with?("niko") && $game_switches[160]) ? Shader::WorldMachine :
|
||||||
@character.shader || Shader::Sprite
|
@character.shader || Shader::Sprite
|
||||||
|
@light_sprite.mirror_x = @sprite.mirror_x = @character.mirror_x
|
||||||
|
@light_sprite.mirror_y = @sprite.mirror_y = @character.mirror_y
|
||||||
|
|
||||||
dir = (@character.direction - 2) / 2
|
dir = (@character.direction - 2) / 2
|
||||||
if Settings[:debug_text] && (@last_char_name != character.character_name || dir != @old_dir)
|
if Settings[:debug_text] && (@last_char_name != character.character_name || dir != @old_dir)
|
||||||
@text_sprite.bitmap.clear
|
@text_sprite.bitmap.clear
|
||||||
@text_sprite.bitmap.draw_text(0, 0, 256, 12, "#{dir == 0 ? "↓" : dir == 1 ? "←" : dir == 2 ? "→" : "↑"} #{@character.character_name}")
|
@text_sprite.bitmap.draw_text(0, 0, 256, 12, "#{dir == 0 ? "↓" : dir == 1 ? "←" : dir == 2 ? "→" : "↑"} #{@character.character_name}")
|
||||||
@last_char_name = character.character_name
|
@last_char_name = @character.character_name
|
||||||
@old_dir = dir
|
@old_dir = dir
|
||||||
elsif !Settings[:debug] && @last_char_name != "мямямя :3"
|
elsif !Settings[:debug_text] && @last_char_name != "мямямя :3"
|
||||||
@text_sprite.bitmap.clear
|
@text_sprite.bitmap.clear
|
||||||
@last_char_name = "мямямя :3"
|
@last_char_name = "мямямя :3"
|
||||||
end
|
end
|
||||||
if Settings[:debug]
|
if Settings[:debug_text]
|
||||||
@text_sprite.x = @character.screen_x
|
@text_sprite.x = @character.screen_x
|
||||||
@text_sprite.y = @character.screen_y
|
@text_sprite.y = @character.screen_y
|
||||||
@text_sprite.z = @character.screen_z + 2
|
@text_sprite.z = 100
|
||||||
end
|
end
|
||||||
# Update sprites
|
# Update sprites
|
||||||
@sprite.update
|
@sprite.update
|
||||||
|
|
@ -208,7 +210,6 @@ class Sprite_Character
|
||||||
sprite_attr :ox, :oy
|
sprite_attr :ox, :oy
|
||||||
sprite_attr :zoom_x, :zoom_y
|
sprite_attr :zoom_x, :zoom_y
|
||||||
sprite_attr :angle
|
sprite_attr :angle
|
||||||
sprite_attr :mirror
|
|
||||||
sprite_attr :bush_depth
|
sprite_attr :bush_depth
|
||||||
sprite_attr :opacity
|
sprite_attr :opacity
|
||||||
sprite_attr :color
|
sprite_attr :color
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#==============================================================================
|
#==============================================================================
|
||||||
|
|
||||||
class Spriteset_Map
|
class Spriteset_Map
|
||||||
|
attr_reader :character_sprites
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Object Initialization
|
# * Object Initialization
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -76,15 +77,6 @@ class Spriteset_Map
|
||||||
end
|
end
|
||||||
# Make timer sprite
|
# Make timer sprite
|
||||||
@timer_sprite = Sprite_Timer.new
|
@timer_sprite = Sprite_Timer.new
|
||||||
# Make lightbulb sprite
|
|
||||||
@bulb = Sprite.new(@viewport_lights)
|
|
||||||
@bulb.x = 0
|
|
||||||
if Graphics.width == 1280
|
|
||||||
@bulb.bitmap = RPG::Cache.light('bulb_16')
|
|
||||||
else
|
|
||||||
@bulb.bitmap = RPG::Cache.light('bulb')
|
|
||||||
end
|
|
||||||
@bulb.opacity = has_lightbulb? ? 255 : 0
|
|
||||||
# Make dynamic light
|
# Make dynamic light
|
||||||
@dynamic_light = DynamicLight.new(@viewport_lights)
|
@dynamic_light = DynamicLight.new(@viewport_lights)
|
||||||
# Panorama animation timer
|
# Panorama animation timer
|
||||||
|
|
@ -350,17 +342,6 @@ class Spriteset_Map
|
||||||
for sprite in @picture_sprites
|
for sprite in @picture_sprites
|
||||||
sprite.update
|
sprite.update
|
||||||
end
|
end
|
||||||
# Update bulb if fading in
|
|
||||||
@bulb.tone = $game_map.ambient
|
|
||||||
if has_lightbulb?
|
|
||||||
if @bulb.opacity < 255
|
|
||||||
@bulb.opacity += 2.125
|
|
||||||
end
|
|
||||||
else
|
|
||||||
if @bulb.opacity > 0
|
|
||||||
@bulb.opacity -= 2.125
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
@dynamic_light.update
|
@dynamic_light.update
|
||||||
# Update particles
|
# Update particles
|
||||||
|
|
@ -368,7 +349,7 @@ class Spriteset_Map
|
||||||
# Update timer sprite
|
# Update timer sprite
|
||||||
@timer_sprite.update
|
@timer_sprite.update
|
||||||
# Set screen color tone and shake position
|
# Set screen color tone and shake position
|
||||||
@viewport.tone = $game_screen.tone + $game_map.ambient * (1.0 - @bulb.opacity / 255.0)
|
@viewport.tone = $game_screen.tone + $game_map.ambient
|
||||||
@viewport.ox = $game_screen.shake
|
@viewport.ox = $game_screen.shake
|
||||||
@viewport_lights.ox = $game_screen.shake
|
@viewport_lights.ox = $game_screen.shake
|
||||||
# Set screen flash color
|
# Set screen flash color
|
||||||
|
|
|
||||||
|
|
@ -214,7 +214,7 @@ class Window_Message < Window_Selectable
|
||||||
# Don't do anything if we're done
|
# Don't do anything if we're done
|
||||||
return if !@drawing_text
|
return if !@drawing_text
|
||||||
|
|
||||||
autoMash = (Input.press?(Input::R) && $game_switches[253])
|
autoMash = (Input.press?(Input::R) && $game_switches[253]) || (Settings[:debug] && Input.press?(Input::DEBUGACTION))
|
||||||
|
|
||||||
# Get 1 text character in c (loop until unable to get text)
|
# Get 1 text character in c (loop until unable to get text)
|
||||||
while ((c = @text.slice!(0)) != nil)
|
while ((c = @text.slice!(0)) != nil)
|
||||||
|
|
@ -236,13 +236,13 @@ class Window_Message < Window_Selectable
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
# \.
|
# \.
|
||||||
if c == "\001" && !(Input.press?(Input::DEBUGACTION) && Settings[:debug])
|
if c == "\001"
|
||||||
# Pause
|
# Pause
|
||||||
@text_pause = autoMash ? 0 : 10
|
@text_pause = autoMash ? 0 : 10
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
# \|
|
# \|
|
||||||
if c == "\002" && !(Input.press?(Input::DEBUGACTION) && Settings[:debug])
|
if c == "\002"
|
||||||
# Pause
|
# Pause
|
||||||
@text_pause = autoMash ? 0 : 10*4
|
@text_pause = autoMash ? 0 : 10*4
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -238,9 +238,12 @@ struct FloatRect{
|
||||||
Vec2 topRight() const { return Vec2(x+w, y); }
|
Vec2 topRight() const { return Vec2(x+w, y); }
|
||||||
Vec2 bottomRight() const { return Vec2(x+w, y+h); }
|
Vec2 bottomRight() const { return Vec2(x+w, y+h); }
|
||||||
|
|
||||||
FloatRect hFlipped() const{
|
FloatRect wFlipped() const{
|
||||||
return FloatRect(x+w, y, -w, h);
|
return FloatRect(x+w, y, -w, h);
|
||||||
}
|
}
|
||||||
|
FloatRect hFlipped() const{
|
||||||
|
return FloatRect(x, y+h, w, -h);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Value between 0 and 255 with internal
|
/* Value between 0 and 255 with internal
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,8 @@ struct SpritePrivate{
|
||||||
Rect *srcRect;
|
Rect *srcRect;
|
||||||
sigc::connection srcRectCon;
|
sigc::connection srcRectCon;
|
||||||
|
|
||||||
bool mirrored;
|
bool mirrorX;
|
||||||
|
bool mirrorY;
|
||||||
int bushDepth;
|
int bushDepth;
|
||||||
float efBushDepth;
|
float efBushDepth;
|
||||||
NormValue bushOpacity;
|
NormValue bushOpacity;
|
||||||
|
|
@ -96,7 +97,8 @@ struct SpritePrivate{
|
||||||
SpritePrivate()
|
SpritePrivate()
|
||||||
: bitmap(0),
|
: bitmap(0),
|
||||||
srcRect(&tmp.rect),
|
srcRect(&tmp.rect),
|
||||||
mirrored(false),
|
mirrorX(false),
|
||||||
|
mirrorY(false),
|
||||||
bushDepth(0),
|
bushDepth(0),
|
||||||
efBushDepth(0),
|
efBushDepth(0),
|
||||||
bushOpacity(128),
|
bushOpacity(128),
|
||||||
|
|
@ -150,7 +152,8 @@ struct SpritePrivate{
|
||||||
rect.w = clamp<int>(rect.w, 0, bmSize.x-rect.x);
|
rect.w = clamp<int>(rect.w, 0, bmSize.x-rect.x);
|
||||||
rect.h = clamp<int>(rect.h, 0, bmSize.y-rect.y);
|
rect.h = clamp<int>(rect.h, 0, bmSize.y-rect.y);
|
||||||
|
|
||||||
quad.setTexRect(mirrored ? rect.hFlipped() : rect);
|
quad.setTexRect(mirrorX ? rect.wFlipped() : rect);
|
||||||
|
quad.setTexRect(mirrorY ? rect.hFlipped() : rect);
|
||||||
|
|
||||||
quad.setPosRect(FloatRect(0, 0, rect.w, rect.h));
|
quad.setPosRect(FloatRect(0, 0, rect.w, rect.h));
|
||||||
recomputeBushDepth();
|
recomputeBushDepth();
|
||||||
|
|
@ -305,7 +308,8 @@ DEF_ATTR_RD_SIMPLE(Sprite, OY, int, p->trans.getOrigin().y)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, ZoomX, float, p->trans.getScale().x)
|
DEF_ATTR_RD_SIMPLE(Sprite, ZoomX, float, p->trans.getScale().x)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, ZoomY, float, p->trans.getScale().y)
|
DEF_ATTR_RD_SIMPLE(Sprite, ZoomY, float, p->trans.getScale().y)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, Angle, float, p->trans.getRotation())
|
DEF_ATTR_RD_SIMPLE(Sprite, Angle, float, p->trans.getRotation())
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, Mirror, bool, p->mirrored)
|
DEF_ATTR_RD_SIMPLE(Sprite, MirrorX, bool, p->mirrorX)
|
||||||
|
DEF_ATTR_RD_SIMPLE(Sprite, MirrorY, bool, p->mirrorY)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, BushDepth, int, p->bushDepth)
|
DEF_ATTR_RD_SIMPLE(Sprite, BushDepth, int, p->bushDepth)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, BlendType, int, p->blendType)
|
DEF_ATTR_RD_SIMPLE(Sprite, BlendType, int, p->blendType)
|
||||||
DEF_ATTR_RD_SIMPLE(Sprite, Width, int, p->srcRect->width)
|
DEF_ATTR_RD_SIMPLE(Sprite, Width, int, p->srcRect->width)
|
||||||
|
|
@ -408,13 +412,23 @@ void Sprite::setAngle(float value){
|
||||||
p->trans.setRotation(value);
|
p->trans.setRotation(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Sprite::setMirror(bool mirrored){
|
void Sprite::setMirrorX(bool mirrored){
|
||||||
guardDisposed();
|
guardDisposed();
|
||||||
|
|
||||||
if (p->mirrored == mirrored)
|
if (p->mirrorX == mirrored)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
p->mirrored = mirrored;
|
p->mirrorX = mirrored;
|
||||||
|
p->onSrcRectChange();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Sprite::setMirrorY(bool mirrored){
|
||||||
|
guardDisposed();
|
||||||
|
|
||||||
|
if (p->mirrorY == mirrored)
|
||||||
|
return;
|
||||||
|
|
||||||
|
p->mirrorY = mirrored;
|
||||||
p->onSrcRectChange();
|
p->onSrcRectChange();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,8 @@ public:
|
||||||
DECL_ATTR( ZoomX, float )
|
DECL_ATTR( ZoomX, float )
|
||||||
DECL_ATTR( ZoomY, float )
|
DECL_ATTR( ZoomY, float )
|
||||||
DECL_ATTR( Angle, float )
|
DECL_ATTR( Angle, float )
|
||||||
DECL_ATTR( Mirror, bool )
|
DECL_ATTR( MirrorX, bool )
|
||||||
|
DECL_ATTR( MirrorY, bool )
|
||||||
DECL_ATTR( BushDepth, int )
|
DECL_ATTR( BushDepth, int )
|
||||||
DECL_ATTR( BushOpacity, int )
|
DECL_ATTR( BushOpacity, int )
|
||||||
DECL_ATTR( Opacity, int )
|
DECL_ATTR( Opacity, int )
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue