This commit is contained in:
Federico Ponchio 2005-02-19 12:06:55 +00:00
parent 9ce3dba5f7
commit c532f14569
4 changed files with 34 additions and 20 deletions

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.31 2005/02/19 10:45:04 ponchio
Patch generalized and small fixes.
Revision 1.30 2005/02/17 15:39:44 ponchio Revision 1.30 2005/02/17 15:39:44 ponchio
Reorderes statistics a bit. Reorderes statistics a bit.
@ -232,8 +235,8 @@ void NexusMt::Draw(unsigned int cell, DrawContest &contest) {
fstart = NULL; fstart = NULL;
vstart = NULL; vstart = NULL;
cstart = (char *)(64 * patch.vstartc); cstart = (char *)(64 * (int)patch.vstartc);
nstart = (char *)(64 * patch.vstartn); nstart = (char *)(64 * (int)patch.vstartn);
} else { } else {
fstart = (char *)patch.FaceBegin(); fstart = (char *)patch.FaceBegin();
vstart = (char *)patch.Vert3fBegin(); vstart = (char *)patch.Vert3fBegin();
@ -376,7 +379,7 @@ void NexusMt::LoadVbo(Entry &entry) {
vbo_used += size; vbo_used += size;
//TODO fix this when we allow data :p //TODO fix this when we allow data :p
size = 64 * patch.vstartd; size = 64 * (int)patch.vstartd;
glGenBuffersARB(1, &entry.vbo_array); glGenBuffersARB(1, &entry.vbo_array);
assert(entry.vbo_array); assert(entry.vbo_array);

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.40 2005/02/17 15:39:44 ponchio
Reorderes statistics a bit.
Revision 1.39 2005/02/17 14:02:03 ponchio Revision 1.39 2005/02/17 14:02:03 ponchio
Full screen options... Full screen options...
@ -371,7 +374,7 @@ int main(int argc, char *argv[]) {
SDL_WaitEvent(&event); SDL_WaitEvent(&event);
anything = true; anything = true;
} }
if(anything) { while(anything) {
switch( event.type ) { switch( event.type ) {
case SDL_QUIT: quit = 1; break; case SDL_QUIT: quit = 1; break;
case SDL_KEYDOWN: case SDL_KEYDOWN:
@ -462,6 +465,8 @@ int main(int argc, char *argv[]) {
case SDL_VIDEOEXPOSE: case SDL_VIDEOEXPOSE:
default: break; default: break;
} }
anything = SDL_PeepEvents(&event, 1, SDL_GETEVENT,
SDL_ALLEVENTS);
} }

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.10 2005/02/19 10:45:05 ponchio
Patch generalized and small fixes.
Revision 1.9 2005/02/08 12:43:03 ponchio Revision 1.9 2005/02/08 12:43:03 ponchio
Added copyright Added copyright
@ -161,13 +164,13 @@ void Patch::Init(Signature &signature,
} }
pad64(offset); pad64(offset);
fstartc = (unsigned short)offset/64; fstartc = (unsigned short)(offset/64);
offset += encodings[signature.fcolor].size(nf); offset += encodings[signature.fcolor].size(nf);
fstartn = (unsigned short)offset/64; fstartn = (unsigned short)(offset/64);
offset += encodings[signature.fnorm].size(nf); offset += encodings[signature.fnorm].size(nf);
fstartt = (unsigned short)offset/64; fstartt = (unsigned short)(offset/64);
offset += encodings[signature.ftext].size(nf); offset += encodings[signature.ftext].size(nf);
fstartd = (unsigned short)offset/64; fstartd = (unsigned short)(offset/64);
offset += encodings[signature.fdata].size(nf); offset += encodings[signature.fdata].size(nf);
vstart = fstart + offset; vstart = fstart + offset;
@ -180,13 +183,13 @@ void Patch::Init(Signature &signature,
assert(0); assert(0);
pad64(offset); pad64(offset);
vstartc = (unsigned short)offset/64; vstartc = (unsigned short)(offset/64);
offset += encodings[signature.vcolor].size(nv); offset += encodings[signature.vcolor].size(nv);
vstartn = (unsigned short)offset/64; vstartn = (unsigned short)(offset/64);
offset += encodings[signature.vnorm].size(nv); offset += encodings[signature.vnorm].size(nv);
vstartt = (unsigned short)offset/64; vstartt = (unsigned short)(offset/64);
offset += encodings[signature.vtext].size(nv); offset += encodings[signature.vtext].size(nv);
vstartd = (unsigned short)offset/64; vstartd = (unsigned short)(offset/64);
offset += encodings[signature.vdata].size(nv); offset += encodings[signature.vdata].size(nv);

View File

@ -24,6 +24,9 @@
History History
$Log: not supported by cvs2svn $ $Log: not supported by cvs2svn $
Revision 1.12 2005/02/19 10:45:05 ponchio
Patch generalized and small fixes.
Revision 1.11 2005/02/08 12:43:03 ponchio Revision 1.11 2005/02/08 12:43:03 ponchio
Added copyright Added copyright
@ -118,15 +121,15 @@ class Patch {
//vcg::Point3f &Vert(unsigned short v) { return VertBegin()[v]; } //vcg::Point3f &Vert(unsigned short v) { return VertBegin()[v]; }
// unsigned short *Face(unsigned short f) { return FaceBegin() + f * 3; } // unsigned short *Face(unsigned short f) { return FaceBegin() + f * 3; }
char *VColorBegin() { return vstart + 64*vstartc; } char *VColorBegin() { return vstart + 64*(int)vstartc; }
char *VNormBegin() { return vstart + 64*vstartn; } char *VNormBegin() { return vstart + 64*(int)vstartn; }
char *VTextBegin() { return vstart + 64*vstartt; } char *VTextBegin() { return vstart + 64*(int)vstartt; }
char *VDataBegin() { return vstart + 64*vstartd; } char *VDataBegin() { return vstart + 64*(int)vstartd; }
char *FColorBegin() { return fstart + 64*fstartc; } char *FColorBegin() { return fstart + 64*(int)fstartc; }
char *FNormBegin() { return fstart + 64*fstartn; } char *FNormBegin() { return fstart + 64*(int)fstartn; }
char *FTextBegin() { return fstart + 64*fstartt; } char *FTextBegin() { return fstart + 64*(int)fstartt; }
char *FDataBegin() { return fstart + 64*fstartd; } char *FDataBegin() { return fstart + 64*(int)fstartd; }
static unsigned int ChunkSize(Signature &signature, static unsigned int ChunkSize(Signature &signature,
unsigned short nvert, unsigned short nvert,