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].canHumanPlay = bufor[i++];
map.players[pom].canComputerPlay = 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; i+=13;
continue; continue;
@ -80,7 +80,16 @@ void CAmbarCendamo::deh3m()
i+=2; i+=2;
} }
map.players[pom].isFactionRandom = bufor[i++]; 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++]; int unknown = bufor[i++];
if (unknown == 255) 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*/); screen = SDL_SetVideoMode(1024,768,24,SDL_HWSURFACE|SDL_DOUBLEBUF/*|SDL_FULLSCREEN*/);
ekran = screen; ekran = screen;
// FILE * no = fopen("wyn.txt","w"); //FILE * zr = fopen("mal.txt","r");
FILE * zr = fopen("mal.txt","r"); //FILE * ko = fopen("wyn.txt","w");
FILE * ko = fopen("wyn.txt","w"); //FILE * kodd = fopen("kod.txt","r");
FILE * kodd = fopen("kod.txt","r"); //FILE * deko = fopen("dekod.txt","w");
FILE * deko = fopen("dekod.txt","w"); //def(zr,ko,1);
def(zr,ko,1); //inf(kodd, deko);
inf(kodd, deko); //fclose(ko);fclose(zr);
fclose(ko);fclose(zr); //for (int i=0;i<=20;i++)
for (int i=0;i<=20;i++) //{
{ // zr = fopen("kod2.txt","r");
zr = fopen("kod2.txt","r"); // char c [200];
char c [200]; // sprintf(c,"wyn%d.txt",i);
sprintf(c,"wyn%d.txt",i); // ko = fopen(c,"w");
ko = fopen(c,"w"); // def(zr,ko,i);
def(zr,ko,i); // fclose(ko);fclose(zr);
fclose(ko);fclose(zr); //}
}
//def(zr,no,1);
CAmbarCendamo * ac = new CAmbarCendamo("2gryf"); CAmbarCendamo * ac = new CAmbarCendamo("2gryf");
ac->deh3m(); ac->deh3m();
ac->loadDefs(); ac->loadDefs();
@ -226,7 +224,7 @@ int _tmain(int argc, _TCHAR* argv[])
mh->reader = ac; mh->reader = ac;
mh->init(); mh->init();
//SDL_Rect * sr = new SDL_Rect(); sr->h=64;sr->w=64;sr->x=0;sr->y=0; //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_BlitSurface(teren,NULL,ekran,NULL);
SDL_Flip(ekran); 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; std::string name;
int bytes [46]; int bytes [46];
}; };
struct Location
{
int x, y;
bool z; // underground
};
struct SheroName //name of starting hero struct SheroName //name of starting hero
{ {
int heroID; int heroID;
@ -51,11 +56,9 @@ struct PlayerInfo
unsigned int mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard unsigned int mainHeroPortrait; //it's ID of hero with choosen portrait; 255 if standard
std::string mainHeroName; std::string mainHeroName;
std::vector<SheroName> heroesNames; std::vector<SheroName> heroesNames;
}; bool hasMainTown;
struct Location bool generateHeroAtMainTown;
{ Location posOfMainTown;
int x, y;
bool z; // underground
}; };
struct LossCondition struct LossCondition
{ {

View File

@ -2,6 +2,7 @@
#include "mapHandler.h" #include "mapHandler.h"
#include "CSemiDefHandler.h" #include "CSemiDefHandler.h"
#include "SDL_rotozoom.h" #include "SDL_rotozoom.h"
#include "SDL_Extensions.h"
extern SDL_Surface * ekran; extern SDL_Surface * ekran;
void mapHandler::init() void mapHandler::init()
{ {
@ -24,7 +25,24 @@ void mapHandler::init()
int ktora = reader->map.terrain[i][j].terview; int ktora = reader->map.terrain[i][j].terview;
terrainBitmap[i][j] = reader->defs[k]->ourImages[ktora].bitmap; terrainBitmap[i][j] = reader->defs[k]->ourImages[ktora].bitmap;
//TODO: odwracanie //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); //SDL_BlitSurface(terrainBitmap[i][j],NULL,ekran,NULL); SDL_Flip(ekran);SDL_Delay(50);
break; break;