summaryrefslogtreecommitdiff
path: root/src/netlem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/netlem.c')
-rw-r--r--src/netlem.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/netlem.c b/src/netlem.c
index 32b339d..8b6b3da 100644
--- a/src/netlem.c
+++ b/src/netlem.c
@@ -105,6 +105,8 @@ int main(int argc, char **argv) {
// Config file loading
loadGameConfig(&conf);
+ memset(&localParams, 0, sizeof(localParams_t));
+
// Libraries initialization
result=init(WIN_CAPTION, &conf, &gGraph);
if(result!=0) {
@@ -179,7 +181,7 @@ int main(int argc, char **argv) {
fps=(STATS_TICKCOUNT*1000.0)/(timeBefore_ms[t]-timeBefore_ms[(t+1)%STATS_TICKCOUNT]);
wantWaitMean=0; for(;t<STATS_TICKCOUNT;t++) { wantWaitMean+=wantWait[t]; }
t=0; wantWaitMean/=(double) STATS_TICKCOUNT;
- snprintf(logMsg, 128, "tick:%d\tlastServerTick:%d\tdrift_ms:%d\tFPS:%.1f\t wantWait:%.1f ms (%.1f %%)\n", tick, lastServerTick, drift_ms, fps, wantWaitMean, (double)wantWaitMean/TICK_DURATION_MS);
+ snprintf(logMsg, 128, "tick:%d\tlastServerTick:%d\tdrift_ms:%d\tFPS:%.1f\t wantWait:%.1f ms (%.1f %%)\n", tick, lastServerTick, drift_ms, fps, wantWaitMean, wantWaitMean*100.0/TICK_DURATION_MS);
logs(LOG_DEBUG, logMsg);
}
}
@@ -187,10 +189,10 @@ int main(int argc, char **argv) {
// Close communcation with the server, stop threads, close logs and go out
SDLNet_TCP_Close(client.sockClient);
- SDL_FreeSurface(gGraph.surfaces.screen);
+ SDL_FreeSurface(gGraph.screen);
SDL_FreeSurface(gGraph.surfaces.terrain);
SDL_FreeSurface(gGraph.surfaces.stencil);
-
+ //TODO
// Pour tout les objectsSurf
//SDL_FreeSurface(gGraph->surfaces.objectsSurf[i]);
@@ -514,11 +516,15 @@ int updateGraphics(gameObjectsState_t *objStates, localParams_t *params, gameGra
tmpSurf=gGraph->surfaces.tmpSurf;
if ( lastViewport.x != gGraph->viewport.x ) {
lastViewport.x=gGraph->viewport.x;
+ dstRect.x=0;
+ dstRect.y=0;
+ dstRect.w=0;
+ dstRect.h=0;
srcRect.x=lastViewport.x;
srcRect.y=lastViewport.y;
srcRect.w=gGraph->screen->clip_rect.w;
srcRect.h=gGraph->screen->clip_rect.h;
- res=repaint(objStates, &gGraph->surfaces, &srcRect, tmpSurf, srcRect);
+ res=repaint(objStates, &gGraph->surfaces, &srcRect, tmpSurf, dstRect);
if ( res != 0 ) {
logs(LOG_WARN, "updateGraphics(), repaint() failed");
}