mirror of
https://git.code.sf.net/p/quake/game-source
synced 2024-11-10 06:31:52 +00:00
use Qreadstring to read the whole file rather than reading it one line at a
time, reducing memory requirements.
This commit is contained in:
parent
929f341e34
commit
2a78bfb98c
1 changed files with 2 additions and 4 deletions
|
@ -220,7 +220,7 @@ Waypoint Loading from file
|
|||
{
|
||||
local QFile file;
|
||||
local PLItem plist;
|
||||
local string plist_data, l;
|
||||
local string plist_data;
|
||||
local integer i, count;
|
||||
|
||||
file = QFS_OpenFile (path);
|
||||
|
@ -228,9 +228,7 @@ Waypoint Loading from file
|
|||
dprint (sprintf ("could not load file: %s", path));
|
||||
return;
|
||||
}
|
||||
plist_data = str_new ();
|
||||
while ((l = Qgetline (file)))
|
||||
str_cat (plist_data, l);
|
||||
plist_data = Qreadstring (file, Qfilesize (file));
|
||||
Qclose (file);
|
||||
plist = [PLItem newFromString:plist_data];
|
||||
str_free (plist_data);
|
||||
|
|
Loading…
Reference in a new issue