• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ conoutf函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中conoutf函数的典型用法代码示例。如果您正苦于以下问题:C++ conoutf函数的具体用法?C++ conoutf怎么用?C++ conoutf使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了conoutf函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: installtex

bool installtex(int tnum, char *texname, int &xs, int &ys, bool clamp)
{
    SDL_Surface *s = IMG_Load(texname);
    if(!s) { conoutf("couldn't load texture %s", texname); return false; };
    if(s->format->BitsPerPixel!=24) { conoutf("texture must be 24bpp: %s", texname); return false; };
    // loopi(s->w*s->h*3) { uchar *p = (uchar *)s->pixels+i; *p = 255-*p; };  
    glBindTexture(GL_TEXTURE_2D, tnum);
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, clamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, clamp ? GL_CLAMP_TO_EDGE : GL_REPEAT);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR); //NEAREST);
    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 
    xs = s->w;
    ys = s->h;
    while(xs>glmaxtexsize || ys>glmaxtexsize) { xs /= 2; ys /= 2; };
    void *scaledimg = s->pixels;
    if(xs!=s->w)
    {
        conoutf("warning: quality loss: scaling %s", texname);     // for voodoo cards under linux
        scaledimg = alloc(xs*ys*3);
        gluScaleImage(GL_RGB, s->w, s->h, GL_UNSIGNED_BYTE, s->pixels, xs, ys, GL_UNSIGNED_BYTE, scaledimg);
    };
    if(gluBuild2DMipmaps(GL_TEXTURE_2D, GL_RGB, xs, ys, GL_RGB, GL_UNSIGNED_BYTE, scaledimg)) fatal("could not build mipmaps");
    if(xs!=s->w) free(scaledimg);
    SDL_FreeSurface(s);
    return true;
};
开发者ID:Knapsack44,项目名称:w,代码行数:28,代码来源:rendergl.cpp


示例2: sendmap

void sendmap(char *mapname)
{
    if(*mapname) save_world(mapname);
    changemap(mapname);
    mapname = getclientmap();
    int mapsize;
    uchar *mapdata = readmap(mapname, &mapsize); 
    if(!mapdata) return;
    ENetPacket *packet = enet_packet_create(NULL, MAXTRANS + mapsize, ENET_PACKET_FLAG_RELIABLE);
    uchar *start = packet->data;
    uchar *p = start+2;
    putint(p, SV_SENDMAP);
    sendstring(mapname, p);
    putint(p, mapsize);
    if(65535 - (p - start) < mapsize)
    {
        conoutf("map %s is too large to send", mapname);
        free(mapdata);
        enet_packet_destroy(packet);
        return;
    };
    memcpy(p, mapdata, mapsize);
    p += mapsize;
    free(mapdata); 
    *(ushort *)start = ENET_HOST_TO_NET_16(p-start);
    enet_packet_resize(packet, p-start);
    sendpackettoserv(packet);
    conoutf("sending map %s to server...", mapname);
    sprintf_sd(msg)("[map %s uploaded to server, \"getmap\" to receive it]", mapname);
    toserver(msg);
}
开发者ID:lazharous,项目名称:Lazarus,代码行数:31,代码来源:clientextras.cpp


示例3: stopsound

void audiomanager::musicpreload(int id)
{
    if(nosound) return;
    stopsound();
    if(musicvol && (id>=M_FLAGGRAB && id<=M_LASTMINUTE2))
    {
        char *name = musics[id];
        conoutf("preloading music #%d : %s", id, name);
        if(gamemusic->open(name))
        {
            defformatstring(whendone)("musicvol %d", musicvol);
            musicdonecmd = newstring(whendone);
            //conoutf("when done: %s", musicdonecmd);
            const int preloadfadetime = 3;
            gamemusic->fadein(lastmillis, preloadfadetime);
            gamemusic->fadeout(lastmillis+2*preloadfadetime, preloadfadetime);
            if(!gamemusic->playback(false))
            {
                conoutf("could not play music: %s", name);
                return;
            }
            setmusicvol(1); // not 0 !
        }
        else conoutf("could not open music: %s", name);
    }
    else setmusicvol(musicvol); // call "musicpreload -1" to ensure musicdonecmd runs - but it should w/o that
}
开发者ID:GameplayRJ,项目名称:AC,代码行数:27,代码来源:audiomanager.cpp


示例4: arenarespawn

void arenarespawn()
{
    if(arenarespawnwait)
    {
        if(arenarespawnwait<lastmillis)
        {
            arenarespawnwait = 0;
            conoutf("new round starting... fight!");
            respawnself();
        };
    }
    else if(arenadetectwait==0 || arenadetectwait<lastmillis)
    {
        arenadetectwait = 0;
        int alive = 0, dead = 0;
        char *lastteam = NULL;
        bool oneteam = true;
        loopv(players) if(players[i]) arenacount(players[i], alive, dead, lastteam, oneteam);
        arenacount(player1, alive, dead, lastteam, oneteam);
        if(dead>0 && (alive<=1 || (m_teammode && oneteam)))
        {
            conoutf("arena round is over! next round in 5 seconds...");
            if(alive) conoutf("team %s is last man standing", lastteam);
            else conoutf("everyone died!");
            arenarespawnwait = lastmillis+5000;
            arenadetectwait  = lastmillis+10000;
            player1->roll = 0;
        };
    };
开发者ID:wibbe,项目名称:simple-rts,代码行数:29,代码来源:clientgame.cpp


示例5: init

    void init(fpsent *d, int at, int ocn, int sk, int bn, int pm, const char *name, const char *team)
    {
        loadwaypoints();

        fpsent *o = newclient(ocn);

        d->aitype = at;

        bool resetthisguy = false;
        if(!d->name[0])
        {
            if(aidebug) conoutf("%s assigned to %s at skill %d", colorname(d, name), o ? colorname(o) : "?", sk);
            else conoutf("connected: %s", colorname(d, name));
            resetthisguy = true;
        }
        else
        {
            if(d->ownernum != ocn)
            {
                if(aidebug) conoutf("%s reassigned to %s", colorname(d, name), o ? colorname(o) : "?");
                resetthisguy = true;
            }
            if(d->skill != sk && aidebug) conoutf("%s changed skill to %d", colorname(d, name), sk);
        }

        copystring(d->name, name, MAXNAMELEN+1);
        copystring(d->team, team, MAXTEAMLEN+1);
        d->ownernum = ocn;
        d->skill = sk;
        d->playermodel = chooserandomplayermodel(pm);

        if(resetthisguy) removeweapons(d);
        if(player1->clientnum == d->ownernum) create(d);
        else if(d->ai) destroy(d);
    }
开发者ID:Ajusa,项目名称:Sauerbraten,代码行数:35,代码来源:ai.cpp


示例6: run

    void run(const char *map) {
        if (started) {
            conoutf("Stopping old server instance ..");
            stop();
        }
        conoutf("Starting server, please wait ..");
#ifndef WIN32
        if (!fork()) {
            const char *a0 = "bin_unix/server_" BINARY_OS_STR "_"
                BINARY_ARCH_STR;

            defformatstring(a1, "-g%s", logger::names[logger::current_level]);
            defformatstring(a2, "-l%s", server_log_file);
            defformatstring(a3, "-mmap/%s.tar.gz", map);

            execl(a0, a0, a1, a2, a3, "-shutdown-if-idle",
                "-shutdown-if-empty", (char*)NULL);
            exit(0);
        }
#else
#ifdef WIN64
        const char *exe = "bin_win64\\server_" BINARY_OS_STR "_"
            BINARY_ARCH_STR ".exe";
#else
        const char *exe = "bin_win32\\server_" BINARY_OS_STR "_"
            BINARY_ARCH_STR ".exe";
#endif
        char buf[4096];
        char *cptr = buf;

        defformatstring(a1, "-g%s", logger::names[logger::current_level]);
        defformatstring(a2, "-l%s", server_log_file);
        defformatstring(a3, "-mmap/%s.tar.gz", map);
        const char a4[] = "-shutdown-if-idle";
        const char a5[] = "-shutdown-if-empty";

        size_t len = strlen(a1);
        memcpy(cptr, a1, len); cptr += len; *(cptr++) = ' ';
        len = strlen(a2);
        memcpy(cptr, a2, len); cptr += len; *(cptr++) = ' ';
        len = strlen(a3);
        memcpy(cptr, a3, len); cptr += len; *(cptr++) = ' ';
        len = sizeof(a4) - 1;
        memcpy(cptr, a4, len); cptr += len; *(cptr++) = ' ';
        len = sizeof(a5) - 1;
        memcpy(cptr, a5, len); cptr += len; *cptr = '\0';

        STARTUPINFO si;
        PROCESS_INFORMATION pi;
        ZeroMemory(&si, sizeof(si));
        si.cb = sizeof(si);
        ZeroMemory(&si, sizeof(pi));

        CreateProcess(exe, buf, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
        CloseHandle(pi.hProcess);
        CloseHandle(pi.hThread);
#endif

        started = true;
    }
开发者ID:plankatron,项目名称:OF-Engine,代码行数:60,代码来源:of_localserver.cpp


示例7: savegame

void savegame(char *name)
{
    if(!m_classicsp) { conoutf("can only save classic sp games"); return; };
    sprintf_sd(fn)("savegames/%s.csgz", name);
    savestate(fn);
    stop();
    conoutf("wrote %s", fn);
};
开发者ID:jhunt,项目名称:cube,代码行数:8,代码来源:savegamedemo.cpp


示例8: conoutf

	static use *checkuse(int type)
	{
		if(!loadinguse)
			conoutf(CON_ERROR, "\fs\f3ERROR:\fr use not defined or being loaded");
		else if(loadinguse->type < type)
			conoutf(CON_ERROR, "\fs\f3ERROR:\fr trying to set an unavailable use property");
		else
			return loadinguse;
		return NULL;
	}
开发者ID:Happy-Ferret,项目名称:Platinum-Arts-Sandbox-Free-Game-Maker,代码行数:10,代码来源:rpgconfig.cpp


示例9: paste

void paste()
{
    EDITMP;
    if(!copybuf) { conoutf("nothing to paste"); return; };
    sel.xs = copybuf->xs;
    sel.ys = copybuf->ys;
    correctsel();
    if(!selset || sel.xs!=copybuf->xs || sel.ys!=copybuf->ys) { conoutf("incorrect selection"); return; };
    makeundo();
    copybuf->x = sel.x;
    copybuf->y = sel.y;
    blockpaste(*copybuf);
};
开发者ID:dhu,项目名称:borealis-demo,代码行数:13,代码来源:editing.cpp


示例10: record

void record(char *name)
{
    if(m_sp) { conoutf("cannot record singleplayer games"); return; };
    int cn = getclientnum();
    if(cn<0) return;
    sprintf_sd(fn)("demos/%s.cdgz", name);
    savestate(fn);
    gzputi(cn);
    conoutf("started recording demo to %s", fn);
    demorecording = true;
    starttime = lastmillis;
	ddamage = bdamage = 0;
};
开发者ID:jhunt,项目名称:cube,代码行数:13,代码来源:savegamedemo.cpp


示例11: ignorelist

static void ignorelist()
{
    if (ips.isempty())
    {
        conoutf("ip ignore list is empty");
        return;
    }

    conoutf("ignoring %u ip%s", (uint)ips.getsize(), plural(ips.getsize()));

    int counter = 0;
    ips.loopips(showignoredip, &counter);
}
开发者ID:PowerKiller,项目名称:wc-ng,代码行数:13,代码来源:ipignore.cpp


示例12: conoutf

	void Client::initConnect(int cn, int protocol)
	{
	    conoutf("Client::initConnect");
		if(protocol!=CubeJ::PROTOCOL_VERSION)
		{
			conoutf(CON_ERROR, "you are using a different game protocol (you: %d, server: %d)", CubeJ::PROTOCOL_VERSION, protocol);
			disconnect();
			return;
		}

		self.clientnum = cn;
        CubeJ::MsgDataType<CubeJ::MSG_REQ_CONNECT> data(self.name);
        SendMessage(data);
    }
开发者ID:offtools,项目名称:cubej,代码行数:14,代码来源:client.cpp


示例13: trydisconnect

void trydisconnect()
{
    if(connpeer)
    {
        conoutf("aborting connection attempt");
        abortconnect();
    }
    else if(curpeer)
    {
        conoutf("attempting to disconnect...");
        disconnect(!discmillis);
    }
    else conoutf("not connected");
}
开发者ID:bartbes,项目名称:CubeCreate,代码行数:14,代码来源:client.cpp


示例14: trydisconnect

void trydisconnect(bool local)
{
    if(connpeer)
    {
        conoutf("aborting connection attempt");
        abortconnect();
    }
    else if(curpeer)
    {
        conoutf("attempting to disconnect...");
        disconnect(!discmillis);
    }
    else if(local && haslocalclients()) localdisconnect();
    else conoutf("not connected");
}
开发者ID:ezhangle,项目名称:OF-Engine,代码行数:15,代码来源:client.cpp


示例15: takefromplayer

 void takefromplayer(char *name, char *ok, char *notok)
 {
     rpgobj *o = playerobj->take(name);
     if(o)
     {
         stack[0]->add(o, false);
         conoutf("\f2you hand over a %s", o->name);
         if(currentquest)
         {
             conoutf("\f2you finish a quest for %s", currentquest->npc); 
             currentquest->completed = true;           
         }
     }
     execute(o ? ok : notok);
 }
开发者ID:Gnaoprr,项目名称:LwHaythServ,代码行数:15,代码来源:objset.cpp


示例16: connectserv

void connectserv(const char *servername, int serverport, const char *serverpassword)
{
    if(connpeer)
    {
        conoutf("aborting connection attempt");
        abortconnect();
    }

    if(serverport <= 0) serverport = server::serverport();

    ENetAddress address;
    address.port = serverport;

    if(servername)
    {
        if(strcmp(servername, connectname)) setsvar("connectname", servername);
        if(serverport != connectport) setvar("connectport", serverport);
        conoutf("attempting to connect to %s:%d", servername, serverport);
        if(!resolverwait(servername, &address))
        {
            conoutf("\f3could not resolve server %s", servername);
            return;
        }
    }
    else
    {
        setsvar("connectname", "");
        setvar("connectport", 0);
        conoutf("attempting to connect over LAN");
        address.host = ENET_HOST_BROADCAST;
    }

    if(!clienthost)
    {
        clienthost = enet_host_create(NULL, 2, server::numchannels(), rate*1024, rate*1024);
        if(!clienthost)
        {
            conoutf("\f3could not connect to server");
            return;
        }
        clienthost->duplicatePeers = 0;
    }

    connpeer = enet_host_connect(clienthost, &address, server::numchannels(), 0);
    enet_host_flush(clienthost);
    connmillis = totalmillis;
    connattempts = 0;
}
开发者ID:ezhangle,项目名称:OF-Engine,代码行数:48,代码来源:client.cpp


示例17: stopreset

void stopreset()
{
    conoutf("demo stopped (%d msec elapsed)", lastmillis-starttime);
    stop();
    loopv(players) zapdynent(players[i]);
    disconnect(0, 0);
};
开发者ID:jhunt,项目名称:cube,代码行数:7,代码来源:savegamedemo.cpp


示例18: savestate

void savestate(char *fn) {
	stop();
	f = gzopen(fn, "wb9");
	if (!f) {
		conoutf("could not write %s", fn);
		return;
	};
	gzwrite(f, (void *) "CUBESAVE", 8);
	gzputc(f, islittleendian);
	gzputi(SAVEGAMEVERSION);
	gzputi(sizeof(Sprite));
	char buf[_MAXDEFSTR];
	sprintf(buf, "%s", getclientmap().c_str());
	gzwrite(f, buf, _MAXDEFSTR);
	gzputi(gamemode);
	gzputi(entityList.size());
	for(Entity &en : entityList) {
		gzputc(f, en.spawned);
	}
	gzwrite(f, player1, sizeof(Sprite));
	std::vector<Sprite *> &monsters = getmonsters();
	gzputi(monsters.size());
	for(Sprite *m : monsters) {
		gzwrite(f, m, sizeof(Sprite));
	}
	gzputi(players.size());
	for(Sprite *p : players) {
		gzput(p == NULL);
		gzwrite(f, p, sizeof(Sprite));
	};
}
开发者ID:mailgyc,项目名称:cube,代码行数:31,代码来源:savegamedemo.cpp


示例19: stopfollowing

 void stopfollowing()
 {
     if(following<0) return;
     following = -1;
     followdir = 0;
     conoutf("follow off");
 }
开发者ID:Amplifying,项目名称:intensityengine,代码行数:7,代码来源:fps.cpp


示例20: execcfg

    bool execcfg(const char *cfgfile, bool ignore_ret)
    {
        string s;
        copystring(s, cfgfile);
        char *buf = loadfile(path(s), NULL);
        if(!buf) return false;
        auto err = lapi::state.do_string(buf, lua::ERROR_TRACEBACK);
        if (types::get<0>(err))
            logger::log(logger::ERROR, "%s\n", types::get<1>(err));

        bool ret = true;
        if (!ignore_ret)
        {
            ret = lapi::state["OF_CFG_VERSION_PASSED"].to<bool>();
            if (!ret)
            {
                conoutf(
                    "Your OctaForge config file was too old to run with "
                    "your current client. Initializing a default set."
                );
            }
            lapi::state["OF_CFG_VERSION_PASSED"] = lua::nil;
        }

        delete[] buf;
        return ret;
    }
开发者ID:Blarget2,项目名称:OF-Engine,代码行数:27,代码来源:of_tools.cpp



注:本文中的conoutf函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cons函数代码示例发布时间:2022-05-30
下一篇:
C++ connman_error函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap