Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
684aeba3
Commit
684aeba3
authored
13 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
aaaaaaaaand.... one more fix
parent
87bfdda4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exec/load/frame.js
+19
-12
19 additions, 12 deletions
exec/load/frame.js
with
19 additions
and
12 deletions
exec/load/frame.js
+
19
−
12
View file @
684aeba3
...
...
@@ -157,16 +157,18 @@ function Frame(x,y,width,height,attr,frame) {
var
updates
=
getUpdateList
().
sort
(
updateSort
);
var
lasty
=
undefined
;
var
lastx
=
undefined
;
var
lastid
=
undefined
;
for
each
(
var
u
in
updates
)
{
var
posx
=
u
.
x
+
properties
.
x
;
var
posy
=
u
.
y
+
properties
.
y
;
if
(
lasty
!==
u
.
y
)
console
.
gotoxy
(
posx
,
posy
);
else
if
(
lastx
==
undefined
||
(
u
.
x
-
lastx
)
!=
1
)
if
(
lasty
!==
u
.
y
||
lastx
==
undefined
||
(
u
.
x
-
lastx
)
!=
1
)
console
.
gotoxy
(
posx
,
posy
);
if
(
lastid
!==
u
.
id
)
console
.
attributes
=
undefined
;
drawChar
(
u
.
ch
,
u
.
attr
,
posx
,
posy
);
lastx
=
u
.
x
;
lasty
=
u
.
y
;
lastid
=
u
.
id
;
}
properties
.
update
=
{};
}
...
...
@@ -178,8 +180,8 @@ function Frame(x,y,width,height,attr,frame) {
this
.
updateFrame
(
frame
);
}
this
.
remove
=
function
(
frame
)
{
delete
properties
.
canvas
[
frame
.
id
];
this
.
updateFrame
(
frame
);
delete
properties
.
canvas
[
frame
.
id
];
}
this
.
top
=
function
(
frame
)
{
var
canvas
=
properties
.
canvas
[
frame
.
id
];
...
...
@@ -198,16 +200,18 @@ function Frame(x,y,width,height,attr,frame) {
this
.
updateFrame
(
frame
);
}
this
.
updateFrame
=
function
(
frame
)
{
var
c
=
properties
.
canvas
[
frame
.
id
]
var
xoff
=
frame
.
x
-
this
.
x
;
var
yoff
=
frame
.
y
-
this
.
y
;
for
(
var
y
=
0
;
y
<
frame
.
height
;
y
++
)
{
for
(
var
x
=
0
;
x
<
frame
.
width
;
x
++
)
{
updateChar
(
c
.
xoff
+
x
,
c
.
yoff
+
y
);
updateChar
(
xoff
+
x
,
yoff
+
y
);
}
}
}
this
.
updateChar
=
function
(
frame
,
x
,
y
)
{
var
c
=
properties
.
canvas
[
frame
.
id
]
updateChar
(
c
.
xoff
+
x
,
c
.
yoff
+
y
);
var
xoff
=
frame
.
x
-
this
.
x
;
var
yoff
=
frame
.
y
-
this
.
y
;
updateChar
(
xoff
+
x
,
yoff
+
y
);
}
/* private functions */
...
...
@@ -224,6 +228,7 @@ function Frame(x,y,width,height,attr,frame) {
list
.
push
({
ch
:
d
.
ch
,
attr
:
d
.
attr
,
id
:
d
.
id
,
x
:
Number
(
x
),
y
:
Number
(
y
)
});
...
...
@@ -271,9 +276,10 @@ function Frame(x,y,width,height,attr,frame) {
}
/* character/attribute pair representing a screen position and its contents */
function
Char
(
ch
,
attr
)
{
function
Char
(
ch
,
attr
,
id
)
{
this
.
ch
=
ch
;
this
.
attr
=
attr
;
this
.
id
=
id
;
}
/* private properties */
...
...
@@ -558,7 +564,7 @@ function Frame(x,y,width,height,attr,frame) {
/* set character and attribute */
var
ch
=
line
[
0
];
line
=
line
.
substr
(
1
);
properties
.
data
[
x
][
y
]
=
new
Char
(
ch
,
attr
);
properties
.
data
[
x
][
y
]
=
new
Char
(
ch
,
attr
,
this
.
id
);
x
++
;
}
y
++
;
...
...
@@ -579,6 +585,7 @@ function Frame(x,y,width,height,attr,frame) {
if
(
f
.
eof
)
return
(
false
);
c
.
attr
=
f
.
readBin
(
1
);
c
.
id
=
this
.
id
;
properties
.
data
[
x
][
y
]
=
c
;
}
}
...
...
@@ -596,7 +603,7 @@ function Frame(x,y,width,height,attr,frame) {
for
(
var
x
=
0
;
x
<
this
.
width
;
x
++
)
{
for
(
var
y
=
0
;
y
<
this
.
height
;
y
++
)
properties
.
display
.
updateChar
(
this
,
x
,
y
);
properties
.
data
[
x
].
push
(
new
Char
(
undefined
,
this
.
attr
));
properties
.
data
[
x
].
push
(
new
Char
(
undefined
,
this
.
attr
,
this
.
id
));
}
position
.
offset
.
y
++
;
}
...
...
@@ -844,7 +851,7 @@ function Frame(x,y,width,height,attr,frame) {
for
(
var
w
=
0
;
w
<
this
.
width
;
w
++
)
{
properties
.
data
.
push
(
new
Array
(
this
.
height
));
for
(
var
h
=
0
;
h
<
this
.
height
;
h
++
)
{
properties
.
data
[
w
][
h
]
=
new
Char
(
undefined
,
this
.
attr
);
properties
.
data
[
w
][
h
]
=
new
Char
(
undefined
,
this
.
attr
,
this
.
id
);
}
}
//log(LOG_DEBUG,format("new frame initialized: %sx%s at %s,%s",this.width,this.height,this.x,this.y));
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment