1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158
|
/*
This file is part of Advanced Strategic Command; http://www.asc-hq.de
Copyright (C) 1994-1999 Martin Bickel and Marc Schellenberger
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
*/
#include <malloc.h>
#include <stdio.h>
#include "..\tpascal.inc"
#include "..\typen.h"
#include "..\vesa.h"
#include "..\loadpcx.h"
#include "..\krkr.h"
#include "..\sgstream.h"
#include "..\misc.h"
#include "..\stack.h"
// const char* direcs[8] = { "oben","rechts oben","rechts","rechts unten","unten","links unten","links","links oben" };
dacpalette256 pal;
int lastid = 78;
char movemalus = 10;
int weather = 3;
tfile datfile;
int main(int argc, char *argv[] )
{
t_carefor_containerstream cfcst;
loadpalette();
settxt50mode ();
char cont;
int trn = 0;
printf ("\n wetter: \n");
num_ed ( weather, 0, 4 );
printf ("\n terrain type: \n");
bitselect ( trn, cbodenarten, cbodenartennum );
do {
lastid++;
settxt50mode ();
char pict = YES; // Bilder einlesen
char dif = 1; // Anzahl der Bilder
char maxmovement = 0;
_settextcolor (7);
_setbkcolor (0);
clearscreen ();
initsvga (0x101);
int bi_picture;
void* picture;
getbi3pict_double ( &bi_picture, &picture );
closesvga();
settxt50mode ();
printf ("\n ID : \n");
num_ed ( lastid , 0, 65534);
pterraintype bdt = NULL;
char name[1000];
{
tfindfile ff ( "*.trr" );
char *c = ff.getnextname();
while( c ) {
bdt = loadbodentyp( c );
if ( bdt->id == lastid ) {
strcpy ( name, c );
break;
}
c = ff.getnextname();
}
}
if ( bdt->id == lastid ) {
bdt->weather[weather] = new twterraintype;
memset ( bdt->weather[weather], 0, sizeof ( *bdt->weather[weather] ));
bdt->weather[weather]->art = bdt->weather[0]->art ;
bdt->weather[weather]->defensebonus = 0;
bdt->weather[weather]->attackbonus = 0;
bdt->weather[weather]->basicjamming = 0;
bdt->weather[weather]->movemaluscount = 1;
bdt->weather[weather]->movemalus = &movemalus;
bdt->weather[weather]->bi_picture[0] = bi_picture;
bdt->weather[weather]->picture[0] = picture;
asfasf {
tn_file_buf_stream mainstream ( name, 2 );
mainstream.writedata ( ( char*) bdt, sizeof ( *bdt ));
mainstream.writepchar( bdt->name );
for (int i=0;i<cwettertypennum ;i++ ) {
if ( bdt->weather[i] ) {
mainstream.writedata ( ( char*) bdt->weather[i], sizeof ( *(bdt->weather[i]) ));
mainstream.writedata ( bdt->weather[i]->movemalus, bdt->weather[i]->movemaluscount );
for ( int j = 0; j < 8; j++ ) {
if ( bdt->weather[i]->picture[j] && bdt->weather[i]->bi_picture[j] == -1 ) {
mainstream.writedata ( ( char*) bdt->weather[i]->picture[j], fieldsize );
}
}
if ( bdt->weather[i]->quickview )
mainstream.writedata ( ( char*) bdt->weather[i]->quickview, sizeof ( *bdt->weather[i]->quickview ));
}
}
}
printf(" %s written\n", name );
} else
printf("not found !\n");
yn_switch (" continue ", " Exit ", 0, 1, cont);
} while ( cont==0 ); /* enddo */
return 0;
}
|