[Scummvm-cvs-logs] SF.net SVN: scummvm:[38719] scummvm/trunk/engines/sci

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 21 19:21:00 CET 2009


Revision: 38719
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38719&view=rev
Author:   fingolfin
Date:     2009-02-21 18:21:00 +0000 (Sat, 21 Feb 2009)

Log Message:
-----------
SCI: Got rid of sci_sched_yield

Modified Paths:
--------------
    scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
    scummvm/trunk/engines/sci/include/resource.h
    scummvm/trunk/engines/sci/scicore/tools.cpp

Modified: scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp
===================================================================
--- scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-21 18:20:40 UTC (rev 38718)
+++ scummvm/trunk/engines/sci/gfx/resource/sci_pic_0.cpp	2009-02-21 18:21:00 UTC (rev 38719)
@@ -39,8 +39,6 @@
 #define INTERCOL(a, b) ((int) sqrt((((3.3 * (a))*(a)) + ((1.7 * (b))*(b))) / 5.0))
 // Macro for color interpolation
 
-#define SCI_PIC0_MAX_FILL 30 // Number of times to fill before yielding to scheduler
-
 #define SCI0_MAX_PALETTE 2
 
 int sci0_palette = 0;
@@ -1310,7 +1308,6 @@
 	int temp;
 	int line_mode = style->line_mode;
 	int sci_titlebar_size = style->pic_port_bounds.y;
-	int fill_count = 0;
 	byte op, opx;
 
 #ifdef FILL_RECURSIVE_DEBUG
@@ -1464,11 +1461,6 @@
 					_gfxr_fill_1(pic, x, y + sci_titlebar_size, (flags & DRAWPIC01_FLAG_FILL_NORMALLY) ?
 					             color : 0, priority, control, drawenable, sci_titlebar_size);
 
-				if (fill_count++ > SCI_PIC0_MAX_FILL) {
-					sci_sched_yield();
-					fill_count = 0;
-				}
-
 #ifdef FILL_RECURSIVE_DEBUG
 				if (!fillmagc) {
 					int x, y;

Modified: scummvm/trunk/engines/sci/include/resource.h
===================================================================
--- scummvm/trunk/engines/sci/include/resource.h	2009-02-21 18:20:40 UTC (rev 38718)
+++ scummvm/trunk/engines/sci/include/resource.h	2009-02-21 18:21:00 UTC (rev 38719)
@@ -250,11 +250,6 @@
 /** Find first set bit in bits and return its index. Returns 0 if bits is 0. */
 int sci_ffs(int bits);
 
-void sci_sched_yield(void);
-/* Yields the running process/thread to the scheduler
-** Parameters: (void)
-** Returns   : after a while.
-*/
 
 /* The following was originally based on glib.h code, which was
  * Copyright (C) 1995-1997  Peter Mattis, Spencer Kimball and Josh MacDonald

Modified: scummvm/trunk/engines/sci/scicore/tools.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-21 18:20:40 UTC (rev 38718)
+++ scummvm/trunk/engines/sci/scicore/tools.cpp	2009-02-21 18:21:00 UTC (rev 38719)
@@ -23,48 +23,27 @@
  *
  */
 
-#ifdef _MSC_VER
-#  include <sys/timeb.h>
-#  include <windows.h>
-#  include <sys/types.h>
-#  include <sys/stat.h>
-#  undef ARRAYSIZE
-#endif
+#include "common/scummsys.h"
 
-#include "common/archive.h"
-#include "common/file.h"
-#include "common/util.h"
-
 #ifdef WIN32
 #  include <windows.h>
 #  include <errno.h>
 #  include <mmsystem.h>
-
-#	ifdef sleep
-#		undef sleep
-#	endif
-
-#	define sleep(x) \
-	do { \
-		if (x == 0) { \
-			Sleep(0); \
-		} else { \
-			if (timeBeginPeriod(1) != TIMERR_NOERROR) \
-				fprintf(stderr, "timeBeginPeriod(1) failed\n"); \
-			Sleep(x); \
-			if (timeEndPeriod(1) != TIMERR_NOERROR) \
-				fprintf(stderr, "timeEndPeriod(1) failed\n"); \
-		} \
-	} while (0);
+#  include <sys/timeb.h>
+#  include <sys/types.h>
+#  include <sys/stat.h>
+#  undef ARRAYSIZE
 #endif
 
-#include "common/scummsys.h"
-#include "common/str.h"
-
 #ifdef UNIX
 #include <fnmatch.h>
 #endif
 
+#include "common/archive.h"
+#include "common/file.h"
+#include "common/util.h"
+#include "common/str.h"
+
 #include "sci/include/engine.h"
 
 namespace Sci {
@@ -83,10 +62,6 @@
 #  include <sys/time.h>
 #endif
 
-#ifdef __DC__
-#  include <kos/thread.h>
-#endif
-
 int script_debug_flag = 0; // Defaulting to running mode
 int sci_debug_flags = 0; // Special flags
 
@@ -375,35 +350,7 @@
 	return 0;
 }
 
-//-- Yielding to the scheduler --
 
-#ifdef HAVE_SCHED_YIELD
-#  include <sched.h>
-
-void sci_sched_yield() {
-	sched_yield();
-}
-
-#elif defined (__DC__)
-
-void sci_sched_yield() {
-	thd_pass();
-}
-
-#elif defined (WIN32)
-
-void sci_sched_yield() {
-	sleep(1);
-}
-
-#else
-
-void sci_sched_yield() {
-}
-
-#endif
-
-
 /* Returns the case-sensitive filename of a file.
 ** Expects *dir to be uninitialized and the caller to free it afterwards.
 ** Parameters: (const char *) fname: Name of file to get case-sensitive.


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list