Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Normand Erwan
VVVVVV_level_merger
Commits
95993ffa
Commit
95993ffa
authored
Jun 01, 2015
by
Orbmancer
Browse files
began to integrate Contents
parent
a6e12c1a
Changes
2
Hide whitespace changes
Inline
Side-by-side
merge.php
View file @
95993ffa
...
...
@@ -3,7 +3,8 @@
error_reporting
(
E_ALL
);
ini_set
(
'display_errors'
,
1
);
require
'Data.class.php'
;
require_once
'Data.class.php'
;
require_once
'model/Contents.class.php'
;
$name
=
$_POST
[
'name'
];
$data
=
$_POST
[
'data'
];
...
...
@@ -19,5 +20,21 @@ var_dump($td);
Data
::
saveXML
(
$data
,
$name
,
$x
,
$y
,
$td
);
echo
'<br/>'
;
var_dump
(
Data
::
loadXML
(
$td
));
$levels
=
Data
::
loadXML
(
$td
);
$contents
[]
=
array
();
var_dump
(
$levels
);
foreach
(
$levels
as
$level
){
$myContent
=
new
Contents
();
$myContent
->
importXML
(
$level
[
'content'
]);
$contents
[]
=
$myContent
;
}
echo
'<br/>'
;
echo
'<br/>'
;
echo
'<br/>'
;
echo
'<br/>'
;
var_dump
(
$levels
);
//Merge $levels
\ No newline at end of file
model/Contents.class.php
View file @
95993ffa
...
...
@@ -32,8 +32,8 @@ class Contents
$prev_y
=
1
;
for
(
$i
=
0
;
$i
<
count
(
$contents
);
++
$i
){
$tab_x
=
(
int
)
floor
(
$i
/
$this
->
$tab
W
idth
);
$tab_y
=
(
int
)
floor
(
$i
/
(
$this
->
$tabwidth
*
$this
->
$tab
H
eight
*
$this
->
mapwidth
));
$tab_x
=
(
int
)
floor
(
$i
/
self
::
$tab
w
idth
);
$tab_y
=
(
int
)
floor
(
$i
/
(
self
::
$tabwidth
*
self
::
$tab
h
eight
*
$this
->
mapwidth
));
$line
[]
=
$contents
[
$i
];
if
(
$prev_y
!=
$tab_y
){
...
...
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