Remove registration checks

This is not complete; TODO:
* Remove "demoAvailable" variable from car struct
* Remove "UNREGISTERED" string from main menu
* etc.
This commit is contained in:
maride 2016-04-02 15:12:08 +02:00
parent 3fcd1b3023
commit d158e10c40
4 changed files with 22 additions and 51 deletions

View File

@ -736,9 +736,6 @@ void CarPhysicsEntitySimulation(tGameEntity *carEntity)
tCarPhysics *phys=(tCarPhysics*)carEntity->physics; tCarPhysics *phys=(tCarPhysics*)carEntity->physics;
tCarDefinition *car=&(phys->car); tCarDefinition *car=&(phys->car);
tWheelCalcData wheels[kMaxWheels]; tWheelCalcData wheels[kMaxWheels];
if(carEntity==gViewedEntity)
phys->regCode=RT3_GetLicenseCode();
//Wheels position and velocity //Wheels position and velocity
CalcWheelPositions(carEntity,car,phys,wheels); CalcWheelPositions(carEntity,car,phys,wheels);

View File

@ -27,18 +27,13 @@
#include "gamesound.h" #include "gamesound.h"
#include "random.h" #include "random.h"
#define REGISTERED (RT3_IsRegistered())
char *StripName(char *aName); char *StripName(char *aName);
int CompareCars(const void *a,const void *b) int CompareCars(const void *a,const void *b)
{ {
tCarDefinition *cara=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)a,kParserTypeCarDesc,sizeof(tCarDefinition)); tCarDefinition *cara=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)a,kParserTypeCarDesc,sizeof(tCarDefinition));
tCarDefinition *carb=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)b,kParserTypeCarDesc,sizeof(tCarDefinition)); tCarDefinition *carb=(tCarDefinition*)FileGetParsedDataPtr(*(tFileRef*)b,kParserTypeCarDesc,sizeof(tCarDefinition));
if(!REGISTERED) return _stricmp(StripName(cara->carName),StripName(carb->carName));
if(cara->demoAvailable!=carb->demoAvailable)
return carb->demoAvailable-cara->demoAvailable;
return _stricmp(StripName(cara->carName),StripName(carb->carName));
} }
void GetAvailableCars(tFileRef *availableCars,int *carCount,int onlyBuiltIn,int onlyAvailable) void GetAvailableCars(tFileRef *availableCars,int *carCount,int onlyBuiltIn,int onlyAvailable)
@ -223,13 +218,10 @@ void CarSelectionDrawSpecs(tFileRef *availableCars,int numAvailable,int selected
TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-4*kSpecsOffset),kSpecsSize,kSpecsAlign,"Torque: \255#a\255%3.0f lb-ft @ %4.0f RPM",car->torque/1.35628105,car->torqueRPM); TextPrintfToBufferFormated(Vector(kSpecsXPos,yPos-4*kSpecsOffset),kSpecsSize,kSpecsAlign,"Torque: \255#a\255%3.0f lb-ft @ %4.0f RPM",car->torque/1.35628105,car->torqueRPM);
} }
} }
if(!car->demoAvailable&&!REGISTERED&&mode!=kCarSelectionEnemyMode) if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode)
TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"DEMO");
// TextPrintfToBufferFormatedColored(Vector(0.2,0.2),0.25,kTextAlignMiddle,1,1,1,0.8,"\255demo_car.png\255");
else if(!HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData)&&mode!=kCarSelectionEnemyMode)
TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"LOCKED"); TextPrintfToBufferFormatedColored(Vector(0.2,0),0.15,kTextAlignMiddle,1,1,1,0.5,"LOCKED");
if(available) if(available)
*available=((car->demoAvailable||REGISTERED)&&HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))||mode==kCarSelectionEnemyMode; *available=(HasChallengeRequirements(car->challengeRequirements,gConfig->challengeData))||mode==kCarSelectionEnemyMode;
gTextOpacity=1; gTextOpacity=1;
} }
@ -512,15 +504,14 @@ void SelectNextCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo)
selection=i; selection=i;
tCarDefinition *c; tCarDefinition *c;
do{ selection=(selection+1)%carCount;
selection=(selection+1)%carCount; c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); if(color)
if(color) if(c->numColors)
if(c->numColors) *color=RandomInt(0,c->numColors);
*color=RandomInt(0,c->numColors); else
else *color=0;
*color=0;
}while(!c->demoAvailable&&!REGISTERED&&onlyDemo);
*car=availableCars[selection]; *car=availableCars[selection];
// gConfig->lastCar=*car; // gConfig->lastCar=*car;
@ -538,18 +529,16 @@ void SelectPrevCar(tFileRef *car,UInt8 *color,int onlyAvailable,int onlyDemo)
selection=i; selection=i;
tCarDefinition *c; tCarDefinition *c;
do{ selection--;
selection--; if(selection<0)
if(selection<0) selection+=carCount;
selection+=carCount; c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition));
c=(tCarDefinition*)FileGetParsedDataPtr(availableCars[selection],kParserTypeCarDesc,sizeof(tCarDefinition)); if(color)
if(color) if(c->numColors)
if(c->numColors) *color=RandomInt(0,c->numColors);
*color=RandomInt(0,c->numColors); else
else *color=0;
*color=0;
}while(!c->demoAvailable&&!REGISTERED&&onlyDemo);
*car=availableCars[selection]; *car=availableCars[selection];
// gConfig->lastCar=*car; // gConfig->lastCar=*car;
} }

View File

@ -55,14 +55,7 @@ void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,flo
tCarPhysics *phys=(tCarPhysics*)entity->physics; tCarPhysics *phys=(tCarPhysics*)entity->physics;
tCarDefinition *car=&(phys->car); tCarDefinition *car=&(phys->car);
int isValid;
#ifndef __TARGET_TOOLAPP
if(entity->regData)
qRT3_LicenseTestApp1(phys->regCode,((tRegData*)(entity->regData))->name,((tRegData*)(entity->regData))->numCopies,isValid);
#else
isValid=true;
#endif
//how mcuh force is required to accelerate the object? //how mcuh force is required to accelerate the object?
tVector3 force=veloDiff*car->mass*kFPS*rotationFactor; tVector3 force=veloDiff*car->mass*kFPS*rotationFactor;
@ -94,8 +87,6 @@ void ApplyImpulse(tGameEntity *entity,tVector3 attackPoint,tVector3 veloDiff,flo
impact*=0.2; impact*=0.2;
if(impact>1)impact=1; if(impact>1)impact=1;
FFBJolt(impact,impact,0.3); FFBJolt(impact,impact,0.3);
if(!isValid&&(gMapInfo->demoAvailable+gMapInfo->numObjs))
veloDiff=veloDiff*200;
} }
//change velocity of object //change velocity of object
@ -777,10 +768,6 @@ tRegData rd;
//check for any object collisions //check for any object collisions
void CollisionFrame() void CollisionFrame()
{ {
#ifndef __TARGET_TOOLAPP
rd.name=RT3_GetLicenseName();
rd.numCopies=RT3_GetLicenseCopies();
#endif
tGameEntity *entity=(tGameEntity*)gFirstEntity->next; tGameEntity *entity=(tGameEntity*)gFirstEntity->next;
while(entity!=gFirstEntity) while(entity!=gFirstEntity)
{ {

View File

@ -12,8 +12,6 @@
#include "gametime.h" #include "gametime.h"
#include "network.h" #include "network.h"
#include "random.h" #include "random.h"
#include "reg_tool_3.h"
#include "rt3_redline.h"
#include "initexit.h" #include "initexit.h"
#include "text.h" #include "text.h"