Fixed ram_buffer init
This commit is contained in:
parent
c8b9c96f29
commit
9f8932c620
apps/nexus
|
@ -15,7 +15,8 @@ bool PatchServer::Create(const std::string &filename,
|
||||||
signature = sig;
|
signature = sig;
|
||||||
chunk_size = csize;
|
chunk_size = csize;
|
||||||
|
|
||||||
ram_size = rsize;
|
if(ram_size == 0) ram_size = 128000000;
|
||||||
|
ram_size = rsize/chunk_size;
|
||||||
ram_used = 0;
|
ram_used = 0;
|
||||||
vbo_size = 0;
|
vbo_size = 0;
|
||||||
vbo_used = 0;
|
vbo_used = 0;
|
||||||
|
@ -35,7 +36,9 @@ bool PatchServer::Load(const std::string &filename, Signature sig,
|
||||||
signature = sig;
|
signature = sig;
|
||||||
chunk_size = csize;
|
chunk_size = csize;
|
||||||
|
|
||||||
ram_size = rsize;
|
if(ram_size == 0) ram_size = 128000000;
|
||||||
|
ram_size = rsize/chunk_size;
|
||||||
|
|
||||||
ram_used = 0;
|
ram_used = 0;
|
||||||
vbo_size = 0;
|
vbo_size = 0;
|
||||||
vbo_used = 0;
|
vbo_used = 0;
|
||||||
|
@ -272,5 +275,6 @@ bool PatchServer::FlushVbo(PTime &ptime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void PatchServer::SetRamBufferSize(unsigned int r_buffer) {
|
void PatchServer::SetRamBufferSize(unsigned int r_buffer) {
|
||||||
|
cerr << "Chunk_size: " << chunk_size << endl;
|
||||||
ram_size = (unsigned int)(r_buffer/chunk_size) + 1;
|
ram_size = (unsigned int)(r_buffer/chunk_size) + 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,11 +49,12 @@ class PatchServer: public File {
|
||||||
unsigned int ram_flushed;
|
unsigned int ram_flushed;
|
||||||
|
|
||||||
|
|
||||||
|
PatchServer(): chunk_size(1024), ram_size(128000000), vbo_size(32000000) {}
|
||||||
bool Create(const std::string &filename, Signature signature,
|
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,
|
bool Load(const std::string &filename, Signature sig,
|
||||||
unsigned int chunk_size, bool readonly,
|
unsigned int chunk_size, bool readonly,
|
||||||
unsigned int ram_size = 128000);
|
unsigned int ram_size = 0);
|
||||||
|
|
||||||
void Close();
|
void Close();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue