mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-23 21:07:17 +00:00
fixed some warnings and errors with ll to int assignment
This commit is contained in:
parent
1b9cdab98c
commit
cfbd5f830c
@ -1892,7 +1892,7 @@ EX void draw_backside() {
|
||||
}
|
||||
else {
|
||||
reverse_side_priorities();
|
||||
for(int i=ptds.size()-1; i>=0; i--)
|
||||
for(int i=isize(ptds)-1; i>=0; i--)
|
||||
if(!among(ptds[i]->prio, PPR::MOBILE_ARROW, PPR::OUTCIRCLE, PPR::CIRCLE))
|
||||
ptds[i]->draw_back();
|
||||
|
||||
|
@ -192,7 +192,7 @@ struct fpattern {
|
||||
|
||||
void add(const matrix& M) {
|
||||
if(!matcode.count(M)) {
|
||||
int i = matrices.size();
|
||||
int i = isize(matrices);
|
||||
matcode[M] = i, matrices.push_back(M);
|
||||
for(int j=0; j<isize(qcoords); j++)
|
||||
addas(mmul(M, qcoords[j]), i);
|
||||
@ -445,14 +445,14 @@ vector<matrix> fpattern::generate_isometries3() {
|
||||
|
||||
void fpattern::add1(const matrix& M) {
|
||||
if(!matcode.count(M)) {
|
||||
int i = matrices.size();
|
||||
int i = isize(matrices);
|
||||
matcode[M] = i, matrices.push_back(M);
|
||||
}
|
||||
}
|
||||
|
||||
void fpattern::add1(const matrix& M, const transmatrix& Full) {
|
||||
if(!matcode.count(M)) {
|
||||
int i = matrices.size();
|
||||
int i = isize(matrices);
|
||||
matcode[M] = i, matrices.push_back(M), fullv.push_back(Full);
|
||||
}
|
||||
}
|
||||
@ -801,7 +801,7 @@ void fpattern::analyze() {
|
||||
}
|
||||
|
||||
DEBB(DF_FIELD, ("variation = %d\n", int(variation)));
|
||||
int N = connections.size();
|
||||
int N = isize(connections);
|
||||
|
||||
markers.resize(N);
|
||||
|
||||
@ -1214,7 +1214,7 @@ EX void nextPrime(fgeomextra& ex) {
|
||||
fp.Prime = nextprime;
|
||||
if(fp.solve() == 0) {
|
||||
fp.build();
|
||||
int cells = fp.matrices.size() / S7;
|
||||
int cells = isize(fp.matrices) / S7;
|
||||
ex.primes.emplace_back(primeinfo{nextprime, cells, (bool) fp.wsquare});
|
||||
ex.dualval.emplace_back(fp.dual);
|
||||
break;
|
||||
|
@ -2835,7 +2835,7 @@ EX bool drawMonster(const transmatrix& Vparam, int ct, cell *c, color_t col, col
|
||||
else if(isWorm(m)) {
|
||||
ld depth = geom3::factor_to_lev(wormhead(c) == c ? cgi.AHEAD : cgi.ABODY);
|
||||
footphase = 0;
|
||||
int q = ptds.size();
|
||||
int q = isize(ptds);
|
||||
drawMonsterType(moPlayer, c, Vs, col, footphase, asciicol);
|
||||
pushdown(c, q, Vs, -depth, true, false);
|
||||
}
|
||||
|
@ -1214,12 +1214,12 @@ EX ld raddif(ld a, ld b) {
|
||||
return d;
|
||||
}
|
||||
|
||||
EX int bucketer(ld x) {
|
||||
return (long long)(x * 10000 + 100000.5) - 100000;
|
||||
EX unsigned bucketer(ld x) {
|
||||
return unsigned((long long)(x * 10000 + 100000.5) - 100000);
|
||||
}
|
||||
|
||||
EX int bucketer(hyperpoint h) {
|
||||
int dx = 0;
|
||||
EX unsigned bucketer(hyperpoint h) {
|
||||
unsigned dx = 0;
|
||||
if(prod) {
|
||||
auto d = product_decompose(h);
|
||||
h = d.second;
|
||||
|
@ -178,7 +178,7 @@ EX int hrand_monster(int x) {
|
||||
// in 3D monster generation depends on the sight range
|
||||
if(WDIM == 3 && !sphere) {
|
||||
int t = isize(gmatrix);
|
||||
if(t > 500) x = ((long long)(x)) * t / 500;
|
||||
if(t > 500) x = int(((long long)(x)) * t / 500);
|
||||
}
|
||||
return hrand(x);
|
||||
}
|
||||
|
@ -288,7 +288,7 @@ shared_ptr<glhr::GLprogram> write_shader(flagtype shader_flags) {
|
||||
|
||||
if(glhr::noshaders || !vid.usingGL) fsh = vsh = "";
|
||||
|
||||
string both = fsh + "*" + vsh + "*" + its(shader_flags);
|
||||
string both = fsh + "*" + vsh + "*" + llts(shader_flags);
|
||||
if(compiled_programs.count(both))
|
||||
return compiled_programs[both];
|
||||
else {
|
||||
|
@ -2922,7 +2922,7 @@ bool celldrawer::draw_shmup_monster() {
|
||||
isBullet(m) ? 0x00FFFFFF :
|
||||
(isFriendly(m->type) || m->type == moPlayer) ? 0x00FF00FF : 0xFF0000FF;
|
||||
|
||||
int q = ptds.size();
|
||||
int q = isize(ptds);
|
||||
if(q != isize(ptds) && !m->inBoat) pushdown(c, q, view, zlev, true, false);
|
||||
|
||||
if(callhandlers(false, hooks_draw, V, c, m)) continue;
|
||||
|
2
tour.cpp
2
tour.cpp
@ -140,7 +140,7 @@ bool handleKeyTour(int sym, int uni) {
|
||||
if(!tour::on) return false;
|
||||
if(!(cmode & sm::DOTOUR)) return false;
|
||||
bool inhelp = cmode & sm::HELP;
|
||||
int flags = slides[currentslide].flags;
|
||||
flagtype flags = slides[currentslide].flags;
|
||||
if((sym == SDLK_RETURN || sym == SDLK_KP_ENTER) && (!inhelp || (flags & QUICKSKIP))) {
|
||||
popScreenAll();
|
||||
if(gamestack::pushed()) {
|
||||
|
10
util.cpp
10
util.cpp
@ -476,7 +476,7 @@ bignum bignum::randomized_div(int x) const {
|
||||
carry += digits[i];
|
||||
// strange compiler buug:
|
||||
// if I do / and %, function 'divmod' is called, and it complains on launch that divmod is unimplemented
|
||||
res.digits[i] = carry / x;
|
||||
res.digits[i] = int(carry / x);
|
||||
carry -= res.digits[i] * (long long)(x);
|
||||
}
|
||||
while(isize(res.digits) && res.digits.back() == 0) res.digits.pop_back();
|
||||
@ -494,10 +494,10 @@ void bignum::addmul(const bignum& b, int factor) {
|
||||
l += carry;
|
||||
if(i < K) l += b.digits[i] * factor;
|
||||
carry = 0;
|
||||
if(l >= BASE) carry = l / BASE;
|
||||
if(l < 0) carry = -(BASE-1-l) / BASE;
|
||||
if(l >= BASE) carry = int(l / BASE);
|
||||
if(l < 0) carry = -int((BASE-1-l) / BASE);
|
||||
l -= carry * BASE;
|
||||
digits[i] = l;
|
||||
digits[i] = int(l);
|
||||
}
|
||||
if(carry < 0) digits.back() -= BASE;
|
||||
while(isize(digits) && digits.back() == 0) digits.pop_back();
|
||||
@ -578,7 +578,7 @@ EX string short_form(bignum b) {
|
||||
|
||||
int digits = q * 9;
|
||||
while(val >= 1000) { val /= 10; digits++; }
|
||||
string str = its(val) + "E" + its(digits + 2);
|
||||
string str = its(int(val)) + "E" + its(digits + 2);
|
||||
str.insert(1, ".");
|
||||
return str;
|
||||
}
|
||||
|
@ -853,7 +853,7 @@ EX namespace tactic {
|
||||
return hiitemsMax(treasureType(l)) * landMultiplier(l) >= 20;
|
||||
}
|
||||
|
||||
EX void record(eLand land, int score, int xc IS(modecode())) {
|
||||
EX void record(eLand land, int score, flagtype xc IS(modecode())) {
|
||||
if(land >=0 && land < landtypes) {
|
||||
for(int i=MAXTAC-1; i; i--) lsc[xc][land][i] = lsc[xc][land][i-1];
|
||||
tactic::lsc[xc][land][0] = score;
|
||||
@ -868,7 +868,7 @@ EX namespace tactic {
|
||||
record(lasttactic, items[treasureType(lasttactic)]);
|
||||
}
|
||||
|
||||
void unrecord(eLand land, int xc = modecode()) {
|
||||
void unrecord(eLand land, flagtype xc = modecode()) {
|
||||
if(land >=0 && land < landtypes) {
|
||||
for(int i=0; i<MAXTAC-1; i++) lsc[xc][land][i] = lsc[xc][land][i+1];
|
||||
lsc[xc][land][MAXTAC-1] = -1;
|
||||
@ -904,7 +904,7 @@ EX namespace tactic {
|
||||
|
||||
EX void showMenu() {
|
||||
|
||||
int xc = modecode();
|
||||
flagtype xc = modecode();
|
||||
|
||||
if(xc == 0) set_priority_board(LB_PURE_TACTICS);
|
||||
if(xc == 2) set_priority_board(LB_PURE_TACTICS_SHMUP);
|
||||
|
Loading…
Reference in New Issue
Block a user