...
 
Commits (12)
hyperrogue (10.4j-1) unstable; urgency=medium
* Team upload.
* New upstream version 10.4j.
* Switch to compat level 11.
* Declare compliance with Debian Policy 4.1.5.
-- Markus Koschany <apo@debian.org> Thu, 02 Aug 2018 02:54:00 +0200
hyperrogue (10.0g-1) unstable; urgency=medium
* Team upload.
......
......@@ -6,7 +6,7 @@ Uploaders:
Christian M. Amsüss <chrysn@fsfe.org>,
Damyan Ivanov <dmn@debian.org>
Build-Depends:
debhelper (>= 10),
debhelper (>= 11),
libfontconfig-dev,
libgl1-mesa-dev,
libpng-dev,
......@@ -14,7 +14,7 @@ Build-Depends:
libsdl-mixer1.2-dev,
libsdl-ttf2.0-dev,
libsdl1.2-dev
Standards-Version: 4.1.0
Standards-Version: 4.1.5
Homepage: http://www.roguetemple.com/z/hyper/
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-games/hyperrogue.git
Vcs-Git: https://anonscm.debian.org/git/pkg-games/hyperrogue.git
......
......@@ -8,9 +8,26 @@ Copyright: 2011-2013 Zeno Rogue <zeno@attnam.com>
License: GPL-2+
Files: src/direntx.*
Copyright: no-copyright
License: public-domain
This file has no copyright assigned and is placed in the Public Domain.
Copyright: 2006-2012 Toni Ronkko
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Files: src/glew.c
Copyright:
......@@ -46,39 +63,6 @@ License: BSD-3-clause-GLEW
** THE POSSIBILITY OF SUCH DAMAGE.
*/
Files: src/mtrand.*
Copyright: 1997 - 2002, Makoto Matsumoto and Takuji Nishimura,
License: BSD-3-clause-mtrand
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions
// are met:
//
// 1. Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
//
// 3. The names of its contributors may not be used to endorse or promote
// products derived from this software without specific prior written
// permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/
Files: src/savepng.*
Copyright: 1995-1996 Guy Eric Schalnat, Group 42, Inc.
License: zlib
......@@ -148,7 +132,7 @@ Comment:
Files: debian/*
Copyright: 2013, chrysn <chrysn@fsfe.org>
2016-2017, Markus Koschany <apo@debian.org>
2016-2018, Markus Koschany <apo@debian.org>
License: GPL-2+
License: GPL-2+
......
[DEFAULT]
pristine-tar = True
From: Markus Koschany <apo@debian.org>
Date: Thu, 2 Aug 2018 03:08:16 +0200
Subject: savepng
savepng.c is now savepng.cpp
Forwarded: no
---
src/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Makefile b/src/Makefile
index 3ba3c9f..2881762 100755
--- a/src/Makefile
+++ b/src/Makefile
@@ -2,8 +2,8 @@ CXXFLAGS ?=
all: hyper
-savepng-loc.o: savepng.c
- gcc savepng.c -c -o savepng-loc.o
+savepng-loc.o: savepng.cpp
+ gcc savepng.cpp -c -o savepng-loc.o
hyper.o: hyper.cpp graph.cpp hyperpoint.cpp geometry.cpp cell.cpp heptagon.cpp game.cpp classes.cpp polygons.cpp language.cpp language-data.cpp achievement.cpp netgen.cpp mapeditor.cpp
g++ hyper.cpp -c -o hyper.o -DFHS -Wall ${CXXFLAGS} ${CPPFLAGS} ${LDFLAGS} -DLINUX
optimization.patch
system-dejavu.patch
savepng.patch
From: Markus Koschany <apo@debian.org>
Date: Thu, 14 Sep 2017 20:53:08 +0200
Date: Thu, 2 Aug 2018 02:58:27 +0200
Subject: system dejavu
Use Debian's system font.
Forwarded: not-needed
---
src/basegraph.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/basegraph.cpp b/src/basegraph.cpp
index e836c6a..e3f3994 100644
index fe1ba25..eb3c7e4 100644
--- a/src/basegraph.cpp
+++ b/src/basegraph.cpp
@@ -57,7 +57,7 @@ int qpixel3(SDL_Surface *surf, int x, int y) {
#if CAP_SDLTTF
@@ -91,7 +91,7 @@ string fontpath = ISWEB ? "sans-serif" : HYPERPATH "DejaVuSans-Bold.ttf";
void loadfont(int siz) {
if(!font[siz]) {
- font[siz] = TTF_OpenFont(ISWEB ? "sans-serif" : HYPERPATH "DejaVuSans-Bold.ttf", siz);
- font[siz] = TTF_OpenFont(fontpath.c_str(), siz);
+ font[siz] = TTF_OpenFont("/usr/share/fonts/truetype/dejavu/DejaVuSans-Bold.ttf", siz);
// Destination set by ./configure (in the GitHub repository)
#ifdef FONTDESTDIR
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Hyperbolic Rogue -- special graphical effects, such as the Blizzard
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
namespace hr {
double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
double cellgfxdist(cell *c, int i) {
if(gp::on) return hdist0(tC0(shmup::calc_relative_matrix(c->mov[i], c, i)));
return nonbitrunc ? tessf * gp::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
}
transmatrix cellrelmatrix(cell *c, int i) {
if(gp::on) return shmup::calc_relative_matrix(c->mov[i], c, i);
double d = cellgfxdist(c, i);
return ddspin(c, i) * xpush(d) * iddspin(c->mov[i], c->spin(i), euclid ? 0 : S42);
}
hyperpoint randomPointIn(int t) {
while(true) {
hyperpoint h = spin(2*M_PI*(randd()-.5)/t) * tC0(xpush(asinh(randd())));
double d =
nonbitrunc ? tessf : t == 6 ? hexhexdist : crossf;
if(hdist0(h) < hdist0(xpush(-d) * h))
return spin(2*M_PI/t * (rand() % t)) * h;
}
}
struct snowball {
transmatrix T;
transmatrix global;
snowball *prev;
snowball *next;
double phase;
snowball(int t) { T = rgpushxto0(randomPointIn(t)); phase = randd(); }
};
struct blizzardcell {
cell *c;
int frame;
int tmp;
transmatrix *gm;
char wmap;
int inward, outward, ward;
int qty[MAX_EDGE];
vector<snowball*> inorder, outorder;
int inid, outid;
~blizzardcell() { for(auto i: inorder) delete i; }
};
map<cell*, blizzardcell> blizzardcells;
void set_blizzard_frame(cell *c, int frameid) {
blizzardcells[c].frame = frameid;
}
vector<blizzardcell*> bcells;
int blizzard_N;
blizzardcell* getbcell(cell *c) {
int i = c->listindex;
if(i<0 || i >= blizzard_N) return NULL;
if(bcells[i]->c != c) return NULL;
return bcells[i];
}
void drawBlizzards() {
poly_outline = OUTLINE_NONE;
auto it = blizzardcells.begin();
bcells.clear();
while(it != blizzardcells.end())
if(it->second.frame != frameid || !gmatrix.count(it->first))
it = blizzardcells.erase(it);
else {
it->second.c = it->first;
bcells.push_back(&it->second);
it++;
}
blizzard_N = isize(bcells);
for(int i=0; i<blizzard_N; i++) {
auto& bc = *bcells[i];
bc.tmp = bc.c->listindex,
bc.c->listindex = i;
bc.gm = &gmatrix[bc.c];
bc.wmap = windmap::at(bc.c);
}
for(int i=0; i<blizzard_N; i++) {
auto& bc = *bcells[i];
cell *c = bc.c;
bc.inward = bc.outward = 0;
for(int i=0; i<c->type; i++) {
int& qty = bc.qty[i];
qty = 0;
cell *c2 = c->mov[i];
if(!c2) continue;
auto bc2 = getbcell(c2);
if(!bc2) continue;
int z = (bc2->wmap - bc.wmap) & 255;
if(z >= windmap::NOWINDBELOW && z < windmap::NOWINDFROM)
bc.outward += qty = z / 8;
z = (-z) & 255;
if(z >= windmap::NOWINDBELOW && z < windmap::NOWINDFROM)
bc.inward += z / 8, qty = -z/8;
}
bc.ward = max(bc.inward, bc.outward);
while(isize(bc.inorder) < bc.ward) {
auto sb = new snowball(c->type);
bc.inorder.push_back(sb);
bc.outorder.push_back(sb);
}
for(auto& sb: bc.inorder) sb->prev = sb->next = NULL;
bc.inid = 0;
}
double at = (ticks % 250) / 250.0;
for(int i=0; i<blizzard_N; i++) {
auto& bc = *bcells[i];
for(auto sb: bc.inorder)
sb->global = (*bc.gm) * sb->T;
}
for(int i=0; i<blizzard_N; i++) {
auto& bc = *bcells[i];
cell *c = bc.c;
bc.outid = 0;
for(int d=0; d<c->type; d++) for(int k=0; k<bc.qty[d]; k++) {
auto& bc2 = *getbcell(c->mov[d]);
auto& sball = *bc.outorder[bc.outid++];
auto& sball2 = *bc2.inorder[bc2.inid++];
sball.next = &sball2;
sball2.prev = &sball;
hyperpoint t = inverse(sball.global) * tC0(sball2.global);
double at0 = at + sball.phase;
if(at0>1) at0 -= 1;
transmatrix tpartial = sball.global * rspintox(t) * xpush(hdist0(t) * at0);
if(wmascii || wmblack)
queuechr(tpartial, .2, '.', 0xFFFFFF);
else
queuepoly(tpartial, shSnowball, 0xFFFFFF80);
}
}
for(int ii=0; ii<blizzard_N; ii++) {
auto& bc = *bcells[ii];
/* if(isNeighbor(bc.c, mouseover)) {
if(againstWind(mouseover, bc.c))
queuepoly(*bc.gm, shHeptaMarker, 0x00C00040);
if(againstWind(bc.c, mouseover))
queuepoly(*bc.gm, shHeptaMarker, 0xC0000040);
} */
forCellIdEx(c2, i, bc.c) if(bc.c == mouseover || c2 == mouseover) {
int col = 0x00C00080;
if(c2 == mouseover)
col ^= 0xC0C00000;
if(isPlayerOn(c2))
col ^= 0x00000040;
if(isPlayerOn(bc.c))
col ^= 0x00000040;
if(againstWind(bc.c, c2))
queuepoly(*bc.gm * ddspin(bc.c, i) * xpush(cellgfxdist(bc.c, i)/2), shWindArrow, col);
}
int B = isize(bc.outorder);
if(B<2) continue;
int i = rand() % B;
int j = rand() % (B-1);
if(i==j) j++;
if(1) {
auto& sb1 = *bc.outorder[i];
auto& sb2 = *bc.outorder[j];
double swapcost = 0;
if(sb1.next) swapcost -= hdist(tC0(sb1.global), tC0(sb1.next->global));
if(sb2.next) swapcost -= hdist(tC0(sb2.global), tC0(sb2.next->global));
if(sb1.next) swapcost += hdist(tC0(sb2.global), tC0(sb1.next->global));
if(sb2.next) swapcost += hdist(tC0(sb1.global), tC0(sb2.next->global));
if(swapcost < 0) {
swap(bc.outorder[i], bc.outorder[j]);
swap(sb1.next, sb2.next);
if(sb1.next) sb1.next->prev = &sb1;
if(sb2.next) sb2.next->prev = &sb2;
}
}
if(1) {
auto& sb1 = *bc.inorder[i];
auto& sb2 = *bc.inorder[j];
double swapcost = 0;
if(sb1.prev) swapcost -= hdist(tC0(sb1.global), tC0(sb1.prev->global));
if(sb2.prev) swapcost -= hdist(tC0(sb2.global), tC0(sb2.prev->global));
if(sb1.prev) swapcost += hdist(tC0(sb2.global), tC0(sb1.prev->global));
if(sb2.prev) swapcost += hdist(tC0(sb1.global), tC0(sb2.prev->global));
if(swapcost < 0) {
swap(bc.inorder[i], bc.inorder[j]);
swap(sb1.prev, sb2.prev);
if(sb1.prev) sb1.prev->next = &sb1;
if(sb2.prev) sb2.prev->next = &sb2;
}
}
auto& sbp = *bc.inorder[i];
if(sbp.next && sbp.prev) {
double p1 = sbp.next->phase;
double p2 = sbp.prev->phase;
double d = p2-p1;
if(d<=.5) d+=1;
if(d>=.5) d-=1;
sbp.phase = p1 + d/2;
if(sbp.phase >= 1) sbp.phase -= 1;
if(sbp.phase < 0) sbp.phase += 1;
}
}
for(auto bc: bcells)
bc->c->listindex = bc->tmp;
}
vector<cell*> arrowtraps;
void drawArrowTraps() {
for(cell *c: arrowtraps) {
auto r = traplimits(c);
try {
transmatrix& t0 = gmatrix.at(r[0]);
transmatrix& t1 = gmatrix.at(r[4]);
queueline(tC0(t0), tC0(t1), 0xFF0000FF, 4, PPR_ITEM);
if((c->wparam & 7) == 3 && !shmup::on) {
// queueline(t0 * randomPointIn(r[0]->type), t1 * randomPointIn(r[1]->type), 0xFFFFFFFF, 4, PPR_ITEM);
int tt = ticks % 401;
if(tt < 0) tt += 401;
for(int u=0; u<2; u++) {
transmatrix& tu = u ? t0 : t1;
transmatrix& tv = u ? t1 : t0;
hyperpoint trel = inverse(tu) * tC0(tv);
transmatrix tpartial = tu * rspintox(trel) * xpush(hdist0(trel) * tt / 401.0);
queuepoly(tpartial * ypush(.05), shTrapArrow, 0xFFFFFFFF);
}
}
}
catch(out_of_range&) {}
}
}
auto ccm_blizzard = addHook(clearmemory, 0, [] () {
arrowtraps.clear();
blizzardcells.clear();
bcells.clear();
}) +
addHook(hooks_removecells, 0, [] () {
eliminate_if(arrowtraps, is_cell_removed);
});
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
namespace hr {
static const int motypes = 162;
struct monstertype {
char glyph;
int color;
const char *name;
const char *help;
};
enum eMonster {
moNone,
moYeti, moWolf, moWolfMoved,
moRanger,
moTroll, moGoblin,
moWorm, moWormtail, moWormwait, moHedge,
moDesertman,
moIvyRoot, moIvyHead, moIvyBranch, moIvyWait, moIvyNext, moIvyDead,
moMonkey,
moSlime,
moMimic, moREMOVED, moGolem, moGolemMoved,
moEagle, moSeep,
moZombie, moGhost, moNecromancer, moShadow,
moTentacle, moTentacletail, moTentaclewait, moTentacleEscaping,
moCultist, moPyroCultist,
moGreater, moGreaterM, moLesser, moLesserM,
moShark, moRunDog, moGreaterShark, moFireFairy,
moCrystalSage, moLancer, moFlailer, moMiner,
moVineBeast, moVineSpirit, moDarkTroll, moEarthElemental,
moBug0, moBug1, moBug2,
moWitch, moWitchSpeed, moWitchFlash, moWitchFire, moWitchWinter, moWitchGhost,
moEvilGolem, moKnight, moCultistLeader, moSlimeNextTurn, moKnightMoved,
moIllusion,
moPirate, moCShark, moParrot,
moHexSnake, moHexSnakeTail, moRedTroll, moBomberbird, moAlbatross,
moTameBomberbird, moTameBomberbirdMoved,
moPalace, moFatGuard, moSkeleton, moVizier,
moViking, moFjordTroll, moWaterElemental,
moMouse, moMouseMoved,
moPrincess, moPrincessMoved,
moPrincessArmed, moPrincessArmedMoved,
moFamiliar, moGargoyle, moFireElemental, moAirElemental,
moOrangeDog, moTentacleGhost,
moMetalBeast, moMetalBeast2, moOutlaw, moMutant,
moStormTroll, moForestTroll,
moRedFox, moWindCrow, moFriendlyGhost, moRatling, moFalsePrincess, moRoseLady,
moRoseBeauty, moRatlingAvenger,
moTortoise, moDragonHead, moDragonTail,
moGadfly, moResearcher, moSparrowhawk,
moKrakenH, moKrakenT, moDraugr, moFriendlyIvy,
moVampire, moBat, moReptile,
moHerdBull, moRagingBull, moSleepBull,
moButterfly, moNarciss, moMirrorSpirit,
moHunterDog, moTerraWarrior, moJiangshi, moVoidBeast, moLavaWolf, moHunterGuard,
moIceGolem, moSandBird, moSalamander, moHunterChanging,
moNorthPole, moSouthPole,
moPair, moHexDemon, moAltDemon, moMonk, moCrusher,
moSwitch1, moSwitch2,
// shmup specials
moPlayer, moBullet, moFlailBullet, moFireball, moTongue, moAirball, moCrushball,
// temporary
moDeadBug, moLightningBolt, moDeadBird, moEnergySword, moWarning, moArrowTrap,
moRogueviz
};
struct genderswitch_t {
int gender;
eMonster m;
const char *name;
const char *desc;
};
#define NUM_GS 6
static const int ittypes = 130;
struct itemtype {
char glyph;
int color;
const char *name;
const char *help;
};
enum eItem {
itNone, itDiamond, itGold, itSpice, itRuby, itElixir, itShard, itBone, itHell, itStatue,
itFeather, itSapphire, itHyperstone, itKey,
itGreenStone, itOrbYendor,
itOrbLightning, itOrbFlash, itOrbWinter, itOrbSpeed, itOrbLife, itOrbShield, itOrbDigging,
itOrbTeleport, itOrbSafety,
itOrbThorns, itFernFlower,
itWine, itOrbAether, itSilver, itOrbPsi,
itRoyalJelly, itEmerald, itOrbInvis, itPower, itOrbFire,
itHolyGrail, itGrimoire,
itOrbDragon, itOrbIllusion,
itPirate, itCompass,
itRedGem, itOrbTime, itOrbSpace,
itBombEgg, itCoast, itWhirlpool,
itOrbFriend, itOrbWater, itOrbAir,
itPalace, itOrbFrog,
itFjord, itOrbFish,
itOrbDiscord,
itSavedPrincess, itOrbLove,
itIvory, itZebra,
itFireShard, itAirShard, itEarthShard, itWaterShard,
itElemental, itOrbSummon, itOrbMatter,
itBounty, itRevolver, itFulgurite, itMutant,
itOrbStunning, itOrbLuck,
itMutant2, itOrbFreedom, itLotus, itOrbUndeath,
itWindstone, itOrbEmpathy, itStrongWind, itBuggy, itBuggy2,
itRose, itCoral, itOrbBeauty, itOrb37, itOrbEnergy,
itBabyTortoise, itOrbShell, itApple, itDragon, itOrbDomination,
itOrbSword, itKraken, itOrbSword2, itBarrow,
itTrollEgg, itWarning, itOrbStone, itOrbNature, itTreat,
itSlime, itAmethyst, itOrbRecall, itDodeca, itOrbDash, itGreenGrass, itOrbHorns,
itOrbBull, itBull, itOrbMirror,
itInventory,
itLavaLily, itHunting, itBlizzard, itTerra,
itOrbSide1, itOrbSide2, itOrbSide3,
itOrbLava, itOrbMorph, itGlowCrystal, itSnake,
itDock, itRuins, itMagnet, itSwitch,
itOrbPhasing, itOrbMagnetism, itOrbSlaying
};
static const int walltypes = 109;
struct walltype {
char glyph;
int color;
const char *name;
const char *help;
};
enum eWall { waNone, waIcewall, waBarrier, waFloorA, waFloorB, waCavewall, waCavefloor, waDeadTroll, waDune,
waMirror, waCloud, waThumperOff, waFire, waAncientGrave, waFreshGrave, waColumn, waSulphurC, waSulphur,
waLake, waFrozenLake, waChasm, waChasmD, waBigTree, waSmallTree,
waVinePlant, waVineHalfA, waVineHalfB, waPartialFire,
waDeadwall, waDeadfloor, waDeadfloor2, waWaxWall, waGlass, waCamelot, waRoundTable,
waCamelotMoat,
waBigStatue,
waSea, waBoat, waCIsland, waCIsland2, waCTree,
waRed1, waRed2, waRed3,
waMineUnknown, waMineMine, waMineOpen,
waStrandedBoat,
waPalace, waClosedGate, waOpenGate, waClosePlate, waOpenPlate, waTrapdoor,
waGiantRug,
waPlatform, waGargoyle, waGargoyleFloor, waRubble, waLadder, waStone,
waBonfireOff, waThumperOn, waEternalFire,
waGargoyleBridge,
waTempWall, waTempFloor, waTempBridge,
waCharged, waGrounded, waSandstone, waSaloon, waMetal,
waDeadTroll2, waFan,
waTemporary, waEarthD, waElementalTmp, waElementalD,
waSlime1, waSlime2, waRose, waWarpGate,
waTrunk, waSolidBranch, waWeakBranch, waCanopy,
waBarrowWall, waBarrowDig,
waPetrified, waTower,
waBigBush, waSmallBush,
waReptile, waReptileBridge,
waInvisibleFloor,
waMirrorWall,
waPetrifiedBridge,
waTempBridgeBlocked,
waTerraWarrior, waBubble,
waArrowTrap, waMercury, waMagma,
waDock, waBurningDock, waRuinWall, waBrownian
};
static const int landtypes = 85;
struct landtype {
int color;
const char *name;
const char *help;
};
enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle, laAlchemist, laMirror, laGraveyard,
laRlyeh, laHell, laCocytus, laMotion, laDryForest, laEmerald, laWineyard, laDeadCaves,
laHive, laPower, laCamelot, laTemple,
laCrossroads2, laCaribbean, laRedRock, laMinefield, laOcean, laWhirlpool,
laPalace, laLivefjord,
laIvoryTower, laZebra, laEFire, laEAir, laEEarth, laEWater, laCrossroads3,
laOceanWall, laElementalWall,
laCanvas, laPrincessQuest,
laWildWest, laStorms, laOvergrown, laClearing,
laHaunted, laHauntedWall, laHauntedBorder,
laWhirlwind, laRose, laWarpCoast, laWarpSea, laCrossroads4,
laEndorian, laTortoise, laDragon,
laKraken, laBurial, laTrollheim,
laHalloween, laDungeon, laMountain, laReptile,
laPrairie, laBull, laCrossroads5, laCA,
laMirrorWall, laMirrored, laMirrorWall2, laMirrored2,
laMirrorOld,
laVolcano, laBlizzard, laHunting, laTerracotta, laMercuryRiver,
laDual, laSnakeNest, laDocks, laRuins, laMagnetic,
laSwitch, laMemory, laBrownian
};
enum eGeometry {
gNormal, gEuclid, gSphere, gElliptic, gZebraQuotient, gFieldQuotient, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gSmallElliptic,
gKleinQuartic, gBolza, gBolza2, gMinimal,
gGUARD};
enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere };
struct geometryinfo {
const char* name;
const char* shortname;
int sides;
int vertex;
int quotientstyle;
eGeometryClass cclass;
int xcode;
std::array<int,2> distlimit; // bitrunc, non-bitrunc
};
static const int qSMALL = 1;
static const int qFIELD = 2;
static const int qNONORIENTABLE = 4;
static const int qTORUS = 8;
static const int qDOCKS = 16;
static const int qZEBRA = 32;
// note: dnext assumes that x&7 equals 7
static const int SEE_ALL = 15;
static const int FORBIDDEN = -1;
extern eGeometry geometry;
extern geometryinfo ginf[gGUARD];
extern monstertype minf[motypes];
extern itemtype iinf[ittypes];
extern const landtype linf[landtypes];
enum cpatterntype {
cpFootball, cpThree, cpChess, cpSingle, cpLarge, cpZebra, cpUnknown
};
struct landtacinfo { eLand l; int tries, multiplier; };
}
This diff is collapsed.
// Usage:
// * compile hyper.cpp with CU == 0
// * compile init.cpp with CU == 1
// * link them.
// Only the parts defined in #if IN_CU(1) will be included in the second compiling.
#ifndef CU
#define IN_CU(x) 1
#else
#define IN_CU(x) (CU == x)
#endif
#include "sysconfig.h"
#include "classes.h"
#include "hyper.h"
#if CAP_ROGUEVIZ
#include "rogueviz.h"
#endif
#define CU_INIT IN_CU(0)
#define CU_HYPER IN_CU(0)
#if IN_CU(0)
#include "classes.cpp"
#endif
#if IN_CU(0)
#include "shaders.cpp"
#include "util.cpp"
#include "hyperpoint.cpp"
#include "patterns.cpp"
#include "fieldpattern.cpp"
#include "heptagon.cpp"
#include "language.cpp"
#include "cell.cpp"
#include "goldberg.cpp"
#include "pattern2.cpp"
#include "flags.cpp"
#include "yendor.cpp"
#include "complex.cpp"
#include "savemem.cpp"
#include "game.cpp"
#include "orbgen.cpp"
#include "monstergen.cpp"
#include "landlock.cpp"
#include "landgen.cpp"
#include "orbs.cpp"
#if CAP_INV
#include "inventory.cpp"
#else
namespace hr { namespace inv { bool on, activating; } }
#endif
#include "system.cpp"
#include "debug.cpp"
#include "geometry.cpp"
#include "polygons.cpp"
#include "floorshapes.cpp"
#include "mapeditor.cpp"
#if CAP_MODEL
#include "netgen.cpp"
#endif
#if CAP_TABFONT || CAP_CREATEFONT
#include "nofont.cpp"
#endif
#include "basegraph.cpp"
#include "renderbuffer.cpp"
#include "help.cpp"
#include "config.cpp"
#include "scores.cpp"
#include "dialogs.cpp"
#include "menus.cpp"
#include "geom-exp.cpp"
#include "quit.cpp"
#include "shmup.cpp"
#if CAP_ROGUEVIZ
#include "rogueviz.cpp"
#endif
#include "conformal.cpp"
#include "rug.cpp"
#include "control.cpp"
#include "hud.cpp"
#include "hypgraph.cpp"
#include "textures.cpp"
#include "graph.cpp"
#include "blizzard.cpp"
#include "sound.cpp"
#include "achievement.cpp"
#include "barriers.cpp"
#include "surface.cpp"
#if CAP_TOUR
#include "tour.cpp"
#endif
#include "commandline.cpp"
#include "bigstuff.cpp"
#if CAP_DAILY
#include "private/daily.cpp"
#else
namespace hr { namespace daily { bool on; } }
#endif
#endif
#if IN_CU(1)
#endif
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
// Hyperbolic Rogue -- fake mobile target
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
#define ISFAKEMOBILE 1
#define MOBPAR_FORMAL int
#define MOBPAR_ACTUAL 0
#define MIX_MAX_VOLUME 128
const char *scorefile = "fakemobile_score.txt";
const char *conffile = "fakemobile_config.txt";
#include <string>
std::string levelfile = "fakemobile_level.txt";
std::string picfile = "fakemobile_pic.txt";
namespace hr {
const char *scorefile = "fakemobile_score.txt";
const char *conffile = "fakemobile_config.txt";
std::string levelfile = "fakemobile_level.txt";
std::string picfile = "fakemobile_pic.txt";
}
#include <SDL/SDL.h>
#include "init.cpp"
using namespace hr;
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_gfxPrimitives.h>
#undef main
transmatrix getOrientation() { return Id; }
void playSound(cell *c, const string& fname, int vol) {
printf("Play sound: %s\n", fname.c_str());
}
......@@ -69,13 +77,13 @@ bool rawdisplaystr(int x, int y, int shift, int size, const char *str, int color
}
int textwidth(int siz, const string &str) {
if(size(str) == 0) return 0;
if(isize(str) == 0) return 0;
if(!font[siz]) font[siz] = TTF_OpenFont("VeraBd.ttf", siz);
int w, h;
TTF_SizeUTF8(font[siz], str.c_str(), &w, &h);
// printf("width = %d [%d]\n", w, size(str));
// printf("width = %d [%d]\n", w, isize(str));
return w;
}
......@@ -110,11 +118,13 @@ int main(int argc, char **argv) {
int mx = 0; int my = 0; bool _clicked = false;
firstland = laMinefield;
inv::on = true;
// firstland = laMinefield;
// activateSafety(laWhirlwind);
items[itGreenStone] = 100;
items[itDiamond] = 50;
for(int i=1; i<10; i++) kills[i] = 5;
// items[itDiamond] = 50;
// for(int i=1; i<10; i++) kills[i] = 5;
while(true) {
......@@ -130,7 +140,7 @@ int main(int argc, char **argv) {
action = 0;
gdpos = 0;
while(gdpos < size(graphdata)) {
while(gdpos < isize(graphdata)) {
switch(gdpop()) {
case 2: {
int x = gdpop(), y = gdpop(), al = gdpop();
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -35,6 +35,9 @@ static void png_write_SDL(png_structp png_ptr, png_bytep data, png_size_t length
SDL_RWwrite(rw, data, sizeof(png_byte), length);
}
#ifdef __cplusplus
extern "C"
#endif
SDL_Surface *SDL_PNGFormatAlpha(SDL_Surface *src)
{
SDL_Surface *surf;
......@@ -56,6 +59,9 @@ SDL_Surface *SDL_PNGFormatAlpha(SDL_Surface *src)
return surf;
}
#ifdef __cplusplus
extern "C"
#endif
int SDL_SavePNG_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst)
{
png_structp png_ptr;
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.