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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Thu Feb 26 03:21:56 CET 2009


Revision: 38891
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38891&view=rev
Author:   fingolfin
Date:     2009-02-26 02:21:55 +0000 (Thu, 26 Feb 2009)

Log Message:
-----------
cleanup

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/engine/kmenu.cpp

Removed Paths:
-------------
    scummvm/trunk/engines/sci/engine/sci_graphics.h

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2009-02-26 02:04:30 UTC (rev 38890)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2009-02-26 02:21:55 UTC (rev 38891)
@@ -29,7 +29,7 @@
 
 namespace Sci {
 
-int stop_on_event;
+int stop_on_event = 0;
 
 #define SCI_VARIABLE_GAME_SPEED 3
 
@@ -85,7 +85,7 @@
 		quit_vm();
 		break;
 
-	case SCI_EVT_KEYBOARD: {
+	case SCI_EVT_KEYBOARD:
 		if ((e.buckybits & SCI_EVM_LSHIFT) && (e.buckybits & SCI_EVM_RSHIFT) && (e.data == '-')) {
 			sciprintf("Debug mode activated\n");
 			script_debug_flag = 1; // Enter debug mode
@@ -106,8 +106,7 @@
 			// character
 			PUT_SEL32V(obj, modifiers, e.buckybits&modifier_mask);
 		}
-	}
-	break;
+		break;
 
 	case SCI_EVT_MOUSE_RELEASE:
 	case SCI_EVT_MOUSE_PRESS: {
@@ -129,13 +128,12 @@
 			PUT_SEL32V(obj, modifiers, (e.buckybits | extra_bits)&modifier_mask);
 			s->r_acc = make_reg(0, 1);
 		}
+		break;
 	}
-	break;
 
-	default: {
+	default:
 		s->r_acc = NULL_REG; // Unknown or no event
 	}
-	}
 
 	if ((s->r_acc.offset) && (stop_on_event)) {
 		stop_on_event = 0;
@@ -187,7 +185,8 @@
 			PUT_SEL32V(obj, type, SCI_EVT_JOYSTICK);
 			PUT_SEL32V(obj, message, mover);
 			return make_reg(0, 1);
-		} else return NULL_REG;
+		} else
+			return NULL_REG;
 	}
 
 	return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-26 02:04:30 UTC (rev 38890)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2009-02-26 02:21:55 UTC (rev 38891)
@@ -29,13 +29,15 @@
 #include "sci/include/engine.h"
 #include "sci/gfx/sci_widgets.h"
 #include "sci/gfx/gfx_widgets.h"
-#include "sci/engine/sci_graphics.h"
 #include "sci/engine/kernel.h"
 
 namespace Sci {
 
 #undef DEBUG_LSRECT
 
+// This is the real width of a text with a specified width of 0
+#define MAX_TEXT_WIDTH_MAGIC_VALUE 192
+
 // Graph subfunctions
 #define K_GRAPH_GET_COLORS_NR 2
 #define K_GRAPH_DRAW_LINE 4
@@ -486,9 +488,9 @@
 	port->widfree(GFXW(port));
 }
 
-static int activated_icon_bar;
-static int port_origin_x;
-static int port_origin_y;
+static int activated_icon_bar = 0;
+static int port_origin_x = 0;
+static int port_origin_y = 0;
 
 reg_t kGraph(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	rect_t area;
@@ -730,12 +732,8 @@
 #define GASEOUS_VIEW_MASK_ACTIVE (_K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_IGNORE_ACTOR)
 #define GASEOUS_VIEW_MASK_PASSIVE (_K_VIEW_SIG_FLAG_NO_UPDATE | _K_VIEW_SIG_FLAG_REMOVE | _K_VIEW_SIG_FLAG_IGNORE_ACTOR)
 
-abs_rect_t set_base(EngineState *s, reg_t object);
+static abs_rect_t nsrect_clip(EngineState *s, int y, abs_rect_t retval, int priority);
 
-inline abs_rect_t get_nsrect(EngineState *s, reg_t object, byte clip);
-
-static inline abs_rect_t nsrect_clip(EngineState *s, int y, abs_rect_t retval, int priority);
-
 static int collides_with(EngineState *s, abs_rect_t area, reg_t other_obj, int use_nsrect, int view_mask, int funct_nr, int argc, reg_t *argv) {
 	int other_signal = GET_SEL32V(other_obj, signal);
 	int other_priority = GET_SEL32V(other_obj, priority);
@@ -1171,7 +1169,7 @@
 	return s->r_acc;
 } // kBaseSetter
 
-static inline abs_rect_t nsrect_clip(EngineState *s, int y, abs_rect_t retval, int priority) {
+static abs_rect_t nsrect_clip(EngineState *s, int y, abs_rect_t retval, int priority) {
 	int pri_top;
 
 	if (priority == -1)
@@ -1189,7 +1187,7 @@
 	return retval;
 }
 
-inline abs_rect_t calculate_nsrect(EngineState *s, int x, int y, int view, int loop, int cel) {
+static abs_rect_t calculate_nsrect(EngineState *s, int x, int y, int view, int loop, int cel) {
 	int xbase, ybase, xend, yend, xsize, ysize;
 	int xmod = 0, ymod = 0;
 	abs_rect_t retval = {0, 0, 0, 0};
@@ -1218,7 +1216,7 @@
 	return retval;
 }
 
-inline abs_rect_t get_nsrect(EngineState *s, reg_t object, byte clip) {
+abs_rect_t get_nsrect(EngineState *s, reg_t object, byte clip) {
 	int x, y, z;
 	int view, loop, cel;
 	abs_rect_t retval;
@@ -1266,7 +1264,7 @@
 	_k_set_now_seen(s, object);
 
 	return s->r_acc;
-} // kSetNowSeen
+}
 
 reg_t kPalette(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	switch (UKPV(0)) {
@@ -2367,17 +2365,6 @@
 	return NULL_REG;
 }
 
-static inline void add_to_chrono(EngineState *s, gfxw_widget_t *widget) {
-	gfxw_port_t *chrono_port;
-	gfxw_list_t *tw;
-
-	chrono_port = gfxw_get_chrono_port(s->visual, &tw, 0);
-	tw->add(GFXWC(tw), widget);
-
-	if (!chrono_port->parent)
-		ADD_TO_CURRENT_PORT(chrono_port);
-}
-
 reg_t kDrawCel(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	int view = SKPV(0);
 	int loop = SKPV(1);
@@ -2404,11 +2391,7 @@
 	new_view = gfxw_new_view(s->gfx_state, Common::Point(x, y), view, loop, cel, 0, priority, -1,
 	                         ALIGN_LEFT, ALIGN_TOP, GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET);
 
-#if 0
-	add_to_chrono(s, GFXW(new_view));
-#else
 	ADD_TO_CURRENT_PICTURE_PORT(GFXW(new_view));
-#endif
 	FULL_REDRAW();
 
 	return s->r_acc;

Modified: scummvm/trunk/engines/sci/engine/kmenu.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-02-26 02:04:30 UTC (rev 38890)
+++ scummvm/trunk/engines/sci/engine/kmenu.cpp	2009-02-26 02:21:55 UTC (rev 38891)
@@ -31,8 +31,7 @@
 
 namespace Sci {
 
-reg_t
-kAddMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kAddMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	char *name = kernel_dereference_char_pointer(s, argv[0], 0);
 	char *contents = kernel_dereference_char_pointer(s, argv[1], 0);
 
@@ -44,8 +43,7 @@
 }
 
 
-reg_t
-kSetMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kSetMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	int index = UKPV(0);
 	int i = 2;
 
@@ -57,16 +55,14 @@
 	return s->r_acc;
 }
 
-reg_t
-kGetMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kGetMenu(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	int index = UKPV(0);
 
 	return menubar_get_attribute(s, (index >> 8) - 1, (index & 0xff) - 1, UKPV(1));
 }
 
 
-reg_t
-kDrawStatus(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kDrawStatus(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	reg_t text = argv[0];
 	int fgcolor = SKPV_OR_ALT(1, s->status_bar_foreground);
 	int bgcolor = SKPV_OR_ALT(2, s->status_bar_background);
@@ -95,8 +91,7 @@
 }
 
 
-reg_t
-kDrawMenuBar(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kDrawMenuBar(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 
 	if (SKPV(0))
 		sciw_set_menubar(s, s->titlebar_port, s->menubar, -1);
@@ -204,8 +199,7 @@
 };
 
 
-void
-about_freesci(EngineState *s) {
+void about_freesci(EngineState *s) {
 	int page;
 	gfxw_port_t *port;
 	int bodyfont, titlefont;
@@ -288,8 +282,7 @@
 }
 
 
-static inline int
-_menu_go_down(EngineState *s, int menu_nr, int item_nr) {
+static int _menu_go_down(EngineState *s, int menu_nr, int item_nr) {
 	int seeker, max = s->menubar->menus[menu_nr].items_nr;
 	seeker = item_nr + 1;
 
@@ -298,7 +291,8 @@
 
 	if (seeker != max)
 		return seeker;
-	else return item_nr;
+	else
+		return item_nr;
 }
 
 #define FULL_REDRAW \
@@ -306,8 +300,7 @@
 	gfxop_update(s->gfx_state);
 
 
-reg_t
-kMenuSelect(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+reg_t kMenuSelect(EngineState *s, int funct_nr, int argc, reg_t *argv) {
 	reg_t event = argv[0];
 	/*int pause_sound = UKPV_OR_ALT(1, 1);*/ /* FIXME: Do this eventually */
 	int claimed = 0;

Deleted: scummvm/trunk/engines/sci/engine/sci_graphics.h
===================================================================
--- scummvm/trunk/engines/sci/engine/sci_graphics.h	2009-02-26 02:04:30 UTC (rev 38890)
+++ scummvm/trunk/engines/sci/engine/sci_graphics.h	2009-02-26 02:21:55 UTC (rev 38891)
@@ -1,45 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-// SCI constants and definitions
-
-#ifndef SCI_ENGINE_SCI_GRAPHICS_H
-#define SCI_ENGINE_SCI_GRAPHICS_H
-
-namespace Sci {
-
-#define MAX_TEXT_WIDTH_MAGIC_VALUE 192
-// This is the real width of a text with a specified width of 0
-
-#define SELECTOR_STATE_SELECTABLE 1
-#define SELECTOR_STATE_FRAMED 2
-#define SELECTOR_STATE_DISABLED 4
-#define SELECTOR_STATE_SELECTED 8
-// Internal states
-#define SELECTOR_STATE_DITHER_FRAMED 0x1000
-
-} // End of namespace Sci
-
-#endif // SCI_ENGINE_SCI_GRAPHICS_H


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