]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
open client sockets before video starts, so that the Windows Firewall
[xonotic/darkplaces.git] / cl_main.c
index 17ccc17a0393cdc91039bd2cebb59c4ef1da5a64..7beb895af01f7198034257c8580c00e19aa5711e 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -89,21 +89,20 @@ cvar_t cl_locs_show = {0, "locs_show", "0", "shows defined locations for editing
 client_static_t        cls;
 client_state_t cl;
 
-#define MAX_PARTICLES                  32768   // default max # of particles at one time
-#define MAX_DECALS                             32768   // default max # of decals at one time
-#define ABSOLUTE_MIN_PARTICLES 512             // no fewer than this no matter what's on the command line
-
 /*
 =====================
 CL_ClearState
 
 =====================
 */
+void CL_VM_ShutDown (void);
 void CL_ClearState(void)
 {
        int i;
        entity_t *ent;
 
+       CL_VM_ShutDown();
+
 // wipe the entire cl structure
        Mem_EmptyPool(cls.levelmempool);
        memset (&cl, 0, sizeof(cl));
@@ -134,19 +133,10 @@ void CL_ClearState(void)
        cl.max_dlights = MAX_DLIGHTS;
        cl.max_lightstyle = MAX_LIGHTSTYLES;
        cl.max_brushmodel_entities = MAX_EDICTS;
-       cl.max_particles = MAX_PARTICLES;
-       cl.max_decals = MAX_DECALS;
+       cl.max_particles = 8192; // grows dynamically
+       cl.max_decals = 2048; // grows dynamically
        cl.max_showlmps = 0;
 
-// COMMANDLINEOPTION: Client: -particles <number> changes maximum number of particles at once, default 32768
-       i = COM_CheckParm ("-particles");
-       if (i && i < com_argc - 1)
-       {
-               cl.max_particles = (int)(atoi(com_argv[i+1]));
-               if (cl.max_particles < ABSOLUTE_MIN_PARTICLES)
-                       cl.max_particles = ABSOLUTE_MIN_PARTICLES;
-       }
-
        cl.num_dlights = 0;
        cl.num_effects = 0;
        cl.num_beams = 0;
@@ -219,7 +209,7 @@ void CL_SetInfo(const char *key, const char *value, qboolean send, qboolean allo
        if (!allowmodel && (!strcasecmp(key, "pmodel") || !strcasecmp(key, "emodel")))
                fail = true;
        for (i = 0;key[i];i++)
-               if (key[i] <= ' ' || key[i] == '\"')
+               if (ISWHITESPACE(key[i]) || key[i] == '\"')
                        fail = true;
        for (i = 0;value[i];i++)
                if (value[i] == '\r' || value[i] == '\n' || value[i] == '\"')
@@ -294,7 +284,6 @@ void CL_ExpandEntities(int num)
        }
 }
 
-void CL_VM_ShutDown (void);
 /*
 =====================
 CL_Disconnect
@@ -315,6 +304,8 @@ void CL_Disconnect(void)
 
        Con_DPrintf("CL_Disconnect\n");
 
+    Cvar_SetValueQuick(&csqc_progcrc, -1);
+       Cvar_SetValueQuick(&csqc_progsize, -1);
        CL_VM_ShutDown();
 // stop sounds (especially looping!)
        S_StopAllSounds ();
@@ -501,7 +492,7 @@ static void CL_UpdateRenderEntity_Lighting(entity_render_t *ent)
        vec3_t tempdiffusenormal;
 
        // fetch the lighting from the worldmodel data
-       VectorSet(ent->modellight_ambient, r_ambient.value * (2.0f / 128.0f), r_ambient.value * (2.0f / 128.0f), r_ambient.value * (2.0f / 128.0f));
+       VectorSet(ent->modellight_ambient, r_refdef.scene.ambient * (2.0f / 128.0f), r_refdef.scene.ambient * (2.0f / 128.0f), r_refdef.scene.ambient * (2.0f / 128.0f));
        VectorClear(ent->modellight_diffuse);
        VectorClear(tempdiffusenormal);
        if ((ent->flags & RENDER_LIGHT) && cl.worldmodel && cl.worldmodel->brush.LightPoint)
@@ -526,7 +517,7 @@ void CL_UpdateRenderEntity(entity_render_t *ent)
 {
        vec3_t org;
        vec_t scale;
-       model_t *model = ent->model;
+       dp_model_t *model = ent->model;
        // update the inverse matrix for the renderer
        Matrix4x4_Invert_Simple(&ent->inversematrix, &ent->matrix);
        // update the animation blend state
@@ -604,20 +595,20 @@ static float CL_LerpPoint(void)
 
 void CL_ClearTempEntities (void)
 {
-       r_refdef.numtempentities = 0;
+       r_refdef.scene.numtempentities = 0;
 }
 
 entity_render_t *CL_NewTempEntity(void)
 {
        entity_render_t *render;
 
-       if (r_refdef.numentities >= r_refdef.maxentities)
+       if (r_refdef.scene.numentities >= r_refdef.scene.maxentities)
                return NULL;
-       if (r_refdef.numtempentities >= r_refdef.maxtempentities)
+       if (r_refdef.scene.numtempentities >= r_refdef.scene.maxtempentities)
                return NULL;
-       render = &r_refdef.tempentities[r_refdef.numtempentities++];
+       render = &r_refdef.scene.tempentities[r_refdef.scene.numtempentities++];
        memset (render, 0, sizeof(*render));
-       r_refdef.entities[r_refdef.numentities++] = render;
+       r_refdef.scene.entities[r_refdef.scene.numentities++] = render;
 
        render->alpha = 1;
        VectorSet(render->colormod, 1, 1, 1);
@@ -753,13 +744,13 @@ void CL_RelinkLightFlashes(void)
 
        if (r_dynamic.integer)
        {
-               for (i = 0, dl = cl.dlights;i < cl.num_dlights && r_refdef.numlights < MAX_DLIGHTS;i++, dl++)
+               for (i = 0, dl = cl.dlights;i < cl.num_dlights && r_refdef.scene.numlights < MAX_DLIGHTS;i++, dl++)
                {
                        if (dl->radius)
                        {
                                tempmatrix = dl->matrix;
                                Matrix4x4_Scale(&tempmatrix, dl->radius, 1);
-                               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, dl->color, dl->style, dl->cubemapname, dl->shadow, dl->corona, dl->coronasizescale, dl->ambientscale, dl->diffusescale, dl->specularscale, dl->flags);
+                               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, dl->color, dl->style, dl->cubemapname, dl->shadow, dl->corona, dl->coronasizescale, dl->ambientscale, dl->diffusescale, dl->specularscale, dl->flags);
                        }
                }
        }
@@ -773,8 +764,8 @@ void CL_RelinkLightFlashes(void)
        {
                if (!cl.lightstyle || !cl.lightstyle[j].length)
                {
-                       r_refdef.rtlightstylevalue[j] = 1;
-                       r_refdef.lightstylevalue[j] = 256;
+                       r_refdef.scene.rtlightstylevalue[j] = 1;
+                       r_refdef.scene.lightstylevalue[j] = 256;
                        continue;
                }
                k = i % cl.lightstyle[j].length;
@@ -786,8 +777,8 @@ void CL_RelinkLightFlashes(void)
                // lightstylevalue is subject to a cvar for performance reasons;
                // skipping lightmap updates on most rendered frames substantially
                // improves framerates (but makes light fades look bad)
-               r_refdef.rtlightstylevalue[j] = ((k*frac)+(l*(1-frac)))*(22/256.0f);
-               r_refdef.lightstylevalue[j] = r_lerplightstyles.integer ? (unsigned short)(((k*frac)+(l*(1-frac)))*22) : k*22;
+               r_refdef.scene.rtlightstylevalue[j] = ((k*frac)+(l*(1-frac)))*(22/256.0f);
+               r_refdef.scene.lightstylevalue[j] = r_lerplightstyles.integer ? (unsigned short)(((k*frac)+(l*(1-frac)))*22) : k*22;
        }
 }
 
@@ -877,7 +868,7 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
        int j, k, l, frame;
        float origin[3], angles[3], delta[3], lerp, d;
        entity_t *t;
-       model_t *model;
+       dp_model_t *model;
        //entity_persistent_t *p = &e->persistent;
        //entity_render_t *r = &e->render;
        // skip inactive entities and world
@@ -890,7 +881,10 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
        e->render.flags = e->state_current.flags;
        e->render.effects = e->state_current.effects;
        VectorScale(e->state_current.colormod, (1.0f / 32.0f), e->render.colormod);
-       e->render.entitynumber = e - cl.entities;
+       if(e >= cl.entities && e < cl.entities + cl.num_entities)
+               e->render.entitynumber = e - cl.entities;
+       else
+               e->render.entitynumber = 0;
        if (e->state_current.flags & RENDER_COLORMAPPED)
                CL_SetEntityColormapColors(&e->render, e->state_current.colormap);
        else if (e->state_current.colormap > 0 && e->state_current.colormap <= cl.maxclients && cl.scores != NULL)
@@ -959,11 +953,7 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
                interpolate = false;
        if (e == cl.entities + cl.playerentity && cl.movement_predicted && (!cl.fixangle[1] || !cl.fixangle[0]))
        {
-               lerp = (cl.time - cl.movement_time[2]) / (cl.movement_time[0] - cl.movement_time[1]);
-               lerp = bound(0, lerp, 1);
-               if (!interpolate)
-                       lerp = 1;
-               VectorLerp(cl.movement_oldorigin, lerp, cl.movement_origin, origin);
+               VectorCopy(cl.movement_origin, origin);
                VectorSet(angles, 0, cl.viewangles[1], 0);
        }
        else if (interpolate && e->persistent.lerpdeltatime > 0 && (lerp = (cl.time - e->persistent.lerpstarttime) / e->persistent.lerpdeltatime) < 1)
@@ -1075,6 +1065,8 @@ void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit, qboolean interpolat
                e->render.flags |= RENDER_SHADOW;
        if (e->render.flags & RENDER_VIEWMODEL)
                e->render.flags |= RENDER_NOSELFSHADOW;
+       if (e->render.effects & EF_NOSELFSHADOW)
+               e->render.flags |= RENDER_NOSELFSHADOW;
 
        // make the other useful stuff
        CL_UpdateRenderEntity(&e->render);
@@ -1357,7 +1349,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                        CL_ParticleTrail(EFFECT_EF_STARDUST, 0, origin, origin, vec3_origin, vec3_origin, NULL, 0, true, false);
        }
        // muzzleflash fades over time, and is offset a bit
-       if (e->persistent.muzzleflash > 0 && r_refdef.numlights < MAX_DLIGHTS)
+       if (e->persistent.muzzleflash > 0 && r_refdef.scene.numlights < MAX_DLIGHTS)
        {
                vec3_t v2;
                vec3_t color;
@@ -1369,7 +1361,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                Matrix4x4_SetOrigin(&tempmatrix, trace.endpos[0], trace.endpos[1], trace.endpos[2]);
                Matrix4x4_Scale(&tempmatrix, 150, 1);
                VectorSet(color, e->persistent.muzzleflash * 4.0f, e->persistent.muzzleflash * 4.0f, e->persistent.muzzleflash * 4.0f);
-               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, color, -1, NULL, true, 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, color, -1, NULL, true, 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
        }
        // LordHavoc: if the model has no flags, don't check each
        if (e->render.model && e->render.effects && !(e->render.flags & RENDER_VIEWMODEL))
@@ -1401,7 +1393,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                VectorMA(dlightcolor, (1.0f / 255.0f), palette_rgb[e->state_current.glowcolor], dlightcolor);
        }
        // make the glow dlight
-       if (dlightradius > 0 && (dlightcolor[0] || dlightcolor[1] || dlightcolor[2]) && !(e->render.flags & RENDER_VIEWMODEL) && r_refdef.numlights < MAX_DLIGHTS)
+       if (dlightradius > 0 && (dlightcolor[0] || dlightcolor[1] || dlightcolor[2]) && !(e->render.flags & RENDER_VIEWMODEL) && r_refdef.scene.numlights < MAX_DLIGHTS)
        {
                matrix4x4_t dlightmatrix;
                Matrix4x4_Normalize(&dlightmatrix, &e->render.matrix);
@@ -1409,10 +1401,10 @@ void CL_LinkNetworkEntity(entity_t *e)
                //if (e->state_current.number == cl.viewentity/* && !chase_active.integer*/)
                //      Matrix4x4_AdjustOrigin(&dlightmatrix, 0, 0, 30);
                Matrix4x4_Scale(&dlightmatrix, dlightradius, 1);
-               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &dlightmatrix, dlightcolor, -1, NULL, true, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &dlightmatrix, dlightcolor, -1, NULL, true, 1, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
        }
        // custom rtlight
-       if ((e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) && r_refdef.numlights < MAX_DLIGHTS)
+       if ((e->state_current.lightpflags & PFLAGS_FULLDYNAMIC) && r_refdef.scene.numlights < MAX_DLIGHTS)
        {
                matrix4x4_t dlightmatrix;
                float light[4];
@@ -1425,7 +1417,7 @@ void CL_LinkNetworkEntity(entity_t *e)
                // FIXME: add ambient/diffuse/specular scales as an extension ontop of TENEBRAE_GFX_DLIGHTS?
                Matrix4x4_Normalize(&dlightmatrix, &e->render.matrix);
                Matrix4x4_Scale(&dlightmatrix, light[3], 1);
-               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &dlightmatrix, light, e->state_current.lightstyle, e->state_current.skin > 0 ? va("cubemaps/%i", e->state_current.skin) : NULL, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_CORONA) != 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &dlightmatrix, light, e->state_current.lightstyle, e->state_current.skin > 0 ? va("cubemaps/%i", e->state_current.skin) : NULL, !(e->state_current.lightpflags & PFLAGS_NOSHADOW), (e->state_current.lightpflags & PFLAGS_CORONA) != 0, 0.25, 0, 1, 1, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
        }
        // do trail light
        if (e->render.flags & RENDER_GLOWTRAIL)
@@ -1439,8 +1431,8 @@ void CL_LinkNetworkEntity(entity_t *e)
                        return;
        // don't show entities with no modelindex (note: this still shows
        // entities which have a modelindex that resolved to a NULL model)
-       if (e->render.model && !(e->render.effects & EF_NODRAW) && r_refdef.numentities < r_refdef.maxentities)
-               r_refdef.entities[r_refdef.numentities++] = &e->render;
+       if (e->render.model && !(e->render.effects & EF_NODRAW) && r_refdef.scene.numentities < r_refdef.scene.maxentities)
+               r_refdef.scene.entities[r_refdef.scene.numentities++] = &e->render;
        //if (cl.viewentity && e->state_current.number == cl.viewentity)
        //      Matrix4x4_Print(&e->render.matrix);
 }
@@ -1455,15 +1447,15 @@ void CL_RelinkWorld(void)
                ent->render.flags |= RENDER_LIGHT;
        VectorSet(ent->render.colormod, 1, 1, 1);
        CL_UpdateRenderEntity(&ent->render);
-       r_refdef.worldentity = &ent->render;
-       r_refdef.worldmodel = cl.worldmodel;
+       r_refdef.scene.worldentity = &ent->render;
+       r_refdef.scene.worldmodel = cl.worldmodel;
 }
 
 static void CL_RelinkStaticEntities(void)
 {
        int i;
        entity_t *e;
-       for (i = 0, e = cl.static_entities;i < cl.num_static_entities && r_refdef.numentities < r_refdef.maxentities;i++, e++)
+       for (i = 0, e = cl.static_entities;i < cl.num_static_entities && r_refdef.scene.numentities < r_refdef.scene.maxentities;i++, e++)
        {
                e->render.flags = 0;
                // if the model was not loaded when the static entity was created we
@@ -1478,7 +1470,7 @@ static void CL_RelinkStaticEntities(void)
                VectorSet(e->render.colormod, 1, 1, 1);
                R_LerpAnimation(&e->render);
                CL_UpdateRenderEntity(&e->render);
-               r_refdef.entities[r_refdef.numentities++] = &e->render;
+               r_refdef.scene.entities[r_refdef.scene.numentities++] = &e->render;
        }
 }
 
@@ -1620,13 +1612,13 @@ void CL_RelinkBeams(void)
 
                if (b->lightning)
                {
-                       if (cl_beams_lightatend.integer && r_refdef.numlights < MAX_DLIGHTS)
+                       if (cl_beams_lightatend.integer && r_refdef.scene.numlights < MAX_DLIGHTS)
                        {
                                // FIXME: create a matrix from the beam start/end orientation
                                vec3_t dlightcolor;
                                VectorSet(dlightcolor, 0.3, 0.7, 1);
                                Matrix4x4_CreateFromQuakeEntity(&tempmatrix, end[0], end[1], end[2], 0, 0, 0, 200);
-                               R_RTLight_Update(&r_refdef.lights[r_refdef.numlights++], false, &tempmatrix, dlightcolor, -1, NULL, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
+                               R_RTLight_Update(&r_refdef.scene.lights[r_refdef.scene.numlights++], false, &tempmatrix, dlightcolor, -1, NULL, true, 1, 0.25, 1, 0, 0, LIGHTFLAG_NORMALMODE | LIGHTFLAG_REALTIMEMODE);
                        }
                        if (cl_beams_polygons.integer)
                                continue;
@@ -1762,10 +1754,11 @@ Update client game world for a new frame
 */
 void CL_UpdateWorld(void)
 {
-       r_refdef.extraupdate = !r_speeds.integer;
-       r_refdef.numentities = 0;
-       r_refdef.numlights = 0;
+       r_refdef.scene.extraupdate = !r_speeds.integer;
+       r_refdef.scene.numentities = 0;
+       r_refdef.scene.numlights = 0;
        r_refdef.view.matrix = identitymatrix;
+       r_refdef.view.quality = 1;
 
        cl.num_brushmodel_entities = 0;
 
@@ -1801,13 +1794,10 @@ void CL_UpdateWorld(void)
                CL_RelinkLightFlashes();
                CSQC_RelinkAllEntities(ENTMASK_ENGINE | ENTMASK_ENGINEVIEWMODELS);
 
-               // move decals, particles, and any other effects
-               CL_MoveDecals();
-               CL_MoveParticles();
-               R_MoveExplosions();
+               // decals, particles, and explosions will be updated during rneder
        }
 
-       r_refdef.time = cl.time;
+       r_refdef.scene.time = cl.time;
 }
 
 // LordHavoc: pausedemo command
@@ -1863,12 +1853,13 @@ static void CL_TimeRefresh_f (void)
        int i;
        float timestart, timedelta;
 
-       r_refdef.extraupdate = false;
+       r_refdef.scene.extraupdate = false;
 
        timestart = Sys_DoubleTime();
        for (i = 0;i < 128;i++)
        {
                Matrix4x4_CreateFromQuakeEntity(&r_refdef.view.matrix, r_refdef.view.origin[0], r_refdef.view.origin[1], r_refdef.view.origin[2], 0, i / 128.0 * 360.0, 0, 1);
+               r_refdef.view.quality = 1;
                CL_UpdateScreen();
        }
        timedelta = Sys_DoubleTime() - timestart;
@@ -2006,7 +1997,7 @@ void CL_Locs_Save_f(void)
        FS_StripExtension(cl.worldmodel->name, locfilename, sizeof(locfilename));
        strlcat(locfilename, ".loc", sizeof(locfilename));
 
-       outfile = FS_Open(locfilename, "w", false, false);
+       outfile = FS_OpenRealFile(locfilename, "w", false);
        if (!outfile)
                return;
        // if any boxes are used then this is a proquake-format loc file, which
@@ -2106,10 +2097,10 @@ void CL_Locs_Reload_f(void)
                if (text < textend)
                        text++;
                // trim trailing whitespace
-               while (lineend > linestart && lineend[-1] <= ' ')
+               while (lineend > linestart && ISWHITESPACE(lineend[-1]))
                        lineend--;
                // trim leading whitespace
-               while (linestart < lineend && *linestart <= ' ')
+               while (linestart < lineend && ISWHITESPACE(*linestart))
                        linestart++;
                // check if this is a comment
                if (linestart + 2 <= lineend && !strncmp(linestart, "//", 2))
@@ -2126,7 +2117,7 @@ void CL_Locs_Reload_f(void)
                        else
                                maxs[i - 3] = atof(linetext);
                        // now advance past the number
-                       while (linetext < lineend && *linetext > ' ' && *linetext != ',')
+                       while (linetext < lineend && !ISWHITESPACE(*linetext) && *linetext != ',')
                                linetext++;
                        // advance through whitespace
                        if (linetext < lineend)
@@ -2137,10 +2128,10 @@ void CL_Locs_Reload_f(void)
                                        limit = 6;
                                        // note: comma can be followed by whitespace
                                }
-                               if (*linetext <= ' ')
+                               if (ISWHITESPACE(*linetext))
                                {
                                        // skip whitespace
-                                       while (linetext < lineend && *linetext <= ' ')
+                                       while (linetext < lineend && ISWHITESPACE(*linetext))
                                                linetext++;
                                }
                        }
@@ -2227,11 +2218,11 @@ void CL_Init (void)
 
        memset(&r_refdef, 0, sizeof(r_refdef));
        // max entities sent to renderer per frame
-       r_refdef.maxentities = MAX_EDICTS + 256 + 512;
-       r_refdef.entities = (entity_render_t **)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t *) * r_refdef.maxentities);
+       r_refdef.scene.maxentities = MAX_EDICTS + 256 + 512;
+       r_refdef.scene.entities = (entity_render_t **)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t *) * r_refdef.scene.maxentities);
 
-       r_refdef.maxtempentities = 512;
-       r_refdef.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.maxtempentities);
+       r_refdef.scene.maxtempentities = 4096; // FIXME: make this grow
+       r_refdef.scene.tempentities = (entity_render_t *)Mem_Alloc(cls.permanentmempool, sizeof(entity_render_t) * r_refdef.scene.maxtempentities);
 
        CL_InitInput ();
 
@@ -2322,9 +2313,7 @@ void CL_Init (void)
        CL_Screen_Init();
 
        CL_Video_Init();
-#ifdef SUPPORT_GECKO
        CL_Gecko_Init();
-#endif
 }