Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zeroing-engine
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
zeroing-engine
Commits
d6398ae8
Commit
d6398ae8
authored
Jul 24, 2020
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兼容混淆版本的引擎
parent
6e583a84
Changes
7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
596 additions
and
714 deletions
+596
-714
engine.js
debug/engine.js
+9
-143
engine.js.map
debug/engine.js.map
+1
-1
manifest.json
manifest.json
+0
-1
package.json
package.json
+39
-36
pre-process.js
scripts/pre-process.js
+11
-5
Sprite.ts
src/2d/display/Sprite.ts
+531
-525
StackContainer.ts
src/zeroing/game-warpper/StackContainer.ts
+5
-3
No files found.
debug/engine.js
View file @
d6398ae8
This diff is collapsed.
Click to expand it.
debug/engine.js.map
View file @
d6398ae8
This diff is collapsed.
Click to expand it.
manifest.json
deleted
100644 → 0
View file @
6e583a84
{
"id"
:
"engine"
,
"url"
:
"engine.cba09e24bd26909e1a67685a889d4799f4c2597a.js"
}
\ No newline at end of file
package.json
View file @
d6398ae8
...
...
@@ -25,10 +25,13 @@
"declare"
:
"node scripts/declare.js src/index.ts"
,
"dev"
:
"rollup -c -m -w"
,
"build"
:
"rollup -c -o dist/engine.js"
,
"build:prod"
:
"rollup -c -o dist/engine.js --environment BUILD:production"
,
"preprocess"
:
"node scripts/pre-process.js engine dist/engine.js"
,
"build:upload"
:
"rm -rf dist&&yarn build:prod && yarn preprocess && ali-oss-publish -c oss.config.js -e dist"
,
"build:debug"
:
"rm -rf dist&&yarn build && yarn preprocess && ali-oss-publish -c oss.config.js -e dist"
,
"build:prod"
:
"rollup -c -o dist/engine.min.js --environment BUILD:production"
,
"preprocess:prod"
:
"node scripts/pre-process.js engine dist/engine.min.js prod"
,
"preprocess:debug"
:
"node scripts/pre-process.js engine dist/engine.js"
,
"pack:prod"
:
"yarn build:prod && yarn preprocess:prod"
,
"pack:debug"
:
"yarn build && yarn preprocess:debug"
,
"upload"
:
"ali-oss-publish -c oss.config.js -e dist"
,
"publish"
:
"rm -rf dist && yarn pack:debug && yarn pack:prod && yarn upload"
,
"ts"
:
"dts-bundle --name engine --main types/src/index.d.ts --out ../../dist/index.d.ts"
,
"token"
:
"uglifyjs -m -c -o px-token.min.js px-token.js"
,
"dts"
:
"dts-bundle-generator -o types.d.ts src/index.ts"
...
...
scripts/pre-process.js
View file @
d6398ae8
...
...
@@ -6,7 +6,7 @@ const crypto = require('crypto');
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
[
_
,
__
,
id
,
fileName
]
=
process
.
argv
;
const
[
_
,
__
,
id
,
fileName
,
isProd
]
=
process
.
argv
;
const
stream
=
fs
.
createReadStream
(
fileName
);
const
fsHash
=
crypto
.
createHash
(
'sha1'
);
...
...
@@ -26,10 +26,16 @@ function loadComplete(md5) {
const
newFileName
=
fileName
.
substr
(
0
,
extIndex
+
1
)
+
md5
+
fileName
.
substr
(
extIndex
);
fs
.
renameSync
(
fileName
,
newFileName
);
let
manifest
=
{
let
manifest
;
if
(
fs
.
existsSync
(
'manifest.json'
))
{
manifest
=
JSON
.
parse
(
fs
.
readFileSync
(
'manifest.json'
,
'utf-8'
));
}
else
{
manifest
=
{
id
,
url
:
path
.
basename
(
newFileName
),
};
}
manifest
[
isProd
?
'url'
:
'url_dbg'
]
=
path
.
basename
(
newFileName
);
fs
.
writeFileSync
(
'manifest.json'
,
JSON
.
stringify
(
manifest
));
}
src/2d/display/Sprite.ts
View file @
d6398ae8
import
{
ObservablePoint
,
Point
,
Rectangle
}
from
'../math'
;
import
{
sign
,
TextureCache
}
from
'../utils'
;
import
{
ObservablePoint
,
Point
,
Rectangle
}
from
'../math'
;
import
{
sign
,
TextureCache
}
from
'../utils'
;
// import { BLEND_MODES } from '../const';
import
Texture
from
'../texture/Texture'
;
import
{
Event
}
from
'../events/Event'
;
import
{
Event
}
from
'../events/Event'
;
import
Container
from
'./Container'
;
import
{
DisplayObject
}
from
"./DisplayObject"
;
import
{
DisplayObject
}
from
"./DisplayObject"
;
import
CanvasRenderer
from
'../renderers/CanvasRenderer'
;
import
{
SCALE_MODES
}
from
'../const'
;
import
{
WebglRenderer
}
from
'../renderers/WebglRenderer'
;
import
{
abs
}
from
"../utils/twiddle"
;
import
{
SCALE_MODES
}
from
'../const'
;
import
{
WebglRenderer
}
from
'../renderers/WebglRenderer'
;
import
{
abs
}
from
"../utils/twiddle"
;
const
indices
=
new
Uint16Array
([
0
,
1
,
2
,
0
,
2
,
3
]);
/**
...
...
@@ -475,6 +475,12 @@ export default class Sprite extends Container {
}
this
.
_texture
=
value
||
Texture
.
EMPTY
;
if
(
this
.
_texture
!=
Texture
.
EMPTY
&&
this
.
_texture
!=
null
&&
!
this
.
_texture
.
baseTexture
.
hasLoaded
)
{
this
.
_texture
.
removeEventListener
(
'update'
,
this
.
_onTextureUpdate
,
this
);
}
this
.
_textureID
=
-
1
;
this
.
_textureTrimmedID
=
-
1
;
this
.
_cachedTint
=
0xFFFFFF
;
...
...
src/zeroing/game-warpper/StackContainer.ts
View file @
d6398ae8
...
...
@@ -136,7 +136,8 @@ export class StackContainer extends Node {
let
len
=
this
.
childNum
;
if
(
len
<=
0
)
{
return
false
;
resolve
(
true
);
return
;
}
let
lastView
=
this
.
getChildAt
(
this
.
children
.
length
-
1
);
let
view
;
...
...
@@ -166,7 +167,8 @@ export class StackContainer extends Node {
let
len
=
this
.
childNum
;
if
(
len
<=
0
)
{
return
false
;
resolve
(
true
);
return
;
}
let
lastView
=
this
.
getChildAt
(
len
-
1
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment