mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 14:56:17 +00:00
Fuck
This commit is contained in:
parent
a4d86310d8
commit
a6e2dc795a
17 changed files with 35 additions and 90 deletions
|
|
@ -25,11 +25,7 @@ else()
|
||||||
if (MSVC)
|
if (MSVC)
|
||||||
add_compile_options(/O2 /fp:fast /GA /GL /Gw Qpar /RTCu)
|
add_compile_options(/O2 /fp:fast /GA /GL /Gw Qpar /RTCu)
|
||||||
else()
|
else()
|
||||||
<<<<<<< HEAD
|
|
||||||
add_compile_options(-s -03 -ffast-math -fdevirtualize-speculatively -fspeculatively-call-stored-functions -fipa-pta -fdelete-null-pointer-checks -flimit-function-alignment -faggressive-loop-optimizations)
|
|
||||||
=======
|
|
||||||
add_compile_options(-O2 -ffast-math -fdevirtualize-speculatively -fspeculatively-call-stored-functions -fipa-pta -fdelete-null-pointer-checks)
|
add_compile_options(-O2 -ffast-math -fdevirtualize-speculatively -fspeculatively-call-stored-functions -fipa-pta -fdelete-null-pointer-checks)
|
||||||
>>>>>>> 7760eac (a)
|
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
## Setup main source ##
|
## Setup main source ##
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,9 @@ void fileIntBindingInit();
|
||||||
|
|
||||||
void journalBindingInit();
|
void journalBindingInit();
|
||||||
void wallpaperBindingInit();
|
void wallpaperBindingInit();
|
||||||
|
#ifdef __linux__
|
||||||
|
void wallpaperBindingTerminate();
|
||||||
|
#endif
|
||||||
void nikoBindingInit();
|
void nikoBindingInit();
|
||||||
void oneshotBindingInit();
|
void oneshotBindingInit();
|
||||||
void SunshineBindingInit();
|
void SunshineBindingInit();
|
||||||
|
|
|
||||||
|
|
@ -169,17 +169,6 @@ RB_METHOD(graphicsReset){
|
||||||
return Qnil;
|
return Qnil;
|
||||||
}
|
}
|
||||||
|
|
||||||
RB_METHOD(graphicsPlayMovie){
|
|
||||||
RB_UNUSED_PARAM;
|
|
||||||
|
|
||||||
const char *filename;
|
|
||||||
rb_get_args(argc, argv, "z", &filename RB_ARG_END);
|
|
||||||
|
|
||||||
shState->graphics().playMovie(filename);
|
|
||||||
|
|
||||||
return Qnil;
|
|
||||||
}
|
|
||||||
|
|
||||||
DEF_GRA_PROP_I(FrameRate)
|
DEF_GRA_PROP_I(FrameRate)
|
||||||
DEF_GRA_PROP_I(FrameCount)
|
DEF_GRA_PROP_I(FrameCount)
|
||||||
DEF_GRA_PROP_I(Brightness)
|
DEF_GRA_PROP_I(Brightness)
|
||||||
|
|
|
||||||
|
|
@ -128,9 +128,6 @@ static buttonCodes[] = {
|
||||||
{ "MOUSELEFT", Input::MouseLeft },
|
{ "MOUSELEFT", Input::MouseLeft },
|
||||||
{ "MOUSEMIDDLE", Input::MouseMiddle },
|
{ "MOUSEMIDDLE", Input::MouseMiddle },
|
||||||
{ "MOUSERIGHT", Input::MouseRight },
|
{ "MOUSERIGHT", Input::MouseRight },
|
||||||
|
|
||||||
{ "LCTRL", Input::LCTRL },
|
|
||||||
{ "RCTRL", Input::RCTRL },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static elementsN(buttonCodes);
|
static elementsN(buttonCodes);
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,6 @@ RB_METHOD(windowInitialize){
|
||||||
|
|
||||||
RB_METHOD(windowUpdate){
|
RB_METHOD(windowUpdate){
|
||||||
RB_UNUSED_PARAM;
|
RB_UNUSED_PARAM;
|
||||||
|
|
||||||
Window *w = getPrivateData<Window>(self);
|
Window *w = getPrivateData<Window>(self);
|
||||||
|
|
||||||
w->update();
|
w->update();
|
||||||
|
|
@ -80,7 +79,6 @@ void windowBindingInit(){
|
||||||
|
|
||||||
_rb_define_method(klass, "initialize", windowInitialize);
|
_rb_define_method(klass, "initialize", windowInitialize);
|
||||||
_rb_define_method(klass, "update", windowUpdate);
|
_rb_define_method(klass, "update", windowUpdate);
|
||||||
|
|
||||||
INIT_PROP_BIND( Window, Windowskin, "windowskin" );
|
INIT_PROP_BIND( Window, Windowskin, "windowskin" );
|
||||||
INIT_PROP_BIND( Window, Contents, "contents" );
|
INIT_PROP_BIND( Window, Contents, "contents" );
|
||||||
INIT_PROP_BIND( Window, Stretch, "stretch" );
|
INIT_PROP_BIND( Window, Stretch, "stretch" );
|
||||||
|
|
|
||||||
|
|
@ -153,10 +153,10 @@ class Credits_Message
|
||||||
else
|
else
|
||||||
@contents.font.color = Color.new(0, 0, 0, 255)
|
@contents.font.color = Color.new(0, 0, 0, 255)
|
||||||
end
|
end
|
||||||
|
|
||||||
x = (320 - widths[0]) / 2
|
x = ((Graphics.width / 2 ) - widths[0]) / 2
|
||||||
y = 0
|
y = 0
|
||||||
y_top = (240 - widths.length * 24) / 2
|
y_top = ((Graphics.height / 2) - widths.length * 24) / 2
|
||||||
|
|
||||||
@contents.font.size = 16
|
@contents.font.size = 16
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ class Game_Map
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_down(distance)
|
def scroll_down(distance)
|
||||||
if $game_switches[98] == true
|
if $game_switches[98] == true
|
||||||
@display_y = [@display_y + distance, (self.height - 15) * 128].min
|
@display_y = [@display_y + distance, (Graphics.height / 28) * 128].min
|
||||||
else
|
else
|
||||||
@display_y += distance
|
@display_y += distance
|
||||||
end
|
end
|
||||||
|
|
@ -290,7 +290,7 @@ class Game_Map
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def scroll_right(distance)
|
def scroll_right(distance)
|
||||||
if $game_switches[98] == true
|
if $game_switches[98] == true
|
||||||
@display_x = [@display_x + distance, (self.width - 20) * 128].min
|
@display_x = [@display_x + distance, (self.width - (Graphics.width / 32)) * 128].min
|
||||||
else
|
else
|
||||||
@display_x += distance
|
@display_x += distance
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@ class Game_Player < Game_Character
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Invariables
|
# * Invariables
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
CENTER_X = (Graphics.width / 2) - 16
|
CENTER_X = ((Graphics.width / 4) - 16) * 4 # Center screen x-coordinate * 4
|
||||||
CENTER_Y = (Graphics.height / 2) - 16
|
CENTER_Y = ((Graphics.height / 4) - 16) * 4 # Center screen y-coordinate * 4
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
# * Passable Determinants
|
# * Passable Determinants
|
||||||
# x : x-coordinate
|
# x : x-coordinate
|
||||||
|
|
@ -31,10 +31,10 @@ class Game_Player < Game_Character
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
# If debug mode is ON and ctrl key was pressed
|
# If debug mode is ON and ctrl key was pressed
|
||||||
if Window_Settings.DebugIsEnabled and Input.press?(Input::LCTRL)
|
#if Window_Settings.DebugIsEnabled and Input.press?(Input::LCTRL)
|
||||||
# Passable
|
# Passable
|
||||||
return true
|
# return true
|
||||||
end
|
#end
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
|
@ -42,8 +42,8 @@ class Game_Player < Game_Character
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
def center(x, y)
|
def center(x, y)
|
||||||
if $game_switches[98] == true
|
if $game_switches[98] == true
|
||||||
max_x = ($game_map.width - 20) * 128
|
max_x = ($game_map.width - (Graphics.width / 32)) * 128
|
||||||
max_y = ($game_map.height - 15) * 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
|
else
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ class Scene_Title
|
||||||
#Debug info like in minecraft Forge :P
|
#Debug info like in minecraft Forge :P
|
||||||
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby #{RUBY_VERSION}"))
|
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby #{RUBY_VERSION}"))
|
||||||
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL #{SDLVer}"))
|
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL #{SDLVer}"))
|
||||||
@menu.bitmap.draw_text(5, 45, 150, 20 tr("Sunshine #{SunshineVer}"))
|
@menu.bitmap.draw_text(5, 45, 150, 20, tr("Sunshine #{SunshineVer}"))
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
|
|
@ -100,7 +100,7 @@ class Scene_Title
|
||||||
@cursor_pos = 0
|
@cursor_pos = 0
|
||||||
# Play title BGM
|
# Play title BGM
|
||||||
if File.exist?("badend.lock")
|
if File.exist?("badend.lock")
|
||||||
#TODO: fix
|
#TODO: fix audio values
|
||||||
Audio.bgm_play("Audio/BGM/MyBurdenIsDead.ogg", 100, 100)
|
Audio.bgm_play("Audio/BGM/MyBurdenIsDead.ogg", 100, 100)
|
||||||
else
|
else
|
||||||
$game_system.bgm_play($data_system.title_bgm)
|
$game_system.bgm_play($data_system.title_bgm)
|
||||||
|
|
@ -149,7 +149,7 @@ class Scene_Title
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 50, 150, 24, tr("Exit"))
|
||||||
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby #{RUBY_VERSION}"))
|
@menu.bitmap.draw_text(5, 5, 150, 20, tr("Ruby #{RUBY_VERSION}"))
|
||||||
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL #{SDLVer}"))
|
@menu.bitmap.draw_text(5, 25, 150, 20, tr("SDL #{SDLVer}"))
|
||||||
@menu.bitmap.draw_text(5, 45, 150, 20 tr("Sunshine #{SunshineVer}"))
|
@menu.bitmap.draw_text(5, 45, 150, 20, tr("Sunshine #{SunshineVer}"))
|
||||||
if $game_switches[160] && $game_switches[152]
|
if $game_switches[160] && $game_switches[152]
|
||||||
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
@menu.bitmap.draw_text(MENU_X, MENU_Y + 75, 150, 24, tr("..."))
|
||||||
end
|
end
|
||||||
|
|
@ -196,7 +196,7 @@ class Scene_Title
|
||||||
if File.exist?("badend.lock")
|
if File.exist?("badend.lock")
|
||||||
case @cursor_pos
|
case @cursor_pos
|
||||||
when 0 # Continue
|
when 0 # Continue
|
||||||
EdText.info(tr("You killed niko."))
|
print("You killed niko.")
|
||||||
when 1 # Settings
|
when 1 # Settings
|
||||||
command_settings
|
command_settings
|
||||||
when 2 # Shutdown
|
when 2 # Shutdown
|
||||||
|
|
|
||||||
|
|
@ -72,8 +72,7 @@ class Spriteset_Map
|
||||||
# Make picture sprites
|
# Make picture sprites
|
||||||
@picture_sprites = []
|
@picture_sprites = []
|
||||||
for i in 1..50
|
for i in 1..50
|
||||||
@picture_sprites.push(Sprite_Picture.new(@viewport_pics,
|
@picture_sprites.push(Sprite_Picture.new(@viewport_pics, $game_screen.pictures[i]))
|
||||||
$game_screen.pictures[i]))
|
|
||||||
end
|
end
|
||||||
# Make timer sprite
|
# Make timer sprite
|
||||||
@timer_sprite = Sprite_Timer.new
|
@timer_sprite = Sprite_Timer.new
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ class Window_Base < Window
|
||||||
super()
|
super()
|
||||||
@windowskin_name = $game_system.windowskin_name
|
@windowskin_name = $game_system.windowskin_name
|
||||||
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
|
self.windowskin = RPG::Cache.windowskin(@windowskin_name)
|
||||||
#self.windowskin_en = RPG::Cache.windowskin("en_normal")
|
|
||||||
self.x = x
|
self.x = x
|
||||||
self.y = y
|
self.y = y
|
||||||
self.width = width
|
self.width = width
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ class Window_Settings
|
||||||
@version = Sprite.new(@viewport)
|
@version = Sprite.new(@viewport)
|
||||||
@version.bitmap = Bitmap.new(60, 20)
|
@version.bitmap = Bitmap.new(60, 20)
|
||||||
@version.x = 10
|
@version.x = 10
|
||||||
@version.y = Graphics.width - 190
|
@version.y = Graphics.width / 1.9
|
||||||
@version.opacity = 128
|
@version.opacity = 128
|
||||||
Language.register_text_sprite(self.class.name + "_title", @title)
|
Language.register_text_sprite(self.class.name + "_title", @title)
|
||||||
Language.register_text_sprite(self.class.name + "_ver", @version)
|
Language.register_text_sprite(self.class.name + "_ver", @version)
|
||||||
|
|
|
||||||
|
|
@ -234,9 +234,7 @@ static const KbBindingData staticKbBindings[] ={
|
||||||
{ SDL_SCANCODE_F6, Input::F6 },
|
{ SDL_SCANCODE_F6, Input::F6 },
|
||||||
{ SDL_SCANCODE_F7, Input::F7 },
|
{ SDL_SCANCODE_F7, Input::F7 },
|
||||||
{ SDL_SCANCODE_F8, Input::F8 },
|
{ SDL_SCANCODE_F8, Input::F8 },
|
||||||
{ SDL_SCANCODE_F9, Input::F9 },
|
{ SDL_SCANCODE_F9, Input::F9 }
|
||||||
{ SDL_SCANCODE_LCTRL, Input:LCTRL },
|
|
||||||
{ SDL_SCANCODE_RCTRL, Input:RCTRL }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static elementsN(staticKbBindings);
|
static elementsN(staticKbBindings);
|
||||||
|
|
|
||||||
17
src/main.cpp
17
src/main.cpp
|
|
@ -221,17 +221,18 @@ int main(int argc, char *argv[]){
|
||||||
SDL_SetHint(SDL_HINT_APP_NAME, "Oneshot: Sunshine");
|
SDL_SetHint(SDL_HINT_APP_NAME, "Oneshot: Sunshine");
|
||||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Oneshot: sunshine");
|
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_NAME, "Oneshot: sunshine");
|
||||||
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, "Game");
|
SDL_SetHint(SDL_HINT_AUDIO_DEVICE_STREAM_ROLE, "Game");
|
||||||
#if defined(__linux__ || BSD || __sun) && SDL_VERSION_ATLEAST(3, 4, 10)
|
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, "1");
|
|
||||||
#endif
|
|
||||||
//X11 work on *BSD,Solaris too!
|
//X11 work on *BSD,Solaris too!
|
||||||
#if defined(__linux__ || BSD || __sun)
|
#if defined(__linux__) || defined(BSD) || defined(__sun)
|
||||||
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
|
SDL_SetHint(SDL_HINT_VIDEO_X11_NET_WM_BYPASS_COMPOSITOR, "0");
|
||||||
#endif
|
#if SDL_VERSION_ATLEAST(3, 4, 10)
|
||||||
|
SDL_SetHint(SDL_HINT_VIDEO_X11_ENABLE_XSYNC_EXT, "1");
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* initialize SDL first */
|
/* initialize SDL first */
|
||||||
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD) == false){
|
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_GAMEPAD) == false){
|
||||||
showInitError(std::string("Error initializing SDL: ") + SDL_GetError())
|
showInitError(std::string("Error initializing SDL: ") + SDL_GetError());
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -279,14 +280,14 @@ int main(int argc, char *argv[]){
|
||||||
if (conf.windowTitle.empty())
|
if (conf.windowTitle.empty())
|
||||||
conf.windowTitle = conf.game.title;
|
conf.windowTitle = conf.game.title;
|
||||||
|
|
||||||
if (TTF_Init() < 0){
|
if (TTF_Init() == false){
|
||||||
showInitError(std::string("Error initializing SDL_ttf: ") + SDL_GetError());
|
showInitError(std::string("Error initializing SDL_ttf: ") + SDL_GetError());
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Sound_Init() == 0){
|
if (Sound_Init() == false){
|
||||||
showInitError(std::string("Error initializing SDL_sound: ") + Sound_GetError());
|
showInitError(std::string("Error initializing SDL_sound: ") + Sound_GetError());
|
||||||
TTF_Quit();
|
TTF_Quit();
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
|
|
|
||||||
|
|
@ -53,16 +53,6 @@ int screenMain(Config &conf){
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SDL_WindowShapeMode shapeMode;
|
|
||||||
// shapeMode.mode = ShapeModeColorKey;
|
|
||||||
// shapeMode.parameters.colorKey = colorKey;
|
|
||||||
|
|
||||||
//SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8);
|
|
||||||
//SDL_PIXELFORMAT_UNKNOWN - 0,0,0,0 ....maybe?
|
|
||||||
|
|
||||||
//SDL_Surface *surface = SDL_CreateSurface(32, 32, SDL_PIXELFORMAT_INDEX8);
|
|
||||||
//SDL_Surface *shape = SDL_CreateSurface(DEFAULT_WIDTH, DEFAULT_HEIGHT, SDL_PIXELFORMAT_UNKNOWN);
|
|
||||||
|
|
||||||
// i have no idea if it works.
|
// i have no idea if it works.
|
||||||
//SDL_Surface *shape = SDL_CreateRGBSurface(0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 8, 0, 0, 0, 0);
|
//SDL_Surface *shape = SDL_CreateRGBSurface(0, DEFAULT_WIDTH, DEFAULT_HEIGHT, 8, 0, 0, 0, 0);
|
||||||
SDL_Surface *shape = SDL_CreateSurface(DEFAULT_WIDTH, DEFAULT_HEIGHT, SDL_PixelFormat::SDL_PIXELFORMAT_RGBA32);
|
SDL_Surface *shape = SDL_CreateSurface(DEFAULT_WIDTH, DEFAULT_HEIGHT, SDL_PixelFormat::SDL_PIXELFORMAT_RGBA32);
|
||||||
|
|
|
||||||
|
|
@ -303,8 +303,7 @@ struct WindowPrivate {
|
||||||
if (bgStretch)
|
if (bgStretch)
|
||||||
backgroundVert.count = 1;
|
backgroundVert.count = 1;
|
||||||
else
|
else
|
||||||
backgroundVert.count =
|
backgroundVert.count = TileQuads::twoDimCount(128, 128, bgRect.w, bgRect.h);
|
||||||
TileQuads::twoDimCount(128, 128, bgRect.w, bgRect.h);
|
|
||||||
|
|
||||||
count += backgroundVert.count;
|
count += backgroundVert.count;
|
||||||
|
|
||||||
|
|
@ -358,9 +357,7 @@ struct WindowPrivate {
|
||||||
void updateBaseAlpha(){
|
void updateBaseAlpha(){
|
||||||
/* This is always applied unconditionally */
|
/* This is always applied unconditionally */
|
||||||
backgroundVert.setAlpha(backOpacity.norm);
|
backgroundVert.setAlpha(backOpacity.norm);
|
||||||
|
|
||||||
baseTexQuad.setColor(Vec4(1, 1, 1, opacity.norm));
|
baseTexQuad.setColor(Vec4(1, 1, 1, opacity.norm));
|
||||||
|
|
||||||
baseTexDirty = true;
|
baseTexDirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -436,8 +433,7 @@ struct WindowPrivate {
|
||||||
/* Cursor */
|
/* Cursor */
|
||||||
if (!cursorRect->isEmpty()){
|
if (!cursorRect->isEmpty()){
|
||||||
/* Effective cursor rect has 16 xy offset to window */
|
/* Effective cursor rect has 16 xy offset to window */
|
||||||
IntRect effectRect(cursorRect->x+16, cursorRect->y+16,
|
IntRect effectRect(cursorRect->x+16, cursorRect->y+16, cursorRect->width, cursorRect->height);
|
||||||
cursorRect->width, cursorRect->height);
|
|
||||||
cursorVert.vert = &vert[i*4];
|
cursorVert.vert = &vert[i*4];
|
||||||
TileQuads::buildFrameSource(cursorSrc, cursorVert.vert);
|
TileQuads::buildFrameSource(cursorSrc, cursorVert.vert);
|
||||||
i += TileQuads::buildFrame(effectRect, cursorVert.vert);
|
i += TileQuads::buildFrame(effectRect, cursorVert.vert);
|
||||||
|
|
@ -527,15 +523,12 @@ struct WindowPrivate {
|
||||||
|
|
||||||
if (useBaseTex){
|
if (useBaseTex){
|
||||||
shader.setTexSize(Vec2i(baseTex.width, baseTex.height));
|
shader.setTexSize(Vec2i(baseTex.width, baseTex.height));
|
||||||
|
|
||||||
TEX::bind(baseTex.tex);
|
TEX::bind(baseTex.tex);
|
||||||
baseTexQuad.draw();
|
baseTexQuad.draw();
|
||||||
}else{
|
}else{
|
||||||
windowskin->bindTex(shader);
|
windowskin->bindTex(shader);
|
||||||
TEX::setSmooth(true);
|
TEX::setSmooth(true);
|
||||||
|
|
||||||
baseQuadArray.draw();
|
baseQuadArray.draw();
|
||||||
|
|
||||||
TEX::setSmooth(false);
|
TEX::setSmooth(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -573,18 +566,14 @@ struct WindowPrivate {
|
||||||
/* Draw arrows / cursors */
|
/* Draw arrows / cursors */
|
||||||
windowskin->bindTex(shader);
|
windowskin->bindTex(shader);
|
||||||
TEX::setSmooth(true);
|
TEX::setSmooth(true);
|
||||||
|
|
||||||
controlsQuadArray.draw(0, controlsQuadCount);
|
controlsQuadArray.draw(0, controlsQuadCount);
|
||||||
|
|
||||||
TEX::setSmooth(false);
|
TEX::setSmooth(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!nullOrDisposed(contents)){
|
if (!nullOrDisposed(contents)){
|
||||||
/* Draw contents bitmap */
|
/* Draw contents bitmap */
|
||||||
glState.scissorBox.setIntersect(contentsRect);
|
glState.scissorBox.setIntersect(contentsRect);
|
||||||
|
|
||||||
shader.setTranslation(efPos + (Vec2i(16) - contentsOffset));
|
shader.setTranslation(efPos + (Vec2i(16) - contentsOffset));
|
||||||
|
|
||||||
contents->bindTex(shader);
|
contents->bindTex(shader);
|
||||||
contentsQuad.draw();
|
contentsQuad.draw();
|
||||||
}
|
}
|
||||||
|
|
@ -598,19 +587,15 @@ struct WindowPrivate {
|
||||||
|
|
||||||
if (active && cursorVert.vert){
|
if (active && cursorVert.vert){
|
||||||
float alpha = cursorAniAlpha[cursorAniAlphaIdx] / 255.0f;
|
float alpha = cursorAniAlpha[cursorAniAlphaIdx] / 255.0f;
|
||||||
|
|
||||||
cursorVert.setAlpha(alpha);
|
cursorVert.setAlpha(alpha);
|
||||||
|
|
||||||
updateArray = true;
|
updateArray = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pause && pauseAniVert.vert){
|
if (pause && pauseAniVert.vert){
|
||||||
float alpha = pauseAniAlpha[pauseAniAlphaIdx] / 255.0f;
|
float alpha = pauseAniAlpha[pauseAniAlphaIdx] / 255.0f;
|
||||||
FloatRect frameRect = pauseAniSrc[pauseAniQuad[pauseAniQuadIdx]];
|
FloatRect frameRect = pauseAniSrc[pauseAniQuad[pauseAniQuadIdx]];
|
||||||
|
|
||||||
pauseAniVert.setAlpha(alpha);
|
pauseAniVert.setAlpha(alpha);
|
||||||
Quad::setTexRect(pauseAniVert.vert, frameRect);
|
Quad::setTexRect(pauseAniVert.vert, frameRect);
|
||||||
|
|
||||||
updateArray = true;
|
updateArray = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -642,7 +627,6 @@ Window::~Window(){
|
||||||
|
|
||||||
void Window::update(){
|
void Window::update(){
|
||||||
guardDisposed();
|
guardDisposed();
|
||||||
|
|
||||||
p->updateControls();
|
p->updateControls();
|
||||||
p->stepAnimations();
|
p->stepAnimations();
|
||||||
}
|
}
|
||||||
|
|
@ -650,7 +634,6 @@ void Window::update(){
|
||||||
DEF_ATTR_SIMPLE(Window, X, int, p->position.x)
|
DEF_ATTR_SIMPLE(Window, X, int, p->position.x)
|
||||||
DEF_ATTR_SIMPLE(Window, Y, int, p->position.y)
|
DEF_ATTR_SIMPLE(Window, Y, int, p->position.y)
|
||||||
DEF_ATTR_SIMPLE(Window, CursorRect, Rect&, *p->cursorRect)
|
DEF_ATTR_SIMPLE(Window, CursorRect, Rect&, *p->cursorRect)
|
||||||
|
|
||||||
DEF_ATTR_RD_SIMPLE(Window, Windowskin, Bitmap*, p->windowskin)
|
DEF_ATTR_RD_SIMPLE(Window, Windowskin, Bitmap*, p->windowskin)
|
||||||
DEF_ATTR_RD_SIMPLE(Window, Contents, Bitmap*, p->contents)
|
DEF_ATTR_RD_SIMPLE(Window, Contents, Bitmap*, p->contents)
|
||||||
DEF_ATTR_RD_SIMPLE(Window, Stretch, bool, p->bgStretch)
|
DEF_ATTR_RD_SIMPLE(Window, Stretch, bool, p->bgStretch)
|
||||||
|
|
@ -666,9 +649,7 @@ DEF_ATTR_RD_SIMPLE(Window, ContentsOpacity, int, p->contentsOpacity)
|
||||||
|
|
||||||
void Window::setWindowskin(Bitmap *value){
|
void Window::setWindowskin(Bitmap *value){
|
||||||
guardDisposed();
|
guardDisposed();
|
||||||
|
|
||||||
p->windowskin = value;
|
p->windowskin = value;
|
||||||
|
|
||||||
if (nullOrDisposed(value))
|
if (nullOrDisposed(value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
@ -795,7 +776,6 @@ void Window::setContentsOpacity(int value){
|
||||||
|
|
||||||
void Window::initDynAttribs(){
|
void Window::initDynAttribs(){
|
||||||
p->cursorRect = new Rect;
|
p->cursorRect = new Rect;
|
||||||
|
|
||||||
p->refreshCursorRectCon();
|
p->refreshCursorRectCon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -809,13 +789,11 @@ void Window::onGeometryChange(const Scene::Geometry &geo){
|
||||||
|
|
||||||
void Window::setZ(int value){
|
void Window::setZ(int value){
|
||||||
ViewportElement::setZ(value);
|
ViewportElement::setZ(value);
|
||||||
|
|
||||||
p->controlsElement.setZ(value + 2);
|
p->controlsElement.setZ(value + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::setVisible(bool value){
|
void Window::setVisible(bool value){
|
||||||
ViewportElement::setVisible(value);
|
ViewportElement::setVisible(value);
|
||||||
|
|
||||||
p->controlsElement.setVisible(value);
|
p->controlsElement.setVisible(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -825,8 +803,6 @@ void Window::onViewportChange(){
|
||||||
|
|
||||||
void Window::releaseResources(){
|
void Window::releaseResources(){
|
||||||
p->controlsElement.release();
|
p->controlsElement.release();
|
||||||
|
|
||||||
unlink();
|
unlink();
|
||||||
|
|
||||||
delete p;
|
delete p;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,7 @@ struct Rect;
|
||||||
|
|
||||||
struct WindowPrivate;
|
struct WindowPrivate;
|
||||||
|
|
||||||
class Window : public ViewportElement, public Disposable
|
class Window : public ViewportElement, public Disposable{
|
||||||
{
|
|
||||||
public:
|
public:
|
||||||
Window(Viewport *viewport = 0);
|
Window(Viewport *viewport = 0);
|
||||||
~Window();
|
~Window();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue