Skip to content

Commit

Permalink
2.3.1 initial update
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyomoto committed Nov 25, 2020
1 parent 7876fb4 commit 6e4494d
Show file tree
Hide file tree
Showing 83 changed files with 1,081 additions and 442 deletions.
159 changes: 148 additions & 11 deletions FASTv33.yyp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion notes/Changelog/Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ exists, or try to work it out from the parent constructor if able. Allows checki
function rather than a string.

#### Input Handling
GenericInput
InputGeneric
* Removed constant. This is only relevant to inputs that have a constant.
* Added missing is() method.

Expand Down
3 changes: 2 additions & 1 deletion objects/FASTRender/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ if ( RenderManager().instance != noone ) {
exit;

}
/// @ignore
RenderManager().instance = id;

application_surface_draw_enable( false );
Expand All @@ -24,4 +25,4 @@ if ( RenderManager().bUseViews ) {

});

}
}
9 changes: 8 additions & 1 deletion objects/__FASTtool/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@

fast = FASTManager();

if ( fast.start ) {
syslog( "dupe found, death for me." );

instance_destroy();

exit;

}
System.write( string_repeat( "~", 40 ) );
System.write( fast );
System.write( string_repeat( "~", 40 ) );
Expand Down
73 changes: 73 additions & 0 deletions objects/oPointerWindow/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
resize = function( _w, _h ) {
surface.resize( _w, _h );
interior.resize( _w - 2, _h - 16 );

interface.width = _w + 2;
interface.height= _h + 2;

interfaceGrab.shape.w = _w;
interfaceGrab.shape.h = 30;

interfaceResize.shape.x = interface.width - 4;
interfaceResize.shape.y = interface.height - 4;

interfaceClose.shape.x = _w - 32;
interfaceClose.shape.y = 4;

interfaceMinimize.shape.x = _w - 64;
interfaceMinimize.shape.y = 4;

}
render = new RenderStack();
surface = new Surface( 1, 1 );
interface = new PointerStack( 0, 0, 1, 1 );
interior = new Surface( 1, 1 );

dragOffset = undefined;

interfaceGrab = interface.add( new PointerSimpleMouse( new ShapeRectangle( 0, 0, 0, 0 ) ) );
interfaceGrab.onEnter = function() {
window_set_cursor( cr_drag );

}
interfaceGrab.onLeave = function() {
window_set_cursor( cr_default );

}
interfaceGrab.onDown = function( _x, _y ) {
interface.hold = interfaceGrab;
dragOffset = { x : x - mouse_x, y : y - mouse_y }

}
interfaceGrab.onUp = function( _x, _y ) {
interface.hold = undefined;

}

interfaceClose = interface.add( new PointerSimpleMouse( new ShapeRectangle( 0, 0, 24, 24 ) ) );
interfaceMinimize = interface.add( new PointerSimpleMouse( new ShapeRectangle( 0, 0, 24, 24 ) ) );

interfaceResize = interface.add( new PointerSimpleMouse( new ShapeRectangle( 0, 0, 5, 5 ) ) );
interfaceResize.onEnter = function() {
window_set_cursor( cr_size_nwse );

}
interfaceResize.onLeave = function() {
window_set_cursor( cr_default );

}
interfaceResize.onDown = function( _x, _y ) {
interface.hold = interfaceResize;

}
interfaceResize.onUp = function( _x, _y ) {
interface.hold = undefined;

resize( max( POINTER_WINDOW_MINIMUM_WIDTH, mouse_x - x + 1 ), max( POINTER_WINDOW_MINIMUM_HEIGHT, mouse_y - y + 1 ) );

}

resize( bbox_right - bbox_left + 1, bbox_bottom - bbox_top + 1 );

#macro POINTER_WINDOW_MINIMUM_WIDTH 80
#macro POINTER_WINDOW_MINIMUM_HEIGHT 80
35 changes: 35 additions & 0 deletions objects/oPointerWindow/Draw_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
if ( surface.update() ) {
surface.set();
draw_clear( c_gray );

draw_set_color( c_white );

draw_rectangle( 1, 1, surface.width - 2, 30, false );
draw_rectangle( 1, 32, surface.width - 2, surface.height - 2, false );

draw_set_color( c_ltgray );

draw_line( 0, 30, surface.width - 2, 30 );
draw_line( 0, surface.height - 32, surface.width - 2, surface.height - 32 );
draw_line( 0, surface.height - 2, surface.width - 2, surface.height - 2 );

surface.reset();

}
surface.draw( x, y );

draw_sprite( gfx_rect, interfaceMinimize.state == interfaceMinimize.INPUT_NONE ? 3 : 4, x + interfaceMinimize.shape.x, y + interfaceMinimize.shape.y );
draw_sprite( gfx_rect, interfaceClose.state == interfaceClose.INPUT_NONE ? 1 : 2, x + interfaceClose.shape.x, y + interfaceClose.shape.y );

if ( interface.hold == interfaceResize ) {
draw_set_color( c_ltgray );
draw_set_alpha( 0.5 );

draw_rectangle( x, y, max( x + 80, mouse_x ), max( y + 80, mouse_y ), false );

draw_set_alpha( 1.0 );

}
//interface.draw( x, y, interface.active ? c_green : c_white );

//draw_text( 16, 32, interface.last );
7 changes: 7 additions & 0 deletions objects/oPointerWindow/Step_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
interface.update( mouse_x - x, mouse_y - y );

if ( interface.hold == interfaceGrab ) {
x = clamp( mouse_x + dragOffset.x, 0, room_width - surface.width );
y = clamp( mouse_y + dragOffset.y, 0, room_height- surface.height);

}
38 changes: 38 additions & 0 deletions objects/oPointerWindow/oPointerWindow.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion objects/oRenderStack/Create_0.gml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
// # oRenderStack v2.1b by Hyomoto
// provides basic draw-order handling
// return the width of the provided surface
/// @desc returns the width of the render surface
width = function() {
return surface.width;

}
/// @desc returns the height of the render surface
height = function() {
return surface.height;

}
/// @params {int} ids... Adds the instance ids to this render.
attach = function( _id ) {
ds_list_add( objects, _id );

Expand Down
31 changes: 0 additions & 31 deletions objects/testObject/testObject.yy

This file was deleted.

4 changes: 2 additions & 2 deletions rooms/Room1/Room1.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion scripts/Array/Array.gml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function Array( _size ) constructor {
static contains = function( _value ) {
var _i = 0; repeat( size() ) {
if ( content[ _i++ ] == _value ) {
return _i;
return _i - 1;

}

Expand Down
4 changes: 2 additions & 2 deletions scripts/ArrayList/ArrayList.gml
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ function ArrayList( _size ) : Array( _size ) constructor {
} else {
var _default = ( argument_count > 1 ? argument[ 1 ] : undefined );

length = ceil( _size == 0 ? 10 : _size * aggression );
content = array_create( length, _default );
length = ceil( _size );
content = array_create( _size == 0 ? 10 : _size * aggression, _default );

}

Expand Down
4 changes: 0 additions & 4 deletions scripts/DsLinkedList/DsLinkedList.gml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ function DsLinkedList() : DsChain() constructor {

while ( _seek != undefined ) {
if ( _seek == _link ) {
if ( _link == step ) {
next();

}
if ( _last != undefined ) {
_last.chain = _link.chain;

Expand Down
2 changes: 2 additions & 0 deletions scripts/DsList/DsList.gml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ function DsList() constructor {

}
pointer = ds_list_create();
//ref = gc_list()
//pointer = ref.pointer;

var _i = 0; repeat( argument_count ) {
add( argument[ _i++ ] );
Expand Down
12 changes: 10 additions & 2 deletions scripts/Gamepad/Gamepad.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
/// @func Gamepad
/// @wiki Input-Handling-Index
function Gamepad() constructor {
/// @param {int} contant The gamepad button constant to bind.
/// @param {Gamepad} gamepad This should generally be `self`, as the inputs much reach back to Gamepad to find the pad index.
/// @desc A wrapper GML's gamepad button inputs.
static input = function( _constant, _gamepad ) constructor {
static pressed = function() {
return gamepad_button_check_pressed( gamepad.padIndex, constant );
Expand All @@ -10,8 +13,6 @@ function Gamepad() constructor {
return gamepad_button_check( gamepad.padIndex, constant );

}
// this is for compatibility with InputDevice
static down = held;
static released = function() {
return gamepad_button_check_released( gamepad.padIndex, constant );

Expand All @@ -20,6 +21,8 @@ function Gamepad() constructor {
return gamepad_button_value( gamepad.padIndex, constant );

}
// this is for compatibility with InputDevice
static down = held;
static toString = function() {
return string( constant ) + "(" + string( pressed() ) + ", " + string( magnitude() ) + ")";

Expand All @@ -30,6 +33,9 @@ function Gamepad() constructor {
last = false;

}
/// @param {int} contant The gamepad axis constant to bind.
/// @param {Gamepad} gamepad This should generally be `self`, as the inputs much reach back to Gamepad to find the pad index.
/// @desc A wrapper GML's gamepad axis inputs.
static inputAxis = function( _axish, _axisv, _gamepad ) constructor {
static degree = function() {
return point_direction( 0, 0, gamepad_axis_value( gamepad.padIndex, axish ), gamepad_axis_value( gamepad.padIndex, axisv ) );
Expand Down Expand Up @@ -84,7 +90,9 @@ function Gamepad() constructor {
gamepad_set_axis_deadzone( padIndex, _amount );

}
/// @desc The port this gamepad is plugged into. You can get the port number via port.portId if this gamepad is plugged into a port.
port = GamepadManager().get_port( self );
/// @desc The pad index this Gamepad is used.
padIndex = -1;

if ( port == undefined ) {
Expand Down
Loading

0 comments on commit 6e4494d

Please sign in to comment.