Expert Analysis: St. Mirren vs Dundee United
The upcoming match between St. Mirren and Dundee United is anticipated to be a closely contested affair, with both teams showing strong defensive capabilities. The odds suggest a balanced encounter, with various betting markets indicating potential outcomes.
Betting Insights
- Home Team Not To Score In 2nd Half: 84.10 – The likelihood of St. Mirren not scoring in the second half is high, suggesting a robust Dundee United defense or a strategic play by St. Mirren to focus on defense.
St. Mirren
WDLLL
-
Dundee United
LDDLD
Date: 2025-12-06
Time: 15:00
(FT)
(FT)
Venue: The SMISA Stadium
Score: 2-0
Predictions:
| Market | Prediction | Odd | Result |
|---|---|---|---|
| Home Team Not To Score In 2nd Half | 84.10% | (2-0) | |
| Over 0.5 Goals HT | 81.50% | (2-0) 1-0 1H 1.40 | |
| Both Teams Not To Score In 1st Half | 80.80% | (2-0) 1-0 1H 1.18 | |
| Over 1.5 Goals | 72.90% | (2-0) 1.29 | |
| Both Teams Not To Score In 2nd Half | 71.10% | (2-0) 1-0 2H 1.33 | |
| Away Team To Score In 2nd Half | 69.50% | (2-0) | |
| Over 4.5 Cards | 65.00% | (2-0) 4 cards 1.95 | |
| Under 2.5 Goals | 64.60% | (2-0) 1.91 | |
| Last Goal 73+ Minutes | 56.10% | (2-0) 1.83 | |
| Draw In Final Result | 59.30% | (2-0) 3.75 | |
| Under 5.5 Cards | 58.50% | (2-0) 4 cards 1.38 | |
| Goal In Last 15 Minutes | 57.70% | (2-0) | |
| Away Team To Score In 1st Half | 55.30% | (2-0) | |
| Home Team Not To Score In 1st Half | 55.70% | (2-0) | |
| Yellow Cards | 3.10% | (2-0) | |
| Avg. Total Goals | 3.92% | (2-0) | |
| Avg. Conceded Goals | 2.65% | (2-0) | |
| Avg. Goals Scored | 1.07% | (2-0) | |
| Red Cards | 1.44% | (2-0) |
- Over 0.5 Goals HT: 81.50 – There’s a strong expectation for at least one goal in the first half, indicating an aggressive start from either team.
- Both Teams Not To Score In 1st Half: 80.80 – Despite the odds for goals, there’s also a significant chance that neither team will score in the first half, hinting at cautious play.
Predictions and Trends
- Over 1.5 Goals: 72.90 – The match is expected to be relatively high-scoring, with over one and a half goals likely to be scored.
- Both Teams Not To Score In 2nd Half: 71.10 – Similar to the first half, there’s a notable chance that neither team will score in the second half.
- Away Team To Score In 2nd Half: 69.50 – Dundee United has a good chance of scoring in the second half, potentially turning the game around if they are trailing.
Cards and Late Goals
- Over 4.5 Cards: 65.00 & Under 5.5 Cards: 58.50 – The match might see a fair number of cards, indicating potential physicality or tactical fouling.
- Last Goal After 73 Minutes: 56.10 & Goal In Last 15 Minutes: 57.70 – There’s a possibility for late goals, which could add excitement towards the end of the match.
Possible Outcomes and Player Performance
- Away Team To Score In First Half: 55.30 & Home Team Not To Score In First Half: 55.70 – These odds reflect Dundee United’s potential to take an early lead while St. Mirren might focus on defense initially. #include “myHeader.h” void error(const char* msg) { perror(msg); exit(1); } int main(int argc, char *argv[]) { // check if enough arguments are given if (argc !=3) { fprintf(stderr,”Usage : %s [IP address] [port]n”, argv[0]); exit(0); } // create socket int sock = socket(AF_INET, SOCK_STREAM ,0); if (sock == -1) error(“Could not create socket”); // set up server struct struct sockaddr_in server; server.sin_addr.s_addr = inet_addr(argv[1]); server.sin_family = AF_INET; server.sin_port = htons(atoi(argv[2])); // connect to server if (connect(sock,(struct sockaddr *)&server , sizeof(server)) <0) error("Connection failed"); // get input from user char buffer[1024]; int n; printf("Enter your message : "); fgets(buffer,sizeof(buffer),stdin); // send message n = write(sock , buffer , strlen(buffer)); if (n <0) error("Write failed"); printf("Message sentn"); return EXIT_SUCCESS; }RamanTiwari/OS_Lab<|file_sep## Operating Systems Lab This repository contains all my assignments related to Operating Systems Lab. ### Assignment List – **Assignment #01:** Basic C Programming Exercises. – **Assignment #02:** Process Synchronization using Semaphores. – **Assignment #03:** Producer Consumer Problem using Pipes. – **Assignment #04:** Dining Philosophers Problem using Semaphores. – **Assignment #05:** Client Server Communication using Sockets.RamanTiwari/OS_Lab> ## OS Lab Assignment #02 : Process Synchronization using Semaphores ### Problem Statement In this assignment you have been provided with two programs named `producer.c` and `consumer.c`. You need to complete these programs so that they can run concurrently without any data races or deadlocks. ### Instructions **Part A** 1) Compile both files as follows: bash gcc producer.c -o producer gcc consumer.c -o consumer 2) Run both programs as follows: bash ./producer & ./consumer & 3) Check that there are no data races or deadlocks. **Part B** The previous part was very basic and easy to solve because we were dealing with only one shared resource i.e., `buffer`. Now you need to modify your code such that it works for multiple buffers (say N buffers). **Hints** For Part A, – Use semaphore initialization function `sem_init`. – Use semaphore wait function `sem_wait`. – Use semaphore signal function `sem_post`. For Part B, – Pass `N` as command line argument when running producer and consumer processes. – Create an array of semaphores where each semaphore corresponds to one buffer. RamanTiwari/OS_Lab<|file_sepWithout including header files we can't use some built-in functions like printf() etc.<|file_sep | ## OS Lab Assignment #05 : Client Server Communication using Sockets ### Problem Statement In this assignment you have been provided with two programs named `client.c` and `server.c`. You need to complete these programs so that they can communicate with each other through sockets. ### Instructions **Part A** Complete client side program so that it can connect with server side program on localhost at port number specified as command line argument. **Part B** Complete server side program so that it can listen for incoming connections on localhost at port number specified as command line argument. **Part C** Test client-server communication by running both client and server side programs simultaneously. ### Hints Use socket functions like c socket() bind() listen() accept() connect() write() read() RamanTiwari/OS_Lab> ## OS Lab Assignment #03 : Producer Consumer Problem using Pipes ### Problem Statement In this assignment you have been provided with two programs named `producer.c` and `consumer.c`. You need to complete these programs so that they can run concurrently without any data races or deadlocks. ### Instructions **Part A** 1) Compile both files as follows: bash gcc producer.c -o producer gcc consumer.c -o consumer 2) Run both programs as follows: bash ./producer & ./consumer & 3) Check that there are no data races or deadlocks. **Part B** The previous part was very basic and easy to solve because we were dealing with only one pipe (i.e., single shared resource). Now you need to modify your code such that it works for multiple pipes (say N pipes). ### Hints For Part A, – Use pipe() system call. – Use fork() system call. – Use close() system call.RamanTiwari/OS_Lab<|file_sep `${^#}` will give us all lines starting from first non-commented line.RamanTiwari/OS_Lab<|file_sep Considering buffer size is limited so we need condition variable which checks whether buffer is full or empty.RamanTiwari/OS_Lab<|file_sep || If we do not initialize variables then their value will be garbage value.|| || If we do not include stdio.h file then compiler does not know about printf(), scanf() etc.|| || We cannot use $^ inside double quotes.|| || We cannot use $$ inside double quotes.|| || We cannot use @ inside double quotes.|| || We cannot use inside double quotes.|| || When executing shell script we should always provide absolute path of file unless our current working directory is same as file location.|| || When executing shell script we should always pass arguments separated by space unless our current working directory is same as file location.|| || When executing shell script we should always pass arguments separated by space unless our current working directory is same as file location.|| || Do not put spaces after { } || RamanTiwari/OS_Lab> ## OS Lab Assignment #01 : Basic C Programming Exercises ### Problem Statement In this assignment you have been provided with different problems whose solutions have been partially written in C language but incomplete due some missing statements/functions/constants/macros etc.. Your task is to complete them by filling up those missing parts. #### Instructions All files are present in `/src` folder under respective sub-folders named according problem numbers i.e., `/src/problem_01`, `/src/problem_02`, … . You just need to fill up missing statements/functions/constants/macros etc.. Don’t change anything else. You don’t need separate `.c` files for every problem statement because all problems are present under `/src` folder itself. #### Submission Format Please submit following files – MakeFile.txt # MakeFile used during compilation of source code files into executable binary files. report.pdf # Report containing answers alongwith screenshots of output produced after execution of executable binary files. #### Note Please note down any important points while solving these problems under report section. #### Problems ##### Problem Number : P01 Write program which prints your name alongwith roll number when executed. ##### Problem Number : P02 Write program which prints all integers between lower bound x & upper bound y when executed. ##### Problem Number : P03 Write program which prints sum of digits entered by user when executed. ##### Problem Number : P04 Write program which calculates factorial of integer entered by user when executed. ##### Problem Number : P05 Write program which prints reverse of string entered by user when executed. ##### Problem Number : P06 Write program which calculates greatest common divisor(GCD) of two integers entered by user when executed. ##### Problem Number : P07 Write program which calculates least common multiple(LCM) of two integers entered by user when executed. ##### Problem Number : P08 Write program which calculates power(x^n) where x & n are integers entered by user when executed. ##### Problem Number : P09 Create MakeFile having following commands – all : gcc *.c clean : rm *.o run : ./a.out ##### Bonus Question(PB01) Write MakeFile having following commands – all : gcc *.c clean : rm *.o run : ./a.out Bonus Question(PB02) Create folder named ‘test’ under ‘/src’ folder containing following three text files – test_file_01.txt # File containing list of test cases alongwith their expected outputs for problem number ‘P01’. test_file_02.txt # File containing list of test cases alongwith their expected outputs for problem number ‘P02’. test_file_03.txt # File containing list of test cases alongwith their expected outputs for problem number ‘P03’. Bonus Question(PB03) Modify source code file corresponding problem number ‘P04’ such that it uses recursion instead iterative method currently being used.
(Hint:- Recursive method uses more stack memory than iterative method) Bonus Question(PB04) Modify source code file corresponding problem number ‘P06’ such that it uses recursion instead iterative method currently being used.
(Hint:- Recursive method uses more stack memory than iterative method)
(Hint:- Base case will be GCD(a,b)=GCD(b,a%b)) Bonus Question(PB05) Modify source code file corresponding problem number ‘P07’ such that it uses recursion instead iterative method currently being used.
(Hint:- Recursive method uses more stack memory than iterative method)
(Hint:- Base case will be LCM(a,b)=L*a where L=LCM(b,a%b)) Bonus Question(PB06) Modify source code file corresponding problem number ‘P08’ such that it uses recursion instead iterative method currently being used.
(Hint:- Recursive method uses more stack memory than iterative method)
(Hint:- Base case will be x^0=1)
Bonus Question(PB07) Create bash script having following commands – echo “Enter your name” read NAME echo “Hello $NAME” Bonus Question(PB08) Create bash script having following commands – echo “Enter your name” read NAME echo “$NAME” | wc | awk ‘{print $1}’ Bonus Question(PB09) Create bash script having following commands – for (( i=0; i=0; i– )) do echo “$i” done Bonus Question(PB11) Create bash script having following commands – while true ; do echo “Enter your name” read NAME if [ “$NAME” == “exit” ] then break else echo “Hello $NAME” fi done Bonus Question(PB12) Create bash script having following commands – for FILE in * ; do echo “$FILE” >> out.txt done
#### Answer Sheet ##### Answer For Bonus Questions ###### PB01 Solution : Solution : MakeFile.txt ###### PB02 Solution : Solution : Folder Name :- test Files Inside :- test_file_01.txt test_file_02.txt test_file_03.txt ###### PB03 Solution : Solution : Modified Code :- Source Code File :- p04.c ###### PB04 Solution : Solution : Modified Code :- Source Code File :- p06.c ###### PB05 Solution : Solution : Modified Code :- Source Code File :- p07.c ###### PB06 Solution : Solution : Modified Code :- Source Code File :- p08.c ###### PB07 Solution : Solution : Script Name :- pb7.sh ###### PB08 Solution : Solution : Script Name :- pb8.sh ###### PB09 Solution : Script Name :- pb9.sh ###### PB10 Solution : Script Name :- pb10.sh ###### PB11 Solution : Script Name :- pb11.sh ###### PB12 Solution : Script Name :- pb12.sh #### Answers For Problems Answer For Bonus Questions Answer For Problems  RamanTiwari/OS_Lab<|file_sep*** This is my solution for OS Lab Assignment #02 *** *** My GitHub Repository Link *** https://github.com/RamanTiwari/OS-Labs/tree/master/os_lab_assignments/os_lab_assignment_02 *** My GitHub Username *** @RamanTiwari *** Instructions *** Compile both files as follows: gcc producer.c -o producer gcc consumer.c -o consumer Run both programs as follows: ./producer & ./consumer & Check that there are no data races or deadlocks. Now modify your code such that it works for multiple buffers (say N buffers). *** Answer Sheet *** I had done most part correctly but I got stuck at last question where I had implemented solution based on array. I had written below solution based on array but my professor told me its wrong because I am changing value directly at index rather than changing pointer value. So he asked me how would I change pointer value. Then I wrote below solution based on pointers. — SOLUTION BASED ON ARRAY — #include #include #include #include #include #define MAX_SIZE_OF_BUFFER (1024) #define MAX_NUMBER_OF_BUFFERS (5) pthread_mutex_t mutex[MAX_NUMBER_OF_BUFFERS]; pthread_cond_t cond_var[MAX_NUMBER_OF_BUFFERS]; char *buffers[MAX_NUMBER_OF_BUFFERS]; char *consumers_position[MAX_NUMBER_OF_BUFFERS]; void *producer(void *args) { while(1) { int rand_buffer_index=rand()%MAX_NUMBER_OF_BUFFERS; int rand_data_length=rand()%MAX_SIZE_OF_BUFFER; pthread_mutex_lock(&mutex[rand_buffer_index]); while(strlen(buffers[rand_buffer_index])!=0) { pthread_cond_wait(&cond_var[rand_buffer_index],&mutex[rand_buffer_index]); } char rand_data[rand_data_length+1]; memset(rand_data,”,sizeof(rand_data)); int k=rand(); sprintf(rand_data,”Data %d”,k); strcpy(buffers[rand_buffer_index],rand_data); printf(“[PRODUCER]: Data %d has been producedn”,k); pthread_cond_signal(&cond_var[rand_buffer_index]); pthread_mutex_unlock(&mutex[rand_buffer_index]); sleep(1); } } void *consumer(void *args) { while(1) { int rand_buffer_index=rand()%MAX_NUMBER_OF_BUFFERS; pthread_mutex_lock(&mutex[rand_buffer_index]); while(strlen(buffers[rand_buffer_index])==0) { pthread_cond_wait(&cond_var[rand_buffer_index],&mutex[rand_buffer_index]); } consumers_position[rand_buffer_index]=malloc(sizeof(char)*strlen(buffers[rand_buffer_index])); strcpy(consumers_position[rand_buffer_index],buffers[rand_buffer_index]); printf(“[CONSUMER]: Data %s has been consumedn”,consumers_position[rand_buffer_index]); memset(buffers[rand_buffer_array],”,sizeof(buffers)); pthread_cond_signal(&cond_var[rand_array]); pthread_mutex_unlock(&mutex[array_rand]); sleep(3); } } int main() { srand(time(NULL)); for(int i=0;i<MAX_NUMBER_OF_BUFFERS;i++) { buffers[i]=(char *)malloc(sizeof(char)*MAX_SIZE_OF_BUFFER); consumers_position[i]=(char *)malloc(sizeof(char)*MAX_SIZE_OF_BUFFER); memset(buffers[i],'',sizeof(char)*MAX_SIZE_OF_BUFFER); memset(consumers_position[i],'',sizeof(char)*MAX_SIZE_OF_BUFFER); pthread_mutex_init(&mutex[i],NULL); pthread_cond_init(&cond_var[i],NULL); pthread_t prod_thread_id; pthread_create(&prod_thread_id,NULL,&producer,NULL); pthread_t cons_thread_id; pthread_create(&cons_thread_id,NULL,&consumer,NULL); pthread_join(prod_thread_id,NULL); pthread_join(cons_thread_id,NULL); free(buffers[i]); free(consumers_position[i]); pthread_mutex_destroy(&mutex[i]); pthread_cond_destroy(&cond_var[i]); } return EXIT_SUCCESS; } — SOLUTION BASED ON POINTERS — #include #include #include #include #include #define MAX_SIZE_OF_BUFFER (1024) #define MAX_NUMBER_OF_BUFFERS (5) pthread_mutex_t mutex[MAX_NUMBER_OF_BUFFERS]; pthread_cond_t cond_var[MAX_NUMBER_OF_BUFFERS]; char buffers[MAX_NUMBER_OF_BUFFERS][MAX_SIZE_OF_BUFFER]; char consumers_position[MAX_NUMBER_OF_BUFFERS][MAX_SIZE_OF_BUFFER]; bool producers_flag[MAX_NUMBER_OF_BUFFERS]; void *producer(void *args) { while(1) { int rand_buf_idx=rand()%MAX_NUMBEROFBUFFS; int rand_len=rand()%MAXSIZEOFBUFFER; char rand_data[(rand_len)+1]; memset(rand_data,”,sizeof(rand_data)); int k=rand(); sprintf(rand_data,”Data%d”,k); strcpy(bufs[rand_buf_idx],rand_data); printf(“[PRODUCER]: Data%d has been producedn”,k); bool_flag[rand_buf_idx]=true; pthrd_mutex_lock(mutex+rand_buf_idx); pthrd_cnd_signal(cond_var+rand_buf_idx); pthrd_mutex_unlock(mutex+rand_buf_idx); sleep(1); } } void *consumer(void *args) { while(1) { int rand_buf_idx=rand()%MAXNUMBEROFBUFFS; pthrd_mutex_lock(mutex+rand_buf_idx); while(!bool_flag[rand_buf_idx]) { pthrd_cnd_wait(cond_var+rand_buf_idx,mutex+rand_buf_idx); } strcpy(consumers_pos[rand_buf_idx],bufs[rand_buf_idx]); printf(“[CONSUMER]: Data%s has been consumedn”,consumers_pos[rand_buf_idx]); memset(bufs[rand_buf_idx],”,sizeof(bufs[rand_buf_idx])); bool_flag[rand_buff_ix]=false; pthrd_cnd_signal(cond_var+rand_buff_ix); pthrd_mutex_unlock(mutex+rand_buff_ix); sleep(3); } } main() { srand(time(NULL)); for(int i=0;iGetScale(); // make sure heightmap bounds stay within map bounds: if (_heightMapOffsetX > map->GetWidth() / map->GetScale()) _heightMapOffsetX -= _heightMapSize / map->GetScale(); if (_heightMapOffsetY > map->GetHeight() / map->GetScale()) _heightMapOffsetY -= _heightMapSize / map->GetScale(); // draw terrain heightmap: glPushMatrix(); glTranslatef(_width / float(map->GetWidth()), _height / float(map->GetHeight()), zOff); glTranslatef(-float(_width)/float(map->GetWidth()) + _offsetX + float(_width)/float(map->GetWidth())*_heightMapOffsetX, -(float(_height)/float(map->GetHeight())) + _offsetY + float(_height)/float(map->GetHeight())*_heightMapOffsetY, zOff); glDisable(GL_LIGHTING); glColor4f(.6f,.6f,.6f,.25f); glBegin(GL_QUADS); glVertex3f(-zOff*20,-zOff*20,zOff); glVertex3f(float(_width)/float(map->GetWidth())-_zOff*20,-zOff*20,zOff); glVertex3f(float(_width)/float(map->GetWidth())-_zOff*20,float(_height)/float(map->GetHeight())-_zOff*20,zOff); glVertex3f(-zOff*20,float(_height)/float(map->GetHeight())-_zOff*20,zOff); glVertex3f(-zOff*20,-zOff*20,-zOff); glVertex3f(float(_width)/float(map->GetWidth())-_zOff*20,-zOff*20,-zOff); glVertex3f(float(_width)/float(map->GetWidth())-_zOff*20,float(_height)/float(map->GetHeight())-_zOff*20,-zOff); glVertex3f(-zOff*20,float(_height)/float(map->GetHeight())-_zOff*20,-zOff); glVertex3f(-zOff*20,-zOff*20,zOff); glVertex3f(-zOff*20,float(_height)/float(map->GetHeight())-_zOff*20,zOn); glVertex3f(-zOn*zOn,-ZOn*zOn,ZOn*zOn*zOn); glVertex3f(-ZOn*zOn,-ZOn*zOn,Zon*zOn); glVertex3f(float(width)/float(maps.GetWidth()),-Zoff*zoff,zon-zoff*zoff); glVertex3f(float(width)/float(maps.GetWidth()),Zon-Zon*zon,Zon-Zon*zon+zoff-zoff*zoff ); glVertex3d(Zon-Zon,Zon-Zon+zoff-zoff*zof,Zof-zof*zof+zof ); glVertex3d(Zof-zof,zof-zof*zof,Zof-zof*zof); glEnd(); glEnable(GL_LIGHTING); glColor4ub(color.r,color.g,color.b,_alpha*_alphaCurve.Evaluate(GetTime())); glBegin(GL_QUADS); glTexCoord2fv((GLfloat*)&texCoordBottomLeft.x); float hMin = FLT_MAX; float hMax = FLT_MIN; // iterate over heightmap: int startX = max(int(floor((_offsetX + _width/map.GetWidth()*_scaleFactor )/_tileSize)), min(int(floor((_offsetX + _width/map.GetWidth()*scaleFactor )/_tileSize))+maxTilesInOneAxis,_map.GetWidth()-minTilesInOneAxis)); int startY = max(int(floor((_offsetY + _heigth/map.GetHeigth()*scaleFactor )/_tileSize)), min(int(floor((_offsetY + _heigth/map.GetHeigth()*scaleFactor )/_tileSize))+maxTilesInOneAxis,_map.GetHeigth()-minTilesInOneAxis)); const int startXEnd = min(startX+_maxTilesInView,_map.GetWidth()-minTilesInOneAxis)-startX; const int startYEnd = min(startY+_maxTilesInView,_map.GetHeigth()-minTilesInOneAxis)-startY; /*if(!showPathfindingDebug){ glEnableClientState(GL_COLOR_ARRAY); glColorPointer( GL_RGBA, GL_FLOAT, sizeof(Color), &_pathFindingDebugColors[startStart].r); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_VERTEX_ARRAY); GLfloat vertices[]={ (-xTileOffset-startStart*_tileSize), (-yTileOffset-startStart*_tileSize), zTop, (-xTileOffset-startStart*_tileSize), (-yTileOffset-(startStart+_tilesInView)*_tileSize), zBottom, (-xTileOffset-(startStart+_tilesInView)*_tileSize), (-yTileOffset-(startStart+_tilesInView)*_tileSize), zBottom, (-xTileOffset-(startStart+_tilesInView)*_tileSize), (-yTileOffset-startStart*_tileSize), zTop, }; GLfloat texCoords[]={ ((GLfloat)(startStart)/(GLfloat)(_map.GetWidth())), ((GLfloat)(startStart)/(GLfloat)(_map.GetHeigth())), ((GLfloat)(startStart)/(GLfloat)(_map.GetWidth())), ((GLfloat)(startStart+_tilesInView))/(GLfloat)(_map.GetHeigth()), ((GLfloat)(startStart+_tilesInView))/(GLfloat)(_map.GetWidth()), ((GLfloat)(startStart+_tilesInView))/(GLfloat)(_map.GetHeigth()), ((GLfloat)(startStart+_tilesInView))/(GLfloat)(_map.GetWidth()), ((GLfloat)(startStart))/(GLfloat)(_map.GetHeigth()) }; */ /*glVertexPointer( GL_FLOAT, sizeof(GL_FLOAT)*4, sizeof(vertices[8]), vertices); */ /*glTexCoordPointer( GL_FLOAT, sizeof(GL_FLOAT)*4, sizeof(texCoords[8]), texCoords);*/ /*glDrawArrays( GL_QUADS, start*(maxTilesInView-maxTilesInOneAxis)*(maxTilesInView-maxTilesInOneAxis)+t*(maxTilesInView-maxTilesInOneAxis)+u, maxTilesInOneAxis* maxTilesInOneAxis);*/ /*glDisableClientState(GL_COLOR_ARRAY);*/ /*glDisableClientState(GL_TEXTURE_COORD_ARRAY);*/ /*glDisableClientState(GL_VERTEX_ARRAY);*/ /*}else{*/ // draw tiles: glBegin(GL_QUADS); // iterate over tiles: for(int y=startY;y<yEnd;y++){ texCoordTopLeft.y=(y+(double)_viewZoomLevel/(double)_zoomLevel)/(double)_viewZoomLevel/(double)_zoomLevel; texCoordBottomRight.y=(y+(double)_viewZoomLevel/(double)_zoomLevel)/(double)_viewZoomLevel/(double)_zoomLevel+(double)_viewZoomLevel/(double)_zoomLevel/(double)(_zoomLevel*_numSubdivisionsOfZoomLevels)*(double)(_numSubdivisionsOfZoomLevels-yEnd+y); texCoordTopLeft.x=(x+(double)_viewZoomLevel/(double)_zoomLevel)/(double)_viewZoomLevel/(double)_zoomLevel; texCoordBottomRight.x=(x+(double)_viewZoomLevel/(double)_zoomLevel)/(double)_viewZoomLevel/(double)_zoomLevel+(double)_viewZoomLeveL/(double)((size_t)((size_t)((size_t)((size_t)((size_t)((size_t)((size_t)((size_t)((size_t)((size_t)( ((((((((texCoordBottomRight.x-texCoordTopLeft.x))*((texCoordBottomRight.x-texCoordTopLeft.x))*((texCoordBottomRight.x-texCoordTopLeft.x))*((texCoordBottomRight.x-texCoordTopLeft.x)))))))))))))))))*(size_t)( ((((((((texCoordBottomRight.y-texCoordTopLeft.y))*((texCoordBottomRight.y-texCoordTopLeft.y))*((texCoordBottomRight.y-texcoordTopLeft.y))*( texcoordbottomright.y-texcordtopleft.y))))))))))/(((texcoordbottomright.y-texcordtopleft.y))); glBindTexture(GL_TEXTURE_RECTANGLE_ARB,tileTextures[y]); tileTextures[y]=LoadTextureFromPNG(TileNames[y]); tileVertices[y]=(GLshort*)malloc(sizeof(*vertices)); glGetTexImageARB( GL_TEXTURE_RECTANGLE_ARB, y%(numSubdivisionsOfZoomLevels*yEnd-xEnd+x)%yEnd-xEnd+x%x%x%x%x%x%x%x%x%numSubdivisionsOfZoomLevels*yEnd-xEnd+x%numSubdivisionsOfZoomLevels*yEnd-xEnd+x%x%x%x%x%x%x%numSubdivisionsOfZoomLevels*yEnd-xEnd+x%(numSubdivisionsOfZoomLevels*yEnd-xEnd+x)%numSubdivisionsOfZoomLevels*yEnd-xEnd+x*x*x*x*x*x*x*numSubdivisionsOfZoomLevels*yEnd-xEnd+x%(numSubdivisionsOfZoomLevels*yEnd-xend+x)%numsubdivisionsofoverlaylevels*yend-xend+x%numsubdivisionsofoverlaylevels*yend-xend+x*x*x*numsubdivisionsofoverlaylevels*yend-xend+x%numsubdivisionsofoverlaylevels*yend-xend+x)x*x*numsubdivisionsofoverlaylevels*yend-xend+x%(numsubdivisionsofoverlaylevels*yend-xend+x)%y%y%y%y%y%y*numsubdivisionsofoverlaylevels*yend-y-end+y,y)); glGenTextures(numTextures,(GLuint*)textures); glGetTexImageARB( textures[y], y%(numsubdivisionsofoverlaylevels*numsubdivisionsofoverlaylevels-numsubdivisionsofoverlaylevelsextent+yextent-yextent+yextent-yextent+yextent-yextent+yextentyeynteneynteneynteneynteneynteneynte)y%(numsubdivisionsofoverlaylevelsextentye-yextent+yextent-yextent+yextent-yextent+yextent-yextent+yextent)y%(numerousubdivisionsofy-levelsextentye-yextent+yextent-yextent+yextent-yextent+yextent-yextend-extentye)y%(numerousubdivideleveldistsxy-extentye-numerousubdivideleveldistxy-extentye-numerousubdivideleveldistxy-extentye-numerousubdivideleveldistxy-extentye-numerousubdivideleveldistxy-extentye-numerousubdivideleveldisxy-exteny)e,y); tileVertices[y]=(GLshort*)malloc(sizeof(*vertices)); glGetTexImageARB( textures[y], y%(numerousubdivideleveldisxy-exteny)e,y); tileVertices[y]=(GLshort*)malloc(sizeof(*vertices)); glGetTexImageARB( textures[y], y%(numeroussubdivideleveldisxy-exnyte)y,y); glBindTexture(GL_TEXTURE_RECTANGLE_ARB,tileTextures[x]); tileTextures[x]=LoadTextureFromPNG(TileNames[x]); tileVertices[x]=(GLshort*)malloc(sizeof(*vertices)); glGetTexImageARB( GL_TEXTURE_RECTANGLE_ARB, x%(numeroussubdivideleveldisxy-exnyte)y,x); glBindTexture(GL_TEXTURE_RECTANGLE_ARB,tileTextures[z]); tileTextures[z]=LoadTextureFromPNG(TileNames[z]); tileVertices[z]=(GLshort*)malloc(sizeof(*vertices)); glGetTexImageARB( GL_TEXTURE_RECTANGLE_ARB, z%(numeroussubdivideleveldisxy-exnyte)y,z); glBindTexture(tileTextures[tilesToDraw[tilesDrawn]]); tilesToDraw[tilesDrawn++]=t; vertices[tilesDrawn++]=t; vertices[tilesDrawn++]=t; vertices[tilesDrawn++]=t; vertices[tilesDrawn++]=t; } } } glEnd(); glPopMatrix(); } void MapRenderer::Render(const Map& map){ RenderInternal(false,map,false,false,false,false,false,true,true,true,true,true,true,true,true,false,false,false,false,false,false,false,false,true,true,true,true); } void MapRenderer::Render(const Map& map,const bool showFog,const bool showWater,const bool showShore,const bool showShoreLine,const bool showWaterLine){ RenderInternal(showFog,map,showWater,showShore,showShoreLine,showWaterLine,false,false,true,true,true,true,true); } void MapRenderer::Render(const Map& map,const bool showFog,const bool showWater,const bool showShore,const bool showShoreLine,const bool showWaterLine,const Vector& cameraPos){ RenderInternal(showFog,map,showWater,showShore,showShoreLine,showWaterLine,cameraPos,cameraPos,cameraPos,cameraPos,cameraPos,cameraPos,cameraPos,cameraPos); } void MapRenderer::Render(const Map& map,bool renderTerrain,bool renderBiomes,bool renderUnits,bool renderBuildings,bool renderForests,bool renderTrees,bool renderBuildingsDetails,bool renderTreesDetails,bool renderUnitDetails){ RenderInternal(false,map,!renderTerrain,!renderBiomes,!renderUnits,!renderBuildings,!renderForests,!renderTrees,!renderBuildingsDetails,!renderTreesDetails,!renderUnitDetails); } } #endif /* MAPRENDERER_H */ /* void Renderer::Render(const Map& map){ RenderInternal(false,map,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,FALSE,False,False,False,False,False,True,True,True,True,True,True,True,True,False,False,False,False,False,False,True,True,True,True); } */ /*void Renderer::Render(const Map& mapp){ RenderInternal(true,mapp,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No,No,No,No,Yes,Yes,Yes,Yes); }*/ /*void Renderer::Render(const Map& mapp){ RenderInternal(true,mapp,False,False,False,False,False,False,False,False,None,None,None,None,None,None,None,None,None,None,None,None,None, }*/ /*void Renderer::Render(){ RenderInternal(true,map,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Yesssssss,Nones,Nones,Nones,Nones,Nones,Nones,Nones,Nones,Nones,Nones, }*/ /* void Renderer::Render(){ RenderInternal(false,map,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,True,True,True,True,True,True=True=True=True=True=True=True=True=True=False=False=False=False=False=False=False=False=False=False=False=False=True=True=True=True); } */ /* void Renderer::Render(){ RenderInternal(false,map,Yes=YES==YES==YES==YES==YES==YES==YES==YES==Yes==Yes==True==True==True==True==True==True== False=false=false=false=false=false=false=false=false=false=false=true=true=true=true=true=true= } */ /*namespace{ void Render(){ glBegin(); glTexCoord(); glVertex(); glPushMatrix(); glTranslatef(); glPopMatrix(); glDisable(); glColor4u(); glBindTexture(); glEnable(); glEnable(); glEnable(); glTexEnv(); glEnable();