Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
urde
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AxioDL
urde
Commits
70747e23
Verified
Commit
70747e23
authored
Dec 11, 2019
by
Phillip Stephens
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix font rendering and world teleporter in MPT and PAL
parent
b5077994
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
Runtime/Graphics/CTextureBoo.cpp
Runtime/Graphics/CTextureBoo.cpp
+3
-1
Runtime/GuiSys/CRasterFont.cpp
Runtime/GuiSys/CRasterFont.cpp
+2
-2
Runtime/GuiSys/CRasterFont.hpp
Runtime/GuiSys/CRasterFont.hpp
+16
-3
Runtime/World/ScriptLoader.cpp
Runtime/World/ScriptLoader.cpp
+6
-1
No files found.
Runtime/Graphics/CTextureBoo.cpp
View file @
70747e23
...
...
@@ -867,7 +867,9 @@ const boo::ObjToken<boo::ITexture>& CTexture::GetFontTexture(EFontType tp) {
CFactoryFnReturn
FTextureFactory
(
const
urde
::
SObjectTag
&
tag
,
std
::
unique_ptr
<
u8
[]
>&&
in
,
u32
len
,
const
urde
::
CVParamTransfer
&
vparms
,
CObjectReference
*
selfRef
)
{
u32
u32Owned
=
vparms
.
GetOwnedObj
<
u32
>
();
const
CTextureInfo
*
inf
=
g_TextureCache
->
GetTextureInfo
(
tag
.
id
);
const
CTextureInfo
*
inf
=
nullptr
;
if
(
g_TextureCache
)
inf
=
g_TextureCache
->
GetTextureInfo
(
tag
.
id
);
return
TToken
<
CTexture
>::
GetIObjObjectFor
(
std
::
make_unique
<
CTexture
>
(
std
::
move
(
in
),
len
,
u32Owned
==
SBIG
(
'
OTEX
'
),
inf
));
}
...
...
Runtime/GuiSys/CRasterFont.cpp
View file @
70747e23
...
...
@@ -32,7 +32,7 @@ CRasterFont::CRasterFont(urde::CInputStream& in, urde::IObjectStore& store) {
u32
txtrId
=
(
version
==
5
?
in
.
readUint64Big
()
:
in
.
readUint32Big
());
x30_fontInfo
=
CFontInfo
(
tmp1
,
tmp2
,
tmp3
,
tmp4
,
name
.
c_str
());
x80_texture
=
store
.
GetObj
({
FOURCC
(
'
TXTR
'
),
txtrId
});
x2c_mode
=
EColor
Type
(
in
.
readUint32Big
());
x2c_mode
=
CTexture
::
EFont
Type
(
in
.
readUint32Big
());
u32
glyphCount
=
in
.
readUint32Big
();
xc_glyphs
.
reserve
(
glyphCount
);
...
...
@@ -79,7 +79,7 @@ CRasterFont::CRasterFont(urde::CInputStream& in, urde::IObjectStore& store) {
x1c_kerning
.
emplace_back
(
first
,
second
,
howMuch
);
}
if
(
magic
==
SBIG
(
'
FONT
'
)
&&
version
<=
2
)
if
(
magic
==
SBIG
(
'
FONT
'
)
&&
version
<=
4
)
x0_initialized
=
true
;
}
...
...
Runtime/GuiSys/CRasterFont.hpp
View file @
70747e23
...
...
@@ -103,7 +103,7 @@ class CRasterFont {
s32
x8_monoHeight
=
16
;
std
::
vector
<
std
::
pair
<
char16_t
,
CGlyph
>>
xc_glyphs
;
std
::
vector
<
CKernPair
>
x1c_kerning
;
EColorType
x2c_mode
=
EColorType
::
Main
;
CTexture
::
EFontType
x2c_mode
=
CTexture
::
EFontType
::
OneLayer
;
CFontInfo
x30_fontInfo
;
TLockedToken
<
CTexture
>
x80_texture
;
s32
x8c_baseline
;
...
...
@@ -125,7 +125,20 @@ public:
s32
GetMonoWidth
()
const
{
return
x4_monoWidth
;
}
s32
GetMonoHeight
()
const
{
return
x8_monoHeight
;
}
EColorType
GetMode
()
const
{
return
x2c_mode
;
}
EColorType
GetMode
()
const
{
switch
(
x2c_mode
)
{
case
CTexture
::
EFontType
::
OneLayer
:
case
CTexture
::
EFontType
::
TwoLayers
:
case
CTexture
::
EFontType
::
FourLayers
:
return
EColorType
::
Main
;
case
CTexture
::
EFontType
::
OneLayerOutline
:
case
CTexture
::
EFontType
::
TwoLayersOutlines
:
case
CTexture
::
EFontType
::
TwoLayersOutlines2
:
return
EColorType
::
Outline
;
default:
return
EColorType
::
Main
;
}
}
s32
GetLineMargin
()
const
{
return
x90_lineMargin
;
}
s32
GetCarriageAdvance
()
const
{
return
GetLineMargin
()
+
GetMonoHeight
();
}
...
...
@@ -148,7 +161,7 @@ public:
const
CGlyph
*
GetGlyph
(
char16_t
chr
)
const
{
return
InternalGetGlyph
(
chr
);
}
void
GetSize
(
const
CDrawStringOptions
&
opts
,
int
&
width
,
int
&
height
,
const
char16_t
*
str
,
int
len
)
const
;
const
boo
::
ObjToken
<
boo
::
ITexture
>&
GetTexture
()
{
return
x80_texture
->
GetFontTexture
(
CTexture
::
EFontType
(
x2c_mode
)
);
return
x80_texture
->
GetFontTexture
(
x2c_mode
);
}
bool
IsFinishedLoading
()
const
;
...
...
Runtime/World/ScriptLoader.cpp
View file @
70747e23
...
...
@@ -2352,7 +2352,7 @@ CEntity* ScriptLoader::LoadVisorFlare(CStateManager& mgr, CInputStream& in, int
CEntity
*
ScriptLoader
::
LoadWorldTeleporter
(
CStateManager
&
mgr
,
CInputStream
&
in
,
int
propCount
,
const
CEntityInfo
&
info
)
{
if
(
propCount
<
4
||
propCount
>
2
1
)
{
if
(
propCount
<
4
||
propCount
>
2
6
)
{
Log
.
report
(
logvisor
::
Warning
,
fmt
(
"Incorrect number of props for WorldTeleporter"
));
return
nullptr
;
}
...
...
@@ -2383,6 +2383,11 @@ CEntity* ScriptLoader::LoadWorldTeleporter(CStateManager& mgr, CInputStream& in,
float
charFadeInTime
=
(
propCount
<
19
?
0.1
f
:
in
.
readFloatBig
());
float
charsPerSecond
=
(
propCount
<
20
?
16.
f
:
in
.
readFloatBig
());
float
showDelay
=
(
propCount
<
21
?
0.
f
:
in
.
readFloatBig
());
std
::
string
str1
=
(
propCount
<
22
?
""
:
in
.
readString
());
std
::
string
str2
=
(
propCount
<
23
?
""
:
in
.
readString
());
/*float f1 =*/
(
propCount
<
24
?
0.
f
:
in
.
readFloatBig
());
/*float f2 =*/
(
propCount
<
25
?
0.
f
:
in
.
readFloatBig
());
/*float f3 =*/
(
propCount
<
26
?
0.
f
:
in
.
readFloatBig
());
if
(
showText
)
return
new
CScriptWorldTeleporter
(
mgr
.
AllocateUniqueId
(),
name
,
info
,
active
,
worldId
,
areaId
,
elevatorSound
,
...
...
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