diff --git a/apps/nexus/patchserver.cpp b/apps/nexus/patchserver.cpp index e0c44c93..79bfc602 100644 --- a/apps/nexus/patchserver.cpp +++ b/apps/nexus/patchserver.cpp @@ -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; } diff --git a/apps/nexus/patchserver.h b/apps/nexus/patchserver.h index f8c73110..c9da64a6 100644 --- a/apps/nexus/patchserver.h +++ b/apps/nexus/patchserver.h @@ -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();