1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Specyfikacja:

- Nowe odkrycia w graczach, związane z głównymi zamkami.

VCMI:
- Poprawne obracanie terenu
- Zczytywanie informacji o głównych miastach. DUŻO więcej map dzięki temu obsługuje.
- nie krzaczy się na małych mapach
- Uaktualniony exek
This commit is contained in:
Michał W. Urbańczyk 2007-06-07 01:46:25 +00:00
parent 35ba2ff9e8
commit 551a843ce3
6 changed files with 55 additions and 27 deletions

View File

@ -61,7 +61,7 @@ void CAmbarCendamo::deh3m()
{
map.players[pom].canHumanPlay = bufor[i++];
map.players[pom].canComputerPlay = bufor[i++];
if (!(map.players[pom].canHumanPlay || map.players[pom].canComputerPlay))
if ((!(map.players[pom].canHumanPlay || map.players[pom].canComputerPlay)) || (!map.areAnyPLayers))
{
i+=13;
continue;
@ -80,7 +80,16 @@ void CAmbarCendamo::deh3m()
i+=2;
}
map.players[pom].isFactionRandom = bufor[i++];
i+=2; //unknown bytes
map.players[pom].hasMainTown = bufor[i++];
if (map.players[pom].hasMainTown)
{
map.players[pom].generateHeroAtMainTown = bufor[i++];
i++; //unknown byte
map.players[pom].posOfMainTown.x = bufor[i++];
map.players[pom].posOfMainTown.y = bufor[i++];
map.players[pom].posOfMainTown.z = bufor[i++];
}
i++; //unknown byte
int unknown = bufor[i++];
if (unknown == 255)
{

36
CMT.cpp
View File

@ -201,24 +201,22 @@ int _tmain(int argc, _TCHAR* argv[])
screen = SDL_SetVideoMode(1024,768,24,SDL_HWSURFACE|SDL_DOUBLEBUF/*|SDL_FULLSCREEN*/);
ekran = screen;
// FILE * no = fopen("wyn.txt","w");
FILE * zr = fopen("mal.txt","r");
FILE * ko = fopen("wyn.txt","w");
FILE * kodd = fopen("kod.txt","r");
FILE * deko = fopen("dekod.txt","w");
def(zr,ko,1);
inf(kodd, deko);
fclose(ko);fclose(zr);
for (int i=0;i<=20;i++)
{
zr = fopen("kod2.txt","r");
char c [200];
sprintf(c,"wyn%d.txt",i);
ko = fopen(c,"w");
def(zr,ko,i);
fclose(ko);fclose(zr);
}
//def(zr,no,1);
//FILE * zr = fopen("mal.txt","r");
//FILE * ko = fopen("wyn.txt","w");
//FILE * kodd = fopen("kod.txt","r");
//FILE * deko = fopen("dekod.txt","w");
//def(zr,ko,1);
//inf(kodd, deko);
//fclose(ko);fclose(zr);
//for (int i=0;i<=20;i++)
//{
// zr = fopen("kod2.txt","r");
// char c [200];
// sprintf(c,"wyn%d.txt",i);
// ko = fopen(c,"w");
// def(zr,ko,i);
// fclose(ko);fclose(zr);
//}
CAmbarCendamo * ac = new CAmbarCendamo("2gryf");
ac->deh3m();
ac->loadDefs();
@ -226,7 +224,7 @@ int _tmain(int argc, _TCHAR* argv[])
mh->reader = ac;
mh->init();
//SDL_Rect * sr = new SDL_Rect(); sr->h=64;sr->w=64;sr->x=0;sr->y=0;
SDL_Surface * teren = mh->terrainRect(0,0,55,25);
SDL_Surface * teren = mh->terrainRect(0,0,32,32);
SDL_BlitSurface(teren,NULL,ekran,NULL);
SDL_Flip(ekran);

BIN
VCMI.exe

Binary file not shown.

BIN
h3m.txt

Binary file not shown.

13
map.h
View File

@ -36,6 +36,11 @@ struct DefInfo //information from def declaration
std::string name;
int bytes [46];
};
struct Location
{
int x, y;
bool z; // underground
};
struct SheroName //name of starting hero
{
int heroID;
@ -51,11 +56,9 @@ struct PlayerInfo
unsigned int mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard
std::string mainHeroName;
std::vector<SheroName> heroesNames;
};
struct Location
{
int x, y;
bool z; // underground
bool hasMainTown;
bool generateHeroAtMainTown;
Location posOfMainTown;
};
struct LossCondition
{

View File

@ -2,6 +2,7 @@
#include "mapHandler.h"
#include "CSemiDefHandler.h"
#include "SDL_rotozoom.h"
#include "SDL_Extensions.h"
extern SDL_Surface * ekran;
void mapHandler::init()
{
@ -24,7 +25,24 @@ void mapHandler::init()
int ktora = reader->map.terrain[i][j].terview;
terrainBitmap[i][j] = reader->defs[k]->ourImages[ktora].bitmap;
//TODO: odwracanie
switch ((reader->map.terrain[i][j].siodmyTajemniczyBajt)%4)
{
case 1:
{
terrainBitmap[i][j] = CSDL_Ext::rotate01(terrainBitmap[i][j]);
break;
}
case 2:
{
terrainBitmap[i][j] = CSDL_Ext::hFlip(terrainBitmap[i][j]);
break;
}
case 3:
{
terrainBitmap[i][j] = CSDL_Ext::rotate03(terrainBitmap[i][j]);
break;
}
}
//SDL_BlitSurface(terrainBitmap[i][j],NULL,ekran,NULL); SDL_Flip(ekran);SDL_Delay(50);
break;