Fixed ram_buffer init

This commit is contained in:
Federico Ponchio 2004-10-20 15:07:02 +00:00
parent c8b9c96f29
commit 9f8932c620
2 changed files with 9 additions and 4 deletions

View File

@ -15,7 +15,8 @@ bool PatchServer::Create(const std::string &filename,
signature = sig;
chunk_size = csize;
ram_size = rsize;
if(ram_size == 0) ram_size = 128000000;
ram_size = rsize/chunk_size;
ram_used = 0;
vbo_size = 0;
vbo_used = 0;
@ -35,7 +36,9 @@ bool PatchServer::Load(const std::string &filename, Signature sig,
signature = sig;
chunk_size = csize;
ram_size = rsize;
if(ram_size == 0) ram_size = 128000000;
ram_size = rsize/chunk_size;
ram_used = 0;
vbo_size = 0;
vbo_used = 0;
@ -272,5 +275,6 @@ bool PatchServer::FlushVbo(PTime &ptime) {
}
void PatchServer::SetRamBufferSize(unsigned int r_buffer) {
cerr << "Chunk_size: " << chunk_size << endl;
ram_size = (unsigned int)(r_buffer/chunk_size) + 1;
}

View File

@ -49,11 +49,12 @@ class PatchServer: public File {
unsigned int ram_flushed;
PatchServer(): chunk_size(1024), ram_size(128000000), vbo_size(32000000) {}
bool Create(const std::string &filename, Signature signature,
unsigned int chunk_size, unsigned int ram_size = 128000);
unsigned int chunk_size, unsigned int ram_size = 0);
bool Load(const std::string &filename, Signature sig,
unsigned int chunk_size, bool readonly,
unsigned int ram_size = 128000);
unsigned int ram_size = 0);
void Close();