Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
openjazz
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PocketInsanity
openjazz
Commits
2b983990
Commit
2b983990
authored
Apr 12, 2010
by
anotherguest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup
parent
877b517e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
sceneload.cpp
src/scene/sceneload.cpp
+10
-14
No files found.
src/scene/sceneload.cpp
View file @
2b983990
...
@@ -82,7 +82,7 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
...
@@ -82,7 +82,7 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
int
pixels
=
0
;
int
pixels
=
0
;
unsigned
char
*
endpixdata
=
pixdata
+
width
*
height
;
unsigned
char
*
endpixdata
=
pixdata
+
width
*
height
;
unsigned
char
*
fillstart
=
NULL
;
unsigned
char
*
fillstart
=
NULL
;
while
(
size
>
0
)
{
while
(
size
>
0
)
{
unsigned
char
header
=
f
->
loadChar
();
unsigned
char
header
=
f
->
loadChar
();
switch
(
header
)
{
switch
(
header
)
{
...
@@ -121,7 +121,9 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
...
@@ -121,7 +121,9 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
unsigned
char
fillColor
=
f
->
loadChar
();
unsigned
char
fillColor
=
f
->
loadChar
();
unsigned
char
fillWidth
=
((
header
-
0x40
)
+
1
);
unsigned
char
fillWidth
=
((
header
-
0x40
)
+
1
);
memset
(
pixdata
,
fillColor
,
fillWidth
);
memset
(
pixdata
,
fillColor
,
fillWidth
);
fillstart
=
pixdata
;
fillstart
=
pixdata
;
while
(
fillstart
+
fillWidth
<
endpixdata
)
{
while
(
fillstart
+
fillWidth
<
endpixdata
)
{
memset
(
fillstart
,
fillColor
,
fillWidth
);
memset
(
fillstart
,
fillColor
,
fillWidth
);
fillstart
+=
width
;
fillstart
+=
width
;
...
@@ -132,13 +134,15 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
...
@@ -132,13 +134,15 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
size
--
;
size
--
;
}
}
else
{
else
{
int
copyWidth
=
(
header
&
0x3f
)
+
1
;
int
copyWidth
=
(
header
&
0x3f
)
+
1
;
unsigned
char
color
;
unsigned
char
color
;
for
(
int
col
=
0
;
col
<
copyWidth
;
col
++
)
{
for
(
int
col
=
0
;
col
<
copyWidth
;
col
++
)
{
color
=
f
->
loadChar
();
color
=
f
->
loadChar
();
fillstart
=
pixdata
;
fillstart
=
pixdata
;
while
(
fillstart
<
endpixdata
)
{
while
(
fillstart
<
endpixdata
)
{
*
fillstart
=
color
;
*
fillstart
=
color
;
fillstart
+=
width
;
fillstart
+=
width
;
}
}
...
@@ -152,7 +156,6 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
...
@@ -152,7 +156,6 @@ void Scene::LoadCompacted(int& size, File* f, unsigned char* pixdata, int width,
}
}
size
--
;
size
--
;
}
}
LOG
(
"PL Compacts pixels"
,
pixels
);
LOG
(
"PL Compacts pixels"
,
pixels
);
...
@@ -245,11 +248,8 @@ void Scene::loadAni (File *f, int dataIndex) {
...
@@ -245,11 +248,8 @@ void Scene::loadAni (File *f, int dataIndex) {
break
;
break
;
case
E1LAniHeader
:
case
E1LAniHeader
:
{
{
LOG
(
"PL 1L Background Type"
,
1
);
LOG
(
"PL 1L Background Type"
,
1
);
SDL_Surface
*
surface
;
unsigned
char
*
pixels
;
unsigned
char
*
pixels
;
pixels
=
new
unsigned
char
[
SW
*
SH
];
pixels
=
new
unsigned
char
[
SW
*
SH
];
memset
(
pixels
,
0
,
SW
*
SH
);
memset
(
pixels
,
0
,
SW
*
SH
);
...
@@ -258,9 +258,7 @@ void Scene::loadAni (File *f, int dataIndex) {
...
@@ -258,9 +258,7 @@ void Scene::loadAni (File *f, int dataIndex) {
delete
[]
pixels
;
delete
[]
pixels
;
// Use the most recently loaded palette
// Use the most recently loaded palette
video
.
setPalette
(
palettes
->
palette
);
video
.
setPalette
(
palettes
->
palette
);
}
}
break
;
break
;
case
EFFAniHeader
:
case
EFFAniHeader
:
...
@@ -293,14 +291,12 @@ void Scene::loadAni (File *f, int dataIndex) {
...
@@ -293,14 +291,12 @@ void Scene::loadAni (File *f, int dataIndex) {
case
ESTAniHeader
:
// Sound item
case
ESTAniHeader
:
// Sound item
{
{
unsigned
char
soundIndex
=
f
->
loadChar
();
unsigned
char
soundIndex
=
f
->
loadChar
();
unsigned
char
soundNote
=
f
->
loadChar
();
unsigned
char
soundNote
=
f
->
loadChar
();
unsigned
char
soundOffset
=
f
->
loadChar
();
unsigned
char
soundOffset
=
f
->
loadChar
();
LOG
(
"PL Audio tag with index"
,
soundIndex
);
LOG
(
"PL Audio tag with index"
,
soundIndex
);
LOG
(
"PL Audio tag play at "
,
soundNote
);
LOG
(
"PL Audio tag play at "
,
soundNote
);
LOG
(
"PL Audio tag play offset "
,
soundOffset
);
LOG
(
"PL Audio tag play offset "
,
soundOffset
);
}
}
break
;
break
;
...
...
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