[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freesci-develop] r1588 - in freesci/branches/glutton/src: engine includ
From: |
freesci |
Subject: |
[freesci-develop] r1588 - in freesci/branches/glutton/src: engine include |
Date: |
Sat, 25 Nov 2006 16:02:00 +0100 |
Author: skovmanden
Date: 2006-11-25 16:01:50 +0100 (Sat, 25 Nov 2006)
New Revision: 1588
Modified:
freesci/branches/glutton/src/engine/kpathing.c
freesci/branches/glutton/src/engine/kstring.c
freesci/branches/glutton/src/engine/seg_manager.c
freesci/branches/glutton/src/include/kernel.h
freesci/branches/glutton/src/include/seg_manager.h
Log:
Sigh. Take three. The pathfinder already works around this issue, and
we definitely don't want to work around it twice. This required a new
call in the segment manager, thus a large number of files were
affected.
Lars
Modified: freesci/branches/glutton/src/engine/kpathing.c
===================================================================
--- freesci/branches/glutton/src/engine/kpathing.c 2006-11-25 14:36:46 UTC
(rev 1587)
+++ freesci/branches/glutton/src/engine/kpathing.c 2006-11-25 15:01:50 UTC
(rev 1588)
@@ -1477,7 +1477,7 @@
if (unreachable) {
/* If pathfinding failed we only return the path up to
vertex_start */
oref = sm_alloc_dynmem(&s->seg_manager, POLY_POINT_SIZE * 3,
- "AvoidPath polyline", &output);
+ AVOIDPATH_DYNMEM_STRING, &output);
if (p->keep_start)
POLY_SET_POINT(oref, 0, p->start.x, p->start.y);
Modified: freesci/branches/glutton/src/engine/kstring.c
===================================================================
--- freesci/branches/glutton/src/engine/kstring.c 2006-11-25 14:36:46 UTC
(rev 1587)
+++ freesci/branches/glutton/src/engine/kstring.c 2006-11-25 15:01:50 UTC
(rev 1588)
@@ -458,8 +458,11 @@
return NULL_REG;
}
- if ((strlen(dest) < 2) ||
- (!is_print_str(dest))) /* SQ4 array handling detected */
+/* Our pathfinder already works around the issue we're trying to fix */
+ if ((strcmp(sm_get_description(&(s->seg_manager), argv[0]),
+ AVOIDPATH_DYNMEM_STRING) != 0) &&
+ ((strlen(dest) < 2) || (!is_print_str(dest))))
+ /* SQ4 array handling detected */
{
#ifndef WORDS_BIGENDIAN
int odd = KP_UINT(argv[1]) & 1;
Modified: freesci/branches/glutton/src/engine/seg_manager.c
===================================================================
--- freesci/branches/glutton/src/engine/seg_manager.c 2006-11-25 14:36:46 UTC
(rev 1587)
+++ freesci/branches/glutton/src/engine/seg_manager.c 2006-11-25 15:01:50 UTC
(rev 1588)
@@ -1254,6 +1254,24 @@
return (unsigned char *) (mobj->data.dynmem.buf);
}
+char *
+sm_get_description(seg_manager_t *self, reg_t addr)
+{
+ mem_obj_t *mobj = self->heap[addr.segment];
+ script_t *scr;
+
+ if (addr.segment >= self->heap_size)
+ return "";
+
+ switch (mobj->type)
+ {
+ case MEM_OBJ_DYNMEM:
+ return mobj->data.dynmem.description;
+ default:
+ return "";
+ }
+}
+
int
sm_free_dynmem(seg_manager_t *self, reg_t addr)
{
Modified: freesci/branches/glutton/src/include/kernel.h
===================================================================
--- freesci/branches/glutton/src/include/kernel.h 2006-11-25 14:36:46 UTC
(rev 1587)
+++ freesci/branches/glutton/src/include/kernel.h 2006-11-25 15:01:50 UTC
(rev 1588)
@@ -54,7 +54,9 @@
extern DLLEXTERN int _debug_seeking;
extern DLLEXTERN int _debug_step_running;
+#define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline"
+
typedef struct {
int x, y, xend, yend;
} abs_rect_t;
Modified: freesci/branches/glutton/src/include/seg_manager.h
===================================================================
--- freesci/branches/glutton/src/include/seg_manager.h 2006-11-25 14:36:46 UTC
(rev 1587)
+++ freesci/branches/glutton/src/include/seg_manager.h 2006-11-25 15:01:50 UTC
(rev 1588)
@@ -505,8 +505,14 @@
** Parameters: (reg_t) addr: Offset of the dynmem chunk to free
*/
+char *
+sm_get_description(struct _seg_manager_t *self, reg_t addr);
+/* Gets the description of a dynmem segment
+** Parameters: (reg_t) addr: Segment to describe
+** Returns : (char *): Pointer to the descriptive string set in
+** sm_alloc_dynmem
+*/
-
/*==============================================================*/
/* Generic Operations on Segments and Addresses */
/*==============================================================*/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freesci-develop] r1588 - in freesci/branches/glutton/src: engine include,
freesci <=