• What are you working on? V2
    2,001 replies, posted
20 minutes ago I learned that imagecreate[b]resampled[/b]() existed, and spent my time creating a script to redo all of my thumbnails. It works gud :D [code]<?php require('../includes/core.php'); function getExt($fileName) { $fileArray = explode(".", $fileName); $key = count($fileArray)-1; return $fileArray[$key]; } $images = mysql_fetch_only("SELECT `file` FROM `img_uploads` ORDER BY `id` DESC"); if (isset($_GET['go']) && $_GET['go'] != 'wasd') { $image = null; foreach ($images as $temp) { if ($temp == $_GET["go"]) $image = $temp; } $img = "../" . $config["imgDir"] . $image; $ext = getExt($image); $imageSize = getimagesize($img); $thumbSize = array(0 => 350, 1 => 350); if ($imageSize[0] < 350) { $thumbSize[0] = $imageSize[0]; } if ($imageSize[1] < 350) { $thumbSize[1] = $imageSize[1]; } switch (exif_imagetype($img)) { case IMAGETYPE_JPEG: $imageRes = imagecreatefromjpeg($img); break; case IMAGETYPE_PNG: $imageRes = imagecreatefrompng($img); break; case IMAGETYPE_GIF: $imageRes = imagecreatefromgif($img); break; default: die("Bad filetype on {$image} ({$img}) (" . exif_imagetype($img) . ")"); } $thumbnailRes = imagecreatetruecolor($thumbSize[0], $thumbSize[1]); if (imagecopyresampled($thumbnailRes, $imageRes, 0, 0, 0, 0, $thumbSize[0], $thumbSize[1], $imageSize[0], $imageSize[1])) { switch (exif_imagetype($img)) { case IMAGETYPE_JPEG: imagejpeg($thumbnailRes, "redone/{$image}", 100); break; case IMAGETYPE_PNG: imagepng($thumbnailRes, "redone/{$image}"); break; case IMAGETYPE_GIF: imagegif($thumbnailRes, "redone/{$image}"); break; } $info = "Success<br>"; } die($info); } ?> <html> <script type="text/javascript"> current = 0; images = new Array( <?php //$i = 0; foreach($images as $image) { echo "\"{$image}\", \n\t"; //$i++; } echo "'wasd'"; ?> ); if (window.XMLHttpRequest) { xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4) { document.getElementById("stuff").innerHTML = document.getElementById("stuff").innerHTML + xmlhttp.responseText; current = current + 1; if (images[current] != null) { doThumb(); } } } function doThumb() { document.getElementById("stuff").innerHTML = document.getElementById("stuff").innerHTML + "<b>" + images[current] + "</b>: "; xmlhttp.open("GET", "?go=" + images[current], true); xmlhttp.send(null); } </script> <body> <a href="javascript:doThumb()">Go</a> <p id="stuff"> </p> </body></html>[/code]
[QUOTE=Ortzinator;17074593]Like [url=http://www.playxpert.com/web/guest/home]PlayXPert[/url]?[/QUOTE] umm i guess so except mine is for tweaking values of the game. (Like a spawn menu for gtaIV)
Server Info Box: [IMG]http://img143.imageshack.us/img143/5688/picofsib21.png[/IMG] After finishing my STEAM Info Box yesterday, I created my Server Checker, atm a HTML Site, but the code for making a picture is mostly finished. Try the HTML Version here: [url]http://sekcobra.bplaced.net/ServerBox/framing.html[/url] [url]http://sekcobra.bplaced.net/ServerBox/?ip=YOURSERVERIP:PORT[/url]
"No hotlinking allowed".
Now?
Still no dice for the image. Also, "all the slots in my country are full" :rolleyes:
Loaded on Imageshack. Now?
I can see them now, anyway...
Yup, I can see the image now.
[QUOTE=Mattz333;17074915]Are you creating the chests when the button is down? (Rather than when is changes state from up to down) because if you are then the code loop will be executing a few times while you think you have only pressed it quickly (to the PC you have held it down for several cycles) and thus it will be creating multiple instances.[/QUOTE] I think the code was taking both a keyup event and a keydown event (or whatever they are really called) to mean the key was pressed, I've changed it now so it only uses the keydown event. Work's Perfect.
Isn't it more common to only use the keyup event so you can cancel your action?
I may change it if I find a need to. I'm not sure what I'm actually going to do with it right now.
Depends. For Rapidfire you'll relay on both, keydown and keyup ;D And FPSs also fire on keydown :)
[img]https://dl.getdropbox.com/u/99765/sdfsdfdsr32r.png[/img] oh god
Do windows "Focus" and stuff and come to the front? Some damn nice work :)
[QUOTE=Tezza1234;17082483]Do windows "Focus" and stuff and come to the front? Some damn nice work :)[/QUOTE] yuup
-snip-
[img]http://i26.tinypic.com/1znbfnk.png[/img] [img]http://i25.tinypic.com/3585ibq.png[/img] [img]http://i32.tinypic.com/30jtfyo.png[/img] I'm so sick of purple right now
For a background I'm using a 10x10 image and then tiling it on the whole screen. How can I make it quicker? [code]while( Y <= 60 ) { while( X <= 80 ) { grass.SetPosition( X * 10, Y * 10 ); App.Draw( grass ); X++; } X = 0; Y++; }[/code] At the minute I'm running at about 26 FPS with it and 1000ish without.
The more declarative solution, using for loops: [cpp] for(int y = 0; y < 600; y += 10) { for(int x = 0; x < 800; x += 10) { grass.SetPosition(x, y); App.Draw(grass); } } [/cpp] (Also gets rid of multiplication, which is, relative to addition, very slow) Depending on what Shape::SetPosition does internally in SFML, it might be better to have one Shape object per tile, with preset positions, or it might just be a waste of the little extra memory used. I really doubt the real FPS drop is coming from that snippet, though.
I think it is that piece of code because when I comment it out and replace it with App.Clear the FPS is a lot higher. Also that piece of code is being run every frame. I'll try your suggestion in a few moments though.
[QUOTE=jA_cOp;17084616] (Also gets rid of multiplication, which is, relative to addition, very slow) [/quote] So? [quote] I really doubt the real FPS drop is coming from that snippet, though.[/QUOTE] What's there to doubt? 4800 batches per-frame is obviously the problem. @ OP: Just render your grass to a single image, then use that images as your background (so 1 draw call instead of 4800)
A simple question: Does GCC on Linux work exactly the same as on Windows, except of course for the output?
[QUOTE=nullsquared;17085292]So? What's there to doubt? 4800 batches per-frame is obviously the problem. @ OP: Just render your grass to a single image, then use that images as your background (so 1 draw call instead of 4800)[/QUOTE] How do you to that with SFML. If you can just point me towards the functions I need then I can work it out.
My objects have motion blur somehow. I can't print screen it, because it isn't rendered motion blur, but I replicated the effect with paint.net [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/motion_blur_prob.png[/IMG] I tried slowing down the framerate, but unless I lower it down to like 10 frames a sec, I get this motion blur that causes all darkly colored objects to appear almost invisible... They aren't even moving that fast either, just lazily drifting by.
[QUOTE=ryandaniels;17085564]My objects have motion blur somehow. I can't print screen it, because it isn't rendered motion blur, but I replicated the effect with paint.net [IMG]http://i429.photobucket.com/albums/qq12/the1trueryandaniels/motion_blur_prob.png[/IMG] I tried slowing down the framerate, but unless I lower it down to like 10 frames a sec, I get this motion blur that causes all darkly colored objects to appear almost invisible... They aren't even moving that fast either, just lazily drifting by.[/QUOTE] Are you using floats for positions? I know that if you draw something at a position that isn't a whole number it blurs it to give it an effect of moving across, at least for sprites.
[QUOTE=Overv;17085416]A simple question: Does GCC on Linux work exactly the same as on Windows, except of course for the output?[/QUOTE] Yes. Make sure you get the mingw 4.4.1 preview though. The 3.4.5 gcc version is total shit.
[QUOTE=Catdaemon;17085868]Are you using floats for positions? I know that if you draw something at a position that isn't a whole number it blurs it to give it an effect of moving across, at least for sprites.[/QUOTE] No, the lines are made by drawing full alpha pixels after converting the float to an int; I should know, I wrote it :D I'm certain that it's a problem with my monitor actually. The question is if it's just my monitor or whether this happens on everyone's, which is why I'm trying to compile a release build, but I'm getting linker errors. LIBCMTD.lib conflicts with msvcrt.lib, but if I ignore either one, I have missing functions.
What's the name of the font of the debug text?
[code] LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(setlocal.obj) : error LNK2005: __configthreadlocale already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in MSVCRT.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in MSVCRT.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in MSVCRT.lib(cinitexe.obj) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in MSVCRT.lib(cinitexe.obj) LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(typinfo.obj) : error LNK2005: "public: void __thiscall type_info::_type_info_dtor_internal_method(void)" (?_type_info_dtor_internal_method@type_info@@QAEXXZ) already defined in MSVCRT.lib(MSVCR90.dll) LIBCMTD.lib(typinfo.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in MSVCRT.lib(ti_inst.obj) LIBCMTD.lib(typinfo.obj) : error LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in MSVCRT.lib(ti_inst.obj) LIBCMTD.lib(exsup.obj) : error LNK2005: __except_list already defined in MSVCRT.lib(dllsupp.obj) MSVCRT.lib(MSVCR90.dll) : error LNK2005: _isspace already defined in LIBCMTD.lib(_ctype.obj) MSVCRT.lib(MSVCR90.dll) : error LNK2005: ___iob_func already defined in LIBCMTD.lib(_file.obj) MSVCRT.lib(MSVCR90.dll) : error LNK2005: _fclose already defined in LIBCMTD.lib(fclose.obj) LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library C:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Release\Belt.exe : fatal error LNK1169: one or more multiply defined symbols found Build log was saved at "file://c:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Belt\Release\BuildLog.htm" Belt - 27 error(s), 2 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] If I ignore msvcrt: [code] ------ Build started: Project: Belt, Configuration: Release Win32 ------ Linking... Graphics.obj : error LNK2001: unresolved external symbol __imp___invalid_parameter_noinfo main.obj : error LNK2001: unresolved external symbol __imp__srand Math.obj : error LNK2001: unresolved external symbol __imp__rand Objects.obj : error LNK2001: unresolved external symbol __imp__memmove_s SDLmain.lib(SDL_win32_main.obj) : error LNK2001: unresolved external symbol __imp__fprintf C:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Release\Belt.exe : fatal error LNK1120: 5 unresolved externals Build log was saved at "file://c:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Belt\Release\BuildLog.htm" Belt - 6 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] If I ignore LIBCMTD: [code] ------ Build started: Project: Belt, Configuration: Release Win32 ------ Linking... libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW C:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Release\Belt.exe : fatal error LNK1120: 1 unresolved externals Build log was saved at "file://c:\Users\Kevin\Documents\Visual Studio 2008\Projects\Belt\Belt\Release\BuildLog.htm" Belt - 2 error(s), 0 warning(s) ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== [/code] [editline]12:37PM[/editline] [QUOTE=Overv;17086085]What's the name of the font of the debug text?[/QUOTE] huh?
Sorry, you need to Log In to post a reply to this thread.