diff --git a/scripts/Game_Character_1.rb b/scripts/Game_Character_1.rb index 0b38a9a..b3c7810 100644 --- a/scripts/Game_Character_1.rb +++ b/scripts/Game_Character_1.rb @@ -25,6 +25,7 @@ class Game_Character attr_reader :through # through attr_accessor :animation_id # animation ID attr_accessor :transparent # transparent flag + attr_accessor :shader #-------------------------------------------------------------------------- # * Object Initialization #-------------------------------------------------------------------------- @@ -65,6 +66,7 @@ class Game_Character @locked = false @prelock_direction = 0 @custom_flags = [] + @shader = Shader::Sprite end #-------------------------------------------------------------------------- # * Determine if Moving diff --git a/scripts/Sprite_Character.rb b/scripts/Sprite_Character.rb index c3c39ea..ca6045a 100644 --- a/scripts/Sprite_Character.rb +++ b/scripts/Sprite_Character.rb @@ -34,7 +34,10 @@ class Sprite_Character def update # Choose the appropriate light sprite @light_sprite.viewport = ($game_screen.tone.blank?) ? @viewport : @light_viewport - @light_sprite.shader = @sprite.shader = @character.character_name.start_with?("en") || (Settings[:twm_shader] && @character.character_name.start_with?("niko") && $game_switches[160]) ? Shader::WorldMachine : Shader::Sprite + @light_sprite.shader = @sprite.shader = + #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.shader || Shader::Sprite dir = (@character.direction - 2) / 2 if Settings[:debug_text] && (@last_char_name != character.character_name || dir != @old_dir) diff --git a/shader/worldMachine.frag b/shader/worldMachine.frag index dfe9b08..31ee033 100644 --- a/shader/worldMachine.frag +++ b/shader/worldMachine.frag @@ -61,5 +61,7 @@ void main(){ lowp float underBush = float(v_texCoord.y < bushDepth); frag.a *= clamp(bushOpacity + underBush, 0.0, 1.0); + frag.a = clamp(frag.a, 0.0, 1.0); + gl_FragColor = frag; } diff --git a/src/sdlsoundsource.cpp b/src/sdlsoundsource.cpp index 0149cdc..0e67e23 100644 --- a/src/sdlsoundsource.cpp +++ b/src/sdlsoundsource.cpp @@ -33,18 +33,13 @@ struct SDLSoundSource : ALDataSource{ ALenum alFormat; ALsizei alFreq; - - SDL_AudioSpec spec; SDLSoundSource(SDL_IOStream &ops, const char *extension, uint32_t maxBufSize, bool looped) : srcOps(ops), looped(looped) { - spec.format = SDL_AUDIO_S16LE; - spec.channels = 2; - spec.freq = 44100; - sample = Sound_NewSample(&srcOps, extension, &spec, maxBufSize); + sample = Sound_NewSample(&srcOps, extension, 0, maxBufSize); if (!sample){ SDL_CloseIO(&ops); diff --git a/src/soundemitter.cpp b/src/soundemitter.cpp index 36996f0..811a2e0 100644 --- a/src/soundemitter.cpp +++ b/src/soundemitter.cpp @@ -174,18 +174,12 @@ void SoundEmitter::stop(){ struct SoundOpenHandler : FileSystem::OpenHandler{ SoundBuffer *buffer; - SDL_AudioSpec spec; - SoundOpenHandler() : buffer(0) - { - spec.format = SDL_AUDIO_S16LE; - spec.channels = 2; - spec.freq = 44100; - } + {} bool tryRead(SDL_IOStream* &ops, const char *ext){ - Sound_Sample *sample = Sound_NewSample(ops, ext, &spec, STREAM_BUF_SIZE); // df;lkjdsfl;kjgt;sjhdlhljkk;ljhgds;ljkglk;jdsl;fjgg;lhkjdsgklhjsdhl;jkg + Sound_Sample *sample = Sound_NewSample(ops, ext, 0, STREAM_BUF_SIZE); if (!sample){ SDL_CloseIO(ops);