Added kdevelop project, -content option/searching, small fading fix
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@66 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
@@ -323,9 +323,10 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
|
|
||||||
if (current_fade != 255 && current_fade != last_fade)
|
if (current_fade != 255 && current_fade != last_fade)
|
||||||
TFB_SwapBuffers(); // if fading, redraw every frame
|
TFB_SwapBuffers(); // if fading, redraw every frame
|
||||||
|
else
|
||||||
|
SDL_Delay(5);
|
||||||
last_fade = current_fade;
|
last_fade = current_fade;
|
||||||
|
|
||||||
SDL_Delay(5);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -391,6 +392,7 @@ TFB_FlushGraphics () // Only call from main thread!!
|
|||||||
SDL_Rect targetRect;
|
SDL_Rect targetRect;
|
||||||
SDL_Surface *surf;
|
SDL_Surface *surf;
|
||||||
|
|
||||||
|
|
||||||
if (DC_image == 0)
|
if (DC_image == 0)
|
||||||
{
|
{
|
||||||
printf ("TFB_FlushGraphics(): error, DC_image == 0\n");
|
printf ("TFB_FlushGraphics(): error, DC_image == 0\n");
|
||||||
|
|||||||
@@ -16,11 +16,43 @@
|
|||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
#include <unistd.h>
|
||||||
|
#else
|
||||||
|
#include <direct.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "libs/graphics/gfx_common.h"
|
#include "libs/graphics/gfx_common.h"
|
||||||
#include "libs/sound/sound_common.h"
|
#include "libs/sound/sound_common.h"
|
||||||
#include "libs/input/input_common.h"
|
#include "libs/input/input_common.h"
|
||||||
#include "libs/tasklib.h"
|
#include "libs/tasklib.h"
|
||||||
|
|
||||||
|
|
||||||
|
BOOLEAN FileExists (char *filename)
|
||||||
|
{
|
||||||
|
FILE *fp;
|
||||||
|
if ((fp = fopen(filename, "rb")) == NULL)
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
fclose (fp);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CDToContentDir (char *contentdir)
|
||||||
|
{
|
||||||
|
char *testfile = "starcon.txt";
|
||||||
|
|
||||||
|
if (!FileExists (testfile))
|
||||||
|
{
|
||||||
|
if (chdir(contentdir) || !FileExists (testfile))
|
||||||
|
{
|
||||||
|
fprintf(stderr, "Fatal error: content not available, running from wrong dir?\n");
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, char *argv[])
|
main (int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@@ -29,6 +61,13 @@ main (int argc, char *argv[])
|
|||||||
int gfxflags = 0;
|
int gfxflags = 0;
|
||||||
int width = 640, height = 480, bpp = 16;
|
int width = 640, height = 480, bpp = 16;
|
||||||
int frequency = 44100;
|
int frequency = 44100;
|
||||||
|
char contentdir[1000];
|
||||||
|
|
||||||
|
#ifndef WIN32
|
||||||
|
strcpy (contentdir, "content");
|
||||||
|
#else
|
||||||
|
strcpy (contentdir, "../../content");
|
||||||
|
#endif
|
||||||
|
|
||||||
// TODO: proper commandline parser, this is just a quick hack
|
// TODO: proper commandline parser, this is just a quick hack
|
||||||
for (i=1;i<argc;++i)
|
for (i=1;i<argc;++i)
|
||||||
@@ -68,7 +107,14 @@ main (int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
gfxflags |= TFB_GFXFLAGS_TVEFFECT;
|
gfxflags |= TFB_GFXFLAGS_TVEFFECT;
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[i],"-content"))
|
||||||
|
{
|
||||||
|
i++;
|
||||||
|
sscanf(argv[i], "%s", contentdir);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CDToContentDir (contentdir);
|
||||||
|
|
||||||
InitThreadSystem ();
|
InitThreadSystem ();
|
||||||
InitTimeSystem ();
|
InitTimeSystem ();
|
||||||
|
|||||||
Reference in New Issue
Block a user