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
0b47d4f3
Commit
0b47d4f3
authored
Nov 02, 2009
by
anotherguest
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated to show more of intro. Delay using timing values
parent
ea5a14fd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
59 deletions
+64
-59
scene.cpp
src/scene.cpp
+64
-59
No files found.
src/scene.cpp
View file @
0b47d4f3
...
@@ -644,7 +644,8 @@ int Scene::play () {
...
@@ -644,7 +644,8 @@ int Scene::play () {
SDL_Rect
dst
;
SDL_Rect
dst
;
unsigned
int
sceneIndex
=
0
;
unsigned
int
sceneIndex
=
0
;
ImageInfo
*
imageInfo
=
NULL
;
ImageInfo
*
imageInfo
=
NULL
;
unsigned
int
pageTime
=
scriptPages
[
sceneIndex
].
pageTime
;
unsigned
int
pageTime
=
scriptPages
[
sceneIndex
].
pageTime
;
unsigned
int
lastTicks
=
globalTicks
;
if
(
scriptPages
[
sceneIndex
].
bgIndex
!=
-
1
)
if
(
scriptPages
[
sceneIndex
].
bgIndex
!=
-
1
)
{
{
imageInfo
=
FindImage
(
scriptPages
[
sceneIndex
].
bgIndex
);
imageInfo
=
FindImage
(
scriptPages
[
sceneIndex
].
bgIndex
);
...
@@ -653,7 +654,6 @@ int Scene::play () {
...
@@ -653,7 +654,6 @@ int Scene::play () {
if
(
imageInfo
!=
NULL
)
if
(
imageInfo
!=
NULL
)
usePalette
(
imageInfo
[
0
].
palette
);
usePalette
(
imageInfo
[
0
].
palette
);
while
(
true
)
{
while
(
true
)
{
if
(
loop
(
NORMAL_LOOP
)
==
E_QUIT
)
return
E_QUIT
;
if
(
loop
(
NORMAL_LOOP
)
==
E_QUIT
)
return
E_QUIT
;
if
(
controls
.
release
(
C_ESCAPE
))
{
if
(
controls
.
release
(
C_ESCAPE
))
{
...
@@ -662,18 +662,22 @@ int Scene::play () {
...
@@ -662,18 +662,22 @@ int Scene::play () {
}
}
if
(
controls
.
release
(
C_ENTER
))
{
if
(
controls
.
release
(
C_ENTER
)
||
((
globalTicks
-
lastTicks
)
>=
pageTime
*
1000
&&
pageTime
!=
256
&&
pageTime
!=
0
)
)
{
sceneIndex
++
;
sceneIndex
++
;
if
(
sceneIndex
==
scriptItems
)
{
if
(
sceneIndex
==
scriptItems
)
{
return
E_NONE
;
return
E_NONE
;
}
}
lastTicks
=
globalTicks
;
// Get bg for this page
// Get bg for this page
if
(
scriptPages
[
sceneIndex
].
bgIndex
!=
-
1
)
{
if
(
scriptPages
[
sceneIndex
].
bgIndex
!=
-
1
)
{
imageInfo
=
FindImage
(
scriptPages
[
sceneIndex
].
bgIndex
);
imageInfo
=
FindImage
(
scriptPages
[
sceneIndex
].
bgIndex
);
if
(
imageInfo
!=
NULL
)
{
if
(
imageInfo
!=
NULL
)
{
usePalette
(
imageInfo
[
0
].
palette
);
usePalette
(
imageInfo
[
0
].
palette
);
}
}
else
{
restorePalette
(
screen
);
}
}
}
pageTime
=
scriptPages
[
sceneIndex
].
pageTime
;
pageTime
=
scriptPages
[
sceneIndex
].
pageTime
;
...
@@ -683,63 +687,64 @@ int Scene::play () {
...
@@ -683,63 +687,64 @@ int Scene::play () {
dst
.
x
=
(
screenW
-
320
)
>>
1
;
dst
.
x
=
(
screenW
-
320
)
>>
1
;
dst
.
y
=
(
screenH
-
200
)
>>
1
;
dst
.
y
=
(
screenH
-
200
)
>>
1
;
if
(
imageInfo
!=
NULL
)
{
if
(
imageInfo
!=
NULL
)
{
SDL_BlitSurface
(
imageInfo
->
image
,
NULL
,
screen
,
&
dst
);
SDL_BlitSurface
(
imageInfo
->
image
,
NULL
,
screen
,
&
dst
);
int
x
=
0
;
}
int
y
=
0
;
for
(
int
text
=
0
;
text
<
scriptPages
[
sceneIndex
].
noScriptTexts
;
text
++
)
{
Font
*
font
=
NULL
;
for
(
int
index
=
0
;
index
<
noScriptFonts
;
index
++
)
{
if
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
fontId
==
scriptFonts
[
index
].
fontId
)
{
switch
(
scriptFonts
[
index
].
fontType
)
{
case
EFONT2Type
:
font
=
font2
;
break
;
case
EFONTBIGType
:
font
=
fontbig
;
break
;
case
EFONTINYType
:
font
=
fontiny
;
break
;
case
EFONTMN1Type
:
font
=
fontmn1
;
break
;
case
EFONTMN2Type
:
font
=
fontmn2
;
break
;
}
continue
;
}
}
if
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
x
!=
-
1
)
{
x
=
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
x
;
y
=
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
y
;
}
switch
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
alignment
)
{
case
0
:
// left
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
x
,
y
);
break
;
case
1
:
// right
int
width
=
font
->
calcStringWidth
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
);
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
320
-
width
,
y
);
break
;
case
2
:
// center
{
int
width
=
font
->
calcStringWidth
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
)
/
2
;
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
160
-
width
,
y
);
}
break
;
}
y
+=
font
->
fontHeight
()
/
2
;
}
}
else
{
else
{
//clearScreen(BLACK);
clearScreen
(
BLACK
);
}
int
x
=
0
;
int
y
=
0
;
for
(
int
text
=
0
;
text
<
scriptPages
[
sceneIndex
].
noScriptTexts
;
text
++
)
{
Font
*
font
=
NULL
;
for
(
int
index
=
0
;
index
<
noScriptFonts
;
index
++
)
{
if
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
fontId
==
scriptFonts
[
index
].
fontId
)
{
switch
(
scriptFonts
[
index
].
fontType
)
{
case
EFONT2Type
:
font
=
font2
;
break
;
case
EFONTBIGType
:
font
=
fontbig
;
break
;
case
EFONTINYType
:
font
=
fontiny
;
break
;
case
EFONTMN1Type
:
font
=
fontmn1
;
break
;
case
EFONTMN2Type
:
font
=
fontmn2
;
break
;
}
continue
;
}
}
if
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
x
!=
-
1
)
{
x
=
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
x
;
y
=
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
y
;
}
switch
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
alignment
)
{
case
0
:
// left
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
x
,
y
);
break
;
case
1
:
// right
int
width
=
font
->
calcStringWidth
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
);
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
320
-
width
,
y
);
break
;
case
2
:
// center
{
int
width
=
font
->
calcStringWidth
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
)
/
2
;
font
->
showString
(
scriptPages
[
sceneIndex
].
scriptTexts
[
text
].
text
,
160
-
width
,
y
);
}
break
;
}
}
y
+=
font
->
fontHeight
()
/
2
;
}
SDL_Delay
(
T_FRAME
);
SDL_Delay
(
T_FRAME
);
}
}
...
...
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