summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-10 00:18:32 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-10 00:18:32 +0000
commit9f29aa11e3a5fceadf1ac2906283b86e5700659b (patch)
treebb5e30bb30542b00188da1b043e17a75f946b442 /crawl-ref/source
parente262ce4eaaf15dce979f563beaa33c73503d089a (diff)
downloadcrawl-ref-9f29aa11e3a5fceadf1ac2906283b86e5700659b.tar.gz
crawl-ref-9f29aa11e3a5fceadf1ac2906283b86e5700659b.zip
Fixing compilation issues from ghost changes.
Fixing incorrect asserts in tiles code. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3236 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/guic-x11.cc4
-rw-r--r--crawl-ref/source/guic.cc42
-rw-r--r--crawl-ref/source/tile1.cc4
-rw-r--r--crawl-ref/source/tile2.cc15
4 files changed, 14 insertions, 51 deletions
diff --git a/crawl-ref/source/guic-x11.cc b/crawl-ref/source/guic-x11.cc
index 7870b3a19e..33f35148a7 100644
--- a/crawl-ref/source/guic-x11.cc
+++ b/crawl-ref/source/guic-x11.cc
@@ -765,8 +765,8 @@ void TileRegionClass::fillrect(int left, int top, int right, int bottom,
ASSERT(left>=0);
ASSERT(top>=0);
- ASSERT(right<mx);
- ASSERT(bottom<my);
+ ASSERT(right<mx*dx);
+ ASSERT(bottom<my*dy);
for (x=left; x<=right; x++){
for (y=top; y<= bottom; y++){
diff --git a/crawl-ref/source/guic.cc b/crawl-ref/source/guic.cc
index 5c29797a5c..f5f0cdc862 100644
--- a/crawl-ref/source/guic.cc
+++ b/crawl-ref/source/guic.cc
@@ -518,34 +518,7 @@ void TextRegionClass::scroll()
void TextRegionClass::adjust_region(int *x1, int *x2, int y)
{
-#ifdef JP
- if (dos_char)
- {
- *x2 = *x2 + 1;
- return;
- }
-
- int nx1 = 0;
- int nx2 = mx;
- unsigned char *ptr = &cbuf[y * mx];
- int x = 0;
-
- while (x<mx)
- {
- if(x<=*x1) nx1=x;
- if(x>*x2)
- {
- nx2=x;
- break;
- }
- if (ptr[x] & 0x80) x+=2;
- else x++;
- }
- *x1 = nx1;
- *x2 = nx2;
-#else
*x2 = *x2 + 1;
-#endif
}
void TextRegionClass::addstr(char *buffer)
@@ -605,14 +578,6 @@ void TextRegionClass::addstr_aux(char *buffer, int len)
adjust_region(&head, &tail, y);
-#ifdef JP
- // prevent half displayed kanji
- cbuf[adrs+head] = ' ';
- abuf[adrs+head] = text_col;
- cbuf[adrs+tail-1] = ' ';
- abuf[adrs+tail-1] = text_col;
-#endif
-
for (i=0; i < len && x + i < mx;i++)
{
cbuf[adrs+x+i]=buffer[i];
@@ -650,14 +615,7 @@ void TextRegionClass::redraw(int x1, int y1, int x2, int y2)
draw_string(head, y, &c[head], x-head, oldcol);
head = x;
}
-#ifdef JP
- if ( ((c[x] & 0x80) == 0x80) && (dos_char == false))
- x+=2;
- else
- x++;
-#else
x++;
-#endif
}
}
diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc
index a330563917..98d4d7e2f8 100644
--- a/crawl-ref/source/tile1.cc
+++ b/crawl-ref/source/tile1.cc
@@ -2235,6 +2235,10 @@ void tilep_race_default(int race, int gender, int level, int *parts)
break;
case SP_VAMPIRE:
result = TILEP_BASE_VAMPIRE;
+ if (gender==TILEP_GENDER_MALE)
+ hair = TILEP_HAIR_ARAGORN;
+ else
+ hair = TILEP_HAIR_ARWEN;
break;
default:
result = TILEP_BASE_HUMAN;
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index aa8b34a242..bcbc8bdc2a 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -10,6 +10,7 @@
#include "direct.h"
#include "dungeon.h"
#include "files.h"
+#include "ghost.h"
#include "guic.h"
#include "itemprop.h"
#include "it_use2.h"
@@ -2110,7 +2111,7 @@ void TileGhostInit(struct ghost_demon &ghost)
{
dolls_data doll;
int x, y;
- unsigned int pseudo_rand = ghost.values[GVAL_MAX_HP]*54321*54321;
+ unsigned int pseudo_rand = ghost.max_hp*54321*54321;
char mask[TILE_X*TILE_Y];
int g_gender = (pseudo_rand >>8)&1;
@@ -2123,9 +2124,9 @@ void TileGhostInit(struct ghost_demon &ghost)
doll.parts[x] = 0;
current_parts[x] = 0;
}
- tilep_race_default(ghost.values[GVAL_SPECIES], g_gender,
- ghost.values[GVAL_EXP_LEVEL], doll.parts);
- tilep_job_default (ghost.values[GVAL_CLASS], g_gender, doll.parts);
+ tilep_race_default(ghost.species, g_gender,
+ ghost.xl, doll.parts);
+ tilep_job_default (ghost.job, g_gender, doll.parts);
for(x = TILEP_PART_CLOAK; x < TILEP_PARTS_TOTAL; x++)
{
@@ -2136,7 +2137,7 @@ void TileGhostInit(struct ghost_demon &ghost)
if (x == TILEP_PART_BODY)
{
int p = 0;
- int ac = ghost.values[GVAL_AC];
+ int ac = ghost.ac;
ac *= (5 + (pseudo_rand/11) % 11);
ac /= 10;
@@ -2156,8 +2157,8 @@ void TileGhostInit(struct ghost_demon &ghost)
}
}
- int sk = ghost.values[GVAL_BEST_SKILL];
- int dam = ghost.values[GVAL_DAMAGE];
+ int sk = ghost.best_skill;
+ int dam = ghost.damage;
int p = 0;
dam *= (5 + pseudo_rand % 11);