mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-07 08:01:16 +00:00
Refactor version stuff a bit
This commit is contained in:
parent
42276e0efd
commit
9d7e7b8b69
3 changed files with 8 additions and 7 deletions
|
@ -1,12 +1,13 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "version.h"
|
#include "version.h"
|
||||||
|
#include "version_text.h"
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
|
|
||||||
static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
|
static char sVersionString[MAX_VERSION_LENGTH] = { 0 };
|
||||||
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
|
static char sLocalVersionString[MAX_LOCAL_VERSION_LENGTH] = { 0 };
|
||||||
|
|
||||||
char* get_version(void) {
|
char* get_version(void) {
|
||||||
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s %d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER);
|
snprintf(sVersionString, MAX_VERSION_LENGTH, "%s", VERSION_TEXT);
|
||||||
return sVersionString;
|
return sVersionString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +15,6 @@ char* get_version_local(void) {
|
||||||
if (PATCH_VERSION_NUMBER <= 0) {
|
if (PATCH_VERSION_NUMBER <= 0) {
|
||||||
return get_version();
|
return get_version();
|
||||||
}
|
}
|
||||||
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s %d.%d.%d", VERSION_TEXT, VERSION_NUMBER, MINOR_VERSION_NUMBER, PATCH_VERSION_NUMBER);
|
snprintf(sLocalVersionString, MAX_LOCAL_VERSION_LENGTH, "%s.%d", VERSION_TEXT, PATCH_VERSION_NUMBER);
|
||||||
return sLocalVersionString;
|
return sLocalVersionString;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
#ifndef VERSION_H
|
#ifndef VERSION_H
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
#define VERSION_TEXT "beta"
|
|
||||||
#define VERSION_NUMBER 34
|
|
||||||
#define MINOR_VERSION_NUMBER 0
|
|
||||||
#define PATCH_VERSION_NUMBER 0
|
#define PATCH_VERSION_NUMBER 0
|
||||||
|
|
||||||
#define MAX_VERSION_LENGTH 10
|
#define MAX_VERSION_LENGTH 28
|
||||||
#define MAX_LOCAL_VERSION_LENGTH 12
|
#define MAX_LOCAL_VERSION_LENGTH 32
|
||||||
|
|
||||||
char* get_version(void);
|
char* get_version(void);
|
||||||
char* get_version_local(void);
|
char* get_version_local(void);
|
||||||
|
|
||||||
|
|
2
src/pc/network/version_text.h
Normal file
2
src/pc/network/version_text.h
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#pragma once
|
||||||
|
#define VERSION_TEXT "beta 34"
|
Loading…
Reference in a new issue