Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tales of MajEyal
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tome
Tales of MajEyal
Commits
0c57be06
Commit
0c57be06
authored
13 years ago
by
dg
Browse files
Options
Downloads
Patches
Plain Diff
fix
git-svn-id:
http://svn.net-core.org/repos/t-engine4@3638
51575b47-30f0-44d4-a5cc-537603b46e54
parent
d98ff6e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/core_lua.c
+8
-9
8 additions, 9 deletions
src/core_lua.c
with
8 additions
and
9 deletions
src/core_lua.c
+
8
−
9
View file @
0c57be06
...
...
@@ -486,7 +486,7 @@ static int sdl_surface_drawstring_newsurface_aa(lua_State *L)
return
1
;
}
static
font_make_texture_line
(
lua_State
*
L
,
SDL_Surface
*
s
,
int
id
,
bool
is_separator
,
int
id_real_line
,
char
*
line_data
)
static
font_make_texture_line
(
lua_State
*
L
,
SDL_Surface
*
s
,
int
id
,
bool
is_separator
,
int
id_real_line
,
char
*
line_data
,
int
line_data_size
)
{
lua_createtable
(
L
,
0
,
5
);
...
...
@@ -522,7 +522,7 @@ static font_make_texture_line(lua_State *L, SDL_Surface *s, int id, bool is_sepa
if
(
line_data
)
{
lua_pushliteral
(
L
,
"line_extra"
);
lua_pushstring
(
L
,
line_data
);
lua_push
l
string
(
L
,
line_data
,
line_data_size
);
lua_rawset
(
L
,
-
3
);
}
...
...
@@ -562,6 +562,7 @@ static int sdl_font_draw(lua_State *L)
int
nb_lines
=
1
;
int
id_real_line
=
1
;
char
*
line_data
=
NULL
;
int
line_data_size
=
0
;
char
*
start
=
(
char
*
)
str
,
*
stop
=
(
char
*
)
str
,
*
next
=
(
char
*
)
str
;
int
max_size
=
0
;
int
size
=
0
;
...
...
@@ -593,7 +594,7 @@ static int sdl_font_draw(lua_State *L)
if
(
!
no_linefeed
&&
(
force_nl
||
(
txt
&&
(
size
+
txt
->
w
>
max_width
))))
{
// Push it & reset the surface
font_make_texture_line
(
L
,
s
,
nb_lines
,
is_separator
,
id_real_line
,
line_data
);
font_make_texture_line
(
L
,
s
,
nb_lines
,
is_separator
,
id_real_line
,
line_data
,
line_data_size
);
is_separator
=
FALSE
;
SDL_FillRect
(
s
,
NULL
,
SDL_MapRGBA
(
s
->
format
,
0
,
0
,
0
,
0
));
// printf("Ending previous line at size %d\n", size);
...
...
@@ -603,7 +604,7 @@ static int sdl_font_draw(lua_State *L)
if
(
force_nl
)
{
id_real_line
++
;
if
(
line_data
)
{
free
(
line_data
);
line_data
=
NULL
;
}
if
(
line_data
)
{
line_data
=
NULL
;
}
}
force_nl
=
FALSE
;
}
...
...
@@ -657,8 +658,8 @@ static int sdl_font_draw(lua_State *L)
}
// Extra data
else
if
((
*
(
next
+
1
)
==
'&'
))
{
if
(
line_data
)
{
free
(
line_data
);
line_data
=
NULL
;
}
line_data
=
strndup
(
next
+
2
,
codestop
-
(
next
+
2
)
)
;
line_data
=
next
+
2
;
line_data
_size
=
codestop
-
(
next
+
2
);
}
// Color
else
{
...
...
@@ -738,14 +739,12 @@ static int sdl_font_draw(lua_State *L)
next
++
;
}
font_make_texture_line
(
L
,
s
,
nb_lines
,
is_separator
,
id_real_line
,
line_data
);
font_make_texture_line
(
L
,
s
,
nb_lines
,
is_separator
,
id_real_line
,
line_data
,
line_data_size
);
if
(
size
>
max_size
)
max_size
=
size
;
if
(
txt
)
SDL_FreeSurface
(
txt
);
SDL_FreeSurface
(
s
);
if
(
line_data
)
free
(
line_data
);
lua_pushnumber
(
L
,
nb_lines
);
lua_pushnumber
(
L
,
max_size
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment