TetriBattle3 100%[TM] development halted, need help

TetriBattle3 100%[TM] development halted, need help…
(Can not continue with this project until this task is completed)

Need some HELP with loading/saving data to a *.TXT file using SDL
(still need a detailed answer from someone)

Hi,

Would like to use the SDL “Files (RWops)” functions
to both:

  1. Read data (each line) from a *.TXT file into separate global variables.
  2. Write data (each global variable) to a *.TXT file into separate lines.

The *.TXT file would be "Configuration.TXT"
and would look like the following:--------------------------------------------------------------
0
1
0
0
1
1
2
0
0
1
1
3
0
0
1
1
128
128

Any one with some ideas on how to do this using the SDL "Files (RWops)"
functions???

Thanks in advance!

You can see what I am working on now by visiting the following web page:
http://www.silentheroproductions.com/tetribattle3_100percent
forpcwindows.htm

(http://www.silentheroproductions.com/tetribattle3_100percentforpcwindows.htm)

(This game is FREEWARE, I may release the entire MSVS.NET2005Pro project
after official 1.0 release)

Jesse “JeZ+Lee” Palser, BS, A+, Network+, MCP
SLNTHERO at AOL.com
Silent Hero Productions ®
"Fun, little games for when you don’t have time to save the world.[TM]"
www.SilentHeroProductions.com (http://www.silentheroproductions.com/)

SlntHero at aol.com wrote:

Need some HELP with loading/saving data to a *.TXT file using SDL
(still need a detailed answer from someone)

You got an answer from Stea Greene here:
http://article.gmane.org/gmane.comp.lib.sdl/27224

Anything wrong with it?

-Christian

TetriBattle3 100%[TM] development halted, need help…
(Can not continue with this project until this task is completed)

Need some HELP with loading/saving data to a *.TXT file using SDL
(still need a detailed answer from someone)

Hi,

Would like to use the SDL “Files (RWops)” functions
to both:

  1. Read data (each line) from a *.TXT file into separate global variables.
  2. Write data (each global variable) to a *.TXT file into separate lines.

Why not just use the C++ iostream library?

#include

// read file
std::ifstream file(“file.txt”);
if(!file)
return -1;
std::string string;
while(!file.eof())
{
string << file;
if(string == “enable-sound”)
enable_sound = true;
// whatever
}

/*****************************/

// write file
std::ofstream file(“file.txt”);
if(!file)
return -1;

if(enable_sound)
file << “enable-sound\n”;
// whatever

The bit for handling files on C’s POSIX is also supported on Windows. The
following function might do the job: fopen(), fclose(), fscanf(), fprintf().

Cheers,
RicardoEm S?bado, 22 de Abril de 2006 11:43, o SlntHero at aol.com escreveu:

The *.TXT file would be "Configuration.TXT"
and would look like the following:

0
1
0
0
1
1
2
0
0
1
1
3
0
0
1
1
128
128

Any one with some ideas on how to do this using the SDL "Files (RWops)"
functions???

Thanks in advance!

You can see what I am working on now by visiting the following web page:
http://www.silentheroproductions.com/tetribattle3_100percent
forpcwindows.htm

(http://www.silentheroproductions.com/tetribattle3_100percentforpcwindows.h
tm)

(This game is FREEWARE, I may release the entire MSVS.NET2005Pro project
after official 1.0 release)

Jesse “JeZ+Lee” Palser, BS, A+, Network+, MCP
SLNTHERO at AOL.com
Silent Hero Productions ®
"Fun, little games for when you don’t have time to save the world.[TM]"
www.SilentHeroProductions.com (http://www.silentheroproductions.com/)


“I’d rather have a bottle in front of me than a frontal lobotomy.”

I would suggest some book on general programming, I saw quiet good answer(s) on this topic already.
try man fgets, fscanf, sscanf, strtoul… fprintf, sprintf…

Regards

SlntHero at aol.com a ?crit :> TetriBattle3 100%[TM] development halted, need help…

(Can not continue with this project until this task is completed)

Need some HELP with loading/saving data to a *.TXT file using SDL
(still need a detailed answer from someone)