games/doom: dont pretend we are in a netgame, fix save/load
This commit is contained in:
parent
30da40c16a
commit
aee28916b0
2 changed files with 22 additions and 44 deletions
|
@ -50,7 +50,7 @@ printf("PORTME i_net.c I_InitNetwork (use 9P)\n");
|
||||||
|
|
||||||
// netsend = PacketSend;
|
// netsend = PacketSend;
|
||||||
// netget = PacketGet;
|
// netget = PacketGet;
|
||||||
netgame = true;
|
// netgame = true;
|
||||||
|
|
||||||
/* parse player number and host list */
|
/* parse player number and host list */
|
||||||
// doomcom->consoleplayer = myargv[i+1][0]-'1';
|
// doomcom->consoleplayer = myargv[i+1][0]-'1';
|
||||||
|
|
|
@ -107,26 +107,13 @@ M_WriteFile
|
||||||
void* source,
|
void* source,
|
||||||
int length )
|
int length )
|
||||||
{
|
{
|
||||||
USED(name, source, length);
|
int fd, n;
|
||||||
I_Error("PORTME: m_misc.c M_WriteFile");
|
|
||||||
return false;
|
|
||||||
/*
|
|
||||||
int handle;
|
|
||||||
int count;
|
|
||||||
|
|
||||||
handle = open ( name, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666);
|
|
||||||
|
|
||||||
if (handle == -1)
|
if((fd = create(name, OWRITE | OTRUNC, 0666)) < 0)
|
||||||
return false;
|
return false;
|
||||||
|
n = write(fd, source, length);
|
||||||
count = write (handle, source, length);
|
close(fd);
|
||||||
close (handle);
|
return n == length;
|
||||||
|
|
||||||
if (count < length)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -138,32 +125,23 @@ M_ReadFile
|
||||||
( char const* name,
|
( char const* name,
|
||||||
byte** buffer )
|
byte** buffer )
|
||||||
{
|
{
|
||||||
USED(name, buffer);
|
int fd, length;
|
||||||
I_Error("PORTME m_misc.c M_ReadFile");
|
Dir *d;
|
||||||
return -1;
|
byte *buf;
|
||||||
/*
|
|
||||||
int handle, count, length;
|
|
||||||
struct stat fileinfo;
|
|
||||||
byte *buf;
|
|
||||||
|
|
||||||
length = 0;
|
if((fd = open(name, OREAD)) < 0)
|
||||||
|
I_Error ("Couldn't open file %s", name);
|
||||||
|
if((d = dirfstat(fd)) == nil)
|
||||||
|
I_Error ("Couldn't stat file %s", name);
|
||||||
|
length = d->length;
|
||||||
|
free(d);
|
||||||
|
|
||||||
handle = I_Open (name);
|
buf = Z_Malloc(length, PU_STATIC, NULL);
|
||||||
if (handle == -1)
|
if(readn(fd, buf, length) != length)
|
||||||
I_Error ("Couldn't read file %s", name);
|
I_Error ("Couldn't read file %s", name);
|
||||||
if (fstat (handle,&fileinfo) == -1)
|
close(fd);
|
||||||
I_Error ("Couldn't read file %s", name);
|
*buffer = buf;
|
||||||
length = fileinfo.st_size;
|
return length;
|
||||||
buf = Z_Malloc (length, PU_STATIC, NULL);
|
|
||||||
count = I_Read (handle, buf, length);
|
|
||||||
I_Close (handle);
|
|
||||||
|
|
||||||
if (count < length)
|
|
||||||
I_Error ("Couldn't read file %s", name);
|
|
||||||
|
|
||||||
*buffer = buf;
|
|
||||||
return length;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue