Don't write in text mode (uio/Win32 conflict; Bug #912) - Michael
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2437 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
Changes towards version 0.6:
|
||||
- All output done in binary mode, due to uio/Win32 conflicts (#912) - Michael
|
||||
- Online key configuration menu actually functional now - Michael
|
||||
- Tweak to Lander UI - Special Weapon is now explicitly Lander Escape,
|
||||
just as Warp Escape is - Michael
|
||||
|
||||
@@ -454,7 +454,7 @@ SaveKeyConfiguration (uio_DirHandle *path, const char *fname)
|
||||
{
|
||||
uio_Stream *f;
|
||||
|
||||
f = res_OpenResFile (path, fname, "wt");
|
||||
f = res_OpenResFile (path, fname, "wb");
|
||||
if (f)
|
||||
{
|
||||
VControl_Dump (f);
|
||||
|
||||
@@ -964,7 +964,7 @@ dump_keybindings (uio_Stream *out, keybinding *kb, char *name)
|
||||
PutResFileChar (':', out);
|
||||
PutResFileChar (' ', out);
|
||||
WriteResFile (name, 1, strlen (name), out);
|
||||
PutResFileChar ('\n', out);
|
||||
PutResFileNewline (out);
|
||||
|
||||
kb = kb->next;
|
||||
}
|
||||
@@ -976,8 +976,9 @@ VControl_Dump (uio_Stream *out)
|
||||
int i;
|
||||
char namebuffer[64];
|
||||
|
||||
sprintf (namebuffer, "version %d\n", version);
|
||||
sprintf (namebuffer, "version %d", version);
|
||||
WriteResFile (namebuffer, 1, strlen (namebuffer), out);
|
||||
PutResFileNewline (out);
|
||||
|
||||
/* Print out keyboard bindings */
|
||||
for (i = 0; i < SDLK_LAST; i++)
|
||||
@@ -998,8 +999,9 @@ VControl_Dump (uio_Stream *out)
|
||||
{
|
||||
int j;
|
||||
|
||||
sprintf (namebuffer, "joystick %d threshold %d\n", i, joysticks[i].threshold);
|
||||
sprintf (namebuffer, "joystick %d threshold %d", i, joysticks[i].threshold);
|
||||
WriteResFile (namebuffer, 1, strlen (namebuffer), out);
|
||||
PutResFileNewline (out);
|
||||
|
||||
for (j = 0; j < joysticks[i].numaxes; j++)
|
||||
{
|
||||
|
||||
@@ -60,6 +60,7 @@ extern int WriteResFile (PCVOID lpBuf, COUNT size, COUNT count,
|
||||
uio_Stream *fp);
|
||||
extern int GetResFileChar (uio_Stream *fp);
|
||||
extern int PutResFileChar (char ch, uio_Stream *fp);
|
||||
extern int PutResFileNewline (uio_Stream *fp);
|
||||
extern long SeekResFile (uio_Stream *fp, long offset, int whence);
|
||||
extern long TellResFile (uio_Stream *fp);
|
||||
extern long LengthResFile (uio_Stream *fp);
|
||||
|
||||
@@ -222,7 +222,7 @@ Alist_Dump (alist *m, uio_Stream *s, const char *prefix)
|
||||
PutResFileChar('=', s);
|
||||
PutResFileChar(' ', s);
|
||||
WriteResFile (e->value, 1, strlen (e->value), s);
|
||||
PutResFileChar('\n', s);
|
||||
PutResFileNewline(s);
|
||||
}
|
||||
e = e->next;
|
||||
}
|
||||
|
||||
@@ -99,6 +99,18 @@ PutResFileChar (char ch, uio_Stream *fp)
|
||||
return (retval);
|
||||
}
|
||||
|
||||
int
|
||||
PutResFileNewline (uio_Stream *fp)
|
||||
{
|
||||
int retval;
|
||||
|
||||
#ifdef WIN32
|
||||
PutResFileChar ('\r', fp);
|
||||
#endif
|
||||
retval = PutResFileChar ('\n', fp);
|
||||
return (retval);
|
||||
}
|
||||
|
||||
long
|
||||
SeekResFile (uio_Stream *fp, long offset, int whence)
|
||||
{
|
||||
|
||||
@@ -109,7 +109,7 @@ res_SaveFilename (uio_DirHandle *path, const char *fname, const char *root)
|
||||
uio_Stream *f;
|
||||
|
||||
check_map_init ();
|
||||
f = res_OpenResFile (path, fname, "wt");
|
||||
f = res_OpenResFile (path, fname, "wb");
|
||||
if (f) {
|
||||
res_SaveFile (f, root);
|
||||
res_CloseResFile (f);
|
||||
|
||||
Reference in New Issue
Block a user